| name | fixer |
| description | Audits, fixes, and improves every plugin in the marketplace against Claude Code official standards. plugin-doctor itself is included in the audit scope. Use on requests like "ํ๋ฌ๊ทธ์ธ ์ ๊ฒ", "plugin doctor", "ํ๋ฌ๊ทธ์ธ ๊ฒ์ฆ", "plugin validate", "ํ๋ฌ๊ทธ์ธ ์์ ", "plugin fix", "๋ง์ผํ๋ ์ด์ค ๊ฒ์ฆ", "ํ๋ฌ๊ทธ์ธ ๊ฑด๊ฐ ๊ฒ์ง". |
| argument-hint | [plugin name (audit all if omitted)] [--update-spec: refresh official docs] |
Plugin Doctor
Diagnose every plugin in the marketplace against Claude Code official standards, and fix auto-fixable issues immediately. plugin-doctor itself is included in the audit scope.
Respond to the user in Korean.
Official Spec Reference
Validation criteria live in references/official-spec.md. It is refreshed automatically in Stage 0.
Arguments
- No
$ARGUMENTS โ audit the whole marketplace
- Plugin name in
$ARGUMENTS โ audit only that plugin
--update-spec โ force-run Stage 0
Diagnostic Process
Stage 0: Official Spec Self-Update
Run only when the --update-spec argument is present, or when the Last updated date in references/official-spec.md is more than 30 days old.
- Read
references/official-spec.md and check the Last updated date
- If a refresh is needed, fetch the official docs with WebFetch:
https://docs.anthropic.com/en/docs/claude-code/plugins
https://docs.anthropic.com/en/docs/claude-code/skills
https://docs.anthropic.com/en/docs/claude-code/agents
https://docs.anthropic.com/en/docs/claude-code/hooks
- Detect new fields, changed rules, added events, etc.
- If there are changes, update
references/official-spec.md and refresh Last updated
- If there are no changes, update only the date
Stage 1: Marketplace Validation
Validate .claude-plugin/marketplace.json.
Checks:
- Valid JSON parsing
- Required fields present:
name, owner.name
version field in SemVer format (regex: ^\d+\.\d+\.\d+$)
- For each entry in the
plugins[] array:
name field present + kebab-case (regex: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$)
source field present
- For relative-path sources, check it starts with
./
- Check the source path exists as a real directory via Glob
- Detect duplicate plugin names
Stage 2: plugin.json Validation
Validate each plugin's .claude-plugin/plugin.json.
Checks:
- File existence (Warning if missing)
- Valid JSON parsing
name field: present + kebab-case
version field: present (Warning if missing) + SemVer format
description field: present (Info if missing)
author field: present (Info if missing)
- Version sync: check it matches the version in marketplace.json (Critical on mismatch)
- If custom paths (commands, agents, skills, hooks, etc.) are configured, check those paths exist
Stage 3: Skill Validation
Validate each plugin's skills/*/SKILL.md.
Checks:
- Valid YAML frontmatter parsing
name field: kebab-case, max 64 chars
description field: presence (Warning if missing)
- Check it contains trigger keywords (Korean/English mix recommended)
allowed-tools field:
- Presence (Warning if missing)
- Check it is in YAML list format (comma-separated string โ Warning + auto-fix suggestion)
- Each tool name valid: built-in tools (Bash, Read, Write, Edit, Glob, Grep, Agent, WebFetch, WebSearch, NotebookEdit, NotebookRead) or the
mcp__* pattern
model field: valid value (sonnet, haiku, opus, or full model ID)
effort field: valid value (low, medium, high, max)
context field: when using fork, check the agent field is also set
- Deprecated commands/ detection: if a
commands/ directory exists โ Critical + provide a skills-migration guide
Stage 4: Agent Validation
Validate each plugin's agents/*.md.
Checks:
- Valid YAML frontmatter parsing
- Required fields:
name (kebab-case), description
tools field: tool-name validity (same criteria as Stage 3)
model field: valid value (sonnet, haiku, opus, inherit)
maxTurns field: check it is a positive integer
- Plugin agent restrictions: Warning if
hooks, mcpServers, or permissionMode fields are present (ignored in plugin agents)
whenToUse field: check it contains an <example> tag (Info if missing)
color field: presence (Info if missing)
Stage 5: Hook Validation
Validate each plugin's hooks/hooks.json or the hooks field inside plugin.json.
Checks:
- Valid JSON parsing
- Check the event name is one of the 25 official events:
SessionStart, InstructionsLoaded, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Notification, SubagentStart, SubagentStop, TaskCreated, TaskCompleted, TeammateIdle, Stop, StopFailure, ConfigChange, CwdChanged, FileChanged, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, Elicitation, ElicitationResult, SessionEnd
- Check the matcher pattern is a valid regex
- Hook type: check it is one of
command, http, prompt, agent
command-type hooks:
- Check the script file path exists
- Check it has execute permission (+x)
- Check
$CLAUDE_PLUGIN_ROOT is used correctly
timeout field: check it is a positive integer
Stage 6: Structure Validation
Validate each plugin's overall directory structure.
Checks:
README.md presence (Warning if missing)
- Detect empty directories:
commands/, agents/, skills/, etc. with no content (Warning)
- Naming consistency: Warning if
reference/ and references/ directories coexist within the same skill
- Critical if components other than
plugin.json (commands, agents, etc.) live inside the .claude-plugin/ directory (wrong location)
- Whether file paths contain
../ (path-escape detection)
Stage 7: Self-Diagnosis
Validate plugin-doctor itself against the same criteria as Stage 1โ6.
Additional checks:
- Check
references/official-spec.md exists and is not empty
- Check this SKILL.md's frontmatter matches the latest official spec
- Check
allowed-tools includes WebFetch and WebSearch (needed to run Stage 0)
- Check the event list referenced in the validation logic matches
official-spec.md
- On finding issues, output auto-fix suggestions
Stage 8: Auto-Fix & Report
Combine all diagnostic results into a report.
Severity classification:
- Critical: issues that can affect plugin operation (e.g., missing required field, wrong path)
- Warning: non-compliance with official standards but no operational impact (e.g., version mismatch, missing README)
- Info: recommended improvements (e.g., insufficient description keywords, unset color)
Auto-fixable items (run after user confirmation):
- Delete empty deprecated
commands/ directories
- Add a missing
version field (taken from marketplace.json)
- Convert
allowed-tools comma-separated string โ YAML list
- Sync marketplace.json โ plugin.json versions
- Fix plugin-doctor's own spec mismatches
Report output format:
# Plugin Doctor Report
## ์คํ ์ํ
- official-spec.md: [๋ ์ง] ([๊ฐฑ์ ์ฌ๋ถ])
## ์์ฝ
| ํ๋ฌ๊ทธ์ธ | Critical | Warning | Info | ์ํ |
|----------|----------|---------|------|------|
| plugin-a | 0 | 1 | 2 | ๐ก |
| plugin-b | 1 | 0 | 0 | ๐ด |
| plugin-doctor (self) | 0 | 0 | 0 | ๐ข |
## ์์ธ ์ง๋จ
### plugin-a
| ์ฌ๊ฐ๋ | Stage | ํญ๋ชฉ | ํ์ฌ ์ํ | ๊ถ์ฅ ์กฐ์น |
|--------|-------|------|----------|----------|
| โ ๏ธ | 6 | README.md | ๋๋ฝ | ์์ฑ ํ์ |
| โน๏ธ | 4 | agent color | ๋ฏธ์ค์ | color ํ๋ ์ถ๊ฐ ๊ถ์ฅ |
## ์๋ ์์ ์ ์
๋ค์ ํญ๋ชฉ์ ์๋ ์์ ํ ๊น์?
- [ ] plugin-a/commands/ ๋น ๋๋ ํ ๋ฆฌ ์ญ์
- [ ] plugin-b/.claude-plugin/plugin.json์ version: "1.0.0" ์ถ๊ฐ
## ์๋ ์กฐ์น ํ์
1. [Critical] plugin-b: ...
Once the user approves an auto-fix, apply that item immediately.
Stage 8.5: Codex Parallel Fix (optional)
If the Codex skill is available and there are 3 or more approved auto-fixable items, you can delegate some to /codex:rescue in parallel to speed up fixing.
- Split approved auto-fixable items into two groups:
- Claude fixes directly: Critical items + items where spec consistency matters
- Delegable to Codex: mechanical fixes among Warnings (version sync, empty-directory deletion, YAML-list conversion, etc.)
- If there is a Codex delegation group, dispatch the
codex:codex-rescue subagent (--write):
- Task: "๋ค์ plugin-doctor findings๋ฅผ ์์ ํ๋ผ: [ํญ๋ชฉ ๋ชฉ๋ก]. ๊ฐ ์์ ํ ๋ณ๊ฒฝ๋ ํ์ผ ๊ฒฝ๋ก๋ฅผ ๋ณด๊ณ ํ๋ผ."
- Run Claude's direct fixes and Codex delegation in parallel
- Collect Codex fix results with
/codex:result
- In Stage 9 revalidation, verify both Claude and Codex fixes
Guardrail: official-spec.md, the severity rubric, and the revalidation score are owned by fixer as the source of truth. If Codex relaxes criteria or deletes a finding, reject that fix.
If the Codex skill is not installed, or there are fewer than 3 auto-fixable items, fix directly using the existing approach.
Stage 9: Skeptical Re-verification Loop
Protocol reference: references/evaluation-protocol.md
Principle: Generator-Evaluator role separation + skeptical evaluation (Anthropic Harness Design blog)
Step 1: Define the Sprint Contract
Before starting any auto-fix, define the completion criteria clearly:
## Sprint Contract
- ์๋ ์์ ๋์: [Critical/Warning ์ค ์๋ ์์ ๊ฐ๋ฅํ ํญ๋ชฉ ๋ชฉ๋ก]
- CLEAN ๊ธฐ์ค: Critical + Warning findings = 0
- ์๋ ์กฐ์น ํญ๋ชฉ: [์๋ ์์ ๋ถ๊ฐ๋ฅํ ํญ๋ชฉ โ ๋ฆฌํฌํธ์๋ง ํ์]
- ์์ ์ด ์๋ ๊ฒ: findings ์ญ์ , ์ฌ๊ฐ๋ ํํฅ, ๊ธฐ์ค ์ํ
This prior agreement is what keeps revalidation criteria consistent.
Step 2: Run Auto-Fixes
After user approval, run the auto-fix items.
Step 3: Skeptical Re-verification
After fixing, switch into a separate skeptical evaluator role and re-verify.
Skeptical evaluation perspective (avoid the self-evaluation trap):
- Was the fix actually applied to the file? โ re-Read the file to confirm
- Did the fix introduce a new problem? โ chain-verify the impact scope
- Deleting findings or lowering severity is NOT a fix
- If in doubt, fail โ at boundary scores (6-7), judge as fail
- Do not self-praise โ before judging "fixed well", re-Read the file first
2-axis multi-dimensional evaluation:
| Axis | Weight | Description |
|---|
| Standard Compliance | 60% | Field/value-format compliance against official-spec.md |
| Structural Health | 40% | File paths, naming, reference integrity |
Score calibration:
| Band | Standard Compliance | Structural Health |
|---|
| 9-10 | 100% official-spec compliance | paths/naming OK + README present |
| 7-8 | 1-2 minor mismatches | 1 minor structural issue |
| 5-6 | many Warning-level mismatches | empty directory, naming mismatch |
| 3-4 | Critical present | files placed in wrong location |
| 1-2 | many required fields missing | basic structure absent |
Verdict: weighted average โฅ7 PASS / 4-6 PARTIAL / <4 FAIL
fixer domain anti-patterns (automatic deductions):
| Anti-pattern | Axis | Deduction |
|---|
| commands/ directory remains | Structural Health | -3 (Critical) |
| plugin.json โ marketplace.json version mismatch | Standard Compliance | -3 (Critical) |
| SKILL.md frontmatter parse failure | Standard Compliance | -3 (Critical) |
| README.md missing | Structural Health | -1 (Warning) |
| empty skills/ or agents/ directory | Structural Health | -1 (Warning) |
| allowed-tools comma-separated string | Standard Compliance | -1 (Warning) |
Revalidation scope:
Re-run only the Stage of the items you fixed:
- plugin.json fix โ re-run Stage 2
- version sync โ re-run Stage 1 + Stage 2
- SKILL.md fix โ re-run Stage 3
- agent fix โ re-run Stage 4
- directory deletion โ re-run Stage 6
Loop Control
Round 1: Sprint Contract ์ ์ โ Stage 1~8 (์ง๋จ) โ ์๋ ์์
Round 2: ํ์์ ์ฌ๊ฒ์ฆ (์์ ํญ๋ชฉ ๊ด๋ จ Stage๋ง)
โ CLEAN โ ์๋ฃ
โ ์์ฌ findings โ ์ถ๊ฐ ์์ + Round 3
Round 3: ํ์์ ์ฌ๊ฒ์ฆ (์ต์ข
)
โ CLEAN โ ์๋ฃ
โ ์์ฌ โ "์๋ ์กฐ์น ํ์" ๋ฆฌํฌํธ ์ถ๋ ฅ ํ ์ข
๋ฃ
Termination conditions (any one met):
- Sprint Contract's CLEAN criterion met โ CLEAN
- This round's findings โฅ previous round โ CONVERGED (fix introduced a new problem)
- Round 3 complete โ MAX_ROUNDS
Artifact generation (required from round 2 onward):
At the end of each round, record into the .claude/doctor/ directory:
verify-round-{N}.md: 2-axis scores, anti-pattern detection results, fix guidance
# Verify Round {N} โ Plugin Doctor
## ํ๋ฌ๊ทธ์ธ๋ณ ํ๊ฐ
### {plugin-name}
| ์ถ | ๊ฐ์ค์น | ์ ์ | ๊ทผ๊ฑฐ |
|----|--------|------|------|
| ํ์ค ์ค์ | 60% | {N}/10 | {๊ตฌ์ฒด์ ๊ทผ๊ฑฐ} |
| ๊ตฌ์กฐ ๊ฑด์ ์ฑ | 40% | {N}/10 | {๊ตฌ์ฒด์ ๊ทผ๊ฑฐ} |
| **๊ฐ์ค ํ๊ท ** | | **{N.N}** | **{PASS/PARTIAL/FAIL}** |
## ์ํฐํจํด ํ์ง
| ํ๋ฌ๊ทธ์ธ | ์ํฐํจํด | ์ถ | ๊ฐ์ |
|----------|----------|-----|------|
## ์ข
ํฉ ํ์ : {CLEAN/CONTINUE/CONVERGED/MAX_ROUNDS}
Add the loop history to the final report:
## ๊ฒ์ฆ ๋ฃจํ ์ด๋ ฅ
| ๋ผ์ด๋ | Sprint Contract | findings | ์์ | ์์ฌ | ๊ฐ์คํ๊ท | ํ์ |
|--------|----------------|----------|------|------|---------|------|
| 1 | Critical+Warning=0 | 5 | 4 | 1 | 6.2 | CONTINUE |
| 2 | Critical+Warning=0 | 1 | 1 | 0 | 8.4 | CLEAN |