This document describes the common workflow structure for systematic, inside-out development. For project-specific details:
- Games: See
workflow-game.md - Applications: See
workflow-application.md
Our workflow follows a systematic, inside-out approach that ensures each layer is proven before moving to the next. We use AI agents to help plan and implement features, maintaining quality through explicit proofs and test-first development.
Our design documents form a clear hierarchy that establishes ownership and prevents architectural drift:
-
Product Design Document (PDD) – Defines what the product is:
- Games: Called GDD (Game Design Document) - see
workflow-game.md - Applications: Called PRD (Product Requirements Document) - see
workflow-application.md - User-facing behavior, goals, workflows, scope, interactions, domain entities
- User experience: UI/UX, success/failure states, feature mechanics
- Must follow the structure defined in the appropriate blueprint (
blueprint/gdd-blueprint.mdfor games,blueprint/prd-blueprint.mdfor applications)
- Games: Called GDD (Game Design Document) - see
-
TDD (Technical Design Document) – Defines how the product is structured:
- Source of truth for architecture: packages, core types, interfaces
- Technical decisions: architecture patterns, protocol choices, data consistency models
- Layer boundaries: domain logic, orchestration, protocol, transport
- Must follow the structure defined in
blueprint/tdd-blueprint.md - All Planning and Implementation agents must respect the TDD as authoritative
-
Package Specs – Describe meaning and invariants for packages:
- Semantic descriptions of core types and their relationships
- Invariants, constraints, and ownership rules
- Not duplicate code – they explain what entities mean, not how they're implemented
- Examples: See project-specific workflows for concrete examples
-
API.md Files – Provide API reference documentation for client-side packages:
- Detailed interface documentation with methods, parameters, and return types
- Semantics, lifecycle, and invariants for client packages
- Code location and design goals for each package
- Examples: See project-specific workflows for concrete examples
-
Devplan (Development Plan) – Defines in what order we evolve the structure:
- D-loop progression (per service: server D0-D9, client D0-D10)
- Capabilities and quality gates
- Sequencing of work
- D-loop definitions are project-specific - see
workflow-game.mdorworkflow-application.md
-
plan.md + CU Implementation Plans – Define how we slice work:
- Change Units (CUs) that implement specific capabilities
- Task breakdowns and allowlists
- Evidence requirements
- Planning & Implementation agents must not contradict the TDD
- If a new core type, package, or subsystem change is needed:
- The TDD (and relevant package spec) must be updated first
- Planning is re-run to incorporate the updated design
- Only then can implementation proceed
- No ad-hoc architectural decisions – all structural changes flow through the TDD
The Product Design Document defines what the product should be. The specific document type and naming depends on the project type:
- Games: GDD (Game Design Document) - see
workflow-game.mdfor details - Applications: PRD (Product Requirements Document) - see
workflow-application.mdfor details
Blueprint: All design documents must follow the structure defined in the appropriate blueprint file.
For version upgrades, we create delta documents that track changes between design document versions. These are maintained by the Delta Agent (agents/deltas/delta_agent.yaml):
- Delta YAML files (
agents/deltas/<pdd>_v*_to_v*.yaml) – Structured list of changes (ADD, MODIFY, REMOVE) with delta IDs, descriptions, design document references, importance, and status - Delta Journal (
agents/deltas/delta_journal.md) – Append-only journal tracking delta extraction, refinement, and critique iterations
Delta Agent Process:
- Extract mode: Identifies changes between design document versions (features, systems, entities, protocol changes)
- Refine mode: Improves descriptions, splits/merges deltas, marks as REVIEWED
- Critique mode: Adversarial check for missing deltas, invalid entries, redundancies
Purpose: Delta documents explicitly describe what changed from the previous design document version, providing traceability for planning and implementation.
For version upgrades, we create gap documents that identify missing implementation details in the TDD compared to design document requirements. These are maintained by the Gap Agent (agents/gaps/gap_agent.yaml):
- Gap YAML files (
agents/gaps/tdd_v*_to_<pdd>_v*.yaml) – Structured list of gaps (MISSING, OUTDATED, INCOMPLETE) with gap IDs, implementation specifications, TDD/design document references, priority, and status - Gap Journal (
agents/gaps/gap_journal.md) – Append-only journal tracking gap extraction, refinement, and critique iterations
Gap Agent Process:
- Extract mode: Identifies implementation details missing from TDD (algorithms, constants, patterns, technical debt)
- Refine mode: Improves descriptions with specific implementation details, removes redundant gaps
- Critique mode: Adversarial check for redundancy with delta analysis, actionability, missing gaps
Key Principle: Gap analysis must NOT duplicate delta analysis. Gaps should only exist if they provide specific implementation details (algorithms, values, patterns) beyond what deltas describe.
Purpose: Gap documents identify actionable TDD improvements needed to support design document requirements, focusing on implementation details that the design document doesn't specify but TDD should document.
When upgrading between versions (e.g., v0 to v1), we use AI agents to analyze and document changes:
The Delta Agent (agents/deltas/delta_agent.yaml) maintains delta documents that track changes between design document versions:
- Purpose: Identify what changed in the design document (features added, modified, or removed)
- Inputs: Old design document, new design document, existing delta file, delta journal
- Outputs: Updated delta YAML file, delta journal entries
- Modes:
extract: Initial delta generation from design document comparisonrefine: Improve descriptions, split/merge deltas, mark as REVIEWEDcritique: Adversarial check for missing deltas, invalid entries, redundancies
- Key Principle: Design document is always the source of truth; delta file is derived
The Gap Agent (agents/gaps/gap_agent.yaml) maintains gap documents that identify missing implementation details in the TDD:
- Purpose: Identify what's missing in the TDD compared to design document requirements (algorithms, constants, patterns, technical debt)
- Inputs: TDD v0, design document v1, delta file, existing gap file, gap journal
- Outputs: Updated gap YAML file, gap journal entries
- Modes:
extract: Initial gap identification focusing on implementation detailsrefine: Improve descriptions with specific details, remove redundant gapscritique: Adversarial check for redundancy with delta analysis, actionability
- Key Principle: Gap analysis must NOT duplicate delta analysis. Gaps should only exist if they provide specific implementation details beyond what deltas describe.
When to Run:
- After creating a new design document version (e.g., v1)
- Before planning implementation work for version upgrades
- When TDD needs to be updated to support new design document requirements
The Architect Agent (agents/architect/architect_agent.yaml) is the single architectural authority that creates and updates TDD and SPEC/API documentation.
- For initial version (v0): Creates the Technical Design Document (TDD) based on your Product Design Document
- For version upgrades: Updates TDD and SPEC/API documentation based on deltas and gaps
The Architect Agent works top-down to ensure TDD, SPEC.md, and API.md files accurately reflect the architectural structure needed to support design document requirements.
v*/<pdd>_<project>_v*.md- Current product design document (GDD for games, PRD for applications)v*/tdd_<project>_v*.md- Current technical design document (may not exist for initial version)agents/deltas/<pdd>_v*_to_v*.yaml- Delta documents (design document changes between versions, only for upgrades)agents/gaps/tdd_v*_to_<pdd>_v*.yaml- Gap documents (TDD implementation gaps, only for upgrades)agents/architect/architect_objectives.md- Architectural objectives for each level (L0–L3)server/**/SPEC.md- Existing service/module specs (may or may not exist yet)client/**/API.md- Existing client-facing contracts (may or may not exist yet)
v*/tdd_<project>_v*.md- Created or updated technical design documentserver/**/SPEC.md- Created or updated service/module specsclient/**/API.md- Created or updated client-facing API documentationagents/architect/architect_journal.md- Journal entries tracking refine and critique iterations
The Architect Agent follows a refine → critique loop at each level (L0→L3):
Enrich raw deltas/gaps with metadata to enable efficient selection and prioritization. Analyze each delta to extract its architectural intent, categorize by level (L0/L1/L2/L3), domain, and affected components. Tag deltas with relevant architectural concerns (e.g., scalability, security, data-ownership), identify relationships and dependencies between deltas, and summarize the architectural change in clear, structured text.
Transform design requirements (from PDD for initial version, or from deltas/gaps for upgrades) into precise architecture documentation. Work top-down (L0→L3), analyzing impact and evaluating against level-specific objectives. Create or update TDD and SPEC/API with explicit responsibilities, boundaries, and contracts. Keep changes minimal and consistent with existing architecture.
Refine steps:
- Select Deltas - Apply delta management strategies to select, prioritize, and batch deltas for this level (L0→L3), respecting dependencies and grouping related changes
- Analyze Context - Understand what changed, why, and which architectural elements are affected at this level
- Evaluate Objectives - Check against level-specific objectives (from
agents/architect/architect_objectives.md) and identify quality attribute impacts - Locate and Update - Find target sections in TDD/SPEC/API and make precise, minimal changes that preserve consistency
- Document Rationale - Include brief reasoning for architectural choices and note any lower-level dependencies (add TODO if needed)
- Verify Coherence - Ensure changes align with higher-level decisions and don't introduce contradictions
- Document in Journal - Record this refine entry in
agents/architect/architect_journal.mdusing the Refine Entry Format
Self-review the new/changed TDD and SPEC/API text against the design document and the rest of the TDD.
Critique checks:
- Are there any obvious contradictions with existing sections?
- Did you accidentally introduce new behavior not requested by deltas/gaps?
- Does this change force an update at a lower level? If yes, add a note/TODO in the relevant section instead of silently assuming it.
Critique actions:
- If the change is noisy or unclear → simplify and tighten once
- If a delta/gap cannot truly be resolved at this level → note this clearly in the TDD section (e.g., "Requires L2/L3 detail") and stop pushing
- Document critique entry in
agents/architect/architect_journal.mdusing the Critique Entry Format
L0 – System Landscape:
- Focus: System landscape, services, external systems, main channels, high-level data and control flows
- Allowed edits: TDD sections describing system overview/architecture diagrams, high-level references in SPEC/API
L1 – Service / Bounded Context Level:
- Focus: Individual services/bounded contexts, responsibilities, owned data, interactions with other services
- Allowed edits: TDD sections describing each service, service-level SPEC files (
server/**/SPEC.md)
L2 – Service-Internal Module Level:
- Focus: Internal structure of each service, modules, layers, and how they collaborate
- Allowed edits: TDD subsections for internal modules, module-level SPEC files (
server/**/SPEC.mdsub-sections)
L3 – Interface & Contract Level:
- Focus: Interface & contract level, APIs, messages, schemas, and error behavior
- Allowed edits: Client
**/API.mdfiles, protocol/contract parts of SPEC.md, TDD contract sections
- Do NOT edit: Design documents (
v*/<pdd>_v*.md),agents/gaps/tdd_v*_to_<pdd>_v*.yaml,agents/deltas/<pdd>_v*_to_v*.yaml, or code - Only edit:
v*/tdd_<project>_v*.md,server/**/SPEC.md,client/**/API.md - Top-down approach: Work L0→L3, ensuring higher-level decisions inform lower-level details
- Minimal changes: Keep changes minimal and consistent with existing architecture
The Architect Agent is done when:
- Current batch of deltas/gaps has been processed (all deltas have clear, updated description in TDD and/or SPEC/API, OR explicit note saying why they are deferred)
- New text is consistent with existing higher-level decisions and previous batches
- No obvious contradictions are visible in the focused context
- Batch processing is complete (refine + critique loop finished for this batch)
When to Run:
- For initial version (v0): After creating the Product Design Document (section 1), before Development Plan Creation (section 4)
- For version upgrades: After Delta and Gap Analysis (section 2), before Development Plan Creation (section 4) and Planning Agent (section 5)
- The created/updated TDD, SPEC.md, and API.md files become inputs for Planning and Implementation agents
The Development Plan (devplan_<project>_v*.md) is created with AI assistance and serves as the master plan for implementation. It defines:
- Paradigm highlights: core principles (domain-first, contracts over code, test-first)
- D-loop progression: Per-service development loops (server: D0-D9, client: D0-D10) from workspace setup to end-to-end scenarios
- Layer progression: how capabilities flow through each loop
- Quality gates: proof requirements, test expectations, evidence standards
- Iteration cycle: how capabilities are broken down and implemented
D-Loops (Development Layers):
IMPORTANT: D-loops are applied per service. Each service (client, server) has its own independent progression through D-loops. Services share D0 (workspace) and D4 (protocol contracts) but have service-specific adapters.
D-loop definitions are project-specific - see workflow-game.md for game-specific D-loops or workflow-application.md for application-specific D-loops.
Key principle: You cannot advance to loop D(n+1) until all proofs for Dn are green for that service. Each service progresses through its D-loops independently.
Example locations:
v0/devplan_<project>.md- Initial development planv1/devplan_<project>_v1.md- v1 upgrade plan
The Planning Agent (agents/planning/planning_agent.yaml) creates detailed implementation plans for each D-loop segment.
v*/devplan_<project>_v*.md- Master development planv*/<pdd>_<project>_v*.md- Product design document (must follow appropriate blueprint)v*/tdd_<project>_v*.md- Technical design document (must followblueprint/tdd-blueprint.md) - Updated by Architect Agentagents/deltas/<pdd>_v*_to_v*.yaml- Delta documents (design document changes between versions)agents/gaps/tdd_v*_to_<pdd>_v*.yaml- Gap documents (TDD implementation gaps)utils/test_lables.md- Test labeling conventionsserver/**/SPEC.md- Service/module specs (updated by Architect Agent)client/src/*/API.md- Client-side API documentation files (updated by Architect Agent)
- Choose next D-loop to advance based on devplan sequencing (per service: server or client)
- Read all relevant documents (devplan, design document, TDD, delta files, gap files, test labels, package specs, API.md files)
- Consider delta and gap documents:
- Deltas identify what changed in the design document (what features to implement)
- Gaps identify what's missing in TDD (implementation details to add)
- Use both to understand scope and technical requirements
- Respect TDD as source of truth:
- Do not invent new packages or core types not present in the TDD
- Use the package and type locations defined by the TDD when planning CUs
- If missing concepts are discovered (e.g., new entity type, new domain primitive), the change must be made in the TDD and package spec first, not designed ad-hoc in plan.md
- Create workspace at
development_v*/<loop>/<yyyy-mm-dd>_<slug>/(specify which service: server or client) - Write plan.md with:
- Loop goals and prerequisites (traceable to devplan)
- 3–7 outcome-oriented steps
- CU List (Change Unit List) with:
- CU IDs (e.g.,
cu/g1-<feature-name>) - Titles (short behavior descriptions)
- Loop targets
- Step references
- kind:
core|feature|refactor(see Key Concepts → Change Units) - subsystem: See project-specific workflows for subsystem types
- tdd_refs: (optional) list of TDD sections being implemented
- Files allowlists
- Proof labels (see project-specific workflows for examples)
- Status (BACKLOG | NEXT | IN_PROGRESS | DONE)
- CU IDs (e.g.,
- Acceptance criteria with required evidence
development_v*/<loop>/<date>_<slug>/plan.md
- No CU marked NEXT initially - Planning agent only creates the backlog
- Steps must map to loop goals from devplan
- CU rows must include proof labels for test requirements
- Prerequisites must reference existing v0/v1 tests that must stay green
The Implementation Agent (agents/implementation/implementation_agent.yaml) executes CUs (Change Units) from the plan, implementing features test-first.
development_v*/<loop>/<slug>/plan.md- The plan created by Planning Agentv*/devplan_<project>_v*.md- Master development planv*/<pdd>_<project>_v*.md- Product design document (must follow appropriate blueprint)v*/tdd_<project>_v*.md- Technical design document (must followblueprint/tdd-blueprint.md) - Updated by Architect Agentagents/deltas/<pdd>_v*_to_v*.yaml- Delta documents (design document changes between versions)agents/gaps/tdd_v*_to_<pdd>_v*.yaml- Gap documents (TDD implementation gaps)utils/test_lables.md- Test labeling conventionscuplan.md- CU planning guidelines (if exists, at root level)server/**/SPEC.md- Service/module specs (updated by Architect Agent)client/src/*/API.md- Client-side API documentation files (updated by Architect Agent)
- Read
plan.mdand find the CU markedNEXTin the CU List - Record its
loop:target and version context
- Create branch:
cu/<loop>-<cu-slug>-<unique>
- Read all relevant documents
- Create
development_v*/<loop>/<slug>/cu_<cu-slug>/<cu-slug>-implementation_plan.mdwith:- Tasks breakdown
- Files allowlist (which files can be modified)
- Target tests (which tests must pass)
- Evidence fields (where to record test results)
- Manual gate: Implementation plan must be approved before coding
- Add or update tests labeled with the CU's loop proof requirements
- Tests must be written before implementation
- Write minimal code within allowlists to satisfy new/updated tests
- Follow test-first principles
- Run labeled test suites
- Record command + result in evidence log
- Ensure all required proofs pass
- Set CU status to
DONEinplan.md - Include evidence links
- Select a new single
NEXTCU (only one at a time)
- Commit changes
- Open PR with template (includes goal, loop, acceptance checks, tests plan, files touched, evidence)
- Secure approvals
- Merge to main
development_v*/<loop>/<slug>/cu_<cu-slug>/<cu-slug>-implementation_plan.md- Code changes in allowed files
- Updated
plan.mdwith CU status changes
- Test-first: Always write tests before implementation
- One CU at a time: Only one CU marked
NEXTin the plan - Evidence-driven: All test results must be recorded
- Allowlist enforcement: Only modify files in the CU's allowlist
- Proof labels: Tests must be labeled according to loop requirements
- No spec modifications: Implementation Agent must not modify the TDD or package spec docs
- If the spec is missing or ambiguous for a CU, treat that as a planning/design problem (i.e., "spec missing; return to Planning Agent")
- Do not improvise new core types or behavior – structural changes must flow through the TDD first
┌─────────────────────────────────────────────────────────────┐
│ 1. Design Phase │
│ └─ Create Product Design Document (GDD/PRD) │
│ (TDD is created/updated by Architect Agent) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 2. Delta & Gap Analysis (Version Upgrades Only) │
│ ├─ Delta Agent: Extract design document changes (v0→v1) │
│ └─ Gap Agent: Identify TDD implementation gaps │
│ (Skip for initial version - go directly to step 3) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 3. Architect Agent │
│ ├─ Initial Version: │
│ │ ├─ Reads: Design doc, objectives │
│ │ └─ Creates: TDD, SPEC.md, API.md (top-down L0→L3) │
│ ├─ Version Upgrades: │
│ │ ├─ Reads: Design doc, TDD, deltas, gaps, objectives │
│ │ └─ Updates: TDD, SPEC.md, API.md (top-down L0→L3) │
│ └─ Process: Refine → Critique loop per level │
│ (TDD/SPEC/API become source of truth for planning) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 4. Development Plan (with AI) │
│ └─ Create devplan_<project>_v*.md │
│ (Defines D-loops, capabilities, quality gates) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 5. Planning Agent │
│ ├─ Reads: devplan, design doc, TDD (updated), SPEC/API │
│ ├─ Chooses next D-loop to advance │
│ └─ Creates: plan.md with CU List │
│ (No CU marked NEXT initially) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 6. Implementation Agent │
│ ├─ Finds NEXT CU from plan.md │
│ ├─ Creates implementation_plan.md │
│ ├─ WAIT: Manual approval gate │
│ ├─ TEST-FIRST: Write tests with proof labels │
│ ├─ IMPLEMENT: Minimal code to pass tests │
│ ├─ VERIFY: Run tests, record evidence │
│ ├─ UPDATE: Mark CU DONE, select next NEXT │
│ └─ COMMIT: PR with evidence, merge │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 7. Iterate │
│ └─ Repeat until all CUs in loop are DONE │
│ └─ Advance to next D-loop when all proofs green │
└─────────────────────────────────────────────────────────────┘
Workflow summary as text:
-
Design Phase:
- Create Product Design Document (GDD for games, PRD for applications)
- TDD is created/updated by Architect Agent (not written manually)
-
Delta & Gap Analysis (Version Upgrades Only):
- Delta Agent: Extract design document changes between versions
- Gap Agent: Identify TDD implementation gaps
- Skip for initial version - proceed directly to Architect Agent
-
Architect Agent:
- Initial Version: Reads design document and objectives; Creates TDD, SPEC.md, API.md
- Version Upgrades: Reads design document, TDD, deltas, gaps, objectives; Updates TDD, SPEC.md, API.md
- Works top-down (L0→L3) with Refine → Critique loop per level
- TDD/SPEC/API become source of truth for planning
-
Development Plan Creation (with AI):
- Create devplan__v*.md
- Defines D-loops, capabilities, quality gates
-
Planning Agent:
- Reads: devplan, design document, TDD (updated), SPEC/API (updated), deltas, gaps, test labels
- Chooses next D-loop to advance
- Creates: plan.md with CU List
- No CU marked NEXT initially
-
Implementation Agent:
- Finds NEXT CU from plan.md
- Creates implementation_plan.md
- WAIT: Manual approval gate
- TEST-FIRST: Write tests with proof labels
- IMPLEMENT: Minimal code to pass tests
- VERIFY: Run tests, record evidence
- UPDATE: Mark CU DONE, select next NEXT
- COMMIT: PR with evidence, merge
-
Iterate:
- Repeat until all CUs in loop are DONE
- Advance to next D-loop when all proofs green
- Small, testable units of work
- Each CU has a clear goal, allowlist, and proof requirements
- Only one CU marked
NEXTat a time - Status flow: BACKLOG → NEXT → IN_PROGRESS → DONE
Each CU is classified by kind and subsystem:
kind:
core– Evolves the primitives of a package (e.g., new entity fields, new domain primitive, new validation rules). Must update the corresponding package spec, and only operates inside that package's core code.feature– Composes existing primitives to implement product features. Must not introduce new core entities, domain formulas, or validation state machines. Cannot change package specs.refactor– Structural changes (renames, moves, mechanical cleanup) with no external behavior change. Tests must remain green; no new primitives.
subsystem:
- See project-specific workflows (
workflow-game.mdorworkflow-application.md) for subsystem types and examples
Guardrail: Feature CUs are not allowed to define new domain state structs, domain formulas, or validation state machines. Any such change must be done as a Core CU for the relevant package and reflected in the TDD + package spec.
Tests are labeled to indicate their scope and purpose:
scope:unit|contract|integration|e2e|perfloop:g0-work|g1-<domain>|g2-<validation>|g3-orch|g4-proto|g5-adapter|g6-client|g7-ops|g8-scenario(see project-specific workflows for exact loop names)layer:<domain>|contract|server|client|ops|infra|scenario(see project-specific workflows for exact layer names)net:proto:v<major>- Protocol versiondep:<dependency>- Integration dependenciesdouble:<test-double>- Test doubles used
Server Service:
- Start with entities (D1)
- Add domain logic (D2)
- Add validation/rules (D3)
- Define contracts (D4)
- Add session orchestration (D5)
- Add context management (D6)
- Implement transport (D7)
- Add observability (D8)
- Validate end-to-end (D9)
Client Service:
- Start with state management (D1)
- Add app orchestrator (D2)
- Define contracts (D4, shared with server)
- Implement network client (D5)
- Add rendering (D6)
- Add UI (D7)
- Add input handling (D8)
- Add observability (D9)
- Validate end-to-end (D10)
- Always write tests before implementation
- Tests define the behavior
- Implementation satisfies the tests
- Evidence must be recorded
- Each version has its own design document, TDD, and devplan
- Delta documents track design document changes between versions (what changed)
- Gap documents track TDD implementation gaps compared to design document requirements (what's missing)
- v0 is the baseline; v1 extends it
- v1 work is isolated in
development_v1/
workflow/
├── workflow.md # This file (base workflow)
├── workflow-game.md # Game-specific extensions
└── workflow-application.md # Application-specific extensions
blueprint/
├── gdd-blueprint.md # GDD structure template (games)
├── prd-blueprint.md # PRD structure template (applications)
└── tdd-blueprint.md # TDD structure template
agents/
├── architect/
│ ├── architect_agent.yaml # Architect agent configuration
│ ├── architect_objectives.md # Architectural objectives (L0–L3)
│ ├── architect_journal.md # Architect refine/critique journal
│ └── client_architect_journal.md # Client-specific architect journal
├── deltas/
│ ├── delta_agent.yaml # Delta Agent configuration
│ ├── delta_journal.md # Delta extraction/refinement journal
│ └── <pdd>_v*_to_v*.yaml # Design document changes (structured)
├── gaps/
│ ├── gap_agent.yaml # Gap Agent configuration
│ ├── gap_journal.md # Gap extraction/refinement journal
│ └── tdd_v*_to_<pdd>_v*.yaml # TDD gaps for design document (structured)
├── planning/
│ └── planning_agent.yaml # Planning agent configuration
└── implementation/
└── implementation_agent.yaml # Implementation agent configuration
utils/
└── test_lables.md # Test labeling conventions
v0/
├── <pdd>_<project>_v0.md # v0 Product Design Document
├── tdd_<project>_v0.md # v0 Technical Design Document
└── devplan_<project>.md # v0 Development Plan
v1/
├── <pdd>_<project>_v1.md # v1 Product Design Document
├── tdd_<project>_v1.md # v1 Technical Design Document
└── devplan_<project>_v1.md # v1 Development Plan
development_v1/
└── <loop>/
└── <date>_<slug>/
├── plan.md # Plan created by Planning Agent
└── cu_<cu-slug>/
└── <cu-slug>-implementation_plan.md # Created by Implementation Agent
client/src/
├── core/API.md # Core package API reference
├── ui/API.md # UI package API reference
└── ... (other API.md files as needed)
server/
└── ... (SPEC.md files as needed)
- Never skip proofs: Each loop must have green tests before advancing
- One CU at a time: Only mark one CU as
NEXTin the plan - Test-first always: Write tests before implementation code
- Record evidence: Document all test results and commands
- Respect allowlists: Only modify files in the CU's allowlist
- Version isolation: Keep v1 work separate from v0
- Manual gates: Wait for approval before implementing
- Clear PRs: Include goal, loop, tests, files, and evidence in PRs
- Follow blueprints: Design documents must follow appropriate blueprint structure
- Architect updates TDD/SPEC/API: The Architect Agent is the single authority for updating TDD, SPEC.md, and API.md files. Planning and Implementation agents must respect these as source of truth.
- Single source of truth for domain entities: All domain entities live in the appropriate domain package and are defined in the model spec. No parallel entity structs elsewhere.
- Core logic only in package cores: Domain logic in the appropriate domain package. Higher layers (session, context, proto, client) compose but don't re-implement these.
This workflow ensures systematic, testable, and maintainable development with clear separation of concerns and explicit quality gates at each layer.