agentleFS
cobusgreylingcobusgreyling/grok-build-arsenal/skills/tdd-intelligence/SKILL.md

tdd-intelligence

Skill6 starsChanged 5 months agoMITView on GitHub

Apply rigorous test-first development. Write failing tests (or characterization tests) that capture desired behavior before implementing. Maintain high test coverage on changed code. Use for new features, refactors, and bug fixes where regression protection matters. Triggers: "TDD this", "test first", "write the test then implement", "add characterization tests".

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    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:

    Run the test and confirm it fails for the right reason.

    line 20
  2. Distinctive:

    Never implement before at least one relevant test exists and is failing appropriately.

    line 34
  3. Distinctive:

    Prefer focused unit tests over broad integration tests for the core logic.

    line 35
  4. Very specific:

    When editing UI or complex flows, combine with browser-qa or manual verification steps.

    line 36
  5. Distinctive:

    Update or add tests in the same diff as the feature when possible.

    line 37
  6. Distinctive:

    Use a subagent to:

    line 41
  7. Distinctive:

    Always surface the actual commands the project uses:

    line 47
  8. Distinctive:

    All tests in the affected area are green at the end.

    line 56

≈ “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

TDD Intelligence

True test-driven development with agentic discipline.

Core Loop

  1. Understand the desired behavior (read existing code, docs, issues).
  2. Write the smallest failing test (or characterization test for legacy) that expresses the goal.
    • Run the test and confirm it fails for the right reason.
  3. Implement the minimal code to make the test pass.
  4. Refactor for cleanliness while keeping tests green.
  5. Add any additional edge-case or regression tests suggested by the implementation.
  6. Verify the full relevant test suite still passes.

For Refactors and Legacy Code

  • First write characterization tests that lock in current (even if imperfect) behavior.
  • Then change implementation.
  • Confirm the characterization tests still pass (proving behavior preservation).

Rules

  • Never implement before at least one relevant test exists and is failing appropriately.
  • Prefer focused unit tests over broad integration tests for the core logic.
  • When editing UI or complex flows, combine with browser-qa or manual verification steps.
  • Update or add tests in the same diff as the feature when possible.

Subagent Support

Use a subagent to:

  • Explore the test surface area before writing tests.
  • Generate additional edge cases after the happy path is implemented.

Verification Commands

Always surface the actual commands the project uses:

  • Python: pytest ... -q --tb=short
  • Next.js: npm test or vitest
  • Rust: cargo test

Discover these via the repo rather than assuming.

Success Criteria

  • The new/changed behavior is covered by tests that would have failed before the change.
  • All tests in the affected area are green at the end.
  • Diff size remains reasonable (tests + implementation together).

Anti-Patterns

  • Writing implementation then retrofitting tests.
  • Skipping tests "because it's simple".
  • Large untested refactors justified by "we'll add tests later".

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.