From sdd
Loads ADR and spec context for architecture-aware responses. Use when starting a new session or referencing existing decisions. Supports cross-module aggregation and qmd-based freshness checks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd:prime [topic] [--module <name>][topic] [--module <name>]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Load existing ADRs and specs into the session so Claude can give architecture-aware responses.
Load existing ADRs and specs into the session so Claude can give architecture-aware responses.
Resolve artifact paths: Follow the Artifact Path Resolution pattern from references/shared-patterns.md 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. For each module, resolve its artifact paths independently. Prefix every artifact reference in the output with the module name in square brackets: [api] ADR-0001, [worker] SPEC-0003. When --module is provided, scope to that single module — no prefix needed. When in single-module mode (no workspace), operate normally without prefixes.
Check if init has been run: Read CLAUDE.md at the project root (or module root if --module is set) and check if it contains references to an ADR or spec directory. If CLAUDE.md does not exist or lacks SDD plugin references, output:
CLAUDE.md does not have SDD plugin references. Run `/sdd:init` first to set up your project, then re-run `/sdd:prime`.
Then stop. Do NOT proceed with scanning.
1a. Tier 2 session-start update (v5.0.0+):
Run qmd update (cheap file-mtime scan) on entry to catch changes from outside the current Claude session — other developers, CI bots, branch switches, manually edited files. Skip the update when the qmd index was touched within the last 60 seconds (back-to-back primes are common; the short-circuit prevents redundant work).
Run qmd status --json and parse the response to find the maximum lastUpdated timestamp across this-repo collections (identified via the exact-prefix match algorithm from the collection names — e.g., claude-plugin-sdd-adrs, claude-plugin-sdd-specs).
If the most recent timestamp is within the last 60 seconds, skip the update entirely (no output).
Otherwise, invoke qmd update. The update is silent on success when the diff is empty. If the update added/modified/removed any documents, print exactly one line in the report header (between the ## Architecture Context Loaded heading and the section tables): Refreshed index ({a} added, {m} updated, {r} removed across this repo's collections).
After the update, run qmd status --json again and sum the (documents - embedded) count across this repo's collections. If non-zero, surface a one-line note in the report header (after the refresh line, if any): {N} chunks unembedded — run \/sdd:index embed` (≈{seconds}s on this machine, foreground; or wait for the next mutation skill to backfill)`. Do NOT prompt via AskUserQuestion — the surface is informational, not a decision the user needs to make right now.
Retrieve artifacts via qmd (unified path for all modes, v5.1.0+):
All artifact retrieval now uses qmd hybrid search for consistency, flexibility, and efficiency. Both untargeted and topic-filtered modes use the same code path with different parameters, executed via the qmd query CLI.
For untargeted priming (/sdd:prime with no topic):
qmd query --json -c {repo}-adrs --limit 10000 --minScore 0 plus a second query for all specs with qmd query --json -c {repo}-specs --limit 10000 --minScore 0{repo}-{module}-adrs, etc.)--limit 10000 and --minScore 0 retrieve all matches without filteringFor topic-filtered priming (/sdd:prime {topic}):
lex (keyword match) and vec (semantic match) sub-queries per references/qmd-helpers.md § "Hybrid Retrieval"qmd query --json -c {repo}-adrs -c {repo}-specs --limit 8 --minScore 0.3 '<queries>'minScore: 0.3, output: No ADRs or specs matched the topic "{topic}". Try a broader term, or run /sdd:prime without a topic to see all artifacts.For each retrieved artifact:
# heading), status, superseded-by (from frontmatter)## Decision Outcome## Overview; count requirements and scenariosFilter non-authoritative artifacts (applies to untargeted mode; topic-filtered mode surfaces all matches with badges):
accepted, proposed, draft, review, approved, implemented, or missing) and non-authoritative (superseded, deprecated, rejected)⚠ badge since topic filtering is often investigative3a. Status Field Extraction algorithm. Two formats are supported because legacy SDD-using repos predate YAML frontmatter:
YAML frontmatter (canonical, current SDD template): look for a status: key inside the --- … --- frontmatter block at the top of the file.
Inline bullet (legacy / hand-authored): if no YAML frontmatter exists OR YAML has no status: field, scan the first 30 lines for a line matching - **Status:** {value} (case-insensitive on "Status"; tolerate * or + as the bullet marker; tolerate Status: without the bold).
Strip refinement notes: the inline-bullet form sometimes carries a parenthetical refinement note: - **Status:** accepted (refined by ADR-0010, 2026-05-03). Split on the first (, trim trailing whitespace, and use only the leading word ("accepted"). The parenthetical content is preserved in the source file but is not rendered in prime tables — it would blow out column width for a corner case better surfaced by /sdd:graph or by reading the artifact directly.
No status found: if neither form yields a value, record the artifact as having no parseable status. Render as — in the table when other artifacts in the same corpus have status; drop the Status column entirely when zero artifacts in the corpus have status (see Step 5 rendering rule).
Extract summaries for context (v5.1.0+):
To make prime output immediately useful without opening files, extract concise summaries:
Handle edge cases:
{adr-dir} does not exist: "The {adr-dir} directory does not exist. Run /sdd:adr [description] to create your first ADR."{spec-dir} does not exist: "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."Present results using the appropriate output format below.
/sdd:prime):## Architecture Context Loaded
Refreshed index (15 added, 174 updated across this repo's collections).
Primed session with {N} ADRs and {M} specs.
### Architecture Decision Records
| ID | Title | Status | Key Decision |
|----|-------|--------|--------------|
| ADR-0001 | {title} | {status} | {one-sentence summary of decision outcome} |
### Specifications
| ID | Title | Status | Requirements |
|----|-------|--------|--------------|
| SPEC-0001 | {title} | {status} | {N} requirements, {M} scenarios |
### Artifact Summaries (v5.1.0+)
**ADR-0001: {title}** (accepted)
{2-3 sentence summary of context, decision, and rationale.}
**ADR-0002: {title}** (proposed)
{2-3 sentence summary.}
**SPEC-0001: {title}**
{2-3 sentence summary of what the spec covers and key requirements.}
### Non-Authoritative (excluded)
- ADR-XXXX: {title} → superseded by ADR-YYYY
- ADR-XXXX: {title} (deprecated)
- SPEC-XXXX: {title} (rejected)
### Quick Reference
- Check for drift: `/sdd:check [target]`
- Full audit: `/sdd:audit [scope]`
- List all artifacts: `/sdd:list`
Notes:
- The "Artifact Summaries" section provides context without opening files and is new in v5.1.0
- The "Non-Authoritative (excluded)" section MUST only appear when there are excluded artifacts. If all artifacts are authoritative, omit the section entirely.
- The "Refreshed index" line appears only when the index had changes; omit when the diff is empty
/sdd:prime in a multi-module project):## Architecture Context Loaded
Primed session with {N} ADRs and {M} specs across {K} modules.
### Architecture Decision Records
| Module | ID | Title | Status | Key Decision |
|--------|----|-------|--------|--------------|
| [api] | ADR-0001 | {title} | {status} | {one-sentence summary} |
| [worker] | ADR-0001 | {title} | {status} | {one-sentence summary} |
### Specifications
| Module | ID | Title | Status | Requirements |
|--------|----|-------|--------|--------------|
| [api] | SPEC-0001 | {title} | {status} | {N} requirements, {M} scenarios |
| [worker] | SPEC-0001 | {title} | {status} | {N} requirements, {M} scenarios |
### Artifact Summaries (v5.1.0+)
**[api] ADR-0001: {title}** (accepted)
{2-3 sentence summary of context, decision, and rationale.}
**[worker] SPEC-0001: {title}**
{2-3 sentence summary of what the spec covers and key requirements.}
### Non-Authoritative (excluded)
- [api] ADR-XXXX: {title} → superseded by ADR-YYYY
- [worker] SPEC-XXXX: {title} (deprecated)
### Quick Reference
- Check for drift: `/sdd:check [target]`
- Check single module: `/sdd:check --module api [target]`
- Full audit: `/sdd:audit [scope]`
- List all artifacts: `/sdd:list`
/sdd:prime {topic}):## Architecture Context Loaded (filtered: "{topic}")
Primed session with {N} ADRs and {M} specs matching "{topic}".
### Matching ADRs
| ID | Title | Status | Relevance |
|----|-------|--------|-----------|
| ADR-XXXX | {title} | {status} | {why this matched the topic} |
| ADR-XXXX | {title} | ⚠ superseded | {why this matched the topic} |
### Matching Specs
| ID | Title | Status | Relevance |
|----|-------|--------|-----------|
| SPEC-XXXX | {title} | {status} | {why this matched the topic} |
### Summaries
**ADR-XXXX: {title}**
{2-3 sentence summary of context, decision, and rationale.}
**ADR-XXXX: {title}** ⚠ superseded by ADR-YYYY
{2-3 sentence summary. Final sentence notes: "This decision was superseded by ADR-YYYY — see the replacement for current guidance."}
**SPEC-XXXX: {title}**
{2-3 sentence summary of what the spec covers and key requirements.}
### Skipped (not relevant to "{topic}")
- ADR-XXXX: {title}
- SPEC-XXXX: {title}
- **Status:** {value} is misleading and was reported as a real-world bug— so the asymmetry is visible. Workspace aggregate mode: the rendered corpus is the union across all modules — drop the column only when ZERO artifacts across ALL modules have status. If even one module has status, keep the column and render — for the modules that do not (the asymmetry is the signal). Single-module mode applies the rule to that module's corpus directlyaccepted (refined by ADR-0010, 2026-05-03) → accepted) — the full text remains in the source file; prime tables show the lifecycle word only[api] ADR-0001)--module is provided, do NOT prefix artifacts — behave as single-modulesuperseded, deprecated, and rejected are non-authoritative; everything else (including missing/empty status) is authoritative (Governing: ADR-0027)ADR-XXXX: {title} → superseded by ADR-YYYY. If superseded-by metadata is missing, render as ADR-XXXX: {title} (superseded — no replacement recorded) so the dead-end is visible⚠ {status} badge in the table and a "superseded by" note in the summary — do NOT silently exclude them, since topic filtering is for historical/investigative use[api] ADR-XXXX: ...) consistent with main-table prefixingqmd update on entry unless the index was touched within 60s. Surface refresh diff as one-line note when non-zero; otherwise silent. Surface unembedded chunk count as one-line informational note (no AskUserQuestion) (Governing: ADR-0026, SPEC-0019 REQ "Tier 2 Session-Start Update via /sdd:prime")qmd query with different limit/minScore parameters: untargeted uses limit: 10000, minScore: 0 to retrieve all artifacts; topic-filtered uses limit: 8, minScore: 0.3 for top-K relevance (Governing: ADR-0024, proposed refinement)npx claudepluginhub joestump/claude-plugin-sdd --plugin sddAuthors, indexes, and lints Architecture Decision Records (ADRs) to preserve the rationale behind system decisions. Scaffolds new ADRs, enforces format, manages supersession, and maintains an index.