import-skilllisted
Install: claude install-skill MichaelHolley/cc-plugins
# Inputs
Expected from the user:
- **repo owner** (required), e.g. `mattpocock`
- **repo name** (required), e.g. `skills`
- **skill name** (optional) — the skill's directory name, e.g. `grilling`. Without it, list the repo's skills and ask which to import.
Intent is either **link** (add a new entry) or **update** (re-pin an existing entry to a newer sha). Infer it from whether the skill already appears in `.claude-plugin/marketplace.json`; ask only if the user's words contradict what you find.
# High-level behavior
1. Read `.claude-plugin/marketplace.json` and check whether the skill already has an entry. This decides link vs update.
2. Resolve the repo's default branch and its HEAD sha (see [Discovery](#discovery)).
3. Locate the skill's `SKILL.md` at that sha. Every candidate path must be confirmed to exist at the resolved sha — never a path from memory or from an existing entry.
4. Read the skill's frontmatter `name` and `description` at that sha.
5. Resolve the author's display name.
6. Write the entry (see [Entry shape](#entry-shape)) into the `plugins` array, then verify the file still parses as JSON.
7. Report: name, path, sha (short), and — on update — the old sha it moved from.
Done when the entry exists with a full 40-character sha, its `path` is confirmed present at that sha, and the JSON parses.
# Discovery
`?` needs quoting in zsh — quote every URL that carries a query string.
```sh
# Default branch + HEAD sha (the pin)
gh api repos/<owner>/<repo> --jq '