test-driven-development
Test-driven development discipline — write a failing test, implement the minimum to pass, then refactor. Use when adding a feature or fixing a bug where…
от metaspartan★ 41 звезда на GitHub
Установить test-driven-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Test-Driven Development (TDD)
Write the test first. It forces precise specifications and gives a free regression net.
Red → Green → Refactor
- Red. Write ONE small test for the behavior you want. Run it. It must FAIL (and fail for the right reason — an assertion, not a compile error in unrelated code).
- Green. Write the minimum code to make that test pass. No more, no less. Run it.
- Refactor. Clean up duplication while keeping tests green. Re-run after each change.
Repeat with the next smallest increment.
Rules of thumb
- Test behavior, not implementation. Prefer public API; don't poke private internals.
- One assertion concept per test. If "and" appears in the test name, consider splitting.
- Name tests like
it("returns X when Y")/should do Z when …. - If a bug fix, write the test that reproduces the bug FIRST (see
systematic-debugging). - Don't write tests that depend on wall-clock, random, or network unless you stub them.
Running tests
- Match the project's framework and command (
bun test,pytest,go test, …). - For Bun projects:
bun test(perAGENTS.md, Bun is the only JS runner).
When TDD is overkill
- Throwaway exploration / spikes — write the test after you know the shape.
- Pure UI tweaks with no logic — a visual check is fine.
TDD pays off most for: parsers, state machines, financial/permission logic, and anything with many edge cases.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-driven-development?
Test-driven development discipline — write a failing test, implement the minimum to pass, then refactor. Use when adding a feature or fixing a bug where correctness matters.
Как установить скилл 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…