tdd · rohitg00 — скилл для Claude Code: что делает и как установить
Скилл tdd задаёт для Claude Code цикл разработки через тесты: сначала падающий тест, затем минимальный рабочий код и рефакторинг.
MIT ★ 2 966 обновлён 2026-09-29
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflowЧто делает tdd
Скилл переводит ассистента в пошаговый цикл Red-Green-Refactor. Сначала агент пишет один падающий тест под следующий фрагмент поведения и проверяет, что падение происходит именно на проверке утверждения, а не из-за сбоя в тестовом окружении. Затем добавляет минимальный код для прохождения теста и только после этого наводит порядок в структуре без изменения внешнего поведения.
Инструкция требует показывать каждый переход от красного к зелёному статусу, а не выдавать сразу итоговый результат. Мокать предписывается только внешние границы системы: сеть, таймеры и файловую систему. Для чисто исследовательского кода, временных спайков или верстки интерфейса такой подход не предназначен, потому что тесты там не дают надёжной фиксации.
Какие задачи решает
- зафиксировать бизнес-логику падающим тестом перед написанием кода
- воспроизвести баг через отдельный проверочный тест и закрыть его
- упростить рефакторинг без риска сломать существующие интерфейсы
- пошагово реализовать парсер или конечный автомат
Примеры запросов агенту
- Внедри расчёт скидки через TDD, начни с падающего теста
- Почини этот баг по методологии red-green-refactor
- Напиши тест на обработку краевых случаев в парсере, потом реализуй логику
Как установить tdd
1Через маркетплейс плагинов
/plugin marketplace add rohitg00/pro-workflow/plugin install pro-workflow@pro-workflowКоманда ставит плагин pro-workflow целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a claude-code3Вручную: положить файлы
~/.claude/skills/tdd/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/tdd/
1Через Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a codex2Вручную: положить файлы
.agents/skills/tdd/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a cursor2Вручную: положить файлы
.cursor/skills/tdd/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install rohitg00/pro-workflow skills/tdd2Вручную: положить файлы
.github/skills/tdd/SKILL.md1Через Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a gemini-cli2Командой платформы
gemini skills install https://github.com/rohitg00/pro-workflow --path skills/tddВручную: положить файлы
.devin/skills/tdd/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о tdd
Как установить tdd в Claude Code?
В чате Claude Code добавьте репозиторий командой /plugin marketplace add rohitg00/pro-workflow, а затем выполните /plugin install pro-workflow@pro-workflow.
Что делает скилл tdd?
Он заставляет модель писать тесты перед кодом, добиваться их падения по понятной причине, писать минимальную реализацию и рефакторить только после успешного прогона.
Когда автор рекомендует не использовать TDD?
Скилл советует отказаться от цикла тестов при создании временных спайков, исследовании архитектуры и вёрстке интерфейсов, где результат проверяется визуально.
Исходный текст
SKILL.md · MIT
--- name: tdd description: Drive a change through a red-green-refactor loop - failing test first, minimal code to pass, then clean up. Use when implementing a feature or fixing a bug where correctness matters and a test can pin the behavior. Says "TDD", "test first", "red green refactor", "write the test first". user-invocable: true --- # tdd The agent codes better with a tight feedback loop than with a long specification. A failing test is the tightest loop there is: it states the target, and the target either goes green or it does not. ## The loop 1. **Red.** Write one failing test that states the next slice of behavior. Run it. Confirm it fails for the right reason - a test that passes before you write the code is testing nothing. If it errors instead of failing on the assertion, fix the test setup first. 2. **Green.** Write the least code that makes the test pass. Not the general solution, not the abstraction - the minimal move. Run the test. Green. 3. **Refactor.** Now clean up with the test as a net: remove duplication, name things, simplify. Re-run after every edit. Behavior is frozen; only the shape changes. 4. Repeat for the next slice. Small slices. The rate of feedback is the speed limit - never take on a step too big to hold a single test. ## What makes a test worth writing - **Tests behavior, not implementation.** Assert on the observable result, not on which private method got called. A test that breaks on every refactor is a liability. - **One reason to fail.** Each test pins one behavior. When it goes red you should know what broke without reading the body. - **Real seams, minimal mocks.** Mock at the system boundary (network, clock, filesystem), not internal collaborators. A test that mocks the thing under test asserts nothing. - **No tautologies.** A test that restates the implementation (`expect(x).toBe(x)` after setting `x`) verifies nothing. Assert the value the behavior should produce. ## When to reach for it Reach for TDD when the behavior is specifiable and a test can pin it: business logic, parsers, state machines, bug fixes (write the failing case first, then fix). Skip it for pure exploration, throwaway spikes, and layout-only UI where a test asserts nothing a human would not eyeball. ## Output contract Show each red-green transition, not just the final green. If a test is hard to write, say what the difficulty reveals about the design - untestable code is usually badly-seamed code, and that is a finding, not an obstacle.
© Rohit Ghumare · MIT · rohitg00/pro-workflow
Похожие скиллы
Все скиллы по теме «Тесты и QA» →Сначала — tdd от других авторов.