$npx -y skills add chenweil/skillcaddy --skill skillcaddy-managerManage Skillcaddy libraries and project skill links. Use for discovery, enable/disable, audits, maintenance, bootstrap, or Web/TUI access.
| 1 | # Skillcaddy Manager |
| 2 | |
| 3 | Treat Skillcaddy as a central skill library with project-level symlink activation. Keep one execution loop across every branch: **state -> route -> preflight -> act -> verify**. |
| 4 | |
| 5 | ## Core Loop |
| 6 | |
| 7 | 1. Resolve the Skillcaddy repository and target project. Default the project to the current working directory only when the user did not provide one. |
| 8 | - Complete when both absolute paths are known. |
| 9 | 2. For recommendations, audits, or mutations, read `GET /api/state?projectPath=<encoded-path>`. If the server is unavailable, inspect the equivalent paths listed under **Core Model**. |
| 10 | - Complete when repository, project, global, Claude, metadata, and `advice` state relevant to the request are known. |
| 11 | 3. Route to the required branch and load only its reference; load multiple references only when the request combines branches: |
| 12 | - Discovery, enable/disable, audit, health, GitHub update, bootstrap, Web/TUI: [OPERATIONS.md](references/OPERATIONS.md) |
| 13 | - Recommendations: [RECOMMENDATION_GUIDE.md](references/RECOMMENDATION_GUIDE.md) |
| 14 | - Notes, tags, `autoEnable`, migration, batch Chinese notes: [METADATA.md](references/METADATA.md) |
| 15 | - Complete when the selected branch, target identities, and completion criterion are explicit. |
| 16 | 4. For a mutation, apply the **Mutation Gate** before acting. Prefer the existing API, TUI, or repository commands over ad hoc filesystem changes. |
| 17 | - Complete when the preflight accounts for every affected item and all blocking ownership or alias issues are resolved. |
| 18 | 5. Execute the narrowest requested operation, rescan state, and report the observed result. |
| 19 | - Complete when the post-operation state proves every requested item succeeded, remained unchanged, was skipped, or failed with a stated reason. |
| 20 | |
| 21 | ## Core Model |
| 22 | |
| 23 | | Scope | Location | Role | |
| 24 | |---|---|---| |
| 25 | | Bundled | `skills/<name>/` | Skills shipped by this repository | |
| 26 | | Central | `official/`, `github/`, `personal/`, `archived/` | Source libraries | |
| 27 | | Project | `<project>/.agents/skills/` | Codex-compatible activation symlinks | |
| 28 | | Project Claude | `<project>/.claude/skills/` | Claude compatibility symlinks | |
| 29 | | Global | `~/.agents/skills/`, `~/.claude/skills/` | User-level skills that may conflict or shadow | |
| 30 | | Collection setup | `collection-metadata/<source>/<collection>.json` | Tracked, read-only setup contract and readiness checks | |
| 31 | |
| 32 | Preserve these invariants: |
| 33 | |
| 34 | - Enable and disable operations create or remove project symlinks; source skill directories remain intact. |
| 35 | - `archived/` skills require an explicit user request. |
| 36 | - GitHub-backed source directories remain free of Skillcaddy metadata; write catalog metadata to the sidecar store. |
| 37 | - Collection activation and project readiness are separate: setup may be missing after links are enabled. |
| 38 | - Interactive setup is never executed silently; obtain confirmation and let the declared setup skill own project edits. |
| 39 | - Repository behavior in `lib/skillStore.js`, `lib/projectActions.js`, and `lib/claudeStore.js` is authoritative when documentation and implementation differ. |
| 40 | - The fixed default Web manager URL is `http://127.0.0.1:4173`. |
| 41 | |
| 42 | ## Mutation Gate |
| 43 | |
| 44 | Before changing state, present a compact preflight containing: |
| 45 | |
| 46 | | Action | Skill | Source/collection | Alias | Target path | Advice/result | |
| 47 | |---|---|---|---|---|---| |
| 48 | |
| 49 | Account for skills that will be changed, left unchanged, skipped, or rejected. Include relevant `/api/state.advice` and metadata writes. |
| 50 | |
| 51 | Require confirmation before proceeding when: |
| 52 | |
| 53 | - one request matches multiple skills and the user has not selected one; |
| 54 | - a project alias points to a different target; |
| 55 | - the project entry is not a symlink or is externally managed; |
| 56 | - a GitHub source has uncommitted changes before update; |
| 57 | - the request reaches into `archived/` without naming the archived target; |
| 58 | - the request would delete a source skill rather than a project link; |
| 59 | - an advice item exposes a destructive or ownership ambiguity. |
| 60 | - an affected collection reports missing or partial interactive setup. |
| 61 | |
| 62 | Surface informational duplicate-name and global-shadowing advice, but do not block solely on it. Use the full skill ID and a confirmed alias to resolve duplicates. |
| 63 | |
| 64 | ## Reporting |
| 65 | |
| 66 | For summaries, distinguish repository availability, project enablement, global presence, Claude compatibility, and unmanaged or broken state. Prefer: |
| 67 | |
| 68 | | Action | Skill | Source | Alias | Result | Notes | |
| 69 | |---|---|---|---|---|---| |
| 70 | |
| 71 | End with the verification performed: rescan/API state, validation command, tests, or server URL. |