agentleFS
LucaDominiciLucaDominici/arbiter/.claude/skills/tdd/SKILL.md

tdd

Skill0 starsChanged 57 days agoApache-2.0View on GitHub

Use when implementing any feature or bugfix. Red-Green-Refactor cycle enforced. Write the failing test first, then minimal implementation.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use capture-learning-tools, design-frontend-dev and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • The-Vibe-CompanySkill

    capture-learning-tools

    Turn technical conversations, bugs, CI failures, review comments,

    Also in 5 projects that use this

  • The-Vibe-CompanySkill

    design-frontend-dev

    Clean Impeccable frontend design skill. Use when the user wants to

    Also in 5 projects that use this

  • tristanphvnSkill

    ketchup-video

    Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.

    Also in 14 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 54 projects that use this

  • jaydubya818Skill

    principle-laziness-protocol

    Apply when a refactor is adding wrappers or abstractions instead of simplifying.

    Also in 45 projects that use this

  • +2 more from The-Vibe-Company
  • +5 more from jaydubya818

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 1

    Distinctive

    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:

    No production code without a failing test first — a test written after the implementation can only confirm what the code already does, …

    line 16
  2. Very specific:

    Only with explicit user permission, and a granted skip is recorded, never tacit: note it in the plan (tdd: skipped — user permission, …

    line 77

“Common” is measured: kept by at least 6 in 10 of the 186 edited versions of this file we could read. “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

Test-Driven Development

No production code without a failing test first — a test written after the implementation can only confirm what the code already does, never what it was supposed to do.

Red-Green-Refactor

  1. RED — Write one failing test for the next behavior
  2. Verify RED — Run the test, confirm it fails for the right reason
  3. Record RED — node dist/cli.js lifecycle record-red --test-path <path> (add --task '#NNN' for a secondary issue on a train). It runs the test, captures the failure, and writes the SHA-pinned evidence file that the red → green phase gate reads; advancing into green refuses without it. A step of the loop, not a separate ceremony: a loop that stops at "Verify RED" leaves the next phase gate red.
  4. GREEN — Write minimal code to pass
  5. Verify GREEN — Run all tests, all pass
  6. REFACTOR — Clean up without breaking tests

Test Command

npm run test

Stack: typescript

Test runner: vitest

import { describe, it, expect } from 'vitest'

describe('feature', () => {
  it('does the expected thing', () => {
    // Arrange
    // Act
    // Assert
    expect(result).toBe(expected)
  })
})

Rules

  • One behavior per test
  • Watch each test fail before implementing
  • Minimal code to pass — no extra features
  • Refactor only after green

Anchor to the Acceptance Criteria (INV-138)

Acceptance tests derive from the issue's frozen criteria, not from your interpretation — writing tests from your own reading of the issue is grading your own homework.

  • Source of truth: the plan's ## Acceptance Criteria block (AC-N: ids frozen verbatim from the issue), never a live re-read of the issue.
  • Cite the id in the test title: it('retries 3 times on 5xx (AC-1)', …) — the reviewer's FIT rubric maps each AC-N to the test line that proves it.
  • State the mapping in the red commit body: "tests map 1:1 to the acceptance criteria of #NNN".
  • A behavior worth implementing that maps to NO criterion means the anchor is incomplete: update the plan anchor first (or capture it via arbiter finding add), don't silently widen scope.

When to Skip TDD

Only with explicit user permission, and a granted skip is recorded, never tacit: note it in the plan (tdd: skipped — user permission, <where granted>) so review and verification see a decision instead of an omission. "This is simple" is never a reason — simplicity predicts typing cost, not defect rate.

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.