Phase 07 · Code Generation
Code Generation is where the Spec Chain pays off. You hand the AI the complete context — requirements, prototype, scenarios, API spec, schema, and test cases — and it generates business code that is correct by construction.
What goes in
The Code Skill assembles the following context automatically:
| File | Purpose |
|---|---|
requirements.md | What to build and why |
2-product-design/*.html | Visual reference |
2-scenario-implementation/*.md | Interaction flows |
openapi.yaml | Exact endpoint contracts |
schema.sql | Data model |
test/*.md | Definition of "correct" |
What comes out
logos/resources/implementation/ — production-ready code organized by your project's architecture (routes, services, repositories, etc.), plus test files that implement the cases from Phase 06.
Running in batches
For large projects, the Code Skill can be run scenario-by-scenario. Each batch must include:
- Business code for the scenario
- Unit and integration test code (with IDs matching Phase 06)
- OpenLogos reporter calls that write results to
logos/resources/verify/test-results.jsonl
Never defer all tests to the final batch.
Prompt template
Use this prompt to invoke the Code Skill for a batch:
Please execute Phase 3 Step 4 for scenarios S01–S03. Split into batches if needed, but each batch must deliver: (1) business code, (2) matching UT/IT test code with IDs from logos/resources/test/, (3) OpenLogos reporter writing to logos/resources/verify/test-results.jsonl. List the test case IDs covered before outputting code.