|
| 1 | +--- |
| 2 | +name: agent-customization |
| 3 | +description: 'Create, update, review, fix, or debug VS Code agent customization files (.instructions.md, .prompt.md, .agent.md, SKILL.md, copilot-instructions.md, AGENTS.md). Use for: saving coding preferences; troubleshooting why instructions/skills/agents are ignored or not invoked; configuring applyTo patterns; defining tool restrictions; creating custom agent modes or specialized workflows; packaging domain knowledge; fixing YAML frontmatter syntax.' |
| 4 | +--- |
| 5 | + |
| 6 | +# Agent Customization |
| 7 | + |
| 8 | +## Decision Flow |
| 9 | + |
| 10 | +| Primitive | When to Use | |
| 11 | +|-----------|-------------| |
| 12 | +| Workspace Instructions | Always-on, applies everywhere in the project | |
| 13 | +| File Instructions | Explicit via `applyTo` patterns, or on-demand via `description` | |
| 14 | +| MCP | Integrates external systems, APIs, or data | |
| 15 | +| Custom Agents | Subagents for context isolation, or multi-stage workflows with tool restrictions | |
| 16 | +| Prompts | Single focused task with parameterized inputs | |
| 17 | +| Skills | On-demand workflow with bundled assets (scripts/templates) | |
| 18 | + |
| 19 | +## Quick Reference |
| 20 | + |
| 21 | +Consult the reference docs for templates, domain examples, advanced frontmatter options, asset organization, anti-patterns, and creation checklists. |
| 22 | + |
| 23 | +| Type | File | Location | Key Field | Reference | |
| 24 | +|------|------|----------|-----------|---------| |
| 25 | +| Workspace Instructions | `copilot-instructions.md`, `AGENTS.md` | `.github/` or root | N/A (always applies) | [Link](./primitives/workspace-instructions.md) | |
| 26 | +| File Instructions | `*.instructions.md` | `.github/instructions/` | `applyTo` (explicit), `description` (on-demand) | [Link](./primitives/instructions.md) | |
| 27 | +| Prompts | `*.prompt.md` | `.github/prompts/` | `description` (user-invoked) | [Link](./primitives/prompts.md) | |
| 28 | +| Custom Agents | `*.agent.md` | `.github/agents/` | `description` (on-demand), `infer` (subagent) | [Link](./primitives/agents.md) | |
| 29 | +| Skills | `SKILL.md` | `.github/skills/<name>/` | `description` (on-demand) | [Link](./primitives/skills.md) | |
| 30 | + |
| 31 | +**User-level**: `{{USER_PROMPTS_FOLDER}}/` (*.prompt.md, *.instructions.md, *.agent.md; not skills) |
| 32 | +Customizations roam with user's settings sync |
| 33 | + |
| 34 | +## Creation Process |
| 35 | + |
| 36 | +If you need to explore or validate patterns in the codebase, use a read-only subagent. If the ask-questions tool is available, use it to interview the user and clarify requirements. |
| 37 | + |
| 38 | +Follow these steps when creating any customization file. |
| 39 | + |
| 40 | +### 1. Determine Scope |
| 41 | + |
| 42 | +Ask the user where they want the customization: |
| 43 | +- **Workspace**: For project-specific, team-shared customizations → `.github/` folder |
| 44 | +- **User profile**: For personal, cross-workspace customizations → `{{USER_PROMPTS_FOLDER}}/` |
| 45 | + |
| 46 | +### 2. Choose the Right Primitive |
| 47 | + |
| 48 | +Use the Decision Flow above to select the appropriate file type based on the user's need. |
| 49 | + |
| 50 | +### 3. Create the File |
| 51 | + |
| 52 | +Create the file directly at the appropriate path: |
| 53 | +- Use the location tables in each reference file |
| 54 | +- Include required frontmatter as needed |
| 55 | +- Add the body content following the templates |
| 56 | + |
| 57 | +### 4. Validate |
| 58 | + |
| 59 | +After creating: |
| 60 | +- Confirm the file is in the correct location |
| 61 | +- Verify frontmatter syntax (YAML between `---` markers) |
| 62 | +- Check that `description` is present and meaningful |
| 63 | + |
| 64 | +## Edge Cases |
| 65 | + |
| 66 | +**Instructions vs Skill?** Does this apply to *most* work, or *specific* tasks? Most → Instructions. Specific → Skill. |
| 67 | + |
| 68 | +**Skill vs Prompt?** Multi-step workflow with bundled assets → Skill. Single focused task with inputs → Prompt. |
| 69 | + |
| 70 | +**Skill vs Custom Agent?** Same capabilities for all steps → Skill. Need context isolation (subagent returns single output) or different tool restrictions per stage → Custom Agent. |
0 commit comments