Prompt file imported from dofuslab/dofuslab (
.codex/prompts/build-discovery-cycle.md). Copyright stays with the author.
Build Discovery Implementation Cycle
Goal: make one reviewable stacked-PR step toward DofusLab Build Discovery v1.
Stacking rule:
- Base current work on the clean CP-SAT review stack.
- The complete history and beam frontier are archive references, not production parents.
- Each cycle should produce one stacked PR-sized change.
- A cycle should have one clear parent branch, one focused commit range, and one PR description.
- Do not keep appending unrelated work to an already oversized diff.
Use this agent sequence:
- Spawn
build-discovery-planner. - If the planner says existing implementation needs review first, spawn
build-discovery-evaluatorand stop after reporting. - Otherwise choose one small slice from the planner output.
- Spawn
build-discovery-workerto implement only that slice. - Spawn
build-discovery-evaluatorto review the resulting diff. - Apply required fixes only if they are narrow and clearly within the selected slice.
- Run focused tests.
- Update
.codex/state/build-discovery-decisions.mdwhen the cycle establishes a durable decision. - Summarize the intended stacked PR boundary: parent branch, changed files, tests, and review focus.
Stop and ask the user if:
- The correct branch/worktree is ambiguous.
- A migration, destructive command, or broad data regeneration is required.
- The implementation would span more than one PRD milestone.
- The current branch has uncommitted baseline work and the next slice would be hard to review without committing, stashing, or creating a new worktree first.
- A requested change would make the synchronous API unable to respect its bounded resource policy.
- Reviewer findings require architectural decisions not already settled by the PRD.
Each cycle output should include:
- Slice implemented or reason no implementation was done.
- Files changed.
- Tests run.
- Reviewer findings.
- Stacked PR boundary and suggested PR title.
- Remaining PRD gap.
- Recommended next cycle prompt.