{"kind":"Skill","metadata":{"namespace":"community","name":"acreadiness-generate-instructions","version":"0.1.0"},"spec":{"description":"Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.","files":{"SKILL.md":"---\nname: acreadiness-generate-instructions\ndescription: 'Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.'\nargument-hint: \"[--output .github/copilot-instructions.md|AGENTS.md] [--strategy flat|nested] [--areas | --area \u003cname\u003e] [--apply-to \u003cglob\u003e] [--claude-md] [--dry-run]\"\n---\n\n# /acreadiness-generate-instructions — write AI agent instructions\n\nUse this skill whenever the user wants to **create**, **regenerate**, or **refresh** their custom instructions for AI coding agents (Copilot, Claude, etc.). This is the *Generate* step in AgentRC's **Measure → Generate → Maintain** loop and the single highest-leverage action for the **AI Tooling** pillar.\n\n## Output options\n\nVS Code recognises several instruction file types — AgentRC generates the most common ones:\n\n| File | Scope | When to use |\n|---|---|---|\n| `.github/copilot-instructions.md` | Always-on, whole workspace | **Default** — VS Code Copilot's native instruction file |\n| `AGENTS.md` | Always-on, whole workspace | Multi-agent repos (Copilot + Claude + others) |\n| `.github/instructions/*.instructions.md` | Scoped by `applyTo` glob | Per-area / per-language rules in monorepos |\n| `CLAUDE.md` | Claude-specific | Add via `--claude-md` (nested only) |\n\n## Strategies\n\n- **`flat`** *(default)* — single `.github/copilot-instructions.md` at the chosen path. Simple, easy to review.\n- **`nested`** — hub at `.github/copilot-instructions.md` + per-topic detail files at `.github/instructions/\u003ctopic\u003e.instructions.md`, each with an `applyTo` glob so VS Code only loads the topic when it's relevant. Better for large or multi-stack repos.\n\n\u003e **Why `.github/instructions/` and not `.agents/`?** AgentRC's default nested layout writes to `.agents/`, which is the right home for *agent-agnostic* repos (Copilot + Claude + Cursor reading `AGENTS.md`). For VS Code Copilot specifically, the native location is `.github/instructions/` with `applyTo` frontmatter — that's what Copilot auto-discovers. This skill rewrites AgentRC's nested output to the VS Code-native location whenever the main output is `.github/copilot-instructions.md`. If you instead chose `--output AGENTS.md`, nested keeps AgentRC's default `.agents/` layout.\n\nFor monorepos, generate **area-scoped** instructions with `--areas`, `--area \u003cname\u003e`, or `--areas-only`. Areas are defined in `agentrc.config.json`. Per-area output is written as VS Code `.instructions.md` files with an `applyTo` glob (see below).\n\n### Topic vs area `.instructions.md` files\n\nBoth end up in `.github/instructions/` but they answer different questions:\n\n| Kind | Filename example | `applyTo` example | Where it comes from |\n|---|---|---|---|\n| **Topic** (nested) | `testing.instructions.md` | `**/*.{test,spec}.{ts,tsx,js}` | AgentRC `--strategy nested` topic split |\n| **Area** (monorepo) | `frontend.instructions.md` | `apps/frontend/**` | `agentrc.config.json` areas + `--areas` |\n\nYou can have both at once: a nested set of topic files plus per-area files for a monorepo.\n\n## Per-area files with `applyTo`\n\nWhen the user opts into areas, emit one VS Code-native `.instructions.md` file per area at `.github/instructions/\u003carea\u003e.instructions.md`. Each file MUST start with frontmatter declaring the glob the rules apply to:\n\n```markdown\n---\napplyTo: \"apps/frontend/**\"\n---\n\n# Frontend area instructions\n\n…AgentRC-generated content for this area…\n```\n\nWorkflow:\n\n1. **Read `agentrc.config.json`** to discover declared areas and their `paths` / globs. If `paths` is missing, ask the user for the glob (e.g. `src/api/**`).\n2. **Run `agentrc instructions --areas`** (or `--area \u003cname\u003e`) to produce the per-area body content.\n3. **Wrap each area's content** in `.github/instructions/\u003carea\u003e.instructions.md` with the `applyTo` frontmatter taken from the area's `paths`. If the user passed `--apply-to \u003cglob\u003e` on a single-area call, use that glob verbatim.\n4. **Leave the main file alone** — the root `.github/copilot-instructions.md` stays as the always-on instructions; `.instructions.md` files only kick in for matching paths.\n\nNaming: lowercase, kebab-case area name. Examples: `.github/instructions/frontend.instructions.md`, `.github/instructions/api.instructions.md`, `.github/instructions/infra.instructions.md`.\n\n## Steps\n\n1. **Pick the target file**. **Default to `.github/copilot-instructions.md`.** Switch to `AGENTS.md` only if the user mentions multi-agent / Claude / Cursor support.\n2. **Always ask which strategy to use** — `flat` or `nested` — unless the user already specified one in their message or via `--strategy`. Present the trade-off briefly:\n   - **Flat** *(default)* — one `.github/copilot-instructions.md`. Simple, easy to review in a single PR. Best for small/medium repos with one stack.\n   - **Nested** — hub `.github/copilot-instructions.md` + per-topic `.github/instructions/\u003ctopic\u003e.instructions.md` files (each with an `applyTo` glob so VS Code only loads them when relevant). Best for large or multi-stack repos. Add `--claude-md` to also emit `CLAUDE.md`.\n   Recommend `nested` proactively when the repo has \u003e 5 top-level directories, multiple stacks, or already uses a monorepo tool (turbo/nx/pnpm workspaces).\n3. **Detect monorepo areas** by reading `agentrc.config.json`. If areas exist, ask the user whether they want **per-area `.instructions.md` files with `applyTo`** in addition to the root file. Default to \"yes\" when `agentrc.config.json` declares areas.\n4. **Run dry-run first** so the user can preview:\n   ```bash\n   npx -y github:microsoft/agentrc instructions --output \u003cfile\u003e --strategy \u003cflat|nested\u003e [--areas|--area \u003cname\u003e] [--claude-md] --dry-run\n   ```\n5. **Show a short summary** of what would change — files that would be created or overwritten, area count + their `applyTo` globs, model used (default `claude-sonnet-4.6`).\n6. **On confirmation, run the same command without `--dry-run`** (and optionally `--force` if files already exist).\n7. **Post-process layout for Copilot output**:\n   - **If `--output` ends in `copilot-instructions.md` and strategy is `nested`**: move/rewrite AgentRC's `.agents/\u003ctopic\u003e.md` files to `.github/instructions/\u003ctopic\u003e.instructions.md`. Add frontmatter to each file with an appropriate `applyTo` glob (see \"Topic applyTo defaults\" below). Delete the now-empty `.agents/` directory.\n   - **If `--areas` was used**: also write `.github/instructions/\u003carea\u003e.instructions.md` for every area, using each area's `paths` from `agentrc.config.json` as the `applyTo` glob (override with `--apply-to` for single-area calls).\n   - **If `--output AGENTS.md`** was chosen: keep AgentRC's native `.agents/` layout for nested — agent-agnostic readers expect it there.\n   Create the `.github/instructions/` directory if missing.\n\n### Topic `applyTo` defaults\n\nWhen promoting AgentRC's nested topic files to `.instructions.md`, use these defaults unless the user specifies otherwise:\n\n| Topic | Default `applyTo` |\n|---|---|\n| `testing` | `**/*.{test,spec}.{ts,tsx,js,jsx,mjs,cjs}` |\n| `style` / `code-quality` / `formatting` | `**/*.{ts,tsx,js,jsx,mjs,cjs,py,go,rs,java,kt,cs}` |\n| `build` / `ci` | `**/{package.json,turbo.json,nx.json,.github/workflows/**}` |\n| `docs` | `**/*.md` |\n| `security` | `**` |\n| anything else / hub-level | `**` |\n8. **Verify** by reading the generated file(s) back and showing the user a 1-paragraph synopsis: stack detected, conventions captured, length, list of `.instructions.md` files with their globs.\n9. **Suggest next steps**:\n   - Re-run the `assess` skill to confirm the AI Tooling pillar score improved.\n   - If the user already has both `copilot-instructions.md` and `AGENTS.md`, recommend consolidating to a single source of truth (AgentRC flags this at maturity Level 2+).\n\n## Notes\n\n- AgentRC reads your **actual code** — no templates. Output reflects detected languages, frameworks, and conventions.\n- `--claude-md` (nested strategy only) also emits `CLAUDE.md`.\n- VS Code applies `.instructions.md` files automatically when the active file matches `applyTo`. The root `.github/copilot-instructions.md` always loads.\n- Never run this skill non-interactively in CI; instructions are part of the repo and should land via PR.\n"},"import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/tree/541b7819d8c3545c6df122491af4fa1eae415779/plugins/acreadiness-cockpit/skills/acreadiness-generate-instructions"}},"content_hash":[13,116,126,22,57,47,100,93,63,143,212,88,194,0,1,30,110,95,12,229,118,47,227,182,91,47,204,160,236,23,17,122],"trust_level":"unsigned","yanked":false}
