tdd
БесплатноБез исполняемых скриптовНе проверенGuide Test-Driven Development using Kent Beck's Red-Green-Refactor cycle. Use when writing tests, implementing features via TDD, entering RED/GREEN/REFACTOR…
Об этом скилле
INSTRUCTIONS
Follow Kent Beck's TDD and Tidy First principles using the following workflow. None of the phases can be skipped.
- RED - Write ONE small failing test
- GREEN - Make minimal behavioral change, then commit
- REFACTOR - Improve structure without changing behavior, commit each step
Workflow Pattern
RED → GREEN → commit → REFACTOR (commit each) → satisfied? ──yes──→ done
↑ │
└───── no (more behavior needed OR triangulate) ───┘
RED Phase
Write ONE small, focused failing test or add ONE failing assertion to an existing test. Do not commit in RED.
- Use a behavior-describing name such as
shouldAuthenticateValidUserortest_empty_input_returns_error - Test one specific behavior; if the thought includes "and also", split it
- Verify the test fails for the right reason, not because of syntax errors, typos, or broken setup
- Create a separate test when behavior, setup, or failure clarity differs
Proceed only after the failure is informative.
GREEN Phase
Make the failing test pass with the smallest behavioral change. Do not refactor yet.
Choose the implementation strategy deliberately:
- Fake It: return the expected constant when the real implementation is not yet clear
- Obvious Implementation: type the direct implementation when a single expression or established pattern is enough
- Triangulation: add another failing example after a fake to force the real abstraction
Run all non-long-running tests. Commit the behavioral change once green.
REFACTOR Phase
Improve structure only after all tests pass. Use the refactoring skill for
pattern selection and workflow mechanics.
- Remove duplication between test and production code
- Improve clarity through better names and smaller structure
- Simplify expressions or logic without changing behavior
- Run tests after every small refactoring
- Commit each successful structural change separately
Start another RED phase when more behavior is needed.
Установить tdd в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл tdd?
Guide Test-Driven Development using Kent Beck's Red-Green-Refactor cycle. Use when writing tests, implementing features via TDD, entering RED/GREEN/REFACTOR phase, or following plan.md test instructions.
Как установить скилл tdd?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tdd запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop 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…
от Anthropicinternal-comms
A 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…
от Anthropicskill-development
This 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…
от Anthropic