Files
ai-artifacts/projects/skills/055-implement-skill-tdd-refactor-grill.md
2026-08-01 14:05:09 -04:00

51 lines
2.9 KiB
Markdown

---
status: resolved
parent: "[[038-implement-skill-map]]"
claimed-by: "019fbb66-80d0-7a01-8ac9-01255adfc7b2"
claimed-at: "2026-08-01T10:57:40-04:00"
blocked-by:
- "[[039-implement-skill-old-workflow-research]]"
- "[[042-implement-skill-no-mistakes-research]]"
- "[[077-implement-skill-matt-tdd-research]]"
- "[[065-implement-workflow-codebase-design-research]]"
tags:
- ticket/grill
---
# Implement workflow TDD skill contract grill
## Question
What standalone `test-driven-development` skill contract should the workflow expose, and how should it carry the necessary public-interface, seam-placement, test-quality, prefactoring, and refactoring guidance without requiring a separate packaged `codebase-design` skill?
## Resolution
`codebase-design` should not be packaged as part of this workflow.
The useful public-interface and seam guidance should be folded into `test-driven-development` and `review` instead.
`test-driven-development` should include only minimal practical seam guidance: test public behavior through the interface the code exposes or the task requires, identify the smallest public seam that can prove the behavior when unclear, and avoid testing internals just to make RED easy.
Tests are always written by someone other than the agent doing implementation.
The normal contract requires an independent test writer.
If the runtime truly cannot spawn an independent worker, the implementation agent must state that limitation before writing tests and preserve the role separation in-process as much as possible.
The implementation agent must not silently skip this requirement.
Use role names by function.
The implementation agent changes production code and drives the loop.
The test writer writes and edits tests.
The implementation agent gives the test writer one behavior, the public seam and context, an independent expected-value source, and failure output.
The implementation agent must not edit test-writer-authored tests.
Mechanical test defects go back to the test writer.
Semantic disagreement pauses for user or intent clarification.
The implementation agent may keep a private behavior backlog, but that backlog is isolated from the test writer.
The test writer receives one behavior at a time, writes one failing test, and then the implementation agent makes the minimal production change to pass.
Repeat the loop one behavior at a time.
Each test needs an independent source of truth for expected values, such as a spec, task, intent excerpt, worked example, known-good literal, existing behavior being preserved, user clarification, or external standard.
The implementation agent's derived computation is not enough.
Refactoring should match the old local `test-driven-development` behavior.
Never refactor while RED.
After tests pass, the implementation agent may refactor production code.
Test writer updates tests only for deliberate public seam changes or test defects.