| name | deep-test |
| description | This skill should be used at Phase 4 of deep-work, after all slices in plan.md are marked [x], to run 9 verification gates: receipt completeness, plan-alignment drift, cross-slice spec/quality review, sensor clean, mutation, fitness delta, and health required/advisory. On failure, triggers the implement-test retry loop (cleanup implement_completed_at + receipt invalidation). Sets test_passed: true marker that gates deep-finish's session-receipt M3 envelope emit (with parent_run_id chain to consumed evolve-insights run). Triggered by /deep-test slash, cross-platform Skill({ skill: "deep-work:deep-test", args: "..." }), or orchestrator dispatch after implement approval. |
| user-invocable | true |
[!IMPORTANT]
Skill body echo ๊ธ์ง
์ด SKILL.md ๋ณธ๋ฌธ์ ์ฌ์ฉ์์๊ฒ echoํ๊ฑฐ๋ ์์ฝํ์ฌ ์ถ๋ ฅํ์ง ๋ง๋ผ.
- Section 1 (state ๋ก๋, verification ๋ช
๋ น ๊ฐ์ง, ์๋ฃ-marker ๊ฐ์ง)๋ silent ๋ด๋ถ ์ฒ๋ฆฌ.
- ์ฒซ ์ฌ์ฉ์-๊ฐ์ ์ฃผ ๋์์ Section 2์ First Action: ์ฒซ verification ์คํ ์ ์ธ + ์ฆ์ Bash ํธ์ถ.
- Section 3 ์๋ฃ ๋ฉ์์ง๋ quality gate๋ฅผ ์ค์ ๋ก ์ํํ ๋ค์๋ง ์ถ๋ ฅ.
Section 1: State ๋ก๋ (ํ์ โ ๊ฑด๋๋ฐ๊ธฐ ๊ธ์ง)
- Session ID ๊ฒฐ์
- $ARGUMENTS์ --session=ID โ ์ฌ์ฉ
- ์์ผ๋ฉด โ .claude/deep-work-sessions.json์์ active session ํ์
- State ํ์ผ ์ฝ๊ธฐ:
.claude/deep-work.{SESSION_ID}.md
- ์กฐ๊ฑด ๋ณ์ ํ์ธ:
- worktree_path โ $ARGUMENTS ์ฐ์ , ์์ผ๋ฉด state์์
- team_mode โ $ARGUMENTS ์ฐ์ , ์์ผ๋ฉด state์์
- ์ถ์ถ:
work_dir, test_retry_count, max_test_retries, evaluator_model. ๋ชจ๋ธ์
Read(../shared/references/model-routing-guide.md#model-routing-state-decode-v612)๋ก
๋ง๋ decodedRouting.test๋ฅผ ์ฌ์ฉํ๋ค.
- Verify:
current_phase = "test", plan.md slice checklist ๋ชจ๋ [x]
test_started_at ๊ธฐ๋ก (ISO timestamp)
Critical Constraints
- DO NOT modify any code files โ Phase Guard๊ฐ ์ฐจ๋จ
- ONLY: ํ
์คํธ ์คํ, ๊ฒฐ๊ณผ ๋ถ์, ๋ฌธ์ ์
๋ฐ์ดํธ
- ํ
์คํธ ์คํจ ์ implement phase๋ก ๋ณต๊ทํ์ฌ ์์
์๋ฃ-Marker ๊ฐ์ง (Phase-level resume โ F1)
test_completed_at + test_passed: true ํ๋๊ฐ state์ ์ด๋ฏธ ์๊ณ $ARGUMENTS์ --force-rerun์ด ์์ผ๋ฉด:
- "Phase 4 (Test)๋ ์ด๋ฏธ ์๋ฃ๋์์ต๋๋ค. Exit Gate๋ฅผ ์ฌํ์ํฉ๋๋ค." ์ถ๋ ฅ
- Orchestrator ยง3-5๋ก ์ ์ด ๋ฐํ (Exit Gate ์ฌ์คํ)
- Section 2/3 ์ง์
๊ธ์ง
Red Flags โ ์ด ์๊ฐ์ด ๋ค๋ฉด ๋ฉ์ถ์ธ์
| ํฉ๋ฆฌํ ์๋ | ํ์ค |
|---|
| "ํ
์คํธ๋ ํต๊ณผํ์ผ๋ ๋๋ค" | ํ
์คํธ ํต๊ณผ โ ์คํ ์ถฉ์กฑ. Receipt์ spec_compliance๋ฅผ ํ์ธํ๋ผ. |
| "lint ๊ฒฝ๊ณ ๋ช ๊ฐ๋ ๊ด์ฐฎ๊ฒ ์ง" | Sensor Clean Gate๊ฐ ์ฐจ๋จํ๋ค. ์ง๊ธ ๊ณ ์ณ๋ผ. |
| "์ปค๋ฒ๋ฆฌ์ง๊ฐ ๋ฎ์ง๋ง ํต์ฌ์ ํ
์คํธํ๋ค" | "ํต์ฌ"์ ์ฃผ๊ด์ ์ด๋ค. ๋๋ฝ๋ ๊ฒฝ๋ก๊ฐ ํ๋ก๋์
์์ ํฐ์ง๋ค. |
| "์ด ์คํจ๋ ํ๊ฒฝ ๋ฌธ์ ์ผ ๊ฑฐ์ผ" | 95%์ "ํ๊ฒฝ ๋ฌธ์ "๋ ๋ถ์์ ํ ์กฐ์ฌ๋ค. Root cause๋ฅผ ์ฐพ์๋ผ. |
Model Routing
decodedRouting.test ํ์ธ (decode ์คํจ ๊ธฐ๋ณธ: "haiku"). "main"์ด ์๋๋ฉด Agent ์์ (์ ์ฒด test ์ง์ ํฌํจ).
"main" โ ์๋ inline ์คํ.
Section 2: Phase ์คํ
First Action (์ฆ์ ์คํ โ ๊ฑด๋๋ฐ๊ธฐ ๊ธ์ง)
Section 1์ verification ๋ช
๋ น ๊ฐ์ง์ ์๋ฃ-marker ๊ฐ์ง๊ฐ silentํ๊ฒ ๋๋ ๋ค ์ฆ์ ๋ค์ ๋ฉ์์ง๋ฅผ ์ถ๋ ฅํ๋ค:
"Test ๋จ๊ณ๋ฅผ ์์ํฉ๋๋ค. Required Gate๋ถํฐ ์์ฐจ ์คํํฉ๋๋ค."
์ด์ด์ Step 1 (Receipt Completeness) โ Step 2 (Plan Alignment / drift) โ ์ดํ quality gate๋ค์ ์์ฐจ ์คํ. "์คํํ ๊น์?" ๊ฐ์ ์ถ๊ฐ ํ์ธ ๊ธ์ง.
๊ธ์ง: ์ด ์ ์ธ๊ณผ ์ฒซ gate ์คํ ์ ์ quality gate ์ค๋ช
, ์๋ฃ ํ
ํ๋ฆฟ, retry ์ ์ฑ
์ ์ถ๋ ฅํ์ง ๋ง๋ผ.
Step 1: Required Gate โ Receipt Completeness
plan.md์ ๋ชจ๋ SLICE-NNN์ ๋ํด $WORK_DIR/receipts/SLICE-NNN.json ์กด์ฌ + status: "complete" ํ์ธ.
์คํจ โ implement๋ก ๋ณต๊ท.
Step 2: Required Gate โ Plan Alignment (Drift Detection)
- plan.md์์ ํ์ผ ๋ชฉ๋ก + ์ฒดํฌ๋ฆฌ์คํธ + ์ค๊ณ ์ง์นจ ํ์ฑ
- Baseline ์ปค๋ฐ ๊ฒฐ์ (์ฐ์ ์์):
plan_approved_at timestamp โ ํด๋น ์์ ์ ๊ฐ์ฅ ๊ฐ๊น์ด ์ปค๋ฐ
- fallback: plan.md ํ์ผ์ mtime โ ํด๋น ์์ ์ปค๋ฐ
- fallback: ์ต๊ทผ 24์๊ฐ ์ด๋ด ์ปค๋ฐ window
git diff --name-only [baseline]..HEAD๋ก ๋ณ๊ฒฝ ํ์ผ ๋น๊ต
- ๊ฐ plan ํญ๋ชฉ ๋ถ๋ฅ: Implemented / Not implemented / Out of scope / Design drift
$WORK_DIR/drift-report.md + fidelity-score.txt ์์ฑ
- Not implemented ๋๋ Design drift ์์ผ๋ฉด โ FAIL (Required Gate)
Step 3: Auto-detect + Run Verification
- ํ๋ก์ ํธ ์ค์ ์์ ๊ฒ์ฆ ๋ช
๋ น์ด ๊ฐ์ง (package.json, pyproject.toml, Makefile ๋ฑ)
- plan.md์
## Quality Gates ํ
์ด๋ธ ์์ผ๋ฉด auto-detection ๋์ ์ฌ์ฉ
- ์์ฐจ ์คํ, ๊ฒฐ๊ณผ ๊ธฐ๋ก:
$WORK_DIR/test-results.md
Step 4: Quality Gates
4-1. Cross-Slice Spec Consistency (โ
Required)
Read(../shared/references/adaptive-review-protocol.md)ํ๊ณ ์ ์ฒด receipt + plan.md๋ก
compileReviewPlan({artifactKind:'cross-slice', ...})๋ฅผ ํธ์ถํ๋ค. Phase 3์์ review๊ฐ
๋น ์ง slice๋ backfillํ๊ณ done_with_concerns๋ extra scrutinyํ๋ค. ์ด gate๋ Required๋ค.
4-2. Cross-Slice Quality Review (โ ๏ธ Advisory)
๊ฐ์ plan์ reviewer๋ก ์ ์ฒด git diff + receipt์ cross-cutting quality๋ฅผ ๊ฒ์ฆํ๋ค. 4-2์
gate ์ง์๋ Advisory๋ก ์ ์งํ๋ High/Critical blocker๋ ์ฌ์ฉ์์๊ฒ required๋ก ํ๋ฉดํํ๋ค.
4-1/4-2์ ํตํฉ ์คํ ์์๋ compileReviewPlan โ reviewers ์คํ โ evaluateReviewExecution โ (proceed/degraded-proceed์์) normalizeFinding โ verdictFromFindings โ writeFindings๋ค. ๊ฒฐ๊ณผ๋
$WORK_DIR/reviews/cross-slice-round<N>-findings.json์ ๋ณด์กดํ๊ณ ํธํ ์์ฝ ๊ฒฝ๋ก๋ง
$WORK_DIR/cross-slice-review.json๋ก ์ ์งํ๋ค. severity์ reviewer๋ ๋ฐํ์ ๊ฒฐ๊ณผ ์ธ์
๋ณ๋ ํ๋์ฝ๋ฉํ์ง ์๋๋ค.
4-3. Verification Evidence (โ
Required)
๊ฐ receipt์ tdd.passing_test_output ๋น์ด์์ง ์์ + verification.full_test_suite PASS ํ์ธ.
4-4. SOLID Review (โ ๏ธ Advisory)
๋ณ๊ฒฝ๋ source ํ์ผ ๋์ SOLID ์์น ํ๊ฐ โ $WORK_DIR/solid-review.md
์์ธ: Read("../shared/references/solid-guide.md")
4-5. Insight Analysis (โน๏ธ Insight)
์ฝ๋ ๋ฉํธ๋ฆญ, ๋ณต์ก๋, ์์กด์ฑ ๋ถ์ โ $WORK_DIR/insight-report.md
์คํจํด๋ pass/fail์ ์ํฅ ์์.
4-6. Sensor Clean (โ
Required) + Coverage (โ ๏ธ Advisory)
Receipt์ sensor_results์์ ์ฝ๊ธฐ (์ฌ์คํ ์๋):
- Sensor Clean: ๋ชจ๋ slice์ lint/typecheck pass ํ์ธ. fail/timeout โ FAIL.
- Coverage: coverage ํผ์ผํธ ํ์. Advisory โ ์ฐจ๋จ ์์.
4-7. Mutation Score (โ ๏ธ Advisory)
mutation testing ๋๊ตฌ ๊ฐ์ง ์ /deep-mutation-test ์คํ.
survived mutants โ /deep-mutation-test๊ฐ ๋ด๋ถ์ ์ผ๋ก implement ๋ณต๊ท ์ฒ๋ฆฌ.
4-8. Fitness Delta (โ ๏ธ Advisory)
Phase 1์ fitness_baseline๊ณผ ํ์ฌ ๋น๊ต. ์๋ฐ ์ฆ๊ฐ ์ ๊ฒฝ๊ณ .
4-9. Health Required (โ
Required)
Phase 1์ unresolved_required_issues ํ์ธ. ์์ผ๋ฉด AskUserQuestion์ผ๋ก acknowledge ์์ฒญ.
๋ชจ๋ gate ํ: quality_gates_passed ์
๋ฐ์ดํธ + $WORK_DIR/quality-gates.md ์์ฑ.
์์ธ: Read("../shared/references/testing-guide.md")
Section 3: ์๋ฃ
์คํ ์์ ์์ ์ฅ์น: ์ด ์น์
์ ๋ชจ๋ quality gate (test, lint, typecheck, sensor, mutation, drift, solid, insight, fitness, health)๋ฅผ ์ค์ ๋ก ์ํํ ๋ค์๋ง ์คํํ๋ค. All Pass ๋ฉ์์ง๋ง ์ถ๋ ฅํ๋ ๊ฒ์ ์คํจ ๋ชจ๋์ด๋ค.
All Pass
- State ์
๋ฐ์ดํธ:
test_passed: true
test_completed_at: current ISO timestamp
current_phase๋ ๋ณ๊ฒฝํ์ง ์์ (test ์ ์ง). Orchestrator ๋๋ /deep-finish๊ฐ idle๋ก ์ ํ.
- ์๋ฃ ๋ฉ์์ง:
๋ชจ๋ ๊ฒ์ฆ ํต๊ณผ! `/deep-finish`๋ก ์ธ์
์ ์๋ฃํ์ธ์.
์์ธ ๊ฒฐ๊ณผ: $WORK_DIR/test-results.md
- Session report ์๋ ์์ฑ:
$WORK_DIR/report.md
- Git commit ์ ์ (git_branch ์ค์ ์)
Handoff to /deep-finish โ M3 envelope chain (v6.5.0)
๋ณธ skill์ envelope์ ์ง์ emitํ์ง ์์ผ๋ฉฐ, /deep-finish ยง7-Z๊ฐ session-receipt envelope์ ์ธ ์ ์๋๋ก ๋ค์ contract๋ง ๋ณด์ฅํ๋ค:
state.test_passed === true + state.test_completed_at ๋ง์ปค ๊ธฐ๋ก โ /deep-finish ยง7-Z์ envelope writer dispatcher๊ฐ ์ด ๋ ํ๋๋ฅผ precondition์ผ๋ก ์ฝ๋๋ค.
- ๋ชจ๋ slice receipt๊ฐ M3 envelope ํํ (
producer === "deep-work" + artifact_kind === "slice-receipt" + schema.name === artifact_kind)๋ก wrap๋ ์ํ โ ยง4-1 (Receipt Completeness) gate๊ฐ identity guard๋ก ์ด๋ฅผ ๊ฒ์ฆํ๋ฏ๋ก, gate๋ฅผ ํต๊ณผํ ์์ ์ ๋ชจ๋ receipt๊ฐ envelope์์ด ๋ณด์ฅ๋จ.
parent_run_id chain โ Phase 1 (deep-research)๊ฐ consumeํ evolve-insights envelope์ run_id๊ฐ state์ ๋ณด๊ด๋์ด ์์ผ๋ฉด, /deep-finish ยง7-Z๊ฐ session-receipt envelope์ envelope.parent_run_id ํ๋์ envelope.provenance.source_artifacts[]์ ํจ๊ป ๊ธฐ๋กํ๋ค (cross-plugin chain trace).
- ๋จ์ผ writer ์ ์ฑ
โ session-receipt๋
hooks/scripts/wrap-receipt-envelope.js๊ฐ --artifact-kind=session-receipt๋ก ํธ์ถ๋์ด ์์ฑ๋จ (deep-implement Step D-1์ slice-receipt writer์ ๋์ผ helper). ๋ณธ skill์ helper๋ฅผ ํธ์ถํ์ง ์๋๋ค.
์ contract๊ฐ ๊นจ์ง๋ฉด /deep-finish ยง7-Z๊ฐ envelope emit์ ์คํจ์ํค๋ฏ๋ก, Some Fail (retry exhausted) ๋ถ๊ธฐ์ receipt invalidation (NW1/NW6) ์ envelope reader๊ฐ stale evidence๋ฅผ ๋ฐ์ง ์๋๋ก ๋ณด์ฅํ๋ contract์ ์ผ๋ถ๋ค.
Some Fail (retry available)
test_retry_count < max_test_retries ์:
test_retry_count ์ฆ๊ฐ
- ์คํจํ gate/slice ๋ถ์ โ ์์ ๋์ ์๋ณ
- State:
current_phase: implement
- ์คํจ slice๋ง TDD cycle ์ฌ์คํ
- ์๋ฃ ํ:
current_phase: test โ ์ ์ฒด gate ์ฌ์คํ (Section 1๋ถํฐ)
Some Fail (retry exhausted)
test_retry_count >= max_test_retries ์:
- ๋์ ์คํจ ์ด๋ ฅ ํ์
current_phase: implement ์ ์ง (์ฌ์ฉ์ ์๋ ์์ ๊ฒฝ๋ก)
- Implement state cleanup (NW1 fix โ v6.3.1, NW6 refined): ์๋ ์์ ๊ฒฝ๋ก๊ฐ ์ ๋๋ก ๋์ํ๋ ค๋ฉด stale completion markers๋ฅผ invalidateํด์ผ ํจ. ๋ action ๋ชจ๋ ์ํ:
implement_completed_at: null ์ค์ (Implement skill ์๋ฃ-Marker branch๊ฐ ๋ฐ๋ํ์ง ์๋๋ก)
- ์คํจํ slice์
[x] ์ฒดํฌ๋งํฌ๋ฅผ [ ]๋ก ํด์ (Implement skill Section 1 Resume Detection์ด ๋ฏธ์๋ฃ slice๋ก ์ธ์ํ๋๋ก)
- ๋์์ ํด๋น slice์ receipt์
status: "invalidated" ๊ธฐ๋ก โ sensor/verification์ด stale evidence๋ฅผ ์ฌ์ฌ์ฉํ์ง ์๊ณ ์ฌ๊ตฌํ ์ ์ evidence๋ฅผ ์์ฑํ๋๋ก ๋ณด์ฅ
- ์ฃผ์ (NW6): Receipt invalidate๋ง ํ๊ณ
[x]๋ฅผ ๊ทธ๋๋ก ๋๋ฉด Resume Detection์ด ๋ฏธ์๋ฃ slice๋ฅผ ์ฐพ์ง ๋ชปํด ์ฌ๊ตฌํ์ด skip๋จ. ๋ฐ๋์ ๋ ๋ค ์ํ.
- ์๋ด:
/deep-test --force-rerun๋ก Test phase ์ง์ ์ฌ์คํ (retry count ์ด๊ธฐํ)
- ๋๋ ์ฌ์ฉ์ ์๋ ์์ ํ
/deep-resume โ Orchestrator ยง3-4 (Implement) ๊ฒฝ๋ก. Step 3์ cleanup ๋๋ถ์ Implement skill์ด Section 1 ์๋ฃ-Marker branch๋ฅผ ํต๊ณผํ๊ณ Section 2์ ์ง์
ํ์ฌ ์ํฅ slice ์ฌ๊ตฌํ + ์ receipt/sensor evidence ์์ฑ. ์๋ฃ ํ Exit Gate โ ์ฌ์ฉ์๊ฐ "๋ค์ phase๋ก ์งํ" ์ ํ ์ Test ์ฌ์ง์
.
- ๋๋
/deep-status --report๋ก ๊ฒฐ๊ณผ ์ ๋ฆฌ
์ฃผ์ (v6.3.1): retry exhausted ํ /deep-resume์ current_phase(implement)๋ฅผ ์ฝ์ด Implement๋ก dispatchํ๋ค. Test skill์ ์๋ฃ-Marker ๊ฐ์ง branch๋ test_passed: true๋ฅผ ์๊ตฌํ๋ฏ๋ก ์ด ์ํ์์๋ ๋ฐ๋ํ์ง ์์ โ ์ํ ๋ฌดํ ๋ฃจํ๋ฅผ ๋ฐฉ์งํ๋ค. ๋ํ Step 3์ Implement marker cleanup์ stale evidence ์ฌ์ฌ์ฉ์ ์ฐจ๋จํ์ฌ ์์ ๋ ์ฝ๋๊ฐ ์ค์ ๋ก ๊ฒ์ฆ๋๋๋ก ํ๋ค (NW1).