agentleFS
javatarzjavatarz/credit-card-lending/.claude/skills/tdd/SKILL.md

tdd

Skill4 starsChanged 11 months agoMITView on GitHub

Enforce Test-Driven Development when writing or modifying code. Use when implementing features, fixing bugs, or when the user asks to write code. Activates automatically for code changes unless user says "quick fix" or "no 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

Show its rules and text

We split this skill into the rules it gives an agent

27 rules. 0 are common, 26 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 177 edited versions we read keep these.

  • 26

    Distinctive

    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:

    If uncertain about mode, default to interactive

    line 49
  2. Distinctive:

    When mode changes, confirm: "Switched to [mode] mode"

    line 51
  3. Distinctive:

    Write just enough test code to fail

    line 60
  4. Distinctive:

    Confirm RED: Test MUST fail

    line 67
  5. Distinctive:

    If it passes: STOP - this is suspicious, discuss with user

    line 68
  6. Distinctive:

    Write minimum code to pass - no more

    line 79
  7. Distinctive:

    Confirm GREEN: Test MUST pass before proceeding

    line 86
  8. Distinctive:

    Look for duplication (primary target)

    line 90
  9. Distinctive:

    Interactive mode: Ask "Any refactoring before we commit?"

    line 92
  10. Distinctive:

    If refactoring: Run tests again to ensure still GREEN

    line 95
  11. Distinctive:

    Interactive mode: Wait for user confirmation before committing

    line 99
  12. Distinctive:

    Batch mode: Commit automatically, user reviews at batch point

    line 101
  13. Distinctive:

    Autonomous mode: Commit if Review skill found no blockers

    line 103
  14. Distinctive:

    When in autonomous mode, invoke the Review skill after GREEN phase.

    line 115
  15. Distinctive:

    When Review skill finds issues above threshold:

    line 127
  16. Distinctive:

    Ask how to proceed:

    line 129
  17. Distinctive:

    After completing an acceptance criterion:

    line 138
  18. Distinctive:

    Ask user to review

    line 141
  19. Distinctive:

    After completing all acceptance criteria:

    line 146
  20. Distinctive:

    Run comprehensive Review skill scan

    line 148
  21. Very specific:

    When invoked from /start-dev:

    line 154
  22. Distinctive:

    Use review mode specified (or default to interactive)

    line 158
  23. Distinctive:

    Write new code only if an automated test has failed

    line 165
  24. Distinctive:

    No production code unless it makes a failing test pass

    line 169
  25. Distinctive:

    No more test code than sufficient to fail

    line 170
  26. Distinctive:

    No more production code than sufficient to pass

    line 171
  27. Distinctive:

    When uncertain, ask: - never proceed without clarity

    line 177

“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

TDD Skill

Enforce Red-Green-Refactor discipline for all code changes.

When This Skill Activates

  • User asks to implement a feature
  • User asks to fix a bug
  • User asks to write or modify code
  • /start-dev delegates Phase 3 to this skill

When This Skill Does NOT Activate

  • User says "quick fix" or "no tdd"
  • Pure refactoring with no behavior change (user specifies)
  • Documentation-only changes

Review Modes

Mode determines when user reviews your work. Default is interactive.

Changing Modes

User can say:

  • use interactive - review each cycle (default)
  • use batch-ac - review after each acceptance criterion
  • use batch-story - review after all acceptance criteria
  • use autonomous strict - agent reviews, flags any code smell
  • use autonomous normal - agent reviews, flags significant issues
  • use autonomous relaxed - agent reviews, flags blockers only

Mode Behavior

ModeReview PointBest For
InteractiveAfter each Red-Green cycleLearning, complex logic, unfamiliar code
Batch ACAfter completing an acceptance criterionModerate oversight, well-understood domain
Batch StoryAfter all acceptance criteria completeMaximum flow, trusted patterns
AutonomousAgent reviews continuouslySpeed with quality gates

Mode Persistence

  • Remember the current mode throughout the conversation
  • If uncertain about mode, default to interactive
  • Acknowledge mode on each cycle: "Running in [mode] mode..."
  • When mode changes, confirm: "Switched to [mode] mode"

The Red-Green-Refactor Workflow

For each piece of functionality:

RED: Write a Failing Test

  1. Identify the smallest next piece of functionality
  2. Write just enough test code to fail
  3. Interactive/Batch: Show the test, explain what it tests
  4. Autonomous: Proceed without showing
  5. Run the test:
    ./gradlew test
  6. Confirm RED: Test MUST fail
    • If it passes: STOP - this is suspicious, discuss with user

GREEN: Make it Pass

  1. Choose a technique:
    TechniqueWhenHow
    Fake ItUnsure of implementationReturn constant, replace with variables later
    Obvious ImplementationKnow exactly what to typeWrite real implementation directly
    TriangulationDesign unclearAdd test cases to reveal pattern
  2. Write minimum code to pass - no more
  3. Interactive/Batch: Show the implementation
  4. Autonomous: Proceed without showing
  5. Run the test:
    ./gradlew test
  6. Confirm GREEN: Test MUST pass before proceeding

REFACTOR: Clean Up

  1. Look for duplication (primary target)
  2. Apply clean code principles
  3. Interactive mode: Ask "Any refactoring before we commit?"
  4. Batch mode: Note refactoring opportunities, continue
  5. Autonomous mode: Invoke Review skill, act on findings based on threshold
  6. If refactoring: Run tests again to ensure still GREEN

COMMIT

Interactive mode: Wait for user confirmation before committing

Batch mode: Commit automatically, user reviews at batch point

Autonomous mode: Commit if Review skill found no blockers

git add -A && git commit -m "<descriptive message> #<issue-number>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"

Autonomous Mode Details

When in autonomous mode, invoke the Review skill after GREEN phase.

Threshold Behavior

ThresholdInterrupt ForContinue If
StrictAny finding (blocker, warning, suggestion)No findings at all
NormalBlockers and warningsOnly suggestions
RelaxedBlockers onlyWarnings and suggestions OK

On Interrupt

When Review skill finds issues above threshold:

  1. Show the findings to user
  2. Ask how to proceed:
    • Fix now
    • Ignore and continue
    • Switch to interactive mode

Batch Review Points

Batch AC Mode

After completing an acceptance criterion:

  1. Show summary of all changes made
  2. Show cumulative Review skill findings (if any)
  3. Ask user to review
  4. Address feedback before next criterion

Batch Story Mode

After completing all acceptance criteria:

  1. Show full summary of implementation
  2. Run comprehensive Review skill scan
  3. Present findings by category
  4. Address feedback before marking story complete

Integration with /start-dev

When invoked from /start-dev:

  • Story context is already established
  • Acceptance criteria are defined
  • Work through criteria one by one
  • Use review mode specified (or default to interactive)

Key Principles

From docs/context/testing.md:

Kent Beck's Two Rules

  1. Write new code only if an automated test has failed
  2. Eliminate duplication

The Three Laws (Uncle Bob)

  1. No production code unless it makes a failing test pass
  2. No more test code than sufficient to fail
  3. No more production code than sufficient to pass

Remember

  • No code without a failing test first - non-negotiable
  • Tests must actually run - "this would fail" doesn't count
  • Small steps - each test covers one small piece
  • When uncertain, ask - never proceed without clarity

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.