skill-package-setup
Skill1 starsChanged 5 months agoMITView on GitHub
Canonical, agent-agnostic policy for WHERE a package's AI agent skills live and HOW they are distributed so they're discoverable by `gh skill` (and any agent host — Copilot, Cursor, Codex, Gemini, Claude) AND, where wanted, shipped with `pip install`. Use this skill to set up skills for a new package, migrate an existing repo to the canonical layout, consolidate skills scattered across `.claude/skills/` / `skills/` / `{pkg}/data/skills/`, make every SKILL.md spec-clean, or answer "where should my package's skills live". Also the authority other skills defer to (e.g. wads-skillify). Triggers on "set up skills", "where should skills live", "make skills gh-skill installable", "migrate/restructure the skills layout", "skillify this repo". Maintainer skill.
- Installs packages
In this repository5 other files it gives its agents.
- skill-buildSkill
- skill-docsSkill
- skill-enableSkill
- skill-manageSkill
- skill-syncSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 70
No skills anywhere → Flow A (new).
- Very specific: line 79
Add relative per-skill symlinks in .claude/skills/ (or skill link-skills .).
- Very specific: line 83
If pip-shipping, wire package-data (skill-enable owns the mechanics).
- Very specific: line 144
Always gh skill preview third-party skills before installing (not verified by GitHub).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill package setup — canonical layout & distribution
The source of truth for where a package's skills live and how they ship.
Agent-agnostic; other tooling (e.g. wads-skillify) defers here for layout and
spec compliance. Two flows: set up a new package, or migrate an existing
one. Detail lives in the references — read on demand:
references/canonical-layout-and-distribution.md— the discovery facts, the full distribution matrix, the SKILL.md spec, and thegh skillsurface.references/migration-runbook.md— exact commands for both flows.
Golden rule: observe, don't invent. Every layout move is shown as a plan before it's applied; never break tests without asking.
Who discovers what (why layout matters)
| Location | gh skill discovers? | Claude Code reads? | Ships via pip? |
{pkg}/data/skills/<name>/ | yes — gh skill matches any non-hidden **/skills/*/SKILL.md (nested-prefix glob) | no | yes (inside the package) |
skills/<name>/ (repo root) | yes — same glob, the ecosystem-wide convention | no | no |
.claude/skills/<name>/ | no — hidden dirs skipped (unless --allow-hidden-dirs) | yes | no |
.agents/skills/<name>/ | install destination for Copilot/Cursor/Codex/Gemini | no | no |
Key fact (confirmed against the gh skill manual): gh skill discovers a
skills/ directory at ANY non-hidden depth, so {pkg}/data/skills/ is a
first-class gh skill source — not a fallback. No single location serves
everyone, though: Claude Code reads only .claude/skills/. Hence the rule.
The rule (memorize this)
Real skill files live in exactly ONE non-hidden location, with relative
per-skill symlinks in .claude/skills/. Pick the location:
| Repo kind | Canonical real-files location |
Pip-installable package whose skills should ship with pip install | {pkg}/data/skills/<name>/ — ships via pip AND gh skill-discoverable. One location serves both channels. |
| Everything else (apps, skill-only repos, dev/maintainer-only skills) | skills/<name>/ at the repo root — the ecosystem convention. |
- Never both. Real files in both
skills/and{pkg}/data/skills/meansgh skillreports duplicate skills. The Step-0findin the runbook is your duplicate check. .claude/skills/<name>is a relative symlink into the chosen location (../../skills/<name>or../../<pkg>/data/skills/<name>) — Claude Code doesn't read the canonical dirs, so this bridge is required. Symlink per skill, never the whole.claude/skills/dir (Claude writes.system/files there).- Don't publish symlinks as the source. Whether
gh skilldereferences a committed symlink at the source path is undocumented — keep real files in the canonical path; use symlinks only as the.claude/skills/bridge.
Decide: new vs migrate
- Inventory:
find . -name SKILL.md -not -path './.git/*'+ls -la .claude/skills. - No skills anywhere → Flow A (new). Skills already exist → Flow B (migrate).
Flow A — new package
- Pick the canonical location per the rule (pip-shipped →
{pkg}/data/skills/, elseskills/). - Scaffold
…/<pkg>-quickstart/SKILL.mdwith spec-valid frontmatter (name== folder name, lowercase[a-z0-9-];description≤ 1024 chars, packed with trigger keywords). Use skill-build/skill-creator for content. - Add relative per-skill symlinks in
.claude/skills/(orskill link-skills .). - Classify audience (consumer vs developer) — reuse skill-enable's signal
lists. Prefix maintainer skills
<pkg>-dev-…; putmetadata.audiencein frontmatter. - If pip-shipping, wire package-data (skill-enable owns the mechanics).
- README "Skills" section with
gh skill install <owner>/<repo> <name>lines (skill-docs can generate it). - Validate (
gh skill publish --dry-run, orskill validate/skills-ref validate), thengh skill publishand tag a release for@vX.Y.Zpinning.
Flow B — migrate an existing repo
Full commands in references/migration-runbook.md. Shape:
- Inventory real files vs symlinks; detect duplicates across locations.
- Choose the one canonical location (rule above).
- Relocate real dirs there with
git mv(e.g. out of.claude/skills/), leaving relative symlinks behind. - Consolidate any duplicates so real files exist in exactly one place.
- Fix spec conformance (checklist below).
- Validate, update the README, publish.
Spec-conformance checklist (either flow)
- Folder name equals
name:;namelowercase[a-z0-9-], ≤64 chars, no leading/trailing/double hyphens (renamefoo_bar→foo-bar+ the folder). - Only spec top-level keys:
name,description,license,compatibility,metadata,allowed-tools. Custom keys (notablyaudience) go undermetadata:. No Claude-only keys (when_to_use,argument-hint,paths,hooks, …) in portable skills. Neveragent-version. allowed-tools, if present, is a space-separated string, not a YAML list.description≤ 1024 chars (what it does + when to use it); body < 500 lines (push detail toreferences/).- Provenance keys (
github-repo,github-path,github-ref,github-pinned,github-tree-sha) are never hand-authored —gh skill installwrites them on the consumer's machine.
Skills that should also run as subagents
A skill and a subagent are the same instructions in two runtimes; Claude Code
preloads a skill's full body into a subagent through the agent file's skills:
field. So a skill that does bulky or read-heavy work, needs a tool restriction or a
cheaper model, or already has a hand-written agent twin, declares the twin in its
own frontmatter and lets opsward render and check it (opsward ADR 0009):
metadata:
subagent: true # optional: subagent-tools, subagent-model,
# subagent-reply-lines, subagent-nameThese keys are spec-legal (metadata takes arbitrary string pairs) and every other
host ignores them, so the skill stays portable. opsward generate --write emits
.claude/agents/<name>.md; opsward maintain reports a twin that is missing, stale
or hand-written. Guideline skills stay inline only; a skill that is only ever
delegated may use Claude's context: fork instead. The opsward-subagents skill
applies the criterion to a repo.
Distribution
- Primary:
gh skill install <owner>/<repo> <name> --agent <host>— works for every agent host; supports pinning (@vX.Y.Z/--pin <sha>) andgh skill update. - Pip-shipped packages additionally deliver skills inside the wheel
(
{pkg}/data/skills/); document the offline link step too. - Always
gh skill previewthird-party skills before installing (not verified by GitHub).
Related skills
- wads-skillify — wads-fleet repo-improvement entry; defers to this skill for layout & compliance, adds the wads assessment baseline + dispatch.
- skill-enable — pip package-data wiring + audience classification.
- skill-build / skill-creator — author skill content.
- skill-docs — README "Skills" section.
- skill-sync — keep skill content in sync with the code it documents.
- opsward-subagents — which skills should also run as subagents; generates
and checks the twins (in the
opswardpackage).
Full gh skill surface and Agent Skills spec:
references/canonical-layout-and-distribution.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

