bundles/testing/skills/tdd/SKILL.md
Test-driven development workflow for feature work and bug fixes. Use when the user asks for TDD, red-green-refactor, test-first implementation, regression-first bug fixes, or vertical-slice delivery. For bugs, require a cheap local test path; skip a new test when the path is unclear, expensive, or integration-heavy.
npx skillsauth add shipshitdev/library 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.
Build or fix behavior one verified slice at a time. A cheap local test path writes the failing check first. An expensive or unclear path names why and uses the closest executable proof instead.
Inputs:
Outputs:
Creates/Modifies:
External Side Effects:
Confirmation Required:
Delegates To:
testing-expert for broad test strategy or framework setupai-regression-testing for bug-specific regression coverage and path paritydebug when the root cause is still unknowncodebase-design when the test boundary is a module seam that still needs shapingverification-before-completion when about to claim the work is doneWrite a new test only when the path is cheap and local:
Skip a new test when it would need broad harness setup, brittle mocks, slow end-to-end infrastructure, vague reproduction steps, or large unrelated fixture churn. Prefer no new test over a bad one.
A bad test mostly tests mocks, encodes implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.
Do not skip silently. Before changing production code, name why a failing test is not worth the cost and name the closest executable check: a targeted script, reproduction command, browser drive, snapshot comparison, log assertion, or focused integration check.
Write one failing behavior test, make it pass, then refactor. Repeat.
Tests should verify behavior through public interfaces. They should survive an internal refactor. If a test fails because a private helper was renamed while the behavior still works, the test is too coupled to implementation.
Ask only when the public behavior or interface is genuinely unclear. Otherwise make a conservative assumption and proceed.
Add one test for one observable behavior.
The test must fail for the right reason:
Run the new test before changing production code. If it passes or fails for an unrelated reason, fix the test or the reproduction first.
Write the smallest production change that makes the test pass.
Do not add speculative options, future branches, or unrelated cleanup while the test is red.
After the test passes:
Prefer thin end-to-end slices over horizontal batches.
Good:
Bad:
For bugs, reproduce first. If the cause is unknown, use debug.
When the cause is known and the cheap-path gate passes:
Stage the failing repro before the fix in git history when committing. The diff tells the story: red, then green.
If there is no good test boundary, state that as a design finding. Add the best available verification and note the residual risk.
Report the evidence, not just the outcome:
development
Coordinates a weekly engineering review of board accuracy, recent code changes, operational health, and scoped cleanup. Use for a recurring repository health review or a review of the last several days.
testing
Audits project board configuration and prepares explicitly requested setup, copy, or normalization changes while preserving the existing workflow and provider boundaries. Use when inspecting a board's fields, columns, scope, or configuration.
testing
Reconciles a project board with current work and delivery evidence, reports incomplete coverage and metadata gaps, and applies only approved provider-supported field changes. Use when auditing board drift, reviewing blocked work, or assessing upcoming delivery.
development
Walk through how a subsystem works. Use for "how does X work", code walkthroughs before changing something, and placement or ownership questions. Explains architecture, runtime flow, and onboarding mental models. Can critique architecture. Use why for motivation.