Run a red-green-refactor TDD workflow — generate failing tests first, implement to green, then check coverage gaps. Usage: /tdd <generate|coverage|validate> [target]
Drive a test-first workflow for $ARGUMENTS using the TDD Guide skill. The first word of $ARGUMENTS selects the mode (generate, coverage, or validate); the rest is the target file or directory. If $ARGUMENTS is empty, ask which mode and target.
Note on tooling: the tdd-guide scripts are Python library modules, not CLI tools — import them; do not invoke them as commands. Runnable patterns below.
/tdd generate <file-or-dir> — write failing tests FIRSTengineering-team/skills/tdd-guide/SKILL.md and engineering-team/skills/tdd-guide/references/tdd-best-practices.md for the red-green-refactor discipline and test-case taxonomy (happy path, edge cases, error cases)engineering-team/skills/tdd-guide/references/framework-guide.md for Jest/Vitest/pytest/JUnit conventionscd engineering-team/skills/tdd-guide/scripts && python3 -c "
from test_generator import TestGenerator, TestFramework
g = TestGenerator(framework=TestFramework.PYTEST, language='python')
cases = g.generate_from_requirements({'acceptance_criteria': [
{'id': 'AC1', 'description': 'validates email format'},
{'id': 'AC2', 'description': 'rejects duplicate emails'}]})
print(g.generate_test_file('registration', cases))
"
/tdd coverage <coverage-report> — analyze gaps against a thresholdpytest --cov --cov-report=lcov, vitest run --coverage, jest --coverage)cd engineering-team/skills/tdd-guide/scripts && python3 -c "
from coverage_analyzer import CoverageAnalyzer
a = CoverageAnalyzer()
a.parse_coverage_report(open('<path-to-lcov-or-json>').read(), 'lcov') # or 'json' / 'xml'
print(a.calculate_summary())
for gap in a.identify_gaps(threshold=80.0): print(gap)
"
(Smoke-test input available at engineering-team/skills/tdd-guide/assets/sample_coverage_report.lcov.)
/tdd generate — coverage gaps are filled with tests, not excuses/tdd validate <test-file> — review test qualityRead the test file and check it against engineering-team/skills/tdd-guide/references/tdd-best-practices.md:
Report failures with concrete rewrite suggestions.
For wiring coverage thresholds into CI, follow engineering-team/skills/tdd-guide/references/ci-integration.md.
engineering-team/skills/tdd-guide/SKILL.md (+ HOW_TO_USE.md)engineering-team/skills/tdd-guide/references/tdd-best-practices.mdengineering-team/skills/tdd-guide/references/framework-guide.mdengineering-team/skills/tdd-guide/references/ci-integration.mdengineering-team/skills/tdd-guide/scripts/ (test_generator, coverage_analyzer, tdd_workflow, fixture_generator, metrics_calculator — import-only)engineering-team/skills/tdd-guide/assets/Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/tdd · pinned to the source commit
# Run from your project root
git clone https://github.com/alirezarezvani/claude-skills.git .skillboard-tmp
git -C .skillboard-tmp checkout 19392f7a08264ed00486a251f5b2098321771f94
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/.gemini/skills/tdd" ".claude/skills/"
rm -rf .skillboard-tmpReview the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
sudo apt update && sudo apt install -y gitnpm install -g @anthropic-ai/claude-code# Run from your project root
git clone https://github.com/alirezarezvani/claude-skills.git .skillboard-tmp
git -C .skillboard-tmp checkout 19392f7a08264ed00486a251f5b2098321771f94
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/.gemini/skills/tdd" ".claude/skills/"
rm -rf .skillboard-tmpDestination: .claude/skills/tdd
Scanner static-checks@0.1.0 · commit 19392f7a0826. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.