| name | ctx-verify |
| description | Runs 3-stage verification of a hierarchical context architecture โ reference integrity, code reference validity, and content accuracy checked in sequence to produce a report. Triggers โ ๊ณ์ธต์ ์ปจํ
์คํธ ๊ฒ์ฆ, ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ, ์ฝ๋ ์ฐธ์กฐ ๊ฒ์ฆ, ๋ด์ฉ ์ ํ์ฑ, ์ปจํ
์คํธ ์ํคํ
์ฒ ๊ฒ์ฆ, ctx-verify. |
| argument-hint | [stage number: 1|2|3|all (default: all)] |
Context Architecture Verify
Performs 3-stage verification of a hierarchical context architecture. For the detailed verification procedure, see references/verification-guide.md in the guide skill.
Respond to the user in Korean.
Execution Steps
Step 0: Collect context files
Collect the following files across the project:
CLAUDE.md (project root)
**/CLAUDE.md (subdirectories โ Claude Code on-demand auto-loading)
.claude/rules/*.md (path-scoped rules)
AGENTS.md (project root โ not auto-loaded by Claude Code)
**/CONTEXT.md (all directories โ not auto-loaded by Claude Code)
If no files exist, output "์ปจํ
์คํธ ์ํคํ
์ฒ๊ฐ ์์ง ์ด๊ธฐํ๋์ง ์์์ต๋๋ค. /agent-context:ctx-init์ ๋จผ์ ์คํํ์ธ์." and exit.
If a stage number is given as an argument, run only that stage. The default is all (run everything).
Stage 1: Reference Integrity
- Extract markdown links
[ํ
์คํธ](๊ฒฝ๋ก) and @path/to/file imports from all context files.
- Check whether each link/import target file exists (use Glob).
- Check that every context file is referenced by at least one parent file.
- Check whether the root CLAUDE.md exists.
- Output the results as a markdown table:
## Stage 1: ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ โ
/โ
| ์ํ | ํ์ผ | ํญ๋ชฉ | ์ค๋ช
|
|------|------|------|------|
| โ | src/CONTEXT.md | ./old/CONTEXT.md ๋งํฌ | ํ์ผ ์กด์ฌํ์ง ์์ |
| โ ๏ธ | tests/CONTEXT.md | (๊ณ ๋ฆฝ) | ์์์์ ์ฐธ์กฐ ์์ |
| โ
| ์ ์ฒด | ์ํ ์ฐธ์กฐ | ์์ |
Stage 2: Code Reference Validation
- Extract code references from all context files (CLAUDE.md, subdirectory CLAUDE.md, .claude/rules/, CONTEXT.md):
- File paths in backticks:
`src/handler.ts`
- Key Files list items
- import/require statements inside code blocks
- Check whether each reference exists in the actual filesystem via Glob.
- For references that do not exist, search for similar filenames (infer moves).
- Check whether the build/test commands in CLAUDE.md are valid (cross-check against package.json scripts, etc.).
- Output the results as a markdown table:
## Stage 2: ์ฝ๋ ์ฐธ์กฐ ๊ฒ์ฆ โ
/โ
| ์ํ | ์ปจํ
์คํธ ํ์ผ | ์ฐธ์กฐ | ๋น๊ณ |
|------|--------------|------|------|
| โ | CLAUDE.md | `npm run lint:fix` | package.json์ ์์ |
| โ ๏ธ | src/CONTEXT.md | `utils.ts` | src/shared/utils.ts๋ก ์ด๋ ์ถ์ |
| โ
| src/api/CONTEXT.md | `handler.ts` | ์กด์ฌ ํ์ธ |
Stage 3: Content Accuracy
- Extract technical claims from context documents:
- "uses library X" โ verify against package.json/Cargo.toml, etc.
- "follows pattern Y" โ attempt to verify from code structure
- "build with command Z" โ check actual runnability
- Verify only the items that can be verified automatically.
- Classify items needing manual verification as Info.
- Output the results as a markdown table:
## Stage 3: ๋ด์ฉ ์ ํ์ฑ โ
/โ
| ์ํ | ์ปจํ
์คํธ ํ์ผ | ์ฃผ์ฅ | ์ค์ |
|------|--------------|------|------|
| โ | CLAUDE.md | "Zustand ์ฌ์ฉ" | package.json์ ์์ |
| โ ๏ธ | src/CONTEXT.md | "RORO ํจํด ์ค์" | 12/15 ์๋ํฌ์ธํธ๋ง ์ค์ |
| โน๏ธ | src/api/CONTEXT.md | "P99 < 100ms" | ์๋ ๊ฒ์ฆ ๋ถ๊ฐ |
Stage 3.5: Codex Second-Pass Validation (optional)
After Stage 2/3 findings are complete, if the Codex skill is available, bring in /codex:review as a second-pass validator.
- Run
/codex:review --wait โ target the context files verified in Stages 1โ3.
- Collect structured findings with
/codex:result.
- Cross-check the Codex findings:
- Critical/Warning items missed in Stages 1โ3 โ add to the consolidated report with
source: "codex-second-pass"
- Items found by both โ keep the existing finding (deduplicate)
- Codex-only Info items โ ignore
Guardrail: The PASS/PARTIAL/FAIL verdict, anti-pattern deductions, and CLEAN criteria are owned by ctx-verify as the source of truth. Codex only supplements coverage.
Skip this stage if the Codex skill is not installed.
Final: Consolidated report
# ์ปจํ
์คํธ ์ํคํ
์ฒ ๊ฒ์ฆ ์ข
ํฉ ๋ฆฌํฌํธ
## ์์ฝ
| ๋จ๊ณ | Critical | Warning | Info | ์ํ |
|------|----------|---------|------|------|
| ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ | 0 | 1 | 0 | ๐ข |
| ์ฝ๋ ์ฐธ์กฐ | 2 | 1 | 0 | ๐ด |
| ๋ด์ฉ ์ ํ์ฑ | 1 | 1 | 2 | ๐ก |
## ์ ์ฒด ๊ฑด์ ์ฑ: ๐ก ์ํธ (์ฃผ์ ํ์)
## ์ฐ์ ์กฐ์น ํญ๋ชฉ
1. [Critical] ...
2. [Critical] ...
3. [Warning] ...
Skeptical Re-verification Loop
Principle: Generator-Evaluator role separation + skeptical evaluation (Anthropic Harness Design blog)
"tuning a standalone evaluator to be skeptical turns out to be far more tractable
than making a generator critical of its own work"
Step 1: Define the Sprint Contract
Before starting automated fixes, agree on the completion criteria:
## Sprint Contract
- ์๋ ์์ ๋์: [์๋ ํ์ ์๋ ์์ ๊ฐ๋ฅ ํญ๋ชฉ]
- CLEAN ๊ธฐ์ค: Critical + Warning findings = 0
- ์๋ ์กฐ์น ํญ๋ชฉ: [๊ณ ๋ฆฝ ํ์ผ ๊ตฌ์กฐ ๋ณ๊ฒฝ, ์๋ ๊ฒ์ฆ ํ์ ๊ธฐ์ ์ ์ฃผ์ฅ]
- ์์ ์ด ์๋ ๊ฒ: findings ์ญ์ , ์ฌ๊ฐ๋ ํํฅ, ๊ฒ์ฆ ๊ธฐ์ค ์ํ
Step 2: Auto-fixable items
| Type | Stage | Fix method |
|---|
| Broken link (target file moved) | 1 | Update path to the similar filename |
| Code reference path mismatch | 2 | Locate current position via Glob โ update path |
| Build/test command mismatch | 2 | Extract the exact command from package.json/Makefile โ update |
| Library description mismatch | 3 | Extract the actual list from the dependency file โ update |
Items requiring manual fixes are shown in the report only.
Step 3: Skeptical re-verification
After fixing, switch to a separate skeptical evaluator role and re-verify.
Skeptical evaluation perspective (avoiding the self-evaluation trap):
- Do the fixed paths/commands actually exist? โ re-confirm with Glob/Read.
- Did the fix break references in other context files? โ trace the impact scope.
- Compare before/after files to check for unintended content changes.
- If in doubt, fail โ at boundary scores (6-7), rule fail.
- Do not self-praise โ re-read the file before judging that "the fix was done well".
3-axis multidimensional evaluation:
| Axis | Weight | Description |
|---|
| Reference Integrity | 40% | Link/import targets exist, no orphaned files |
| Code Sync | 35% | Code reference paths valid, build/test commands valid |
| Content Accuracy | 25% | Technical claims match reality |
Score calibration:
| Range | Reference Integrity | Code Sync | Content Accuracy |
|---|
| 9-10 | Links 100% valid + 0 orphans | All paths/commands valid | Technical claims 100% verified |
| 7-8 | Links valid, 1 orphan | 1-2 paths incomplete | Mostly accurate |
| 5-6 | 1-2 broken links | Build command mismatch | Major library mismatch |
| 3-4 | Many broken links | Core paths missing | Major technical claims inaccurate |
| 1-2 | Root CLAUDE.md missing | Most code references invalid | Content unrelated to reality |
Verdict: weighted average โฅ7 PASS / 4-6 PARTIAL / <4 FAIL
ctx-verify domain anti-patterns (automatic deductions):
| Anti-pattern | Axis | Deduction |
|---|
| Circular reference | Reference Integrity | -3 |
| Link to a nonexistent file | Reference Integrity | -2 |
| Description of a removed library | Content Accuracy | -2 |
| Orphaned context file | Reference Integrity | -1 |
| Reference to a moved file not updated | Code Sync | -1 |
| Non-runnable build command | Code Sync | -1 |
Artifact generation (required for 2+ rounds):
At the end of each round, record into the .claude/ctx-verify/ directory:
# Verify Round {N} โ Context Architecture
## ํ๊ฐ ์ถ ์ ์
| ์ถ | ๊ฐ์ค์น | ์ ์ | ๊ทผ๊ฑฐ |
|----|--------|------|------|
| ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ | 40% | {N}/10 | {๊ตฌ์ฒด์ ๊ทผ๊ฑฐ} |
| ์ฝ๋ ๋๊ธฐํ | 35% | {N}/10 | {๊ตฌ์ฒด์ ๊ทผ๊ฑฐ} |
| ๋ด์ฉ ์ ํ์ฑ | 25% | {N}/10 | {๊ตฌ์ฒด์ ๊ทผ๊ฑฐ} |
| **๊ฐ์ค ํ๊ท ** | | **{N.N}** | **{PASS/PARTIAL/FAIL}** |
## ์ํฐํจํด ํ์ง
| ์ํฐํจํด | ์ถ | ๊ฐ์ | ์์ธ |
|----------|-----|------|------|
## ์์ ์ง์นจ (PARTIAL/FAIL ์)
1. {ํ์ผ}:{์์น} โ {๊ตฌ์ฒด์ ์์ ๋ฐฉ๋ฒ}
Loop control
Round 1: Sprint Contract ์ ์ โ Stage 1~3 ๊ฒ์ฆ โ ์๋ ์์ (์ฌ์ฉ์ ์น์ธ)
Round 2: ํ์์ ์ฌ๊ฒ์ฆ (์์ ํ Stage๋ง)
โ CLEAN โ ์๋ฃ
โ ์์ฌ findings โ ์ถ๊ฐ ์์ + Round 3
Round 3: ํ์์ ์ฌ๊ฒ์ฆ (์ต์ข
)
โ CLEAN โ ์๋ฃ
โ ์์ฌ โ "์๋ ์กฐ์น ํ์" ๋ฆฌํฌํธ ์ถ๋ ฅ ํ ์ข
๋ฃ
Termination conditions (any one met):
- The Sprint Contract's CLEAN criteria are met โ CLEAN
- This round's findings โฅ the previous round's โ CONVERGED (the fix introduced new problems)
- Round 3 complete โ MAX_ROUNDS
Add the loop history to the final report:
## ๊ฒ์ฆ ๋ฃจํ ์ด๋ ฅ
| ๋ผ์ด๋ | Sprint Contract | findings | ์์ | ์์ฌ | ๊ฐ์คํ๊ท | ํ์ |
|--------|----------------|----------|------|------|---------|------|
| 1 | Critical+Warning=0 | 4 | 3 | 1 | 5.8 | CONTINUE |
| 2 | Critical+Warning=0 | 1 | 0 | 1 | 6.2 | CONVERGED (์๋ ์กฐ์น ํ์) |