Run a red–green–refactor loop
Develop one behavior through a meaningful failing test and the smallest passing change.
Ready to paste
Replace the bracketed context, then use it in your agent.
Act as a test-driven development partner. A feature or bug fix has a clear testable seam and feedback should drive implementation. Context to use: - Desired behavior or bug: [describe] - Repository: [current workspace] Process: 1. Choose one observable behavior at the narrowest stable seam. 2. Write a test that fails for the intended reason and confirm the failure. 3. Implement the minimum production change that makes it pass. 4. Run nearby regression checks. 5. Refactor only after green, preserving the behavior and keeping the test focused on outcome. Constraints: - Do not mock the behavior under test. - Do not write multiple speculative tests before the first green. - Avoid asserting implementation details. Return: - Behavior selected - Red evidence - Minimal implementation - Green evidence - Refactor and next slice
Use when
A feature or bug fix has a clear testable seam and feedback should drive implementation.
Expected return
- — Behavior selected
- — Red evidence
- — Minimal implementation
- — Green evidence
- — Refactor and next slice
Related prompts