/sdd:audit [scope] [--review] [--scrum] [--module <name>]from sdd
Performs a comprehensive audit of design artifact alignment across the project, checking spec compliance and ADR adherence across six drift categories. Use for architecture audits, drift reports, or design reviews.
Ships in sdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Harness portability. This skill runs on any agent harness that loads Agent Skills — Claude Code, Codex CLI, OpenCode, Crush. Tool names used below (
AskUserQuestion,Task,TeamCreate,SendMessage,TaskCreate,ToolSearch,mcp__*,${CLAUDE_PLUGIN_ROOT}) denote capabilities, not hard requirements: map each to your harness's equivalent or use the documented fallback per${CLAUDE_PLUGIN_ROOT}/references/harness-compat.md. References toCLAUDE.mdmean the project memory file (CLAUDE.md,AGENTS.md, orCRUSH.md) per harness-compat § "Project Memory File". A citation of the formshared-patterns.md § "Section"names one##heading in that file — load only that section (see its "How to Read This File" note), never the whole file. Invocation and arguments. Where your harness has no command layer (Crush, Codex CLI, OpenCode) this skill is reached from itsdescription, not a slash command: the/sdd:{name}form below is Claude Code namespacing.$ARGUMENTSmeans whatever arrived with the invocation: take the target and any--flagsfrom the request that triggered this skill, and when neither is present follow this skill's documented no-argument path instead of reporting missing arguments (harness-compat § "Invocation and Arguments").
You are performing a deep, comprehensive audit of design artifact alignment across the project or a specified scope. This skill covers all six drift categories and produces a structured report with prioritized findings.
Resolve artifact paths: Follow the Artifact Path Resolution pattern from ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Artifact Path Resolution" to determine the ADR and spec directories. If $ARGUMENTS contains --module <name>, resolve paths relative to that module; otherwise, in a workspace, aggregate across all modules. The resolved ADR directory is {adr-dir} and spec directory is {spec-dir}.
Cross-module aggregation: When in aggregate mode (no --module, workspace detected), iterate over all discovered modules and run the full audit analysis (steps 4–6) per module. Label every finding with its source module in the output tables (add a Module column). After per-module analysis, include a Cross-Module Summary section that aggregates finding counts per module and highlights any cross-module inconsistencies (e.g., one module's ADR contradicting another module's spec). When --module is provided, scope to that single module — no module labels needed. When in single-module mode (no workspace), operate normally.
Parse arguments: Extract the scope and flags from $ARGUMENTS.
security, api, database), a directory path (src/), or omitted for a full project audit.--review: Enable team review mode. Default: off. Mutually exclusive with: --scrum.--scrum: Enable scrum triage ceremony. Default: off. Mutually exclusive with: --review.--module <name>: Resolve artifact paths relative to the named module. Default: none./sdd:audit without a scope for a full project audit."Locate design artifacts:
{adr-dir} for ADR files. If the directory does not exist, report: "The {adr-dir} directory does not exist. Run /sdd:adr [description] to create your first ADR."{spec-dir} for spec files. If the directory does not exist, report: "The {spec-dir} directory does not exist. Run /sdd:spec [capability] to create your first spec."/sdd:adr or a spec with /sdd:spec first."Choose execution mode: Check if $ARGUMENTS contains --scrum or --review. --scrum takes precedence over --review if both are present.
Default (no --review, no --scrum): Single-agent mode.
With --review (and no --scrum): Team review mode.
TeamCreate:
general-purpose) to perform the full analysis and write the audit reportgeneral-purpose) to validate the auditor's findings for accuracy, completeness, and correct severity assignmentsTeamCreate fails — or is not a registered tool on this harness — fall back to single-agent mode and tell the user: "Team creation failed. Proceeding with single-agent audit and self-review."With --scrum: Scrum triage mode — see the Scrum Triage Ceremony section below. When --scrum is set, complete the standard audit analysis (steps 4–6) first, then enter the ceremony. Do NOT run --review mode when --scrum is set.
3a. Tier 3 staleness check (v5.0.0+):
On entry, check the qmd index's last-modified timestamp for this repo's collections (use the exact-prefix match algorithm from ${CLAUDE_PLUGIN_ROOT}/references/qmd-helpers.md § "This-Repo Collection Identification"). If older than the configured staleness threshold (default 120m, configurable in CLAUDE.md ### SDD Configuration #### Index Freshness **Staleness Threshold** per the Config Resolution pattern), trigger a silent qmd update first. Emit a one-line note in the report header: Index was {age} stale — refreshed before running. On fresh, proceed silently. On qmd update failure, surface the error per qmd-helpers.md § "Error Handling" and continue best-effort.
3b. qmd-aware artifact retrieval per target file (v5.0.0+):
Audit operates at scale across many target files. For each target file in scope, use qmd hybrid retrieval (per ${CLAUDE_PLUGIN_ROOT}/references/qmd-helpers.md § "Hybrid Retrieval") to identify the top-K candidate ADRs and specs governing that specific file, then deep-read only those candidates. The pre-v5 "read all ADRs and specs once, then semantically match against every target" path is removed in v5 — per-target qmd retrieval is the canonical mechanism.
Per-file query construction follows the same pattern as /sdd:check:
lex: file path basename + exported symbols + governing comment block contentvec: one-sentence summary of what the file doesintent: "/sdd:audit {scope} — find ADRs and specs governing {file}"collections: ["{repo}-adrs", "{repo}-specs"] (or per-module variants)limit: 8, minScore: 0.3Per-target retrieval is more expensive than the pre-v5 single-pass scan, but produces dramatically tighter, file-relevant context for the drift analysis in Step 5. On large audit scopes (entire repo), this is what /sdd:audit was designed to scale to — the per-target retrieval is small per-call and runs in qmd's sub-second hybrid path.
On qmd unreachable / timeout per qmd-helpers.md § "Error Handling", surface the error and stop. Per ADR-0024 / SPEC-0019 REQ "qmd Assumption in Consumer Skills", fallback paths were eliminated in v5; the failure mode is "fix qmd, retry."
Validate spec artifact pairing: For each spec directory found under {spec-dir}, check that both spec.md and design.md exist. If a spec.md exists without a corresponding design.md (or vice versa), report as [WARNING] under "Stale Artifacts" with finding: "Unpaired spec artifact: {path} exists but {missing-file} is missing. Per ADR-0003, spec.md and design.md are a paired unit." (Governing: ADR-0003, SPEC-0003)
Analyze across all six categories:
Code vs. Specification Drift: Does the implementation match spec requirements and scenarios?
[CRITICAL][WARNING][WARNING]Code vs. ADR Drift: Does the implementation follow accepted ADR decisions?
[CRITICAL][WARNING]ADR vs. Spec Inconsistencies: Are ADR decisions consistent with spec requirements?
[CRITICAL][WARNING]Coverage Gaps: What code areas have no governing ADR or spec?
[INFO]Stale Artifacts: Do artifact statuses match implementation reality?
proposed that have existing implementations -- [WARNING]draft that have deployed implementations -- [WARNING]accepted ADRs whose decisions have been overridden in code -- [WARNING]Policy Violations: Are specs internally consistent in their use of RFC 2119 keywords?
[INFO][CRITICAL][INFO]PRD Status Gates (per SPEC-0037; skip entirely when the PRD directory does not exist): PRDs are optional and client-facing-only, so never report an ADR or spec for having no upstream PRD — absence of a PRD is never a finding (ADR-0036 commitment 1). For each PRD:
approved or shipped PRD whose governs: list resolves to no existing ADR or spec -- [WARNING]shipped PRD with a success criterion carrying no met evidence and no recorded waiver -- [CRITICAL]approved or shipped PRD with unresolved entries under ## Open questions -- [WARNING]shall, no leading EARS keyword) -- [WARNING]status: outside the draft / client-review / approved / shipped enum -- [WARNING]PRD-XXXX-slug.md, or that lives inside the spec directory -- [WARNING] (ADR-0036 commitments 2 and 3)Produce the audit report using the standard format:
## Design Audit Report
Scope: {scope or "Full project"}
Analyzed: {N} ADRs, {M} specs, {P} source files
Total findings: {X} ({C} critical, {W} warning, {I} info)
---
### Code vs. Specification Drift
| Severity | Finding | Spec | Location |
|----------|---------|------|----------|
| [CRITICAL] | {description} | SPEC-XXXX | src/path/file.ts:NN |
### Code vs. ADR Drift
| Severity | Finding | ADR | Location |
|----------|---------|-----|----------|
| [WARNING] | {description} | ADR-XXXX | src/path/file.ts:NN |
### ADR vs. Spec Inconsistencies
| Severity | Finding | ADR | Spec |
|----------|---------|-----|------|
| [CRITICAL] | {description} | ADR-XXXX | SPEC-XXXX |
### Coverage Gaps
| Severity | Area | Description |
|----------|------|-------------|
| [INFO] | src/path/ | {description} |
### Stale Artifacts
| Severity | Artifact | Issue |
|----------|----------|-------|
| [WARNING] | ADR-XXXX | {description} |
### Policy Violations
| Severity | Finding | Source | Location |
|----------|---------|--------|----------|
| [INFO] | {description} | SPEC-XXXX | {spec-dir}/path/spec.md |
---
### Summary
| Category | Critical | Warning | Info | Total |
|----------|----------|---------|------|-------|
| Code vs. Spec | N | N | N | N |
| Code vs. ADR | N | N | N | N |
| ADR vs. Spec | N | N | N | N |
| Coverage Gaps | N | N | N | N |
| Stale Artifacts | N | N | N | N |
| Policy Violations | N | N | N | N |
| **Total** | **N** | **N** | **N** | **N** |
### Recommended Actions
1. [CRITICAL] {action}
2. [WARNING] {action}
3. [INFO] {action}
Workspace aggregate mode adds these sections to the report:
Module column in every findings table (e.g., | [api] | [CRITICAL] | ... |)### Cross-Module Summary
| Module | Critical | Warning | Info | Total |
|--------|----------|---------|------|-------|
| [api] | N | N | N | N |
| [worker] | N | N | N | N |
| **Total** | **N** | **N** | **N** | **N** |
### Cross-Module Inconsistencies
| Severity | Finding | Module A | Module B |
|----------|---------|----------|----------|
| [CRITICAL] | {description of cross-module contradiction} | [api] ADR-XXXX | [worker] SPEC-XXXX |
If no cross-module inconsistencies are found, omit the "Cross-Module Inconsistencies" table and note: "No cross-module inconsistencies detected."
Add recommended actions at the end, ordered by severity:
/sdd:status to update/sdd:adr/sdd:spec/sdd:check (audit is a superset of check)Handle clean results: If no drift is found across any category:
## Design Audit Report
Scope: {scope or "Full project"}
Analyzed: {N} ADRs, {M} specs, {P} source files
No drift detected. All implementation aligns with governing ADRs and specs.
--scrum)When --scrum is set, run the standard audit analysis (steps 4-8 above) first, then follow the Triage Ceremony in references/triage-ceremony.md. The triage ceremony groups audit findings into functional themes, runs a 5-agent triage team to prioritize and dispute findings, and produces a triage report with remediation priorities and optional issue creation. Governing: SPEC-0013, ADR-0014.
--review mode)TeamDelete when done.See the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Severity Assignment Rules" for the full mapping. Key: MUST/SHALL violations → CRITICAL, SHOULD violations → WARNING, coverage gaps → INFO.
--review mode, follow the team handoff protocol exactly. Do not present the report until the reviewer sends "APPROVED".ADR-0001, SPEC-0002, Req 3. Do not abbreviate.src/auth/login.ts:45).## for the top-level heading (report title) and ### for sections within the report.--scrum is set, MUST run the full standard audit analysis first, then the triage ceremony — never skip the standard analysis (Governing: SPEC-0013 REQ "Scrum Flag and Mode Activation")--scrum and --review are mutually exclusive; --scrum takes precedence if both are providedaccepted) and specs (approved/implemented) are the source of truth — code deviation is presumed wrong unless the Architect explicitly reclassifies a finding as an artifact update (Governing: SPEC-0013 REQ "Source of Truth Principle")qmd update and emit a one-line note (Governing: ADR-0026, SPEC-0019 REQ "Tier 3 Staleness Threshold for Consumer Skills")What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub joestump/claude-plugin-sdd --plugin sdd22 skills in this plugin
/adrCreate a new Architecture Decision Record (ADR) using MADR format. Use when the user wants to document an architectural decision, says "create an ADR", "we need an ADR for", or discusses a decision that should be recorded./checkQuick-check code against ADRs and specs for drift. Use when the user says "check for drift", "does this match the spec", or wants a fast alignment check on a specific file or directory./discoverDiscover implicit architectural decisions and spec-worthy subsystems in an existing codebase. Use when the user says "discover architecture", "what decisions exist in this code", "bootstrap ADRs", or wants to reverse-engineer design artifacts from code.Other plugins' skills for the same job