tdd-guide
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and Mocha. Use when the user asks to write tests, improve test coverage, practice TDD, generate mocks or stubs, or mentions testing frameworks like Jest, pytest, or JUnit.
npx skills add alirezarezvani/claude-skills --skill tdd-guide --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# TDD Guide Test-driven development skill for generating tests, analyzing coverage, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, and Vitest. --- ## Workflows ### Generate Tests from Code 1. Provide source code (TypeScript, JavaScript, Python, Java) 2. Specify target framework (Jest, Pytest, JUnit, Vitest) 3. Run `test_generator.py` with requirements 4. Review generated test stubs 5. **Validation:** Tests compile and cover happy path, error cases, edge cases ### Analyze Coverage Gaps 1. Generate coverage report from test runner (`npm test -- --coverage`) 2. Run `coverage_analyzer.py` on LCOV/JSON/XML report 3. Review prioritized gaps (P0/P1/P2) 4. Generate missing tests for uncovered paths 5. **Validation:** Coverage meets target threshold (typically 80%+) ### TDD New Feature 1. Write failing test first (RED) 2. Run `tdd_workflow.py --phase red` to validate 3. Implement minimal code to pass (GREEN) 4. Run `tdd_workflow.py --phase green` to validate 5. Refactor while keeping tests green (REFACTOR) 6. **Validation:** All tests pass after each cycle --- ## Examples ### Test Generation — Input → Output (Pytest) **Input source function (`math_utils.py`):** ```pyth
- Workflows
- Generate Tests from Code
- Analyze Coverage Gaps
- TDD New Feature
- Examples
- Test Generation — Input → Output (Pytest)
- Coverage Analysis — Sample P0/P1/P2 Output
- Key Tools
- Input Requirements
- Spec-First Workflow
- Spec Directory Convention
- Extracting Tests from Specs
- Red-Green-Refactor Examples Per Language
- TypeScript / Jest
python scripts/test_generator.py --input math_utils.py --framework pytest python scripts/coverage_analyzer.py --report lcov.info --threshold 80
What does the tdd-guide skill do?
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and Mocha. Use when the user asks to write tests, improve test coverage, practice TDD, generate mocks or stubs, or mentions testing frameworks like Jest, pytest, or JUnit.
How do I install it?
Run `npx skills add alirezarezvani/claude-skills --skill tdd-guide --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From alirezarezvani/claude-skills, a repository with 23,791 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.