Writes delta specifications with requirements and Given/When/Then scenarios.
Triggers: /sdd-spec <change-name>, write specs, specifications, functional requirements, sdd spec
Purpose
Specs define WHAT the system must do from the perspective of observable behavior. They do not say how to implement it. They are the source of truth for verification.
Key concept — Delta Specs: Specs are deltas (changes) on top of what already exists, not full replacements.
- If there is no existing spec: I write a complete spec
- If a spec already exists: I write ADDED/MODIFIED/REMOVED sections
Skill resolution
When the orchestrator launches this sub-agent, it resolves the skill path using:
1. .claude/skills/sdd-spec/SKILL.md (project-local — highest priority)
2. ~/.claude/skills/sdd-spec/SKILL.md (global catalog — fallback)
Project-local skills override the global catalog. See docs/SKILL-RESOLUTION.md for the full algorithm.
Claude execution wiring
These notes bind the tool-neutral logic above to the Claude Code harness. They are the EXECUTION layer that does not port to other tools.
- Step 0a/0c preload — follow
skills/_shared/sdd-phase-common.mdSection F (Project Context Load) and Section G (Spec Context Preload). Non-blocking. - Step 0b domain preload — list
.mdfiles inai-context/features/andReadeach matching file. Read errors are treated as a miss (skip silently). - Proposal read — use the harness
Read("docs/sdd/{change-name}/proposal.md")tool. If the disk file is absent (legacy change), fall back tomem_search(query: "sdd/{change-name}/proposal")→mem_get_observation(id). If neither exists and Engram is not reachable, the orchestrator passes proposal content inline. - Spec persistence — write the disk artifact first with
Write("docs/sdd/{change-name}/spec.md", …), thenmem_savea pointer + summary withtopic_key: sdd/{change-name}/spec,type: architecture,project: {project}, content ="path: docs/sdd/{change-name}/spec.md\n\n{1-3 sentence summary}". If Engram MCP is not reachable, still write the disk artifact (source of truth) and skip the engram pointer only. - Orchestrator output — return the neutral Output Contract as the JSON block
the orchestrator expects; the manual next step is
/sdd-design <change-name>then/sdd-tasks <change-name>. List the loadedai-context/features/*.mdfiles inartifacts(read, not written) when domain context was preloaded.