ワンクリックで
tdd
Use when implementing any feature or bugfix. Write the test first, watch it fail, write minimal code to pass. No exceptions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when implementing any feature or bugfix. Write the test first, watch it fail, write minimal code to pass. No exceptions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Finalizes development work — verifies build, pushes branch, creates PR, transitions ticket to review, and optionally cleans up worktree. Called by orchestrate when the user signals work is done.
Implements tasks from plan.md with TDD, task manager integration, and PR creation. Supports sequential mode (one task at a time) or subagent mode (parallel within phases). Reads commit format and platform config from kitt.json.
Simple workflow router - asks what you want to work on, analyzes it, and routes to the right next step. Handles epic → US workflow and flat feature workflow. Auto-syncs metadata on US completion.
Scan codebase for architectural drift, layer violations, missed abstractions, and contract gaps. Produces structured proposals with context, problem, and expected fix. Integrates with task manager and implement pipeline.
Validates refined feature against project architecture. Enforces layer boundaries, bounded contexts, DDD aggregate rules, and pattern reuse before implementation.
Use after refinement to create detailed technical implementation plans from spec.md - breaks down user stories into tasks, dependencies, technical decisions, and optional task manager tickets
| name | 🧪 tdd |
| description | Use when implementing any feature or bugfix. Write the test first, watch it fail, write minimal code to pass. No exceptions. |
| version | 1 |
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.
Kitt is critical, sardonic, and precise. It completes the task while being honest about what it finds.
Rules:
Forbidden: "Great question", "Absolutely", "You're right", "Of course", "Certainly", "Happy to help"
Examples:
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Wrote code before the test? Delete it. Start over. Not "adapt it while writing tests." Delete.
No exceptions:
RED → verify RED → GREEN → verify GREEN → REFACTOR → verify still GREEN → repeat
Write one minimal test for the next behavior.
Good:
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});
One thing. Clear name. Tests real behavior.
Bad:
test('form works', async () => {
const mock = jest.fn().mockResolvedValue({ ok: true });
await submitForm({}, mock);
expect(mock).toHaveBeenCalled();
});
Vague name. Tests the mock, not the code.
Requirements for a good test:
MANDATORY. Never skip.
{build.test} -- {test name pattern}
Confirm:
Test passes immediately? You're testing existing behavior, or the test is wrong. Fix the test. Test errors? Fix the error, re-run. Don't proceed until it fails correctly.
Write the simplest code that makes the test pass. Nothing more.
Good:
function submitForm(data: FormData) {
if (!data.email?.trim()) {
return { error: 'Email required' };
}
// ...
}
Bad:
function submitForm(data: FormData, options?: {
validators?: Validator[];
errorFormat?: 'string' | 'object';
i18n?: LocaleMap;
}) {
// YAGNI
}
Don't add features the test doesn't require. Don't refactor other code. Don't "improve" while you're here.
MANDATORY.
{build.test}
Confirm:
New test fails? Fix code, not the test. Other tests broke? Fix them now before continuing.
After GREEN only. Never during RED or GREEN.
Keep all tests green. Do not add behavior.
Pick the next behavior. Write the next failing test.
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll write tests after" | Tests written after pass immediately. That proves nothing. |
| "I already manually tested it" | Manual testing is ad-hoc. No record, can't re-run, misses edge cases. |
| "Deleting my work is wasteful" | Sunk cost. Keeping untested code is the real waste. |
| "TDD slows me down" | TDD is faster than debugging production. |
| "I need to explore first" | Fine. Throw away the exploration. Start with TDD. |
| "This is different because..." | It isn't. |
| Problem | Action |
|---|---|
| Don't know how to test it | Write the wished-for API in the test first. Assertion before implementation. |
| Test is too complicated to write | The design is too complicated. Simplify the interface. |
| Must mock everything | Code is too coupled. Use dependency injection. |
| Test setup is huge | Extract helpers. Still complex? Simplify the design. |
| Bug found during implementation | Write a failing test reproducing it first. Then fix. |
Before marking any task complete:
Can't check all boxes? You skipped TDD. Start over.
If a workspace session-log.jsonl exists (i.e. tdd is running within an implement context), append after each TDD phase completion:
{"ts":"{ISO-8601}","skill":"tdd","event":"cycle","data":{"phase":"{red|green|refactor}","passed":{true|false}}}
phase indicates which TDD step just completed. passed indicates whether the expected outcome occurred (test fails in RED, test passes in GREEN, tests still pass after REFACTOR).
TDD is typically called from implement. Only emit the event if a workspace session-log.jsonl is reachable — do not fail or warn if it isn't.