agentleFS
shalombshalomb/agent-skills/skills/farley-tdd/SKILL.md

farley-tdd

Skill3 starsChanged 3 months agoMITView on GitHub

Audit and score an existing test suite against Dave Farley's Properties of Good Tests using the Farley Index. Use when tests already exist and the question is whether they can be trusted — flaky runs, slow CI, brittle tests, or validating that TDD was actually practised. For writing new code test-first use `test-driven-development`; for reviewing specific tests or a diff use `test-design-review`. Triggers on: 'farley', 'farley index', 'test quality', 'test suite audit', 'flaky tests', 'am I really doing TDD'.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Red: Write a failing test that defines the required behavior.

    line 26
  2. Distinctive:

    Green: Write the minimal production code necessary to pass the test.

    line 27
  3. Distinctive:

    Speculative Tests: Do not write all tests upfront.

    line 36
  4. Distinctive:

    All tests written must embody Farley's properties: Fast, Maintainable, Repeatable, Atomic, Necessary, Understandable.

    line 40
  5. Very specific:

    Read the full reference spec at docs/reference/farley-index.md.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Farley Test-Driven Development (TDD)

This skill provides comprehensive guidance on practicing Test-Driven Development (TDD) and evaluating test quality using Dave Farley's Properties of Good Tests.

What Good TDD Looks Like

Reference criteria for judging whether TDD was actually practised. To do TDD on new code, use test-driven-development — this section is the yardstick, not the workflow.

The Red-Green-Refactor cycle:

  1. Red: Write a failing test that defines the required behavior.
  2. Green: Write the minimal production code necessary to pass the test.
  3. Refactor: Improve the code structure without altering behavior.

A suite where Refactor was routinely skipped shows up as duplication across test setup and production code that no test ever forced out. Score it under Maintainable and Understandable.

Canon TDD Pitfalls (via Kent Beck) — evidence of these in the history or the suite means the cycle was not followed:

  • Speculative Tests: Do not write all tests upfront. Convert exactly one item from your test list into a concrete test, make it pass, then move to the next.
  • Mixing Interface & Implementation: The "Red" phase is for designing the interface. The "Refactor" phase is for designing the implementation. Do not mix them.
  • Abstracting Too Soon: In the "Refactor" phase, remember that duplication is a hint, not a command. Don't over-abstract prematurely.

All tests written must embody Farley's properties: Fast, Maintainable, Repeatable, Atomic, Necessary, Understandable.

Note: For tactical guidance on writing good assertions and avoiding brittle setup patterns, use the test-design-review skill.

The Farley Index Evaluator

A quantitative diagnostic tool that scores an automated test suite against these six Properties of Good Tests. It shifts the question from "Do we have tests?" to "Can we trust our tests?"

When to Use This Skill

Trigger ScenarioPrimary Property to EvaluateReason
Onboarding a new developerUnderstandableTests should be clear, living specifications.
Planning a refactorMaintainableTests must survive internal changes without breaking.
CI/CD pipeline is too slowFastIdentify tests that hit real I/O and slow the pipeline.
Debugging flaky test runsAtomic / RepeatableExpose shared state and non-deterministic dependencies.
Pre-release quality auditRepeatable / AtomicConfirm tests are trustworthy under parallel execution.
Validating TDD practicesNecessaryEvery line of production code must be demanded by a test.

Instructions

  1. Read the full reference spec at docs/reference/farley-index.md.
  2. Collect inputs from the user (source path, test path; optionally logs and VCS flag).
  3. Execute the evaluation protocol defined in the reference spec.
  4. Output the farley_index_score, per-dimension metrics, red_flags, and recommendations.
  5. Tailor the depth of analysis to the requesting agent's role:
    • Bart → focus on red flags and blockers (Refactor Judge mode).
    • Ralph → focus on Necessary + Fast to validate TDD hygiene.
    • Lisa → focus on Maintainable + Atomic to inform architecture decisions.
    • Lovejoy → focus on Repeatable as a release-gate signal.
    • Marge → translate score into plain-language user-impact summary.

Triggers

  • "farley"
  • "farley index"
  • "farley-index"
  • "test quality"
  • "test health"
  • "brittle tests"
  • "mock tautology"
  • "test theatre"
  • "flaky tests"
  • "test suite audit"
  • "TDD validation"
  • "test coupling"
  • "am I really doing TDD"

Not this skill

If the user wants to…Use
Write new code test-firsttest-driven-development
Review specific tests or a difftest-design-review
Burn down a TODO.md backlogralph-build-agent
Evaluate Gherkin/BDD specsadzic-bdd

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.