Add: skills doctor subcommand + post-install routing repair#142
Open
hjick wants to merge 1 commit intopbakaus:mainfrom
Open
Add: skills doctor subcommand + post-install routing repair#142hjick wants to merge 1 commit intopbakaus:mainfrom
hjick wants to merge 1 commit intopbakaus:mainfrom
Conversation
상류 `npx skills` (vercel-labs/skills#851) 가 Claude Code 글로벌 설치를 ~/.agents/skills/ 로만 보내고 ~/.claude/skills/ 에 symlink 를 만들지 않는 경우, Claude Code 가 스킬을 못 보는 문제가 있다. 상류 PR 이 머지되어 배포되기 전까지 사용자 보호용 방어 코드를 추가한다. - `npx impeccable skills doctor [--fix]` 추가. 모든 PROVIDER_DIRS 의 글로벌 설치 위치를 스캔해 ~/.agents/skills/<name> 만 있고 ~/.claude/skills/<name> 이 없는 경우를 감지하고, --fix 로 symlink 를 만든다. 비-TTY 환경에서는 --fix 가 명시적 동의로 간주됨. - `impeccable skills install` 마지막에 동일 진단을 수행하고, 문제가 있으면 사용자에게 자동 복구를 제안한다 (-y 모드는 무자각 자동). - 진단/복구 로직은 try/catch 로 감싸 install 본 흐름을 절대 깨지 않게 한다. - 파일별: cli/bin/commands/skills.mjs 핵심 로직, cli/bin/cli.js 헬프 갱신, README.md 트러블슈팅 섹션 추가, tests/skills-doctor.test.js 6 케이스 회귀 테스트.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users who install impeccable globally via the recommended `npx skills add pbakaus/impeccable` flow can hit a routing bug in the upstream `skills` package: the skill lands in `
/.agents/skills/impeccable/` but not in `/.claude/skills/impeccable/`. Claude Code only reads from `~/.claude/skills/`, so the skill never activates and users see no `/impeccable` commands. I personally hit this — silent failure for a few days until I traced it to the install location.This is a known upstream issue: vercel-labs/skills#851 (and #693, #1045, #744). I have an upstream PR open at vercel-labs/skills#1089 that fixes the root cause (the interactive prompt did not pre-check Claude Code, so users hitting Enter installed only `.agents/skills` universal agents). Until that lands and ships, this PR adds a defensive layer here.
Changes
`npx impeccable skills doctor [--fix]`
A new diagnostic subcommand. Scans `
//skills/` for impeccable installs and detects the routing mismatch: `/.agents/skills/` exists but `~/.claude/skills/` is missing. Reports the issue and (with `--fix`) creates the symlink. Idempotent. Honors prefixed names like `i-impeccable`. Treats non-TTY `--fix` as explicit consent so it composes with CI / scripts.Auto-detect after install
`impeccable skills install` now calls the same diagnostic after the upstream `npx skills add` returns. If a misrouted install is detected, the user is prompted (or auto-repaired in `-y` mode). Wrapped in `try/catch` so the diagnostic step can never break install.
Docs
README gains a Troubleshooting subsection under Installation explaining the symptom, the upstream issue link, and the doctor command.
Tests
`tests/skills-doctor.test.js` — 6 cases mirroring the existing `tests/skills-cli.test.js` pattern (`bun:test`, real temp HOME directories):
/.claude/skills/impeccable` when `/.agents/skills/impeccable` existsVerification
```sh
bun test tests/skills-doctor.test.js # 6 pass
bun run test # 186 pass (Node) — pre-existing failures in tests/skills-cli.test.js are unrelated and reproduce on main
bun run build # validateProse + counts pass
```
Manual repro:
```sh
mkdir -p /tmp/hometest/.agents/skills/impeccable
HOME=/tmp/hometest node cli/bin/cli.js skills doctor --fix
test -L /tmp/hometest/.claude/skills/impeccable && echo OK
```
Notes
Note
Medium Risk
Touches the
skills installflow and adds filesystem symlink creation under user home directories, which could affect user environments if path detection is wrong, though the repair is scoped and best-effort.Overview
Adds a new
impeccable skills doctor [--fix]subcommand that scans global skill locations under~/.*?/skills/to detect the knownnpx skillsrouting mismatch (installed in~/.agents/skills/but missing from~/.claude/skills/) and optionally repairs it by creating the missing symlink.impeccable skills installnow runs the same routing check after installation and prompts (or auto-fixes in--yes/non-interactive mode) without failing the install on diagnostic errors. CLI help output, README troubleshooting docs, and a newtests/skills-doctor.test.jssuite were added to cover diagnose/fix/idempotency and prefixed skill names.Reviewed by Cursor Bugbot for commit c8f76ea. Bugbot is set up for automated code reviews on this repo. Configure here.