원클릭으로
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when implementing any feature or bugfix, before writing implementation code
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
The Evaluate-Loop coordinator for soe. Runs the BRAINSTORM → PLAN → EVALUATE_PLAN → EXECUTE → EVALUATE_EXEC → (FIX↺ | COMPLETE) state machine for a track: dispatches leaf agents, dispatches workers into isolated worktrees and applies their validated returns serially, and is the SOLE writer of .soe/tracks/{id}/state.json. Resumes crash-safely from committed state and bounds its fix/plan loops. Use when: 'run the loop', 'orchestrate', 'run the track', 'evaluate-loop', 'drive the track to completion'.
Session-model-led multi-model tiering. Use in ANY conversation (ambient) or in the pipeline to decide which model tier does which slice of work, and to delegate to the right model-pinned agent (strategist/deep-reasoner/fast-worker). The session model you selected IS the orchestrator; it self-selects its topology from its own model identity.
Use when the orchestrator needs to delegate an implementation task to an isolated worker — dispatches each worker as a Task-tool subagent in its own git worktree, awaits its return as the completion signal, and applies results serially as the sole state.json writer behind a validated context firewall
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Use at run start to discover what reviewers/analyzers/generators any installed plugin provides and route work by ROLE. Builds a role→provider map via lib/capability-scan.js so the loop prefers the best-matching installed specialist (a Go reviewer, a Flutter reviewer, AgentShield, ...) and falls back to soe-core's generic (soe:code-reviewer, soe:security-reviewer, soe:architect, ...) when none is installed. soe-core is self-sufficient and NEVER hard-depends on packs.
| name | test-driven-development |
| description | Use when implementing any feature or bugfix, before writing implementation code |
Gate type: verification (always autonomous — see
soe:gate-classification).
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.
Violating the letter of the rules is violating the spirit of the rules.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Wrote code before the test? Delete it. Start over. No exceptions:
Always: new features, bug fixes, refactoring, behavior changes.
Exceptions (ask your human partner): throwaway prototypes, generated code, config files.
Thinking "skip TDD just this once"? Stop. That's rationalization.
digraph tdd_cycle {
rankdir=LR;
step0 [label="STEP 0\nDefine API\n(features)", shape=box, style=filled, fillcolor="#ffffcc"];
red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
verify_red [label="Verify fails\nfor right reason", shape=diamond];
green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
verify_green [label="Verify passes\nAll green", shape=diamond];
refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
step0 -> red -> verify_red;
verify_red -> green [label="yes"];
verify_red -> red [label="wrong\nfailure"];
green -> verify_green;
verify_green -> refactor [label="yes"];
verify_green -> green [label="no"];
refactor -> red [label="next"];
}
For a new feature, before writing tests, pin down what you're building so RED fails for the right reason:
As a [role], I want [action], so that [benefit].Not implemented (or language equivalent).This makes RED fail because the behavior is missing — not because of a type error or typo.
Skip Step 0 for bug fixes — go straight to RED with a test reproducing the bug.
Write one minimal test showing what should happen. One behavior, clear name, real code (no mocks unless unavoidable).
test('retries failed operations 3 times', async () => {
let attempts = 0;
const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };
const result = await retryOperation(operation);
expect(result).toBe('success');
expect(attempts).toBe(3);
});
First detect the test runner — don't assume npm test (see reference.md). Then run the new test and confirm a valid RED:
A test that was written but never compiled and executed does not count as RED.
Test passes? You're testing existing behavior — fix the test. Test errors for the wrong reason? Fix it, re-run until it fails correctly.
Write the simplest code that passes. Don't add features, refactor other code, or "improve" beyond the test (YAGNI). Then re-run the same test target and confirm it's GREEN, other tests still pass, and output is pristine (no errors/warnings). Test fails? Fix code, not test.
Remove duplication, improve names, extract helpers. Keep tests green; don't add behavior. Then loop to the next failing test.
Bug found? Write a failing test reproducing it, then follow the cycle. The test proves the fix and prevents regression. Never fix bugs without a test.
Code before test · test after implementation · test passes immediately · can't explain why it failed · tests added "later" · "already manually tested" · "keep as reference" · "deleting X hours is wasteful" · "TDD is dogmatic, I'm being pragmatic" · "this is different because…"
All of these mean: delete the code, start over with TDD.
Can't check every box? You skipped TDD. Start over.
Production code → a test exists and failed first
Otherwise → not TDD
No exceptions without your human partner's permission.