From sdd
SDD — Spec-Driven Development: detect code that drifted from .specs/<domain>/spec.md (changed without spec update).
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd:driftThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Usage: `/sdd:drift` (no arguments — scans every domain via the union discovery in [layered-context](../../lib/instructions/layered-context.md#domain-discovery-all-domains)).
Usage: /sdd:drift (no arguments — scans every domain via the union discovery in layered-context).
Detects files that have changed since the corresponding domain's living spec (centralized .specs/<domain>/spec.md or a colocated specPath) was last updated. Useful for catching code that evolved without going through /sdd:specify → /sdd:plan → /sdd:implement, so the living spec is now lying.
Read .sdd.json (if present):
specExempt: glob list of paths to ignore. Default: ["*.config.*", "*.test.*", "**/migrations/**", "scripts/**"].driftCheck: "off" | "warn" | "gate". Default: "warn". off short-circuits the skill (✓ Drift check disabled (.sdd.json#driftCheck = off)); warn and gate both run the report — gate is informational here (the gating decision is up to the surrounding workflow / CI).domains: same map used by layered-context. Used to resolve which files belong to which domain and to discover colocated domains.Stop only if there are both no configured domains in .sdd.json#domains and no .specs/*/spec.md on disk, with: No domains configured and no .specs/ folder — nothing to check. Run /sdd:init or seed .specs/<domain>/spec.md first.
Enumerate domains and orphans by running the resolver script:
python3 lib/scripts/resolve-spec-paths.py --all
The JSON domains[] is the union of .sdd.json#domains and the .specs/*/spec.md glob (de-duplicated by resolved path), each with its resolved specPath. The JSON orphans[] is the orphan list (see below).
For each discovered domain:
specPath from the script output (colocated or centralized — already computed).git log -n 1 --format=%H -- <resolved-spec-path>
Skip the domain if the file is untracked (no commits yet) — log ℹ <domain>: spec.md not yet committed; skipping drift check.Also report each entry in the script's orphans[] (a *.spec.md in the tree that no configured specPath claims): ℹ Orphan living spec <path> — not referenced by any .sdd.json domain.
For each domain with a tracked spec:
.sdd.json#domains.<domain>.pattern exists, use that regex.<domain>/ and src/<domain>/ (anything inside a directory whose basename equals the domain name).git log --since-commit=<spec-commit> --name-only --pretty=format: -- <pattern-paths>
Or equivalently git diff --name-only <spec-commit>..HEAD -- <pattern-paths>. Pick the form that respects the pattern.specExempt.Per drifted file, classify:
| Signal | Severity |
|---|---|
File listed in any specs/*/.spec-context.json#files_modified since the spec's last commit | tracked (changed via SDD pipeline — Layer 1 wasn't synced; treat as a missed sync) |
File outside files_modified of any spec | unspeced (changed entirely outside SDD) |
File matches specExempt | (filtered out earlier; never appears) |
unspeced is more concerning than tracked — tracked may just mean the spec author didn't add a delta block, while unspeced means SDD never saw the change at all.
Display per-domain:
🔍 Spec drift report
📁 <resolved-spec-path> (last updated <YYYY-MM-DD>, commit <abbrev>)
<N> files changed since spec was last updated:
tracked src/auth/login.ts — touched in spec 014-add-rate-limit (no delta block)
tracked src/auth/session.ts — touched in spec 014-add-rate-limit (no delta block)
unspeced src/auth/oauth.ts — changed outside SDD pipeline
👉 Run /sdd:specify to add a delta spec, or add the path to specExempt in .sdd.json.
If a domain has no drift, output ✓ <domain> — in sync on a single line.
If every domain is in sync, the final line is ✓ All domains in sync. and nothing else.
Always exit with success (this skill never halts the pipeline). Surrounding workflows can choose to treat unspeced rows as gates.
npx claudepluginhub alfredoperez/sdd --plugin sddGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.