Build one behavior slice test-first
This is a focused procedure. For its place in a larger workflow, see Implement a planned task.
The owner explicitly wants test-first development and the behavior is agreed.
Finish with: An observed red test and the smallest green implementation at a user-confirmed seam.
Read the diagram
Open interactive diagram · Download SVG · Editable candidate
Arrows show this suggested sequence, not declared requires dependencies. Approval arrows are conditional. Declining a gate stops that branch without authorizing its writes. The numbered steps below are the text equivalent of the diagram.
Before you start
Use a trusted project and follow its instructions. Confirm the requested scope, installed skills, runtime tools, and any required workspace or approval. This selection includes the catalogued instruction requirements coding. Resolve them before use.
Steps
- Create task branch.
isolated-workspaceprovides the guidance for this step. - Resolve language guidance.
coding-with-rulesprovides the guidance for this step. - Run one failing test.
tddprovides the guidance for this step. - Make the slice pass.
tddprovides the guidance for this step.
Where to stop
Confirm the test seams with the user before writing a test. Stop the red-to-green implementation loop at green; refactoring belongs to a separate authorized review-stage handoff, not this loop. Never claim an unobserved failure.
Optional branches
- Choose
document-projectwhen implementation changes how readers use the project, or existing documentation blocks a real developer task. - Choose
code-reviewwhen you want changes since a fixed commit, branch, tag, or merge-base checked against both standards and the originating specification.
Optional branches are not prerequisites or permission to launch another phase. You can omit them or stop at the stated result. See relationship types for the distinction.