skills/tdd/SKILL.md
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
npx skillsauth add SZoloth/skill-pack 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.
Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
See tests.md for examples and mocking.md for mocking guidelines.
DO NOT write all tests first, then all implementation. This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."
This produces crap tests:
Correct approach: Vertical slices via tracer bullets. One test → one implementation → repeat. Each test responds to what you learned from the previous cycle. Because you just wrote the code, you know exactly what behavior matters and how to verify it.
WRONG (horizontal):
RED: test1, test2, test3, test4, test5
GREEN: impl1, impl2, impl3, impl4, impl5
RIGHT (vertical):
RED→GREEN: test1→impl1
RED→GREEN: test2→impl2
RED→GREEN: test3→impl3
...
Before writing any code:
Ask: "What should the public interface look like? Which behaviors are most important to test?"
You can't test everything. Confirm with the user exactly which behaviors matter most. Focus testing effort on critical paths and complex logic, not every possible edge case.
Write ONE test that confirms ONE thing about the system:
RED: Write test for first behavior → test fails
GREEN: Write minimal code to pass → test passes
This is your tracer bullet - proves the path works end-to-end.
For each remaining behavior:
RED: Write next test → fails
GREEN: Minimal code to pass → passes
Rules:
After all tests pass, look for refactor candidates:
Never refactor while RED. Get to GREEN first.
[ ] Test describes behavior, not implementation
[ ] Test uses public interface only
[ ] Test would survive internal refactor
[ ] Code is minimal for this test
[ ] No speculative features added
development
Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.
development
Expert coach for learning, mastering, and upskilling in any domain. Use when the user wants to learn, master, improve, upskill, get better at, or get coached on any topic. Helps build consistent practice habits, identify prerequisites, design efficient learning loops, avoid common pitfalls, maintain discipline, and measure progress. Based on evidence-based principles from "Advice on Upskilling" by Justin Skycak.
development
Cognitive engagement coach based on "Think First, AI Second" principles. This skill should be used when the user asks strategic, architectural, or high-stakes questions, OR when they explicitly request challenge/critique (e.g., "poke holes", "devil's advocate", "challenge this"). Promotes active thinking over passive AI consumption.
development
Domain-grounded judgment for creation: code, visuals, documents, design, data artifacts, and other output where quality depends on choosing what not to include. Use this skill when the user wants something to feel authored rather than generated, when the brief says a draft feels off, when polish alone is insufficient, or when the deliverable is externally visible and the quality bar is shaped by practitioner norms. Triggers on requests like 'use taste', 'apply taste', 'make this good', 'tighten this', 'clean this up', 'less is more', 'this feels generated', or any creation task where judgment matters more than coverage. Do not use for exhaustive extraction, rote transformation, or work where comprehensiveness is the explicit goal.