A rigid workflow enforcing the Red-Green-Refactor cycle for feature development.
Install
mkdir -p .claude/skills/tdd-launchscout && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17172" && unzip -o skill.zip -d .claude/skills/tdd-launchscout && rm skill.zipInstalls to .claude/skills/tdd-launchscout
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use this skill when working on any new feature. It enforces a strict test-driven development workflow where tests are written before implementation code.Key capabilities
- →Write a failing test before implementation code
- →Write minimum code to make a failing test pass
- →Repeat the Red-Green-Refactor cycle for new behaviors
- →Break down requirements into small, testable behaviors
- →Use factories for test data
How it works
The skill enforces a strict Test-Driven Development (TDD) workflow, guiding the user through the Red-Green-Refactor cycle. It ensures tests are written first, followed by minimal implementation, and then refactoring.
Inputs & outputs
When to use tdd
- →Develop new features
- →Refactor existing logic
- →Ensure test coverage for new requirements
About this skill
Test-Driven Development (TDD)
When building any new feature, follow the Red-Green-Refactor cycle strictly. Do NOT write implementation code before writing a failing test.
The Workflow
1. Red: Write a Failing Test First
- Before writing implementation code, write a test that describes the expected behavior
- Run the test and confirm it fails for the right reason (not a syntax error or missing module, but a genuine assertion failure or missing function). Pick a test case that will genuinely fail — typically the case that contradicts the current default or existing behavior.
- If the test fails for the wrong reason (e.g. compilation error from missing module), create just enough skeleton code (empty module, function head returning nil) to get a proper assertion failure
2. Green: Write the Minimum Code to Pass
- Write only the code necessary to make the failing test pass
- Do not add extra functionality, handle edge cases, or refactor yet
- Run the test and confirm it passes
3. Refactor: Clean Up
- Now improve the code: rename, extract, simplify
- Run the tests after each refactoring step to make sure they still pass
- This is also the time to consider if additional test cases are needed for edge cases or error paths
4. Repeat
- Pick the next piece of behavior and start a new Red-Green-Refactor cycle
Practical Guidelines
- One test at a time: Write exactly ONE failing test, watch it fail, make it pass, then move on to the next test. Do NOT write multiple tests before implementing. The rhythm is: write test → run test (red) → write code → run test (green) → repeat.
- Small steps: Each cycle should cover one small, well-defined behavior. A single cycle should not try to implement an entire feature at once.
- Run tests frequently: Run
mix test(or the relevant subset) after every change, both test and implementation. - Test naming: Test descriptions should read like specifications of behavior, e.g.
"returns only items with nil received_date"not"test filter function". - One assertion focus: Each test should ideally verify one logical behavior. Multiple asserts are fine if they verify aspects of the same behavior.
- Use factories: Always use ExMachina factories (
insert/2,build/2) for test data.
When Working on a Feature
- Start by understanding the requirement
- Break it into small, testable behaviors
- Use the TodoWrite tool to list the behaviors as individual TDD cycles
- Work through each cycle one test at a time: Red -> Green -> Refactor
- After all cycles, run the full test suite (
mix testandnpm run test --prefix assets) - Invoke the
code-reviewskill when done
When not to use it
- →When writing implementation code before writing a failing test
- →When writing multiple tests before implementing
- →When adding extra functionality or handling edge cases before tests pass
Limitations
- →The skill enforces a strict Red-Green-Refactor cycle.
- →The skill requires running tests frequently after every change.
- →The skill requires breaking down features into small, testable behaviors.
How it compares
This workflow strictly adheres to the TDD cycle, ensuring tests drive development and refactoring, which differs from a traditional approach where implementation might precede testing or refactoring is deferred.
Compared to similar skills
tdd side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tdd (this skill) | 0 | 5mo | No flags | Beginner |
| python-testing-patterns | 77 | 3mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| test-cases | 57 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
test-cases
cexll
This skill should be used when generating comprehensive test cases from PRD documents or user requirements. Triggers when users request test case generation, QA planning, test scenario creation, or need structured test documentation. Produces detailed test cases covering functional, edge case, error handling, and state transition scenarios.
reviewing-code
CaptainCrouton89
Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.
wcag-audit-patterns
wshobson
Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects