From up
Use when implementing deterministic, reusable code where regressions would warrant a CI red light. Enforces RED-GREEN-REFACTOR. Applicability rule and skip conditions inside.
How this skill is triggered — by the user, by Claude, or both
Slash command
/up:test-driven-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write the test first. Watch it fail. Write minimal code to pass. Refactor. Repeat.
Write the test first. Watch it fail. Write minimal code to pass. Refactor. Repeat.
Core principle: if you didn't watch the test fail, you don't know whether it tests the right thing.
The decision is recorded during up:udesign as TDD: yes or TDD: no (reason).
Wrote code before the test? Delete it. Start over from the test. Don't "adapt" what you wrote — the test will be shaped by the code instead of shaping it.
def test_retry_succeeds_after_two_failures():
attempts = 0
def op():
nonlocal attempts
attempts += 1
if attempts < 3:
raise RuntimeError("fail")
return "success"
assert retry(op, max_attempts=3) == "success"
assert attempts == 3
Test passed immediately? You're testing behavior that already exists. Fix the test.
def retry(op, max_attempts):
for i in range(max_attempts):
try:
return op()
except Exception:
if i == max_attempts - 1:
raise
raise RuntimeError("unreachable")
Don't add features, options, or "while I'm here" changes. Just pass the test.
Run the new test and the existing suite. If either fails: back to GREEN (not RED — don't change the test).
Names, duplication, helpers. Keep tests green. Don't add behavior in this step. Then loop back to RED for the next test.
Tests-after answer: what does this do? Tests-first answer: what should this do?
They are not the same. Tests-after are biased by the implementation you already wrote. Tests-first force edge-case discovery before you commit to a design.
Write a failing test that reproduces the bug. Then RED-GREEN-REFACTOR. The test proves the fix and prevents regression.
Production code → a test exists and was written first and failed first
Otherwise → not TDD
npx claudepluginhub btseytlin/ultrapack --plugin upGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.