borghei/Claude-Skills / engineering/tdd-guide
tdd-guide
VerifiedGuide red-green-refactor TDD with test generation, coverage-gap analysis, and multi- framework support. Use when writing tests first, analyzing coverage, generating test stubs, or converting tests between Jest, Pytest, JUnit, and Vitest.
| File | Kind | Size |
|---|---|---|
| HOW_TO_USE.md | markdown | 7.0 KB |
| README.md | markdown | 18.0 KB |
| SKILL.md | skill md | 8.9 KB |
| assets/expected_output.json | config | 2.3 KB |
| assets/sample_coverage_gaps.lcov | other | 438 B |
| assets/sample_coverage_report.lcov | other | 615 B |
| assets/sample_input_python.json | config | 1.4 KB |
| assets/sample_input_typescript.json | config | 1.4 KB |
| references/ci-integration.md | markdown | 3.9 KB |
| references/framework-guide.md | markdown | 4.2 KB |
| references/tdd-best-practices.md | markdown | 3.4 KB |
| references/tool-reference.md | markdown | 18.9 KB |
| references/troubleshooting-and-quality.md | markdown | 3.9 KB |
| references/workflows.md | markdown | 1.5 KB |
| scripts/coverage_analyzer.py | script | 15.3 KB |
| scripts/fixture_generator.py | script | 14.0 KB |
| scripts/format_detector.py | script | 11.9 KB |
| scripts/framework_adapter.py | script | 14.5 KB |
| scripts/metrics_calculator.py | script | 15.1 KB |
| scripts/output_formatter.py | script | 12.4 KB |
| scripts/tdd.py | script | 7.5 KB |
| scripts/tdd_workflow.py | script | 16.6 KB |
| scripts/test_generator.py | script | 14.4 KB |
references/workflows.md
View on GitHub# Core Workflows
Step-by-step procedures with validation checkpoints. Read this when starting a TDD cycle, analyzing coverage gaps, or generating tests from requirements.
## Workflow 1: TDD a New Feature
1. Write a failing test for the feature requirement (RED phase)
2. Call `validate_red_phase()` -- confirms test exists and fails
3. Write minimal code to make the test pass (GREEN phase)
4. Call `validate_green_phase()` -- confirms all tests pass
5. Refactor while keeping tests green (REFACTOR phase)
6. Call `validate_refactor_phase()` -- confirms tests still pass after cleanup
7. **Validation checkpoint:** Each cycle completes in under 10 minutes; zero test smells introduced
## Workflow 2: Analyze Coverage Gaps
1. Generate coverage report: `npm test -- --coverage` or `pytest --cov`
2. Detect format with `detect_format()` and parse with `parse_coverage_report()`
3. Run `identify_gaps(threshold=80.0)` to get prioritized file list (P0/P1/P2)
4. Generate test stubs for P0 files (business-critical, lowest coverage)
5. **Validation checkpoint:** Line coverage >= 80%; branch coverage >= 70%; zero P0 gaps in critical paths
## Workflow 3: Generate Tests from Requirements
1. Structure requirements as user stories with acceptance criteria
2. Call `generate_from_requirements()` with target framework
3. Review generated test cases for completeness (happy path, error, edge cases)
4. Generate test file with `generate_test_file()`
5. **Validation checkpoint:** Each acceptance criterion has at least one test; all tests compile
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |