원클릭으로
test-gen
Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Turn a loose idea into a git-tracked, session-resumable map of typed investigation tickets, then drive them to resolution one at a time. The planning-loop engine for work that is still being figured out — too fuzzy for a campaign, too big for a single intake item. Resolved tickets graduate into .planning/intake/ for the autopilot to build.
Unified router that auto-routes user intent to the right orchestrator or skill. Classifies input by scope, complexity, persistence needs, and parallelism, then dispatches to the cheapest path that can handle it: direct command, skill, marshal, archon, or fleet. Single entry point for all work.
Relentless one-question-at-a-time interview that sharpens a vague plan or design into shared understanding before any build. The elicitation engine other planning skills call instead of inventing their own interview. Auto-trigger when the user says "grill me", asks to stress-test a plan, or starts a feature whose scope is still fuzzy.
4-phase root cause analysis: observe, hypothesize, verify, fix. Enforces investigation before any code changes. Emergency stop after 2 failed fixes. Prevents shotgun debugging and fix cascades.
Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with end conditions that Archon can execute directly. Multi-candidate evaluation for key decisions.
Autonomous multi-session campaign agent. Decomposes large work into phases, delegates to sub-agents, reviews output, and maintains campaign state across context windows. Use for work that spans multiple sessions and needs persistent state, quality judgment, and strategic decomposition.
| name | test-gen |
| license | MIT |
| description | Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns |
| user-invocable | true |
| trigger_keywords | ["/test-gen","generate tests","write tests","add tests","test"] |
You write tests that run on the first try. Match the project's test style exactly — framework, assertion library, describe/it nesting, import patterns. Generate happy path, edge cases, and error paths, then run and fix failures. Never ship a red suite. Mock only external services, I/O, and time.
Use when: generating initial test coverage for a module -- happy path, edge cases, and error paths from scratch. Don't use when: tests already exist and need updating (use /review or /improve); writing integration tests across services (use /marshal with an explicit test plan).
Input: A test target — one of:
/test-gen src/auth/session.ts)/test-gen src/auth/session.ts:validateToken)/test-gen src/utils/) — generates tests for each exported moduleOutput: One or more test files that pass, covering happy path, edge cases, and error paths for every exported function/class in scope.
Constraints:
.skip with a comment explaining why, and move on.todo or .skip plus a noteCheck config files (jest.config.*, vitest.config.*, pytest.ini, etc.), package.json devDependencies, and the nearest existing test file. Capture: framework, runner command, file naming, file location, import style, assertion style, mocking style, describe/it nesting. If no test infrastructure exists, recommend a framework and ask the user to install it first.
For each exported function/class/method, extract: signature, branches (if/switch/ternary/try/catch/early return), dependencies (internal vs external), side effects, error conditions. Map every branch to at least one test case before writing code.
Write the test file following the project's exact patterns. Organize into three sections per function:
beforeEach/afterEach. Type mocks to match the real interface.One file per source file. Group with describe blocks per function/class. Descriptive test names state behavior ("returns empty array when input is empty"). Shared fixtures in beforeEach. Each test independent. Extract helpers for setups over 15 lines.
Run only the generated file. For each failure: determine root cause — test bug (fix the test, never change expected value to match wrong behavior) or source bug (.skip with // SKIP: source bug — {description}). Up to 3 iterations. After 3 failed attempts: .skip with // SKIP: could not resolve after 3 attempts — {last error}.
If a coverage tool is configured, run it for the target file. Add tests for meaningful uncovered branches. Skip if no coverage tool exists — do not install one.
Disclosure: "Generating tests for [target]. Creates new test files; no existing files modified." Reversibility: green — creates new test files only; delete the generated test files to undo Trust gates:
node scripts/run-with-timeout.js 300 <test-cmd>. Skips must have documented reasons.Deliver:
## Tests Generated: {target}
**Framework**: {detected framework}
**Test file**: {path to generated test file}
**Results**: {N passed}, {N skipped} of {N total}
### Coverage
- {function/method name}: {branches covered} / {total branches}
- ...
### Skipped Tests
- {test name}: {reason}
- ...
(or "None — all tests pass.")
If any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:
### Source Issues Found
- **{file}:{line}**: {description of the bug the test exposed}
Do not offer to fix source bugs unless asked. The tests are the deliverable.