Use Test-Driven Development for features that benefit from upfront behavior specification.
Executes Test-Driven Development workflow: writes failing tests, implements features, refactors, and verifies against original use-cases.
/plugin marketplace add cowwoc/claude-code-cat/plugin install cat@claude-code-catThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Use Test-Driven Development for features that benefit from upfront behavior specification.
Invoke for:
Skip TDD for:
┌──────────────────────────────────────────────────────────────────────────────────┐
│ TDD STATE MACHINE │
├──────────────────────────────────────────────────────────────────────────────────┤
│ │
│ [START] ──► [RED] ──► [GREEN] ──► [REFACTOR] ──► [VERIFY] ──► [COMPLETE] │
│ │ ▲ │ │ │ │
│ ▼ │ ▼ ▼ ▼ │
│ Write │ Write impl Clean up Run ORIGINAL │
│ test │ Run test Run tests use-case! │
│ MUST │ MUST PASS MUST PASS │ │
│ FAIL │ │ │
│ │ ┌───────────┴───────────┐ │
│ │ ▼ ▼ │
│ │ STILL FAILS? WORKS! │
│ │ │ │ │
│ └────────────────────┘ ▼ │
│ Test didn't capture [COMPLETE] │
│ the REAL bug - write │
│ NEW test that fails │
│ for same reason as │
│ original use-case │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘
Release transitions are VERIFIED by actually running tests.
# JavaScript/TypeScript
npm test -- --grep "your test name"
# Python
pytest tests/test_file.py::test_function -v
# Go
go test -run TestFunctionName ./...
# Rust
cargo test test_name
git add tests/
git commit -m "test: add failing test for [feature]
- Describes expected behavior
- Will pass when feature is implemented"
CRITICAL: Do NOT create duplicate tests when changing behavior.
WRONG approach (creates conflicts):
// Old test expects behavior A
testDoesA() { ... expects A ... }
// New test expects behavior B
testDoesB() { ... expects B ... }
// ❌ Now you have TWO conflicting tests!
CORRECT approach:
// Update the existing test to reflect new behavior
testBehavior() {
... expects B (the NEW correct behavior) ...
}
// ✓ One test, one source of truth
git add src/
git commit -m "feature: implement [feature]
- Makes failing test pass
- [Brief description of implementation approach]"
git add .
git commit -m "refactor: clean up [feature]
- [What was improved]
- No behavior changes"
⚠️ CRITICAL: Test passing ≠ bug is fixed. Don't assume your RED test captured the bug correctly.
Your RED test wasn't capturing the ACTUAL bug. Return to RED release:
Analyze why the fix didn't work:
Write a NEW test that:
Repeat the full cycle: RED → GREEN → REFACTOR → VERIFY
This loop continues until the ORIGINAL use-case works.
TDD produces 2-3 atomic commits per feature:
test: add failing test for email validation
- Tests valid email formats accepted
- Tests invalid formats rejected
- Tests empty input handling
feature: implement email validation
- Regex pattern validates format
- Returns boolean for validity
- Handles edge cases
refactor: extract validation helper (optional)
- Moved pattern to constant
- No behavior changes
Can you write expect(fn(input)).toBe(output) before writing fn?
→ Yes: Use this TDD workflow → No: Standard implementation, add tests after if needed
build-test-report - Run tests and report resultsgit-commit - Commit conventionsThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.