‹ 首页

acreadiness-generate-instructions

@boshi-xixixi · 收录于 5 天前 · 上游提交 2 个月前

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.

适合你,如果需要在项目中配置 AI 编码助手的指令文件。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add boshi-xixixi/traeskill/acreadiness-generate-instructions
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- boshi-xixixi/traeskill/acreadiness-generate-instructions
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify boshi-xixixi/traeskill/acreadiness-generate-instructions
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
254GitHub stars
~1.9K上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 9cf38e6 · 表述以原文为准
它做什么

安装后,Claude 能根据你的代码库自动生成 AI 编程助手的指令文件,例如 .github/copilot-instructions.md,支持单文件或按主题/区域拆分成多个 .instructions.md 文件,并自动设置文件作用范围。

什么时候触发

当你要求“生成”或“刷新”AI 助手指令文件,或者在运行了 /acreadiness-assess 评估后需要改进 AI 工具支柱时触发。

装好后可以这样说
Claude 会创建主文件和多主题文件。
技能原文 SKILL.md作者撰写 · MIT · 9cf38e6

/acreadiness-generate-instructions — write AI agent instructions

Use 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.

Output options

VS Code recognises several instruction file types — AgentRC generates the most common ones:

| File | Scope | When to use | |---|---|---| | .github/copilot-instructions.md | Always-on, whole workspace | Default — VS Code Copilot's native instruction file | | AGENTS.md | Always-on, whole workspace | Multi-agent repos (Copilot + Claude + others) | | .github/instructions/*.instructions.md | Scoped by applyTo glob | Per-area / per-language rules in monorepos | | CLAUDE.md | Claude-specific | Add via --claude-md (nested only) |

Strategies
  • flat (default) — single .github/copilot-instructions.md at the chosen path. Simple, easy to review.
  • nested — hub at .github/copilot-instructions.md + per-topic detail files at .github/instructions/<topic>.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.
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.

For monorepos, generate area-scoped instructions with --areas, --area <name>, 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).

Topic vs area .instructions.md files

Both end up in .github/instructions/ but they answer different questions:

| Kind | Filename example | applyTo example | Where it comes from | |---|---|---|---| | Topic (nested) | testing.instructions.md | **/*.{test,spec}.{ts,tsx,js} | AgentRC --strategy nested topic split | | Area (monorepo) | frontend.instructions.md | apps/frontend/** | agentrc.config.json areas + --areas |

You can have both at once: a nested set of topic files plus per-area files for a monorepo.

Per-area files with applyTo

When the user opts into areas, emit one VS Code-native .instructions.md file per area at .github/instructions/<area>.instructions.md. Each file MUST start with frontmatter declaring the glob the rules apply to:

---
applyTo: "apps/frontend/**"
---

# Frontend area instructions

…AgentRC-generated content for this area…

Workflow:

  1. 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/**).
  2. Run agentrc instructions --areas (or --area <name>) to produce the per-area body content.
  3. Wrap each area's content in .github/instructions/<area>.instructions.md with the applyTo frontmatter taken from the area's paths. If the user passed --apply-to <glob> on a single-area call, use that glob verbatim.
  4. 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.

Naming: lowercase, kebab-case area name. Examples: .github/instructions/frontend.instructions.md, .github/instructions/api.instructions.md, .github/instructions/infra.instructions.md.

Steps
  1. Pick the target file. Default to .github/copilot-instructions.md. Switch to AGENTS.md only if the user mentions multi-agent / Claude / Cursor support.
  2. Always ask which strategy to useflat or nested — unless the user already specified one in their message or via --strategy. Present the trade-off briefly:
  3. Flat (default) — one .github/copilot-instructions.md. Simple, easy to review in a single PR. Best for small/medium repos with one stack.
  4. Nested — hub .github/copilot-instructions.md + per-topic .github/instructions/<topic>.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. Recommend nested proactively when the repo has > 5 top-level directories, multiple stacks, or already uses a monorepo tool (turbo/nx/pnpm workspaces).
  5. 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.
  6. Run dry-run first so the user can preview: ```bash npx -y github:microsoft/agentrc instructions --output <file> --strategy <flat|nested> [--areas|--area <name>] [--claude-md] --dry-run ```
  7. 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).
  8. On confirmation, run the same command without --dry-run (and optionally --force if files already exist).
  9. Post-process layout for Copilot output:
  10. If --output ends in copilot-instructions.md and strategy is nested: move/rewrite AgentRC's .agents/<topic>.md files to .github/instructions/<topic>.instructions.md. Add frontmatter to each file with an appropriate applyTo glob (see "Topic applyTo defaults" below). Delete the now-empty .agents/ directory.
  11. If --areas was used: also write .github/instructions/<area>.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).
  12. If --output AGENTS.md was chosen: keep AgentRC's native .agents/ layout for nested — agent-agnostic readers expect it there. Create the .github/instructions/ directory if missing.
Topic applyTo defaults

When promoting AgentRC's nested topic files to .instructions.md, use these defaults unless the user specifies otherwise:

| Topic | Default applyTo | |---|---| | testing | **/*.{test,spec}.{ts,tsx,js,jsx,mjs,cjs} | | style / code-quality / formatting | **/*.{ts,tsx,js,jsx,mjs,cjs,py,go,rs,java,kt,cs} | | build / ci | **/{package.json,turbo.json,nx.json,.github/workflows/**} | | docs | **/*.md | | security | ** | | anything else / hub-level | ** |

  1. 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.
  2. Suggest next steps:
  3. Re-run the assess skill to confirm the AI Tooling pillar score improved.
  4. 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+).
Notes
  • AgentRC reads your actual code — no templates. Output reflects detected languages, frameworks, and conventions.
  • --claude-md (nested strategy only) also emits CLAUDE.md.
  • VS Code applies .instructions.md files automatically when the active file matches applyTo. The root .github/copilot-instructions.md always loads.
  • Never run this skill non-interactively in CI; instructions are part of the repo and should land via PR.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。