skills/tdd/SKILL.md
Test-driven development loop. Write failing test first, then implement to make it pass. Use when the user says 'tdd', 'test first', 'write the test first', 'failing test', 'red green refactor', or for any bug fix where the fix should be proven by a test. Also use when autopilot or other skills need test-first execution.
npx skillsauth add vltansky/skills tddInstall 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.
Red → Green → Refactor. No exceptions.
Read the code that needs to change. Before writing anything:
Find existing test files for the module. Match the project's test patterns:
# Find test files near the target
find . -path '*/node_modules' -prune -o -name '*.test.*' -print -o -name '*.spec.*' -print | head -20
Read 1-2 existing test files to learn:
__tests__/ vs test/)Identify the test command from CLAUDE.md, package.json, or Makefile.
Do not invent a new test style. Match what exists.
Write the test FIRST. The test describes the expected behavior — it is the spec.
The test must reproduce the bug:
Test: "should return user score as number, not NaN"
Expected: fail (because the bug produces NaN)
Actual: FAIL ✓ — test correctly catches the bug
The test describes the desired behavior:
"returns empty array when no matches found" not "test filterResults method"Write the minimum code to make the test pass. Nothing more.
Test: "should return user score as number, not NaN"
Expected: pass (bug is fixed)
Actual: PASS ✓
Full suite: 142 passed, 0 failed ✓
Distinguish between:
Tests are green. Now clean up — but only if needed:
After every refactor step, re-run tests. If anything breaks, revert that refactor.
Do NOT refactor:
Two commits (or one if the change is small):
test: add failing test for [description] — the test alone, before the fix
(optional, skip if the test and fix are trivially small)fix: [description] or feat: [description] — the implementation that makes it passStage specific files. Never git add ..
When autopilot invokes TDD for an execution step:
Autopilot passes: the step description, affected files, and test command. TDD returns: test file path, implementation file paths, guardrail results.
tools
Prepare a Hetzner Cloud VPS for secure Codex remote SSH access. Use when the user wants to create or configure a Hetzner server for Codex remote control, fix "No codex found in PATH" on a remote machine, install agent development tooling on a VPS, harden SSH access to a Hetzner server, or connect the server through Codex Settings, Connections, Add SSH.
data-ai
Summarize your GitHub activity from the last 24 hours across all repos. Use when user says "what did I do", "my activity", "standup", "recap", "summarize my day", "what-i-did", "git activity", "daily summary".
development
Review changed code for reuse, quality, and efficiency, then fix any issues found. Use when the user says "simplify", "simplify this", "review changes", "clean up my code", "check for duplicates", "code reuse review", or wants a post-change quality sweep.
development
Create a GitHub PR with conventional format and AI session context. Use when user says 'create PR', 'open PR', 'submit changes', 'send to dev', 'ship it', or is done with their task.