Skill 4: SDD-Codegen
What SDD-Codegen Does
SDD-Codegen generates the application’s code from the specifications alone. The agent does not read the original source; everything it needs was distilled into the specs. Two modes are available:
- Orchestrated. Every domain, in one coherent runnable application. Domains are ordered bottom-up where possible, and cross-domain contracts are frozen up front so every worker codes to a stable surface. One worker runs per domain, sequentially, and each hand-back is reviewed before the next starts. The application-level domain goes last and assembles the whole
- Single-domain. One named domain, standalone
Generation is from the baseline only. Nothing under any changes/ directory is implemented, and none of it influences the dependency graph, the ordering, or a contract.
Example prompts
Generate the code from ./specs-sanitized/ into ./generated/
Generate the Billing domain from ./specs-sanitized/ into ./src/
Build the app from ./specs-sanitized/ using the modern tech stack
If both technology-decisions.md and technology-decisions-modern.md exist, you will be asked which governs the run. This is a run-wide decision made once, so answer deliberately: the current stack reproduces the application as it is, while the modern stack replatforms it.
What You Get
./generated/
<the application's source code>
orchestration/
generation-order.md # the order chosen, cycles found, forward references, rationale
handbacks/<domain>.md # each worker's report
summary.md
openspec/
changes-applied.md # which architectural fixes this code contains
implementation-map/<domain>.md # requirement -> the code implementing it
The openspec/ folder matters beyond this run. implementation-map/ is how a later change finds the code behind a given requirement instead of searching for it, and changes-applied.md is how you tell whether the code and the specs still agree.
If It Refuses To Run
sdd-codegen stops if the specs tree still carries extraction artifacts: a traceability.md, an *.evidence.md, an open-questions.md, or a source-basis tag such as [Observed] or [Derived]. This means Step 3 was skipped or did not complete successfully. Run sdd-sanitize-specs and point sdd-codegen at the sanitized copy, or complete the sanitization yourself.
Next SDD Pipeline Skill
The next SDD Pipeline Skill is: