$npx -y skills add Webioinfo01/aweskill --skill aweskill-doctorUse when aweskill state is abnormal or repair-first: broken projections, duplicates, stale entries, suspicious or new matches, sync problems, malformed SKILL.md frontmatter, warnings, or unexpected post-install/projection state. 中文触发词:技能诊断、技能修复、损坏投影、重复技能、同步问题、异常条目、doctor clean、do
| 1 | # Aweskill Doctor |
| 2 | |
| 3 | Diagnose first. Mutate only with `--apply`. Verify after every mutation. |
| 4 | |
| 5 | ## Symptom Workflows |
| 6 | |
| 7 | ### Agent Cannot See a Skill |
| 8 | |
| 9 | The user says a skill should be available but the agent doesn't show it. |
| 10 | |
| 11 | ```bash |
| 12 | # 1. Check what's projected |
| 13 | aweskill agent list --global --agent <id> --verbose |
| 14 | |
| 15 | # 2. If the skill is missing from projections, sync it |
| 16 | aweskill doctor sync --global --agent <id> |
| 17 | |
| 18 | # 3. Apply if dry-run reports repairable entries |
| 19 | aweskill doctor sync --global --agent <id> --apply |
| 20 | |
| 21 | # 4. Verify |
| 22 | aweskill agent list --global --agent <id> --verbose |
| 23 | ``` |
| 24 | |
| 25 | If the skill doesn't exist in the central store either, escalate to `$aweskill` for `find` / `install`. |
| 26 | |
| 27 | ### Projection is Broken |
| 28 | |
| 29 | `agent list` shows `broken` — a managed symlink or copy target no longer resolves. |
| 30 | |
| 31 | ```bash |
| 32 | # 1. Inspect |
| 33 | aweskill agent list --global --agent <id> --verbose |
| 34 | |
| 35 | # 2. Dry-run sync to see what would be repaired |
| 36 | aweskill doctor sync --global --agent <id> |
| 37 | |
| 38 | # 3. Apply repair |
| 39 | aweskill doctor sync --global --agent <id> --apply |
| 40 | |
| 41 | # 4. Verify |
| 42 | aweskill agent list --global --agent <id> --verbose |
| 43 | ``` |
| 44 | |
| 45 | ### Store Has Suspicious Files |
| 46 | |
| 47 | `store list` or `doctor clean` reports suspicious entries — missing SKILL.md, reserved names, or junk files. |
| 48 | |
| 49 | ```bash |
| 50 | # 1. Inspect |
| 51 | aweskill doctor clean --verbose |
| 52 | aweskill doctor clean --skills-only --verbose # scan only skills/ |
| 53 | aweskill doctor clean --bundles-only --verbose # scan only bundles/ |
| 54 | |
| 55 | # 2. Apply cleanup |
| 56 | aweskill doctor clean --apply |
| 57 | |
| 58 | # 3. Verify |
| 59 | aweskill store list --verbose |
| 60 | ``` |
| 61 | |
| 62 | Use `--remove-suspicious` on `doctor sync` only when suspicious agent entries should actually be removed instead of reported. |
| 63 | |
| 64 | ### Duplicate Skills Exist |
| 65 | |
| 66 | Multiple central-store skills collapse to one duplicate family, or multiple agent-side entries map to one canonical skill. |
| 67 | |
| 68 | ```bash |
| 69 | # 1. Inspect |
| 70 | aweskill doctor dedup |
| 71 | |
| 72 | # 2. Apply dedup (keeps canonical, moves duplicates to dup_skills/) |
| 73 | aweskill doctor dedup --apply |
| 74 | |
| 75 | # 3. Backup before dedup (copies to backup/dedup first) |
| 76 | aweskill doctor dedup --apply --backup |
| 77 | |
| 78 | # 4. If permanent removal is explicitly required |
| 79 | aweskill doctor dedup --apply --delete |
| 80 | |
| 81 | # 5. For agent-side duplicates |
| 82 | aweskill doctor sync --global --agent <id> --apply |
| 83 | ``` |
| 84 | |
| 85 | ### SKILL.md Frontmatter is Malformed |
| 86 | |
| 87 | `doctor fix-skills` reports missing closing `---`, invalid YAML, missing `name` or `description`, or files that start with body content. |
| 88 | |
| 89 | ```bash |
| 90 | # 1. Inspect with details |
| 91 | aweskill doctor fix-skills --include-info --verbose |
| 92 | |
| 93 | # 2. Limit to specific skills |
| 94 | aweskill doctor fix-skills --skill <name1>,<name2> --verbose |
| 95 | |
| 96 | # 3. Normalize frontmatter |
| 97 | aweskill doctor fix-skills --apply |
| 98 | |
| 99 | # 4. If original files should be preserved first |
| 100 | aweskill doctor fix-skills --apply --backup |
| 101 | ``` |
| 102 | |
| 103 | ### Installed CLI Behaves Differently from Repo Code |
| 104 | |
| 105 | Escalate to `$aweskill` — this is a Self-Update issue, not a doctor issue. The `$aweskill` skill handles CLI version mismatches via `aweskill self-update`. |
| 106 | |
| 107 | ## Quick Reference |
| 108 | |
| 109 | ### Inspection Commands (read-only) |
| 110 | |
| 111 | - `aweskill store list --verbose` — central store contents |
| 112 | - `aweskill bundle list --verbose` — bundle overview |
| 113 | - `aweskill agent list [--scope] [--agent] --verbose` — projection state |
| 114 | - `aweskill doctor clean --verbose` — suspicious store entries (`--skills-only` / `--bundles-only` to narrow scope) |
| 115 | - `aweskill doctor dedup` — duplicate families |
| 116 | - `aweskill doctor fix-skills --include-info --verbose` — frontmatter issues (`--skill <name>` to limit scope) |
| 117 | - `aweskill doctor sync [--scope] [--agent] --verbose` — sync dry-run |
| 118 | |
| 119 | ### Mutation Commands (require --apply) |
| 120 | |
| 121 | - `aweskill doctor clean --apply` — remove suspicious store entries |
| 122 | - `aweskill doctor dedup --apply` — resolve duplicates (add `--backup` to preserve first, `--delete` for permanent removal) |
| 123 | - `aweskill doctor fix-skills --apply` — normalize frontmatter (add `--backup` to preserve originals) |
| 124 | - `aweskill doctor sync --apply` — repair projections (add `--remove-suspicious` to remove unmanaged entries) |
| 125 | |
| 126 | ## References |
| 127 | |
| 128 | - `references/triage.md` — diagnosis decision tree |
| 129 | - `references/failure-patterns.md` — symptom-to-command mapping |