Skip to content

Add: skills doctor subcommand + post-install routing repair#142

Open
hjick wants to merge 1 commit intopbakaus:mainfrom
hjick:fix/skills-doctor-v2
Open

Add: skills doctor subcommand + post-install routing repair#142
hjick wants to merge 1 commit intopbakaus:mainfrom
hjick:fix/skills-doctor-v2

Conversation

@hjick
Copy link
Copy Markdown

@hjick hjick commented May 7, 2026

Supersedes #141 (rebased onto current main).

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):

  • clean state (no installs)
  • detects missing `/.claude/skills/impeccable` when `/.agents/skills/impeccable` exists
  • clean when both exist
  • `--fix` creates the symlink
  • handles prefixed `i-impeccable`
  • idempotent (running `--fix` twice does not error)

Verification

```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 install flow 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 known npx skills routing mismatch (installed in ~/.agents/skills/ but missing from ~/.claude/skills/) and optionally repairs it by creating the missing symlink.

impeccable skills install now 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 new tests/skills-doctor.test.js suite 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.

상류 `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 케이스 회귀 테스트.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant