feat(mods): model-router active in every session — skills-dir link, mods suite, doctor section, CLAUDE.md
Tracked relative symlink skills/model-router -> ../mods/model-router: Claude Code loads the mod in place as model-router@skills-dir wherever link.sh links ~/.claude/skills (no CLAUDE_CODE_PLUGIN_DIRS: absolute paths in the tracked settings.json). Engine-laid mods/*/tsconfig.json gitignored. lib/tests/mods.test.sh: manifest name, link target, claude plugin validate and test per mod, capability-probed, time-bounded, SKIP with reason. doctor.sh: fail-soft Mods section (link by -ef, one guarded plugin list). CLAUDE.md: mods/ section (loading, per-machine enabled:false switch, dev-copy shadowing, tests).
This commit is contained in:
@@ -59,6 +59,28 @@ Gotcha, learned the hard way: `git rm --cached` keeps the working file,
|
||||
but if the branch you merge into still tracks it, the merge deletes it
|
||||
from disk. Untrack and merge, then restore with the command above.
|
||||
|
||||
## mods/ — function-hooks plugins (Claude Code mods)
|
||||
|
||||
A mod lives in `mods/<name>/` (`.claude-plugin/plugin.json` + hooks). It
|
||||
loads through the tracked relative symlink `skills/<name>` -> `../mods/<name>`
|
||||
(`~/.claude/skills` links to `skills/`) as `<name>@skills-dir`, in place,
|
||||
live at the next session or `/reload-plugins`. New mod: `ln -s ../mods/<name>
|
||||
skills/<name>` from the repo root (guard with `[ -L ]`, a re-run nests a link).
|
||||
Not `CLAUDE_CODE_PLUGIN_DIRS` (absolute path, settings `env` has no `$HOME`
|
||||
expansion, settings.json is tracked), nor a local marketplace (`add` writes
|
||||
an absolute path into settings.json).
|
||||
- The engine lays `mods/<name>/tsconfig.json` and `.claude-plugin/types/`;
|
||||
both are gitignored.
|
||||
- Optional user config: `~/.claude/<name>.json`. Its `"enabled": false` is the
|
||||
per-machine off switch (untracked). `"<name>@skills-dir": false` in
|
||||
`enabledPlugins` also works but lands in the TRACKED settings.json and
|
||||
dirties every machine's tree.
|
||||
- A dev copy of the same name (`--plugin-dir`, hot-reload link in
|
||||
`~/.claude/dev-mods/<session>/`) shadows the skills-dir copy for that
|
||||
session: remove it before reading `/reload-plugins` as a test of the link.
|
||||
- Tests: `make test suite=lib/tests/mods.test.sh` (manifest, link,
|
||||
`claude plugin validate`, `claude plugin test`). `doctor.sh` has a Mods section.
|
||||
|
||||
## Transient planning artifacts
|
||||
|
||||
`docs/superpowers/specs/**` and `docs/superpowers/plans/**` are run-time
|
||||
|
||||
Reference in New Issue
Block a user