
Tdd Guide
Generate prioritized tests and read coverage gaps so you ship features with a red-green-refactor discipline instead of retrofitting QA.
Overview
TDD Guide is an agent skill most often used in Ship (also Build) that generates prioritized tests and coverage analysis to support test-driven development.
Install
npx skills add https://github.com/alirezarezvani/claude-skills --skill tdd-guideWhat is this skill?
- Generates named tests with types (happy_path, error_case) and P0 priority labels
- Emits coverage analysis: line, branch, and function coverage with gap callouts
- Includes complexity metrics: cyclomatic, cognitive complexity, and testability score
- Produces concrete test code snippets aligned to a stated framework (e.g., Jest)
- Bundles assessment text such as excellent coverage when all paths are exercised
- Example output documents eight generated tests with sixteen assertions for a validator module
- Example coverage block reports 100% line, branch, and function coverage with twelve branches covered
- Example metrics include cyclomatic complexity 6, cognitive complexity 8, and testability score 85.0
Adoption & trust: 907 installs on skills.sh; 17.5k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You ship features fast but tests lag behind, so regressions show up late and you cannot see which branches never get exercised.
Who is it for?
Indie developers practicing TDD on TypeScript/JavaScript modules who want structured test names, P0 cases, and coverage summaries from the agent.
Skip if: Teams that need full E2E or load-test orchestration only, with no interest in unit-level TDD loops.
When should I use this skill?
When practicing TDD, generating unit tests, or analyzing coverage and testability for a module
What do I get? / Deliverables
You leave a session with generated test cases, a test file target, and coverage or complexity notes that tell you what to write or fix next.
- Generated test file with prioritized cases (e.g., *.test.ts)
- Coverage and complexity summary with gap list
- Test quality metrics (assertion counts, assessment text)
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the skill’s outputs are test files, coverage analysis, and quality gates right before safe release. Testing subphase matches generated Jest-style cases, branch coverage, and explicit happy-path versus error-case suites.
Where it fits
Generate P0 happy-path and error tests while implementing a password validator service.
Review line and branch coverage summaries and close gaps before tagging a release.
Add regression tests after a production bug without skipping edge-case cases.
How it compares
A TDD and unit-test generator workflow—not a replacement for your CI runner or a dedicated mutation-testing SaaS.
Common Questions / FAQ
Who is tdd-guide for?
Solo builders and small teams who want the agent to draft Jest-style tests and coverage-oriented feedback while they code.
When should I use tdd-guide?
During Build while implementing functions or classes; during Ship testing when closing coverage gaps before release.
Is tdd-guide safe to install?
Check the Security Audits panel on this Prism page and limit agent permissions if tests execute shell or install packages automatically.
SKILL.md
READMESKILL.md - Tdd Guide
{ "test_generation": { "generated_tests": [ { "name": "should_validate_password_length_successfully", "type": "happy_path", "priority": "P0", "framework": "jest", "code": "it('should validate password with sufficient length', () => {\n const validator = new PasswordValidator();\n const result = validator.validate('Test@123');\n expect(result).toBe(true);\n});" }, { "name": "should_handle_too_short_password", "type": "error_case", "priority": "P0", "framework": "jest", "code": "it('should reject password shorter than 8 characters', () => {\n const validator = new PasswordValidator();\n const result = validator.validate('Test@1');\n expect(result).toBe(false);\n});" } ], "test_file": "password-validator.test.ts", "total_tests_generated": 8 }, "coverage_analysis": { "summary": { "line_coverage": 100.0, "branch_coverage": 100.0, "function_coverage": 100.0, "total_lines": 20, "covered_lines": 20, "total_branches": 12, "covered_branches": 12 }, "gaps": [], "assessment": "Excellent coverage - all paths tested" }, "metrics": { "complexity": { "cyclomatic_complexity": 6, "cognitive_complexity": 8, "testability_score": 85.0, "assessment": "Medium complexity - moderately testable" }, "test_quality": { "total_tests": 8, "total_assertions": 16, "avg_assertions_per_test": 2.0, "isolation_score": 95.0, "naming_quality": 87.5, "quality_score": 88.0, "test_smells": [] } }, "recommendations": [ { "priority": "P1", "type": "edge_case_coverage", "message": "Consider adding boundary value tests", "action": "Add tests for exact boundary conditions (7 vs 8 characters)", "impact": "medium" }, { "priority": "P2", "type": "test_organization", "message": "Group related tests using describe blocks", "action": "Organize tests by feature (length validation, complexity validation)", "impact": "low" } ], "tdd_workflow": { "current_phase": "GREEN", "status": "Tests passing, ready for refactoring", "next_steps": [ "Review code for duplication", "Consider extracting validation rules", "Commit changes" ] } } TN: SF:src/auth/password-validator.ts FN:3,(anonymous_0) FN:4,validate FNDA:10,(anonymous_0) FNDA:25,validate FNF:2 FNH:2 DA:1,1 DA:2,1 DA:3,1 DA:4,25 DA:5,25 DA:6,10 DA:7,20 DA:8,8 DA:9,15 DA:10,5 DA:11,12 DA:12,3 LF:12 LH:12 BRDA:5,0,0,10 BRDA:5,0,1,15 BRDA:7,1,0,8 BRDA:7,1,1,12 BRDA:9,2,0,5 BRDA:9,2,1,10 BRDA:11,3,0,3 BRDA:11,3,1,9 BRF:8 BRH:8 end_of_record TN: SF:src/utils/discount-calculator.ts FN:1,calculateDiscount FNDA:15,calculateDiscount FNF:1 FNH:1 DA:1,1 DA:2,15 DA:3,15 DA:4,2 DA:5,13 DA:6,1 DA:8,12 DA:9,12 LF:8 LH:8 BRDA:3,0,0,2 BRDA:3,0,1,13 BRDA:5,1,0,1 BRDA:5,1,1,12 BRF:4 BRH:4 end_of_record { "language": "python", "framework": "pytest", "source_code": "def calculate_discount(price: float, discount_percent: float) -> float:\n \"\"\"Calculate discounted price.\"\"\"\n if price < 0:\n raise ValueError(\"Price cannot be negative\")\n if discount_percent < 0 or discount_percent > 100:\n raise ValueError(\"Discount must be between 0 and 100\")\n \n discount_amount = price * (discount_percent / 100)\n return round(price - discount_amount, 2)", "requirements": { "user_stories": [ { "description": "Calculate discounted price for valid inputs", "action": "calculate_discount", "given": ["Price is 100", "Discount is 20%"], "when": "Discount is calculated", "then": "Return 80.00", "error_conditions": [ { "condition": "negative_price", "description": "Price is negative", "error_type": "ValueError" }, {