Agent skill · software engineering · alirezarezvani
tdd-guide
Test-first development and test generation for Jest, Pytest, JUnit, Vitest or Mocha: red-green-refactor, fixtures and mocks, coverage gaps. Use whenever the user asks to write tests (before or after the code), mock a dependency or raise coverage.
Why this skill is useful
Adds multiple executable scripts for test generation, coverage analysis, and TDD workflows that enhance the AI's capabilities in unit testing.
What it needs
Requires python installed locally. About 7k tokens when loaded. Last updated 2026-08-05. 23,939 stars on the source repository.
What this skill does
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 testgenerator.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 coverageanalyzer.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 tddworkflow.py --phase red to validate 3. Implement minimal code to pass (GREEN) 4. Run tddworkflow.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 (mathutils.py): Command: Generated test output (testmathutils.py): --- Coverage Analysis — Sample P0/P1/P2 Output Command: Sample output: --- Key Tools Tool Purpose Usage ------ --------- ------- testgenerator.py Generate test cases from code/requirements python scripts/testgenerator.py --input source.py --framework pytest coverageanalyzer.py Parse and analyze coverage reports python scripts/coverageanalyzer.py --report lcov.info --threshold 80 tddworkflow.py Guide red-green-refactor cycles python scripts/tddworkflow.py --phase red --test testauth.py fixturegenerator.py Generate test data and mocks python scripts/fixturegenerator.py --entity User --count 5 Additional scripts: frameworkadapter.py (convert between frameworks), metricscalculator.py (quality metrics), formatdetector.py (detect language/framework), outputformatter.py (CLI/desktop/CI output). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills alirezarezvani/tdd-guide--ee9925