Every SDD change flows through up to nine phases, each executed by a dedicated sub-agent. The orchestrator never does phase work itself — it delegates, collects the result, and decides what runs next. This page documents exactly what happens in each phase: what the sub-agent reads, what it writes, and what engram topic key it uses to store its artifact.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lnardev/opencode-config-agent/llms.txt
Use this file to discover all available pages before exploring further.
SDD Init Guard
Before executing any SDD command, the orchestrator silently checks whethersdd-init has been run for the current project.
- It searches engram:
mem_search(query: "sdd-init/{project}", project: "{project}") - If found → init was already done. Proceed normally.
- If not found → delegate to
sdd-initfirst, then proceed with the requested command.
Phase Reference
Phase 1 — sdd-init: Initialize
Phase 1 — sdd-init: Initialize
The init phase detects everything about your project and bootstraps the artifact persistence backend. It runs exactly once per project (or when you explicitly re-run
/sdd-init to refresh the context).What it does:- Reads
package.json,go.mod,pyproject.toml, etc. to detect the tech stack - Scans for all testing infrastructure (test runner, unit/integration/E2E layers, coverage tools, quality tools)
- Resolves Strict TDD Mode (see below)
- Bootstraps the
openspec/directory if the artifact store isopenspecorhybrid - Builds the skill registry (scans all
*/SKILL.mdfiles, writes.atl/skill-registry.md) - Persists project context and testing capabilities to the active backend
- Engram:
sdd-init/{project}(project context) andsdd/{project}/testing-capabilities - OpenSpec:
openspec/config.yaml,openspec/specs/,openspec/changes/ - Always:
.atl/skill-registry.md
sdd-init/{project}Phase 2 — sdd-explore: Explore
Phase 2 — sdd-explore: Explore
The explore phase investigates your codebase for a specific topic or idea. It reads widely, compares approaches, and produces a structured analysis — without creating or modifying any project files.What it does:
- Reads project context from engram (optional, if init was already run)
- Scans relevant files and directories for the topic
- Compares possible implementation approaches
- Identifies affected modules, potential risks, and a recommended direction
sdd/{change}/exploreEngram topic key: sdd/{change}/exploreExploration is optional but strongly recommended before
/sdd-new. It gives the proposal phase real codebase context rather than relying on the AI’s assumptions.Phase 3 — sdd-propose: Propose
Phase 3 — sdd-propose: Propose
The propose phase creates a structured change proposal. It reads the exploration artifact (if it exists) and produces a scoped, reviewable proposal that defines what will change and why.What it does:
- Reads the exploration artifact if available
- Defines the change scope, goals, and out-of-scope items
- Identifies affected modules and packages
- Documents risks and includes a rollback plan
- Produces a proposal ready for spec and design phases
sdd/{change}/explore (optional)Writes: sdd/{change}/proposalEngram topic key: sdd/{change}/proposalPhase 4 — sdd-design: Design
Phase 4 — sdd-design: Design
The design phase takes the proposal and produces a full technical design. It runs in parallel with the spec phase — both depend on the proposal, and tasks depend on both.What it does:
- Reads the proposal (required)
- Produces architecture decisions with explicit rationale
- Includes sequence diagrams for complex flows
- Documents technical approach, data models, and integration points
- Records decisions that
sdd-applymust follow
sdd/{change}/proposal (required)Writes: sdd/{change}/designEngram topic key: sdd/{change}/designPhase 5 — sdd-spec: Spec
Phase 5 — sdd-spec: Spec
The spec phase produces detailed behavioral specifications in Given/When/Then format using RFC 2119 keywords (MUST, SHALL, SHOULD, MAY). These scenarios become the acceptance criteria that
sdd-verify checks against.What it does:- Reads the proposal (required)
- Writes detailed specifications for every feature and edge case
- Uses Given/When/Then scenario format
- Uses RFC 2119 keywords for requirement strength
- Produces the specification document that
sdd-tasksandsdd-verifydepend on
sdd/{change}/proposal (required)Writes: sdd/{change}/specEngram topic key: sdd/{change}/specPhase 6 — sdd-tasks: Tasks
Phase 6 — sdd-tasks: Tasks
The tasks phase breaks the spec and design down into concrete, session-sized implementation tasks. It requires both spec and design to be complete first.What it does:
- Reads both the spec and design artifacts (both required)
- Groups tasks by phase: infrastructure → implementation → testing
- Uses hierarchical numbering (1.1, 1.2, 2.1, etc.)
- Keeps each task small enough to complete in one session
- Produces the task list that
sdd-applyexecutes against
sdd/{change}/spec + sdd/{change}/design (both required)Writes: sdd/{change}/tasksEngram topic key: sdd/{change}/tasksPhase 7 — sdd-apply: Apply
Phase 7 — sdd-apply: Apply
The apply phase executes the implementation. It reads tasks, spec, and design, then writes code following the project’s conventions. When Strict TDD Mode is active, it follows a RED → GREEN → REFACTOR cycle for every task.What it does:
- Reads tasks, spec, design, and previous apply-progress (if continuing a batch)
- Implements each incomplete task in order
- Marks tasks complete (
[x]) as it goes, updating the tasks artifact - Saves incremental progress after each batch
- When TDD is active: writes failing test → implements minimum code to pass → refactors
sdd/{change}/tasks + sdd/{change}/spec + sdd/{change}/design + sdd/{change}/apply-progress (if exists)Writes: sdd/{change}/apply-progressEngram topic key: sdd/{change}/apply-progressPhase 8 — sdd-verify: Verify
Phase 8 — sdd-verify: Verify
The verify phase validates the implementation against the specifications. It produces a structured report with findings categorized as CRITICAL, WARNING, or SUGGESTION.What it does:
- Reads spec, tasks, and apply-progress (all required)
- Checks completeness: are all tasks marked done?
- Checks correctness: does the code match every spec scenario?
- Checks coherence: were the design decisions followed?
- Runs tests and build (real execution, not simulated)
- Builds a spec compliance matrix
sdd/{change}/spec + sdd/{change}/tasks + sdd/{change}/apply-progressWrites: sdd/{change}/verify-reportEngram topic key: sdd/{change}/verify-reportPhase 9 — sdd-archive: Archive
Phase 9 — sdd-archive: Archive
The archive phase closes the change. It reads all artifacts, writes a final archive report, syncs delta specs into the main spec directory, and marks the change as complete.What it does:
- Reads all artifacts: proposal, spec, design, tasks, verify-report (all required)
- Confirms the verify report shows the change is ready
- Syncs delta specs into
openspec/specs/(source of truth) - Records all observation IDs in the archive report for traceability
- Moves the change folder to archive with a date prefix
sdd/{change}/archive-reportEngram topic key: sdd/{change}/archive-reportEngram Topic Key Format
Every artifact is stored in engram using a predictable topic key. The orchestrator passes these keys to sub-agents as artifact references — sub-agents always retrieve full content viamem_search → mem_get_observation (search results are capped at 300-character previews).
| Artifact | Topic Key |
|---|---|
| Project context | sdd-init/{project} |
| Exploration | sdd/{change}/explore |
| Proposal | sdd/{change}/proposal |
| Spec | sdd/{change}/spec |
| Design | sdd/{change}/design |
| Tasks | sdd/{change}/tasks |
| Apply progress | sdd/{change}/apply-progress |
| Verify report | sdd/{change}/verify-report |
| Archive report | sdd/{change}/archive-report |
| DAG state | sdd/{change}/state |
Strict TDD Mode
Whensdd-init detects a test runner in the project, it sets strict_tdd: true and caches it in engram. Before launching sdd-apply or sdd-verify, the orchestrator searches for this value and, if found, injects the following instruction into the sub-agent prompt:
- System prompt marker (
gentle-ai:sdd-model-assignments) — highest priority openspec/config.yaml→strict_tddfield- If no config found but a test runner exists → default to
strict_tdd: true - If no test runner →
strict_tdd: false
Apply-Progress Continuity
Large changes may require multiple apply batches. When launchingsdd-apply for a continuation batch (not the first), the orchestrator:
- Searches for existing apply-progress:
mem_search(query: "sdd/{change}/apply-progress", ...) - If found, injects this into the sub-agent prompt:
Result Contract
Every phase sub-agent returns a structured envelope with the same fields:| Field | Description |
|---|---|
status | success, partial, or error |
executive_summary | One-paragraph summary of what was done |
artifacts | List of artifact keys written |
next_recommended | Which phase should run next |
risks | Any risks or blockers identified |
skill_resolution | injected, fallback-registry, fallback-path, or none |
The orchestrator checks
skill_resolution after every delegation. If it is anything other than injected, it re-reads the skill registry immediately and injects compact rules into all subsequent delegations. This is a self-correction mechanism for context loss from compaction.