test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
от skeletorflet★ 48 звёзд на GitHub
Установить test-driven-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Test-Driven Development (TDD)
Overview
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Red-Green-Refactor
RED - Write Failing Test
Write one minimal test showing what should happen. One behavior, clear name, real code.
Verify RED - Watch It Fail
MANDATORY. Test must fail for expected reason (feature missing, not typos).
GREEN - Minimal Code
Write simplest code to pass the test. Don't add features beyond the test.
Verify GREEN - Watch It Pass
MANDATORY. Test passes, other tests still pass, output pristine.
REFACTOR - Clean Up
After green only. Remove duplication, improve names, extract helpers. Keep tests green.
Good Tests
- Minimal: One thing per test
- Clear: Name describes behavior
- Shows intent: Demonstrates desired API
Common Rationalizations
- "Too simple to test" - Simple code breaks. Test takes 30 seconds.
- "I'll test after" - Tests passing immediately prove nothing.
- "Already manually tested" - Ad-hoc ≠ systematic.
- "Deleting X hours is wasteful" - Sunk cost fallacy.
Red Flags - STOP and Start Over
Code before test, test passes immediately, "just this once", "keep as reference".
Example: Bug Fix
RED: Write test for empty email rejection. Verify RED: Test fails with expected message. GREEN: Add validation check. Verify GREEN: Test passes. REFACTOR: Extract validation if needed.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-driven-development?
Use when implementing any feature or bugfix, before writing implementation code
Как установить скилл test-driven-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-driven-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…