# Copilot Generation

> Generate VS Code Copilot customization files for a target repository. Use when creating agents, skills, instructions, prompts, hooks, or workspace instructions based on a repo analysis report. Covers all 6 Copilot primitives with templates, quality rules, and interconnection patterns. Use when this capability is needed.

- Skill: `tomevault-io/copilot-generation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/copilot-generation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/copilot-generation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/copilot-generation

---


# 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:

1. **Handoff chains**: Design agent-to-agent flow
   - Typical: Planner → Implementer → Reviewer → Tester
   - Each agent's `handoffs:` field points to the next agent(s)
2. **Skill sharing**: Map which agents use which skills
   - Skills are discovered by description — ensure agent instructions reference the skill's purpose
3. **Prompt routing**: Each prompt's `agent:` field points to the correct agent
4. **Instruction discovery**: Ensure instruction `description` fields contain keywords agents will encounter

### Step 3 — Generate Files

Use the reference templates for each primitive type:

- [Agent templates](./references/agent-templates.md)
- [Skill templates](./references/skill-templates.md)
- [Instruction templates](./references/instruction-templates.md)
- [Prompt templates](./references/prompt-templates.md)
- [Hook templates](./references/hook-templates.md)
- [Workspace instruction templates](./references/workspace-templates.md)

Generate in dependency order:
1. `copilot-instructions.md` (foundation — other files reference project context from here)
2. `.github/instructions/` (conventions — agents discover these)
3. `.github/skills/` (capabilities — agents reference these)
4. `.github/agents/` (roles — reference skills, have handoffs)
5. `.github/prompts/` (entry points — route to agents)
6. `.github/hooks/` (enforcement — independent)

### Step 4 — Validate Cross-References

After generation, verify:
- [ ] Every `handoffs.agent` value matches an existing `.agent.md` filename (minus extension)
- [ ] Every `agent:` in prompts matches an existing agent name
- [ ] Every skill `name` matches its folder name
- [ ] All `applyTo` globs 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

1. **Descriptions are the discovery surface** — include trigger phrases that agents will encounter
2. **One concern per instruction file** — never mix testing + API + styling
3. **Minimal tool sets** — planner: `[read, search, web]`, implementer: `[read, edit, search, execute]`, reviewer: `[read, search]`
4. **Link, don't embed** — reference existing project docs rather than copying content
5. **Quote values with colons** — `description: "Use when: doing X"` not `description: Use when: doing X`
6. **Skills have folder discipline** — `name` must match folder, use `./` for relative paths
7. **Scale to complexity** — small repos get 2-3 agents, large repos get the full chain

---
> Source: [manojkumardesai/adas](https://github.com/manojkumardesai/adas) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

