Copilot Customization Generation
Generate a complete, interconnected suite of VS Code Copilot customization files for a target repository based on a repo analysis report.
When to Use
- Generating Copilot agent system files for a target repo
- Deciding which primitives to create based on scan data
- Ensuring generated files follow correct syntax, quality rules, and interconnection patterns
Procedure
Step 1 — Determine What to Generate
Based on the scan report, decide which files are needed using these signal rules:
Agents (always generate at least planner + implementer)
| Signal | Agent to Create |
|---|---|
| Always | planner.agent.md — read-only research and planning |
| Always | implementer.agent.md — code writing and editing |
| Test framework detected | tester.agent.md — test writing and execution |
| CI/CD or deploy config detected | deployer.agent.md — deployment workflows |
docs/ folder or extensive README |
docs.agent.md — documentation writing |
| Large codebase (500+ files) or security patterns | reviewer.agent.md — code review and security |
Skills (generate when workflow is multi-step or shared)
| Signal | Skill to Create |
|---|---|
| Test framework detected | run-tests — shared by tester + reviewer agents |
| Lint/format tools detected | lint-format — shared across all editing agents |
| CI/CD detected | deploy — used by deployer agent |
| DB/migration patterns detected | db-migrations — used by implementer agent |
Instructions (generate per concern)
| Signal | Instruction to Create |
|---|---|
| Primary language detected | {language}-conventions.instructions.md with applyTo for language files |
| Test framework detected | testing.instructions.md with applyTo: "**/*.test.*" or equivalent |
| API routes/endpoints detected | api-patterns.instructions.md with applyTo for API directory |
| Component patterns (React/Vue/etc.) | component-patterns.instructions.md with applyTo for component files |
| Security patterns detected | security.instructions.md — on-demand, no applyTo |
| DB patterns detected | database.instructions.md — on-demand or scoped |
Prompts (generate for common tasks)
| Signal | Prompt to Create |
|---|---|
| Test framework detected | generate-tests.prompt.md routed to tester agent |
| Component framework detected | scaffold-component.prompt.md routed to implementer |
| API framework detected | create-endpoint.prompt.md routed to implementer |
| Always | review-code.prompt.md routed to reviewer (if exists) or planner |
| Docs folder detected | generate-docs.prompt.md routed to docs agent |
Hooks (generate conservatively)
| Signal | Hook to Create |
|---|---|
| Formatter config exists (prettier, black, rustfmt) | post-edit-format.json — PostToolUse on edit |
| Dangerous command risk | block-dangerous.json — PreToolUse on execute |
Workspace Instructions (always generate)
Always generate copilot-instructions.md as the foundation.
Step 2 — Design Interconnections
Before generating, plan the connections:
- Handoff chains: Design agent-to-agent flow
- Typical: Planner → Implementer → Reviewer → Tester
- Each agent's
handoffs:field points to the next agent(s)
- Skill sharing: Map which agents use which skills
- Skills are discovered by description — ensure agent instructions reference the skill's purpose
- Prompt routing: Each prompt's
agent:field points to the correct agent - Instruction discovery: Ensure instruction
descriptionfields contain keywords agents will encounter
Step 3 — Generate Files
Use the reference templates for each primitive type:
- Agent templates
- Skill templates
- Instruction templates
- Prompt templates
- Hook templates
- Workspace instruction templates
Generate in dependency order:
copilot-instructions.md(foundation — other files reference project context from here).github/instructions/(conventions — agents discover these).github/skills/(capabilities — agents reference these).github/agents/(roles — reference skills, have handoffs).github/prompts/(entry points — route to agents).github/hooks/(enforcement — independent)
Step 4 — Validate Cross-References
After generation, verify:
- Every
handoffs.agentvalue matches an existing.agent.mdfilename (minus extension) - Every
agent:in prompts matches an existing agent name - Every skill
namematches its folder name - All
applyToglobs match actual file patterns in the repo - No duplicate or conflicting instructions
- Descriptions are keyword-rich and contain "Use when..." patterns
- Tool sets are minimal — each agent has only the tools it needs
Quality Rules
- Descriptions are the discovery surface — include trigger phrases that agents will encounter
- One concern per instruction file — never mix testing + API + styling
- Minimal tool sets — planner:
[read, search, web], implementer:[read, edit, search, execute], reviewer:[read, search] - Link, don't embed — reference existing project docs rather than copying content
- Quote values with colons —
description: "Use when: doing X"notdescription: Use when: doing X - Skills have folder discipline —
namemust match folder, use./for relative paths - Scale to complexity — small repos get 2-3 agents, large repos get the full chain
Source: manojkumardesai/adas — distributed by TomeVault.