Files
msd-core/docs/skills/discovery-contract.md
Jakub Zych a9a7a328e6 refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD
across contents and paths, upstream package/repo coordinates -> @golem15/msd-core
and golem15com/msd-core. Deep links into upstream history, sibling upstream
packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is.

Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line,
package/plugin identity, regenerated lockfile, install-tree fixtures, derived
registries and benchmark baseline; migration checksum baseline re-locked
(MSD keeps its own install state, so no install had applied the old sums);
sort-order and regex-escaped expectations in tests adjusted.
2026-10-06 01:47:40 +02:00

87 lines
2.4 KiB
Markdown

# Skill Discovery Contract
> Canonical rules for scanning, inventorying, and rendering MSD skills.
## Root Categories
### Project Roots
Scan these roots relative to the project root:
- `.claude/skills/`
- `.agents/skills/`
- `.cursor/skills/`
- `.github/skills/`
- `./.codex/skills/`
These roots are used for project-specific skills and for the project `CLAUDE.md` skills section.
### Managed Global Roots
Scan these roots relative to the user home directory:
- `~/.claude/skills/`
- `~/.codex/skills/`
These roots are used for managed runtime installs and inventory reporting.
### Deprecated Import-Only Root
- `~/.claude/msd-core/skills/`
This root is kept for legacy migration only. Inventory code may report it, but new installs should not write here.
### Legacy Claude Commands
- `~/.claude/commands/msd/`
This is not a skills root. Discovery code only checks whether it exists so inventory can report legacy Claude installs.
## Normalization Rules
- Scan only subdirectories that contain `SKILL.md`.
- Read `name` and `description` from YAML frontmatter.
- Use the directory name when `name` is missing.
- Extract trigger hints from body lines that match `TRIGGER when: ...`.
- Treat `msd-*` directories as installed framework skills.
- Treat `~/.claude/msd-core/skills/` entries as deprecated/import-only.
- Treat `~/.claude/commands/msd/` as legacy command installation metadata, not skills.
## Scanner Behavior
### `src/profile-output.cts`
- Builds the project `CLAUDE.md` skills section.
- Scans project roots only.
- Skips `msd-*` directories so the project section stays focused on user/project skills.
- Adds `.codex/skills/` to the project discovery set.
### `src/init.cts`
- Generates the skill inventory object for `skill-manifest`.
- Reports `skills`, `roots`, `installation`, and `counts`.
- Marks `msd_skills_installed` when any discovered skill name starts with `msd-`.
- Marks `legacy_claude_commands_installed` when `~/.claude/commands/msd/` contains `.md` command files.
## Inventory Shape
`skill-manifest` returns a JSON object with:
- `skills`: normalized skill entries
- `roots`: the canonical roots that were checked
- `installation`: summary booleans for installed MSD skills and legacy Claude commands
- `counts`: small inventory counts for downstream consumers
Each skill entry includes:
- `name`
- `description`
- `triggers`
- `path`
- `file_path`
- `root`
- `scope`
- `installed`
- `deprecated`