.cursor/skills/tdd-workflow/SKILL.md
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.
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!)
Fill test cases table BEFORE any code:
## TEST CASES (fill BEFORE implementation!)
| # | Scenario | Input | Expected Output | Type | Status |
|---|----------|-------|-----------------|------|--------|
| 1 | Happy path | <input> | <expected> | Unit | pending |
| 2 | Edge case: empty | [] | <expected> | Unit | pending |
| 3 | Edge case: null | null | Error | Unit | pending |
| 4 | Integration | <context> | <expected> | Integration | pending |
Coverage categories:
STOP: Do NOT proceed to Phase 1 until table is filled!
feature.test.ts)npm test -- --grep "feature"
# Expected: FAIL
STOP: Do NOT write implementation until tests fail!
npm test -- --grep "feature"
# Expected: PASS
STOP: Do NOT refactor until ALL tests are green!
npm test (must stay green)## TDD VERIFICATION
| Category | Written | Passing | Skipped |
|----------|---------|---------|---------|
| Happy path | X | X | 0 |
| Edge cases | X | X | 0 |
| Error cases | X | X | 0 |
| Integration | X | X | 0 |
| **TOTAL** | 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.
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.
development
Improve code structure without changing behavior. Use when refactoring, cleaning up, optimizing, simplifying, extracting methods, or reducing complexity. Requires tests BEFORE refactoring, small steps, commit after each green test.