agentleFS
igorkulmanigorkulman/pi-skills/skills/tdd/SKILL.md

tdd

Skill3 starsChanged 2 months agoMITView on GitHub

Implement the current analyzed task test-first through observable behavior, one red-green-refactor slice at a time.

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

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 13

    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:

    Ask only when a missing product decision or material architecture choice prevents a safe implementation.

    line 15
  2. Distinctive:

    Read and apply pragmatic-testing before choosing or changing tests.

    line 16
  3. Distinctive:

    Test observable behavior through the highest practical stable seam, not private implementation details.

    line 17
  4. Distinctive:

    Never commit automatically.

    line 20
  5. Distinctive:

    Use the analysis to identify:

    line 24
  6. Distinctive:

    If no analysis is present but the task is clear, inspect only enough code and tests to establish these facts.

    line 33
  7. Distinctive:

    Write one focused test before its production implementation.

    line 41
  8. Distinctive:

    Prefer existing test helpers and boundary fakes.

    line 51
  9. Distinctive:

    Run only the focused test and confirm that it fails for the intended missing behavior, not because of unrelated setup, environment, or …

    line 53
  10. Distinctive:

    Run the same focused test through the same execution route until it passes.

    line 61
  11. Distinctive:

    Prefer Xcode MCP's focused test tools for red-green cycles.

    line 79
  12. Distinctive:

    Use Xcode MCP for broader tests, builds, diagnostics, and SwiftUI previews when available.

    line 80
  13. Distinctive:

    Treat a real MCP compilation or test failure as a result to fix, not a reason to switch execution routes.

    line 82

“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

Implement the task already established in the conversation using test-driven development. Invoking this skill is authorization to make the scoped test and production-code changes; it is not authorization to stage, commit, push, change external systems, or broaden the task.

Operating contract

  • Consume the latest analyze findings and testing approach when present. Do not ask the user to restate the ticket or approve routine red-green-refactor cycles.
  • Ask only when a missing product decision or material architecture choice prevents a safe implementation. Group currently known blocking questions, then resume automatically after the answer.
  • Read and apply pragmatic-testing before choosing or changing tests. It supplies the test-quality rules; this skill retains the test-first execution order.
  • Test observable behavior through the highest practical stable seam, not private implementation details.
  • Work in vertical slices: one behavior, one failing test, the minimum implementation, then refactor while green.
  • Preserve unrelated changes and follow repository guidance.
  • Never commit automatically. Leave code review and committing as explicit subsequent workflows.

1. Establish the first slice

Use the analysis to identify:

  • the acceptance criterion being implemented
  • the recommended test seam
  • the first observable behavior and a plausible production mistake the test must detect
  • the independent expected result and distinct protection the test adds
  • the focused test target and execution route
  • any part requiring non-automated verification

If no analysis is present but the task is clear, inspect only enough code and tests to establish these facts. If there is no meaningful automated seam, stop and explain why TDD is unsuitable rather than manufacturing an implementation-coupled test.

For a partially testable task, apply TDD only to the behavior with a valid seam. Retain the analysis's preview, hardware, manual, or other verification for the remainder.

Completion criterion: one narrow observable behavior, a plausible regression, and the test that should detect it are identified without an unresolved requirement or seam decision.

2. Red

Write one focused test before its production implementation.

A useful test:

  • describes caller- or user-visible behavior
  • exercises a public or otherwise stable interface
  • uses an independent expected result from the requirement or a known example
  • fails if the behavior regresses while surviving internal refactoring
  • uses doubles only for collaborators outside the behavior under test, such as network APIs, persistence, time, randomness, or hardware; the double must not implement the product rule being asserted

Prefer existing test helpers and boundary fakes. Do not introduce a new abstraction solely to make a test possible unless the analyzed plan already established that seam.

Run only the focused test and confirm that it fails for the intended missing behavior, not because of unrelated setup, environment, or syntax problems. A compilation failure is useful red evidence only when the planned behavior intentionally requires a new public interface.

Completion criterion: the focused test has run and produced the expected red signal.

3. Green

Implement only enough production behavior to satisfy the current test. Avoid speculative support for later slices and avoid unrelated cleanup.

Run the same focused test through the same execution route until it passes. Fix failures within the current slice without asking for routine confirmation.

When the test's ability to detect the named plausible mistake remains uncertain, follow pragmatic-testing's safe targeted-mutation procedure, confirm the intended assertion fails, restore the exact pre-mutation content, and re-run green. The initial red proves missing behavior, not necessarily sensitivity to a subtly wrong implementation.

Completion criterion: the focused test passes, protects the identified contract, and no requirement beyond the current slice was implemented speculatively.

4. Refactor

Improve names, duplication, and structure exposed by the slice while preserving behavior. Re-run the focused test after refactoring and keep it green. Skip refactoring when the implementation is already clear.

Completion criterion: the slice is clear, scoped, and green.

5. Repeat and verify

Repeat red, green, and refactor for the next observable behavior. Do not write all tests up front; let each completed slice inform the next.

For Xcode projects:

  1. Prefer Xcode MCP's focused test tools for red-green cycles.
  2. Use Xcode MCP for broader tests, builds, diagnostics, and SwiftUI previews when available.
  3. Fall back to shell xcodebuild through the xcodebuild-xcsift workflow only when MCP is unavailable or lacks the required operation.
  4. Treat a real MCP compilation or test failure as a result to fix, not a reason to switch execution routes. Never run both routes concurrently.

After all slices are green, run the broader focused verification identified by the analysis and inspect the final diff for scope. Perform the non-automated verification where available; never claim a fake hardware adapter proves behavior against a physical device or that logic tests prove visual correctness.

Report:

  • behaviors implemented
  • tests added or changed
  • red and green evidence, plus the plausible regressions protected
  • targeted mutation results when used, or any uncertainty about test effectiveness
  • execution route used
  • broader verification and any manual/device verification still needed
  • residual risks

Finish by recommending /skill:code-review. Do not stage or commit.

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.