From r5
Use this skill whenever the user wants to implement something using TDD (Test-Driven Development), mentions "Red Green Refactor", says "テスト駆動", "テスト書いて", "TDDで実装", "テストファースト", "test-driven", or asks to write a test for a function that doesn't exist yet. This skill enforces a strict type-first, stub-first discipline: types and stubs must exist before any test is written. Invoke this skill even if the user just says "TDDで" or "write a test for X" — the skill will handle the full Red → Green → Refactor cycle.
npx claudepluginhub radius5-study/r5-plugin --plugin r5This skill uses the workspace's default tool permissions.
This skill runs one complete TDD cycle (Red → Green → Refactor) per function/method.
Guides TDD workflow with red-green-refactor cycle: plan interfaces, tracer bullet tests, minimal implementation to green, refactor under tests. For explicit TDD requests only.
Enforces strict TDD workflow for feature implementation: write one failing test, minimal code to pass, refactor, repeat. Prevents writing full test suites upfront.
Orchestrates agentic Red-Green-Refactor TDD cycles to build features incrementally: decompose into small tasks, write failing tests, make pass, refactor. Detects project lang and test setup.
Share bugs, ideas, or general feedback.
This skill runs one complete TDD cycle (Red → Green → Refactor) per function/method. Multiple functions are handled by spawning parallel sub-agents.
/simplify skill.Before anything else, read CLAUDE.md (and any rules/settings files) to discover:
npx vitest run, pytest)*.test.ts, test_*.py)Extract from the user's natural language input:
If multiple functions are described, identify them all now. You will handle them in parallel (see Multi-Method below).
Write the function/method signature with full type annotations to the target file. Do NOT write an implementation yet — only the signature.
The form this takes depends on the language:
If the return type is genuinely unknown at this stage, discuss with the user before proceeding.
Types must always be explicit — vague types (any, object, untyped wildcards) are not acceptable substitutes.
Replace the bare signature with a valid stub — a function body that:
The stub's purpose is to make the test runnable — it will fail, but it won't crash before reaching the assertion.
After writing the stub, verify it loads cleanly (dry-run, compile check, or import check depending on the language).
Write unit tests that:
Then run the test runner and confirm the tests actually fail. A real Red state means: the test reaches the assertion and fails — not a compile error, not a missing import, not a crash before the assertion.
If the tests don't even run (import error, syntax error, etc.), fix that first. That's not Red yet.
Use the test file location and naming convention from the project config (CLAUDE.md / rules). If not specified, follow the language/framework conventions.
Write the smallest implementation that makes the failing tests pass. "Minimal" means: if removing a line would cause a test to fail, keep it; otherwise, remove it.
Then run the test runner and confirm all tests pass:
PASS src/pricing.test.ts
✓ calculateTotal returns correct total with tax (3ms)
✓ calculateTotal handles zero tax rate (1ms)
Retry up to 2 times, making targeted changes based on the failure output. If still failing after 2 retries, stop and report to the user:
Green failed after 2 retries. Failure:
<paste actual test output>
This likely indicates a design issue in the stub or type signature —
for example, the return type or parameter contract may need revisiting.
Please review the stub and let me know how to proceed.
Once Green, invoke /simplify on the implementation file.
Do not manually refactor — delegate entirely.
When the user describes multiple functions in one request:
Stub phase (parallel): Create type definitions and stubs for all functions simultaneously. Stubs don't depend on each other.
Green phase (ordered): Identify dependency relationships (does function A call function B?).
Each sub-agent receives:
See references/examples.md for concrete worked examples in TypeScript (vitest) and Python (pytest).