Drops the dual-surface "skills/ + .github/prompts/" framing in favour of the Copilot cloud agent's documented .github/skills/<name>/SKILL.md autodiscovery with description-matching routing. - replace .github/prompts/ mirror with .github/instructions/*.instructions.md path-scoped auto-apply - AGENTS.md becomes the single source of style; copilot-instructions.md reduced to a redirect + skills-menu for discoverability - add frontmatter spec table (name/description/license/allowed-tools) - restate handoff rationale as cloud-agent per-turn routing
5.4 KiB
5.4 KiB
name, description
| name | description |
|---|---|
| add-copilot-project-skill | Scaffold a project-specific skill set that guides contributors through a repo's repeatable, error-prone extension tasks — consumed by the GitHub Copilot cloud coding agent via the official .github/skills/ format, single-sourced from the repo's own docs, and backed by a mechanical validator. Tuned for config-driven pipelines (e.g. R `{targets}` projects). Use when the user says "add copilot project skills", "turn our onboarding/extension workflow into skills", "guide contributors to add datasets/modules/targets/chapters", "make a Copilot skill set for this repo", "/add-copilot-project-skill". |
add-copilot-project-skill
Build a set of project skills that live in the repo and lower the error rate
on its recurring extension tasks (add a data source, a module, a pipeline node,
a report section). The skills follow the GitHub Copilot cloud coding agent
skill format (docs):
.github/skills/<name>/SKILL.md, autodiscovered, routed by description
matching — no slash-invocation step required.
When to use
- A repo has a repeatable, multi-step extension task with silent failure modes (something declared but not registered; a name that must match in two places).
- The team uses GitHub Copilot's cloud agent (issue assignment /
@copilotin PR comments) and wants guided, in-repo workflows. - The user wants the SKILLS authoring conventions (frontmatter, "Use when" trigger, ≤100-line progressive-disclosure body) targeting Copilot.
Process
- Interview the repo, not just the user. Read the existing contributor
docs, the task runner (
justfile/make), and the directories a contributor edits. Identify, with the user:- the 3–6 extension tasks worth a skill each (the artifacts);
- which tasks compose into a larger one (the modalities/parents);
- the silent failure modes — invariants that, if violated, fail late or never (these become the validator). See project-validator.md.
- Build the validator first — everything else leans on it. A standalone
script (
scripts/validate_extension.*, wired asjust validate) that checks the invariants, scoped to changed files, tuned to pass clean on the main branch. Details + the AST-parsing and severity rules in project-validator.md. - Write the always-on conventions —
AGENTS.mdcarries the house style..github/copilot-instructions.mdis a thin redirect toAGENTS.mdplus a skills menu that names each skill with its trigger phrases (improves discoverability beyond description matching alone). Templates in skill-templates.md. - Author the leaf skills (one per artifact task) and parent skills (one
per composite/modality) at
.github/skills/<name>/SKILL.md. Each is a thin, conversation-style stub: interview first, point at live repo files as the example (zero drift), end at the validator, then hand off to the next skill by name and pause — the cloud agent decides per turn whether to load a sibling skill, so never auto-chain. Layout and the handoff rule are in layout-and-surfaces.md. - Add path-scoped instructions at
.github/instructions/<name>.instructions.mdwithapplyTo:globs. These auto-load when a contributor opens a matching file, surfacing the relevant skill's name and the project-specific gotchas without requiring an explicit prompt. - Verify: run
just validateon a clean tree (expect zero errors); confirm every path a skill cites actually exists; deliberately break one invariant and confirm the validator catches it, then revert. Assign a test issue to Copilot that should match one skill'sdescription:and confirm the agent's plan paraphrases lines from thatSKILL.md.
Output / done criteria
.github/skills/<name>/SKILL.mdfor each task (canonical, autodiscovered);.github/instructions/<name>.instructions.mdfor each editable surface;AGENTS.md(canonical house style);.github/copilot-instructions.md(thin redirect + skills menu); a workingscripts/validate_extension.*wired asjust validate.- Validator passes clean on the main branch and fires on an injected break.
- Skills reference live files, interview first, and hand off explicitly.
- The cloud agent loads the matching skill when given a trigger-phrase prompt.
Guardrails
- Single-source. The procedure lives in the repo's
docs/;SKILL.mdbodies are stubs that link to it.AGENTS.mdis the single source of style; never duplicate its content intocopilot-instructions.md. - No auto-chaining. Parents guide; they don't silently run children. The cloud agent's description matcher routes per turn — name the next skill and let the user (or the agent's own next decision) re-enter.
- Validator must pass clean first. Tune severities to the existing tree, or contributors learn to ignore it. Don't invent invariants the repo doesn't hold.
- Description matching is the discovery surface. Lead each
description:with "Use when the user says ..." trigger phrases. Two skills sharing a trigger collide; sharpen the differentiators. - This skill produces another repo's skills — keep its own SKILL.md generic; the worked specifics belong in the target repo's docs and live examples.