| name | drift-check |
| description | Use when the user wants plan-alignment verification โ comparing the approved plan against actual implementation to detect unimplemented items, out-of-scope changes, and design drift. Triggers on `/drift-check`, "plan drift", "drift detection", "plan alignment", "ํ๋ ๋๋ฆฌํํธ", "๊ณํ ์ ํฉ์ฑ", "๋๋ฆฌํํธ ๊ฒ์ฆ", or auto-invocation by `/deep-test` as the Required Gate (blocks on drift). Read-only โ does NOT modify code. Saves results to `$WORK_DIR/drift-report.md` when in workflow mode. |
| user-invocable | true |
Invocation
์ด ์คํฌ์ ๋ ๊ฐ์ง ๊ฒฝ๋ก๋ก ํธ์ถ๋ฉ๋๋ค โ ์ด๋ ์ชฝ์ด๋ ๋ณธ SKILL ๋ณธ๋ฌธ์ ์ ์ฐจ๋ฅผ ๊ทธ๋๋ก ์คํํฉ๋๋ค:
- Claude Code ์ฌ๋์ โ ์ฌ์ฉ์๊ฐ
/drift-check [args...] ์
๋ ฅ (skill ์ user-invocable: true ๊ฐ ์ฌ๋์ ์ง์
์ ํ์ฉ).
- ํ ์์ด์ ํธ / Codex / Copilot CLI / Gemini CLI / SDK โ
Skill({ skill: "deep-work:drift-check", args: "..." }) ํํ๋ก ๋ช
์ invoke (cross-platform ํ์ค ๊ฒฝ๋ก).
๋ ๊ฒฝ๋ก ๋ชจ๋ args ๋ ๋์ผํ ํ ํฐ ๋ฌธ์์ด๋ก ์ ๋ฌ๋๋ฉฐ, ๋ณธ๋ฌธ ($ARGUMENTS ์๋ฆฌ) ์ ํ์๊ฐ ๋์ผํ๊ฒ ์ฒ๋ฆฌํฉ๋๋ค.
Inputs (skill args)
| ์ธ์ | ์๋ฏธ |
|---|
| (์์) | ํ์ฑ ์ธ์
์ plan.md ์ฌ์ฉ |
<plan-file-path> | ๋ช
์๋ plan ํ์ผ ๊ฒฝ๋ก |
๋น args / ๋งค์นญ๋์ง ์๋ ํ ํฐ โ ๋ณธ๋ฌธ์ default ๋ถ๊ธฐ๋ก ์ง์
.
Prerequisites
์ด entry skill ์ deep-work-orchestrator (Phase dispatch) ๋ฐ deep-work-workflow (reference skill โ Phase ๊ท์ฝ/Exit Gate/M3 envelope) ์ ํจ๊ป ๋์ํฉ๋๋ค. ํ์ฑ deep-work ์ธ์
์ด ์์ ๋๋ ์ธ์
state file (.claude/deep-work.<SESSION_ID>.md) ์ ๋ณ์ (work_dir, current_phase, active_slice ๋ฑ) ๋ฅผ ์ฝ์ด ๋์ํ๋ฉฐ, ์ธ์
์ธ๋ถ์์๋ standalone ์คํ์ด ๊ฐ๋ฅํ ๊ฒฝ์ฐ ๋ณธ๋ฌธ์ ๋ถ๊ธฐ๋ฅผ ๋ฐ๋ฆ
๋๋ค.
Cross-platform self-containment: Claude Code ์์๋ sibling skill ์ด description ๋งค์นญ์ผ๋ก ์๋ ๋ก๋๋ฉ๋๋ค. Codex / Copilot CLI / Gemini CLI / Agent SDK ์์ Skill() ๋ก ํธ์ถ ์ sibling auto-load ๋ณด์ฅ์ด ์ฝํ ์ ์์ผ๋ฏ๋ก, ๋ณธ๋ฌธ์ self-contained ์ผ๋ก ๋ณด์กด๋์ด ์์ต๋๋ค โ state file ํด์, $ARGUMENTS ํ์ฑ, AskUserQuestion ๋ถ๊ธฐ, ์ถ๋ ฅ ํฌ๋งท์ด ์ธ๋ผ์ธ.
Quality Gate (v6.2.4) โ /deep-test๊ฐ Required Gate๋ก ์๋ ์คํํฉ๋๋ค. ํน์ plan ํ์ผ์ ๋ํ ๋
๋ฆฝ ๊ฒ์ฆ์ด ํ์ํ ๋ ์ง์ ์ฌ์ฉํ์ธ์.
Standalone: /drift-check [plan-file]
Plan Alignment Check (Drift Detection)
You are performing a Plan Alignment Check โ comparing the approved plan against actual implementation to detect drift.
Language
Detect the user's language from their messages or the Claude Code language setting. Output ALL user-facing messages in the detected language. The display templates below use Korean as the reference format โ translate naturally to the user's language while preserving emoji, formatting, and structure.
Critical Constraints
- DO NOT modify any code files. This is a verification-only operation.
- Read plan, read code, compare, and report findings.
- Save results to file when in workflow mode.
Instructions
1. Determine operating mode and load plan
Resolve the current session's state file:
- If
DEEP_WORK_SESSION_ID env var is set โ .claude/deep-work.${DEEP_WORK_SESSION_ID}.md
- If
.claude/deep-work-current-session pointer file exists โ read session ID โ .claude/deep-work.${SESSION_ID}.md
- Legacy fallback โ
$STATE_FILE
Set $STATE_FILE to the resolved path.
Check if $STATE_FILE exists and has an active session (current_phase is not idle).
Workflow Mode (active deep-work session):
- Read
work_dir from the state file
- Set
WORK_DIR to the value of work_dir
- Load
$WORK_DIR/plan.md as the plan
- Get comparison baseline:
plan_approved_at from state file, or fall back to the commit closest to plan.md's modification time
Standalone Mode (no active session):
- If
$ARGUMENTS is provided: use as plan file path
- If
$ARGUMENTS is empty: error โ "Plan ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ง์ ํด์ฃผ์ธ์. ์: /drift-check path/to/plan.md"
2. Extract plan items
Parse the plan file and extract 3 categories:
A. ํ์ผ ๋ชฉ๋ก โ "Files to Modify", "์์ ๋์ ํ์ผ", "File Changes" ๋ฑ์ ์น์
์์ ํ์ผ ๊ฒฝ๋ก ์ถ์ถ.
B. ๊ตฌํ ํญ๋ชฉ โ ์ฒดํฌ๋ฆฌ์คํธ(- [ ], - [x]), ๋ฒํธ ๋งค๊ธด ๋จ๊ณ, ๋๋ "Implementation Steps" ์น์
์ ๊ฐ ํญ๋ชฉ. ๊ฐ ํญ๋ชฉ์์ ๋ค์์ ์ถ์ถ:
- ๋์ ํ์ผ (์์ผ๋ฉด)
- ๊ตฌํํ ๋ด์ฉ ์์ฝ
- plan ๋ด ์์น (์น์
๋ฒํธ/์ด๋ฆ)
C. ์ค๊ณ ๊ฒฐ์ โ "Design Decisions", "์ค๊ณ ์ง์นจ", "Architecture", "Constraints" ๋ฑ์ ์น์
์์ ๋ช
์์ ์ค๊ณ ์ง์์ฌํญ ์ถ์ถ. ์:
- "Strategy ํจํด์ผ๋ก ๊ตฌํ"
- "์ธํฐํ์ด์ค๋ฅผ ํตํ ์์กด์ฑ ์ฃผ์
"
- "๊ธฐ์กด XXX ํด๋์ค๋ ์์ ํ์ง ์์"
Display extracted items:
Plan ํญ๋ชฉ ์ถ์ถ ์๋ฃ:
ํ์ผ: [N]๊ฐ
๊ตฌํ ํญ๋ชฉ: [N]๊ฐ
์ค๊ณ ๊ฒฐ์ : [N]๊ฐ
3. Collect actual implementation
git diff --name-only [baseline-commit]..HEAD
git diff [baseline-commit]..HEAD -- [file]
baseline-commit ๊ฒฐ์ :
plan_approved_at ํ์์คํฌํ๊ฐ ์์ผ๋ฉด โ git log --before="[timestamp]" -1 --format=%H
- ์์ผ๋ฉด โ plan.md ํ์ผ์ mtime ๊ธฐ์ค ๊ฐ์ฅ ๊ฐ๊น์ด ์ปค๋ฐ
- ๋ ๋ค ์์ผ๋ฉด โ
HEAD~10 (์ต๊ทผ 10์ปค๋ฐ๊ณผ ๋น๊ต, ๊ฒฝ๊ณ ํ์)
4. Compare and classify
๊ฐ Plan ํญ๋ชฉ์ ๋ค์ ์ค ํ๋๋ก ๋ถ๋ฅ:
| ๋ถ๋ฅ | ์กฐ๊ฑด | ๊ธฐํธ |
|---|
| ๊ตฌํ ์๋ฃ | Plan ํญ๋ชฉ์ด ์ค์ ์ฝ๋์ ๋ฐ์๋จ | PASS |
| ๋ฏธ๊ตฌํ | Plan์ ์์ง๋ง ์ฝ๋์ ์์ | FAIL |
| ๋ฒ์ ์ด๊ณผ | Plan์ ์์ง๋ง ์ฝ๋์ ์์ (์ ๊ท ํ์ผ/๋๊ท๋ชจ ๋ณ๊ฒฝ) | WARN |
| ์ค๊ณ ์ดํ | Plan์ ์ค๊ณ ๊ฒฐ์ ๊ณผ ๋ค๋ฅด๊ฒ ๊ตฌํ๋จ | FAIL |
๋น๊ต ๋ฐฉ๋ฒ:
ํ์ผ ์์ค: Plan์ ํ์ผ ๋ชฉ๋ก๊ณผ git diff์ ํ์ผ ๋ชฉ๋ก์ ์งํฉ ๋น๊ต.
- Plan์๋ง ์๋ ํ์ผ โ ๋ฏธ๊ตฌํ
- git diff์๋ง ์๋ ํ์ผ โ ๋ฒ์ ์ด๊ณผ ํ๋ณด (ํ
์คํธ ํ์ผ, ์ค์ ํ์ผ ๋ฑ์ ์๋ ์ ์ธ)
ํญ๋ชฉ ์์ค: ๊ฐ ๊ตฌํ ํญ๋ชฉ์ ๋ํด ๊ด๋ จ ํ์ผ์ diff๋ฅผ ์ฝ๊ณ , ํด๋น ํญ๋ชฉ์ด ๊ตฌํ๋์๋์ง ํ๋จ.
- ํด๋์ค/ํจ์/์ธํฐํ์ด์ค ์์ฑ ํญ๋ชฉ โ ํด๋น ์ฌ๋ณผ์ด ์ฝ๋์ ์กด์ฌํ๋์ง ํ์ธ
- ๋ก์ง ๋ณ๊ฒฝ ํญ๋ชฉ โ diff์์ ๊ด๋ จ ๋ณ๊ฒฝ์ด ์๋์ง ํ์ธ
- ํ๋จ์ด ์ด๋ ค์ด ํญ๋ชฉ โ "ํ์ธ ํ์"๋ก ํ์ (false negative ๋ฐฉ์ง)
์ค๊ณ ์์ค: ๊ฐ ์ค๊ณ ๊ฒฐ์ ์ ๋ํด ์ค์ ์ฝ๋๊ฐ ํด๋น ๊ฒฐ์ ์ ๋ฐ๋ฅด๋์ง ํ์ธ.
- "Strategy ํจํด" ์ง์ โ ์ธํฐํ์ด์ค + ๊ตฌํ์ฒด ๋ถ๋ฆฌ๊ฐ ๋์ด์๋์ง
- "๊ธฐ์กด XXX ์์ ๊ธ์ง" โ ํด๋น ํ์ผ์ด diff์ ์๋์ง
- "์ธํฐํ์ด์ค ์์กด" โ new ConcreteClass() ๋์ ์ธํฐํ์ด์ค ์ฐธ์กฐ์ธ์ง
5. Generate report
## Plan Alignment Report
**Plan**: [plan file path]
**๋น๊ต ๊ธฐ์ค**: [baseline commit hash] โ HEAD
**๋น๊ต ๋ฒ์**: [N]๊ฐ ์ปค๋ฐ, [N]๊ฐ ํ์ผ ๋ณ๊ฒฝ
---
### ์ข
ํฉ ๊ฒฐ๊ณผ
| ๊ตฌ๋ถ | ๊ฑด์ | ํ์ |
|------|------|------|
| ๊ตฌํ ์๋ฃ | 8/10 | โ |
| ๋ฏธ๊ตฌํ | 2/10 | **Fail** |
| ๋ฒ์ ์ด๊ณผ | 1๊ฑด | Warning |
| ์ค๊ณ ์ดํ | 0๊ฑด | โ |
**ํ์ **: Required Gate ์คํจ โ ๋ฏธ๊ตฌํ 2๊ฑด
---
### ๊ตฌํ ์๋ฃ
- [x] `src/auth/service.ts` โ AuthService ํด๋์ค ์์ฑ (Plan 3.1)
- [x] `src/auth/types.ts` โ IAuthProvider ์ธํฐํ์ด์ค ์ ์ (Plan 3.2)
### ๋ฏธ๊ตฌํ โ ๋ฐ๋์ ๊ตฌํ ํ์
1. `src/auth/middleware.ts` โ ์ธ์ฆ ๋ฏธ๋ค์จ์ด (Plan 3.3)
โ Plan์ ๋ช
์๋์์ผ๋ ํ์ผ์ด ์์ฑ๋์ง ์์
2. `tests/auth.test.ts` โ AuthService ๋จ์ ํ
์คํธ (Plan 5.1)
โ Plan์ ๋ช
์๋์์ผ๋ ํ์ผ์ด ์์ฑ๋์ง ์์
### ๋ฒ์ ์ด๊ณผ
- `src/utils/crypto.ts` โ Plan์ ๋ช
์๋์ง ์์ ํ์ผ ์ถ๊ฐ
โ ์๋๋ ๋ณ๊ฒฝ์ด๋ฉด ๋ฌด์ ๊ฐ๋ฅ. ์ง์์ ์ด๋ฉด Plan ์
๋ฐ์ดํธ ๊ถ์ฅ.
### ์ค๊ณ ์ ํฉ์ฑ
- DIP: IAuthProvider ์ธํฐํ์ด์ค ์ฌ์ฉ (Plan 3.2 ์ค์)
- "๊ธฐ์กด UserService ์์ ๊ธ์ง" โ UserService.ts ๋ฏธ๋ณ๊ฒฝ ํ์ธ
5-1. Calculate Fidelity Score
After classifying all plan items, calculate a numeric Fidelity Score (0-100):
Scoring rules:
- Each plan item has a base value of
100 / total_plan_items points
- Fully implemented item: full points
- Partially implemented item: half points
- Not implemented item: 0 points
- Out of scope item: -2 points per item (capped โ score cannot go below 0)
Formula: score = max(0, (full_items * full_points) + (partial_items * half_points) - (out_of_scope_items * 2))
Normalize to 0-100 scale.
Add the Fidelity Score to the drift report output:
๐ Plan Fidelity Report
โโโโโโโโโโโโโโโโโโโโโ
โ
๊ตฌํ ์๋ฃ: [N]/[total] items ([pct]%)
โ ๏ธ ๋ถ๋ถ ๊ตฌํ: [N]/[total] items
[for each: โโ #[N]: "[description]" โ [what's done], [what's missing]]
โ ๋ฏธ๊ตฌํ: [N]/[total] items
[for each: โโ #[N]: "[description]"]
๐ ๋ฒ์ ์ด๊ณผ: [N] items
[for each: โโ [file]: [description]]
Fidelity Score: [score]/100
Write the numeric fidelity_score value to $WORK_DIR/fidelity-score.txt as a plain number (e.g., 85) for consumption by the quality score calculator in deep-finish.
Write fidelity_score: [N] to the state file $STATE_FILE.
6. Determine pass/fail
๋ฏธ๊ตฌํ 0๊ฑด AND ์ค๊ณ ์ดํ 0๊ฑด โ PASS
๋ฏธ๊ตฌํ >0๊ฑด OR ์ค๊ณ ์ดํ >0๊ฑด โ FAIL (Required โ ์ํฌํ๋ก์ฐ ์ฐจ๋จ)
๋ฒ์ ์ด๊ณผ๋ง ์์ โ PASS (๊ฒฝ๊ณ ๋ง ํ์)
7. Save results
Workflow Mode:
- Write full report to
$WORK_DIR/drift-report.md
- Display summary in terminal
- FAIL ์: "๋ฏธ๊ตฌํ ํญ๋ชฉ์ ๊ตฌํํ๊ฑฐ๋, /deep-plan ๋ช
๋ น์ ๋ค์ ์คํํ์ฌ Plan์ ์์ ํ์ธ์."
Standalone Mode:
- Display full report in terminal
- Ask: "๋ฆฌํฌํธ๋ฅผ ํ์ผ๋ก ์ ์ฅํ ๊น์? (๊ธฐ๋ณธ: ์๋์ค)"
- If yes, save to
./drift-report.md