agentleFS
willianbswillianbs/skills/tdd-executor/SKILL.md

tdd-executor

Skill0 starsChanged 4 months agoMITView on GitHub

Runs red/green/refactor loops against acceptance criteria and TEST_STRATEGY. Use when practicing TDD or when tests should lead implementation. Emits TDD_SESSION. Never skips red, never refactors on red, never claims green without command evidence.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Upstream: test-strategy-designer, delivery-planner, spec-validator.

    line 31
  2. Distinctive:

    Stop if AC is untestable — hand back to spec-validator.

    line 43
  3. Very specific:

    Update TDD_SESSION log per cycle.

    line 51
  4. Distinctive:

    After cycles, summarize coverage vs AC IDs.

    line 52
  5. Distinctive:

    Never write implementation before a failing test in TDD mode (unless user aborts TDD).

    line 92
  6. Distinctive:

    Never refactor on red.

    line 93
  7. Distinctive:

    Never invent green test results.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Implement behavior test-first with a disciplined red → green → refactor loop tied to AC IDs.

When to Use / When NOT to Use

Use when: user asks for TDD; high-correctness units; pairing with TEST_STRATEGY; implementing pure logic/API contracts.

Do not use when: spike/prototype explicitly throwaway; pure docs; exploratory defect triage (defect-analyst first).

Preconditions

At least one testable AC or behavior statement. Prefer TEST_STRATEGY + TASK_GRAPH. Project test command discoverable.

Inputs / Outputs

Inputs: AC IDs, TEST_STRATEGY, CONTEXT_PACK, task scope.

Outputs: TDD_SESSION (+ code/tests); may produce/update IMPL_REPORT fields.

Upstream / Downstream

Upstream: test-strategy-designer, delivery-planner, spec-validator.

Downstream: feature-implementer (if continuing), code-reviewer, quality-gate.

Core Principles

  1. Red before implementation for the vertical under test.
  2. Green: minimal code to pass.
  3. Refactor only on green; keep tests green.
  4. One failing behavior at a time.
  5. Behavior-focused tests; avoid testing privates unless necessary.
  6. Record exact commands and outcomes.
  7. Stop if AC is untestable — hand back to spec-validator.

Process

For each AC/slice:

  1. Red — write failing test; run; capture failure.
  2. Green — minimal implementation; run; capture pass.
  3. Refactor — clean structure; run; stay green.
  4. Update TDD_SESSION log per cycle.
  5. After cycles, summarize coverage vs AC IDs; note gaps.

Lite

Single function/bugfix: one red/green cycle + optional refactor.

Evidence Requirements

commands_run with fail then pass. No “should pass” without running.

Stop Conditions / Failure Modes

ConditionAction
Cannot get a failing test (already green)Revisit AC / test design
Untestable ACHand off spec-validator
Refactor breaks testsFix before continuing

Severity + Confidence

N/A primarily; residual risk if ACs unverified.

Output Contract

## TDD_SESSION
AC focus: ...
Cycles:
  - red: command/result
  - green: command/result
  - refactor: command/result
Remaining gaps: ...
Decision: Proceed | ProceedWithConditions | Revise | Block

Handoffs

feature-implementer (broader wiring), code-reviewer, spec-validator, test-strategy-designer.

Never

  • Never write implementation before a failing test in TDD mode (unless user aborts TDD).
  • Never refactor on red.
  • Never invent green test results.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.