agentleFS
LuisUrrutiaLuisUrrutia/skills/tdd/SKILL.md

tdd

Skill2 starsChanged 57 days agoMITView on GitHub

Use when implementing features or fixes with test-driven development (TDD).

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use make-bot-ui, Poteto Mode 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.
  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 8 projects that use this

  • jtarorehSkill

    Poteto Mode

    poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.

    Also in 5 projects that use this

  • risadamsSkill

    which-skill

    Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.

    Also in 7 projects that use this

  • TheOnlyFusionCubeSkill

    principle-attack-the-premise

    Inventory who actually owns or exhibits the imbalance, then challenge the shared premise before writing another patch. Use when two or more fixes that share one premise have failed the same gate.

    Also in 11 projects that use this

  • TheOnlyFusionCubeSkill

    principle-test-behavior-not-implementation

    Call the system the way its consumer does and assert meaningful observable output; avoid mocks or assertions that only mirror internal calls. Use when when writing or evaluating tests.

    Also in 11 projects that use this

  • shreyT19Skill

    principle-laziness-protocol

    Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading. Bias toward deletion and the smallest change that solves the problem.

    Also in 22 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 177 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this method when the user or caller selects test-first development.

    line 9
  2. Distinctive:

    Read the relevant implementation, tests, and project contracts.

    line 14
  3. Distinctive:

    When accessible evidence leaves a material behavior or interface choice unresolved, ask and pause its tests and implementation.

    line 21
  4. Distinctive:

    Keep a brief list of observable scenarios.

    line 32
  5. Distinctive:

    When choosing a test boundary, an independent expected result, or test doubles requires judgment, read references/test-design.md.

    line 36
  6. Distinctive:

    Write the check: Add a focused test through the chosen boundary.

    line 41
  7. Distinctive:

    Observe red: Run the test before implementing the behavior.

    line 46
  8. Distinctive:

    Choose the next scenario: Use what the completed cycle established to select the next missing behavior.

    line 60
  9. Distinctive:

    If a new test passes immediately, inspect its assertions and the existing path.

    line 68
  10. Distinctive:

    If the test cannot run, resolve in-scope setup problems with established tooling first.

    line 75
  11. Distinctive:

    Run the relevant suite and the project's required build, type, lint, and smoke checks.

    line 84

“Common” is measured: kept by at least 6 in 10 of the 177 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

Build requested behavior through short red, green, and optional refactor cycles. Use this method when the user or caller selects test-first development. Start from the request and project context; no work-mode or earlier phase is required.

Establish the behavior

Read the relevant implementation, tests, and project contracts. Identify the observable behavior to add or change, its source of truth, and the existing test command. Run the relevant existing checks to distinguish prior failures from regressions introduced here.

Choose the public boundary callers use and the closest test layer that exercises the behavior. Reuse established boundaries without asking for routine approval. When accessible evidence leaves a material behavior or interface choice unresolved, ask and pause its tests and implementation. Continue only work that remains valid under any plausible answer. Do not turn the missing decision into an assumed default, a new parameter, or a callback merely to keep coding; that also changes the contract. The current implementation alone does not define correctness.

For a bug, take an established failure and intended correction as input. If they are not evident from the request and code, diagnosis is separate work before the TDD repair; do not expand this method into an open investigation. An existing debug investigation can supply that evidence without becoming a dependency.

Keep a brief list of observable scenarios. Start with one useful behavior and let later cycles cover remaining requirements and boundaries. A list of scenarios is a plan, not a batch of speculative tests to write up front.

When choosing a test boundary, an independent expected result, or test doubles requires judgment, read references/test-design.md.

Work one behavior at a time

  1. Write the check. Add a focused test through the chosen boundary. Derive its expected result from the contract, a worked example, or another independent source. Assert the observable result and relevant state or effects; do not reproduce the production algorithm to compute the expectation. Name the test after its observable behavior using the project's terms.
  2. Observe red. Run the test before implementing the behavior. Inspect why it fails. A broken runner, missing fixture, syntax error, or unrelated failure does not establish the intended red state. Add only minimal declarations or wiring when needed to make the test reach the missing behavior, then rerun it. That scaffolding must not satisfy the new assertion. Retain the command and relevant failure as evidence.
  3. Make it green. Implement the smallest coherent change that satisfies this behavior and preserves existing contracts. Run the new test and relevant nearby tests. Resolve regressions introduced by the change before proceeding; do not weaken correct assertions to accommodate an incorrect implementation.
  4. Refactor when useful. With the relevant tests passing, remove duplication or clarify the changed code without altering its contract. Rerun those tests. Refactoring is optional and stays within this change; a broader redesign is a separate decision.
  5. Choose the next scenario. Use what the completed cycle established to select the next missing behavior. Repeat until the requested contract is covered and implemented, rather than anticipating unrelated future features.

A scenario may need several assertions to express one behavior, such as a returned result and an unchanged balance. Group equivalent inputs when they exercise the same rule; keep unrelated behaviors in separate cycles.

If a new test passes immediately, inspect its assertions and the existing path; the behavior may already be supported. Keep useful coverage, report that no red state occurred, and choose the next missing behavior. An optional mutation probe belongs in a disposable copy and is separate from the TDD sequence. Do not damage working code to manufacture red or describe tests added after implementation as test-first development.

If the test cannot run, resolve in-scope setup problems with established tooling first. New testing dependencies follow the project's choices and task authority. When execution still needs an inaccessible prerequisite or new authority, stop the affected cycle and report the exact blocker. Continue independent work, but do not silently switch the requested TDD task to unverified implementation-first work.

Finish with evidence

Run the relevant suite and the project's required build, type, lint, and smoke checks. Self-check the changed files and, when permitted, the diff for accidental changes and tests tied to incidental structure. A broad code review remains a separate caller-owned task. Separate pre-existing failures, new regressions, and checks that could not run.

Report the behavior implemented, meaningful red and green observations, optional refactoring, exact final commands and outcomes, and remaining gaps. A passing final suite alone does not demonstrate test-first ordering.

This skill owns test-driven implementation. Diagnosis-only requests, running existing checks, and adding coverage for already working code have different completion criteria. Repository instructions and the caller own worktrees, commits, PRs, and further delivery; this skill neither initiates those tasks nor cancels an existing requirement to perform them.

For a requested check or update of this skill's sources, read references/upstream-updates.md.

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.