TASK GUIDE · SOURCE-AWARE

Test-Driven Development (TDD) Workflow for Coding Agents

A practical coding-agent TDD workflow: agree on a public test seam, fail one behavior test, implement the smallest slice, then refactor during review.

Build this plan for my Agent ↗
Desired outcome

Turn one agreed public behavior into a failing test, pass it with the smallest change, then verify the result.

Safe working boundary

Test the public contract, not internals; a green suite does not prove behavior it never exercised.

01 · SKILL STACK

A minimal three-role stack

Each role has one job. The personalized builder can adjust the selection for your Agent without changing the decision logic.

01 · Core execution

tdd

Guides one public-behavior test → minimal implementation slice at a time; refactoring is a separate review step.

Main limitation
The workflow needs a functioning test runner and clear public behavior.
First risk
False confidence
Source evidence
Pinned · c55ee460
Inspect tdd ↗
02 · Guardrail

create-implementation-plan

Keeps the test tied to the actual change boundary.

Main limitation
Demanding zero ambiguity can create oversized plans or false precision for exploratory work.
First risk
False certainty from generated detail
Source evidence
Pinned · 1f564408
Inspect create-implementation-plan ↗
03 · Evidence

Minimal Run and Audit

Runs the smallest relevant suite and records the result.

Main limitation
It does not choose the reproduction target, train a model, conduct broad paper analysis, or hide scientific-meaning changes.
First risk
Scientific changes hidden as setup fixes
Source evidence
Pinned · fb3ccdf5
Inspect Minimal Run and Audit ↗

02 · TDD WORKFLOW

A practical TDD workflow for coding agents

This guide follows Matt Pocock's pinned TDD Skill: its implementation loop is red → green, while refactoring belongs to the later review stage. Many general TDD guides use the shorthand red–green–refactor; this distinction describes that specific Skill, not a universal definition of TDD.

  1. Agree on the test seamName the public interface and behavior with the developer before writing a test. Add one line on what the test will catch—and what it will miss.
  2. Make one behavior test failTest through that public interface. Let the test fail for the intended reason, and take expected results from the spec or an independent example—not from the implementation.
  3. Pass one vertical sliceChange only enough code to pass that test, then repeat for the next behavior. Avoid writing the whole suite before implementation or coupling assertions to private internals.
  4. Review, refactor, and verifyInspect the diff and keep cleanup in a separate review step. After any refactor, rerun the affected tests; a green suite covers only the behaviors and environments it actually exercises.

Illustrative example: an expired discount code

At the public checkout boundary, specify the expected response when a code has expired, then write one test that fails against the current behavior. Use the written requirement as the expected result. This is an example only—not a measured benchmark or a claim about a particular project.

Read the pinned upstream TDD instructions ↗ · c55ee46

03 · ACCEPTANCE

How to know the task is finished

  1. Agree on the public test seam and note what the test catches and misses.
  2. Show one behavior test failing for the intended reason before implementation.
  3. Pass it with the smallest change, then rerun relevant tests after review or refactoring.

04 · STOP CONDITIONS

When to stop

  • The test only mirrors implementation details.
  • Unrelated behavior changes to make the test pass.
  • The full suite is skipped after shared code changes.

05 · METHOD

How this guide was produced

SkillSignal maps a defined task to three non-overlapping responsibilities, then selects from reviewed catalog metadata. Agent fit, source state, permissions, and published scores are evaluated with deterministic rules. No LLM writes or reorders the recommendation at request time.