agentleFS
luizomfluizomf/omskills/skills/engineering/tdd/SKILL.md

tdd

Skill3 starsChanged 2 months agoMITView on GitHub

Use a red → green → refactor loop. Apply the test-seam, test-quality, anti-pattern, and loop rules below during every cycle. When exploring the codebase, read CONTEXT.md if it exists and use its domain terms in test names and interface vocabulary. Follow ADRs that apply to the code under test. Before writing the first test or changing implementation, pass the adaptive Delivery mode gate. Read-only inspection and reproduction may precede it. Treat an explicit semantic choice as sufficient; ask only when…

194 other projects use a version of this, 28 of them edited.

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

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a red → green → refactor loop.

    line 10
  2. Very specific:

    When exploring the codebase, read CONTEXT.md if it exists and use its domain terms in test names and interface vocabulary.

    line 13
  3. Distinctive:

    Before writing the first test or changing implementation, pass the adaptive Delivery mode gate.

    line 17
  4. Distinctive:

    Use tests.md for examples and mocking.md for mocking guidelines.

    line 34
  5. Very specific:

    Use the architecture meaning of seam from codebase-design (resolve this link from the physical base printed by cd …

    line 39
  6. Distinctive:

    Before writing any test:

    line 46
  7. Distinctive:

    Treat a test seam already confirmed in the accepted request, Spec, Ticket, repository sources, or conversation as confirmed.

    line 49
  8. Distinctive:

    Red: write one test at one confirmed test seam and run it.

    line 90
  9. Distinctive:

    Green: add only the implementation required to make that test pass.

    line 92
  10. Distinctive:

    Start the next slice only after the refactored slice and all relevant prior tests pass.

    line 98

“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

Use a red → green → refactor loop. Apply the test-seam, test-quality, anti-pattern, and loop rules below during every cycle.

When exploring the codebase, read CONTEXT.md if it exists and use its domain terms in test names and interface vocabulary. Follow ADRs that apply to the code under test.

Before writing the first test or changing implementation, pass the adaptive Delivery mode gate. Read-only inspection and reproduction may precede it. Treat an explicit semantic choice as sufficient; ask only when topology or maintainer availability remains materially unresolved. An untracked request or exactly one selected Ticket stays with its conversational owner through the authorized stopping point. Maintainer absence alone adds no readiness, Prompt Audit, or dispatcher. Resolve choices from accepted sources; ask the available maintainer only for missing input that blocks progress, without repeating established choices.

Test criteria

A test must exercise behavior through a confirmed test seam and assert a caller-visible result. It must not depend on private methods or internal structure. Name the test for the capability and condition it verifies, such as user can checkout with valid cart.

Use tests.md for examples and mocking.md for mocking guidelines.

Test seams

Use the architecture meaning of seam from codebase-design (resolve this link from the physical base printed by cd '<loaded-skill-directory>' && pwd -P, not the workspace): a location where behavior can be altered without editing code at that location. A test seam is a seam exposed through the caller-visible interface that production callers and behavior tests share.

Before writing any test:

  1. List every caller-visible test seam to be exercised.
  2. Treat a test seam already confirmed in the accepted request, Spec, Ticket, repository sources, or conversation as confirmed. When those accepted sources and repository behavior determine the caller-visible interface and seam, record that evidence and proceed without asking for reconfirmation. Resolve a minor residual choice that does not change caller-visible coverage through established repository conventions.
  3. Resolve each genuinely unconfirmed material seam through the applicable authority branch:
    • The responsible agent resolves the seam from the accepted contract. If genuinely missing input blocks progress and the maintainer is available, ask which caller-visible interface and seams to exercise. If the maintainer is away and established authority cannot resolve it, report the blocker. A delegated helper returns the unresolved seam to that owner.
    • In any other print/headless invocation, report the unresolved seam to the caller and stop before writing tests. Print/headless execution never waits for a conversational answer.

Seam selection is complete only when every test seam is confirmed from accepted sources or interactive confirmation, or the applicable terminal blocker has been returned. Write behavior tests only at confirmed test seams. Do not bypass the caller-visible interface to test internal seams.

Anti-patterns

  • Implementation-coupled: the test mocks internal collaborators, invokes private methods, or verifies through a side channel such as querying the database instead of using the confirmed interface. It fails after an internal refactor even though observable behavior is unchanged.
  • Tautological: the assertion derives its expected value with the same operation as the implementation, such as expect(add(a, b)).toBe(a + b), a hand-built snapshot produced by the same steps, or a constant compared with itself. Derive expected values from an independent source: a known-good literal, a worked example, or the specification.
  • Horizontal slicing: multiple tests are written before any corresponding implementation. Use vertical slices instead: one failing test → its minimal implementation → the next test.

Loop

For each vertical slice, in this order:

  1. Red: write one test at one confirmed test seam and run it. Proceed only when it fails because the requested behavior is absent.
  2. Green: add only the implementation required to make that test pass. Run the current test and every relevant previously passing test until they all pass. Do not implement behavior reserved for a later test.
  3. Refactor: improve the test and implementation structure without changing observable behavior or adding behavior reserved for a later slice. Rerun the same tests until they all pass again.
  4. Start the next slice only after the refactored slice and all relevant prior tests pass.

A vertical slice is complete only after red demonstrated the missing behavior, green supplied it, and refactor preserved it with passing tests.

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.