.claude/skills/tdd-workflow/SKILL.md
Test-Driven Development with strict Red-Green-Refactor cycle. Use when developing with TDD, writing tests before code, adding test coverage, or when user mentions test-first, red-green-refactor, or wants reliable test suites.
npx skillsauth add dmitryprg-ai/cursor-develop-autorules tdd-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Principle: Red -> Green -> Refactor (strict order)
Writing tests first catches design issues early — if the API is awkward to test, it's awkward to use. Tests also serve as living documentation that stays current because it breaks when behavior changes.
Fill the test cases table first because it forces you to think about behavior before implementation. Without this step, tests end up only covering the happy path.
| # | Scenario | Input | Expected Output | Type |
|---|----------|-------|-----------------|------|
| 1 | Happy path | ... | ... | Unit |
| 2 | Edge: empty | [] | ... | Unit |
| 3 | Edge: null | null | Error | Unit |
| 4 | Integration | ... | ... | Integration |
Coverage categories:
Do NOT proceed until the table is filled — skipping this step leads to incomplete test coverage that gives false confidence.
feature.test.ts)npm test -- --grep "feature"
# Expected: FAIL
Tests must fail first because a test that passes without implementation might be testing the wrong thing.
npm test -- --grep "feature"
# Expected: PASS
Refactoring with a green test suite is safe. Refactoring without tests is gambling.
| Category | Written | Passing | Skipped |
|----------|---------|---------|---------|
| Happy path | X | X | 0 |
| Edge cases | X | X | 0 |
| Error cases | X | X | 0 |
| Integration | X | X | 0 |
development
Scan codebase for technical debt and fix safely with TDD. Use to find oversized files, duplicated code, code smells, and refactor safely. Workflow - SCAN, TEST CASES, REFACTOR, VERIFY. Keywords - techdebt, tech debt, duplicates, code quality audit.
development
Test-Driven Development workflow with strict Red-Green-Refactor cycle. Use when developing features with TDD, writing tests before code, or when test-driven approach is needed. MANDATORY order - test cases table BEFORE code, failing tests BEFORE implementation.
testing
Review work session quality and capture improvements. Use at end of session, after large tasks, after series of errors, or when user asks for session review, retrospective, lessons learned. Records improvements to backlog.
data-ai
Analyze data, investigate datasets, work with CSV/parquet/pandas/dataframes. Use when analyzing data, exploring datasets, running experiments, or when user mentions data, analysis, parquet, csv, pandas, dataframe, statistics, investigation.