Agentic Workspace Skill
Expert guide for designing and implementing SOTA agentic architectures in multi-project
VS Code workspaces. Covers the full stack: agents, skills, instructions, prompts, context
engineering, and the interplay between them.
Core Principles
1. Progressive Disclosure (Token Efficiency)
Context is expensive. Load the minimum at startup, expand on demand:
| Tier |
What |
When |
Token Budget |
| Metadata |
name + description |
Always (startup) |
~100 tokens/skill |
| Instructions |
Full SKILL.md body |
On activation |
< 5 000 tokens |
| Resources |
references/, scripts/, assets/ |
On demand |
As needed |
Rule: Every piece of context should earn its token cost. Challenge each element: "Does this justify its presence?"
2. Layered Context Architecture
Context flows from general to specific. More specific layers override less specific ones.
Layer 1 User-level instructions (~/.agents/skills/, VS Code userdata)
Layer 2 Repository root AGENTS.md + .github/copilot-instructions.md
Layer 3 Project root project/AGENTS.md (nearest-file-wins)
Layer 4 Path-specific instructions .github/instructions/*.instructions.md (applyTo globs)
Layer 5 Skills (triggered) ~/.agents/skills/ + .github/skills/ (on activation)
Layer 6 Agents (when invoked) .github/agents/*.agent.md
Layer 7 Prompts (when invoked) .github/prompts/*.prompt.md
Nearest-file-wins: The nearest AGENTS.md in the directory tree takes precedence.
3. Separation of Concerns
| Artifact |
Purpose |
Scope |
Activation |
| Skill |
Reusable capability with scripts/resources |
CrossProject portable |
Dynamically by task relevance |
| Instruction |
Project-specific coding rules |
Path-scoped or repo-wide |
Auto by file match (applyTo) |
| Prompt |
Reusable template for specific task |
Workspace or user |
Manually invoked |
| Agent |
Role/persona with tools + handoffs |
Workspace or user |
Manually selected or via handoff |
| AGENTS.md |
Context index and entry point for agents |
Per directory tree |
Always included |
Protocol — Setting Up an Agentic Workspace
Step 1 — Audit Current State
- List all existing
.agent.md, SKILL.md, .instructions.md, .prompt.md, AGENTS.md files
- Map the project structure (monorepo? multi-root? packages?)
- Identify duplications, gaps, and context pollution risks
- Check if global skills (
~/.agents/skills/) are in lock file
Step 2 — Design the Agent Hierarchy
Choose the right architecture pattern (see references/architecture-patterns.md):
- Linear Pipeline: Research → Plan → Implement → Review (simple, predictable)
- Orchestrator-Workers: Supervisor routes to specialists (flexible, SOTA for complex tasks)
- Swarm/Handoffs: Lightweight specialist handoffs (good for well-defined roles)
For most workspaces: Orchestrator at root + specialists per project/domain.
Step 3 — Define Agent Taxonomy
Root (shared across all projects)
├── Orchestrator — task analysis + routing
├── Research — web + codebase research, freshness validation
├── Plan — read-only exploration + structured planning
└── Review — QA, architecture compliance, testing validation
Project-specific (override or extend root agents)
├── Deploy — deployment workflows
├── Migration — database/API migrations
└── <domain> — domain-specific specialist
Tool scoping by agent role:
- Research:
['search', 'fetch', 'codebase', 'problems'] — read-only
- Plan:
['search', 'codebase', 'problems'] — read-only
- Review:
['search', 'codebase', 'problems', 'diagnostics'] — read-only
- Implement:
['editFile', 'createFile', 'terminal', 'search', 'codebase'] — full access
- Orchestrator:
['search', 'codebase'] — routing only (minimal tools)
Step 4 — Design the Skill Ecosystem
Global skills (~/.agents/skills/) — cross-project, install via skills.sh or manual
Project skills (.github/skills/) — project-specific, committed to repo
Decision criteria:
- Will this skill be useful in >1 project? → Global
- Is this tightly coupled to this project's stack? → Project-local
- Does it need scripts or data files? → Use
scripts/, references/, assets/ subdirs
Step 5 — Write Instructions (Path-Specific Context Injection)
Instructions auto-activate based on applyTo glob patterns. Cover every significant directory:
# Standard instruction set for a TypeScript project
applyTo: "src/core/**" → domain rules (zero deps, Result pattern)
applyTo: "src/adapters/**" → adapter rules (implement ports, DI injection)
applyTo: "src/cli/**" → CLI conventions (framework, one-file-per-command)
applyTo: "**/tests/**" → test rules (Vitest, no infra deps for unit tests)
applyTo: "**/*.test.ts" → same as above
Step 6 — Write AGENTS.md Files
One per project + one at monorepo root (if applicable):
- Root AGENTS.md: Monorepo index (projects, shared agents, global skills, architecture)
- Project AGENTS.md: Project-specific details (stack, commands, build/test, local skills)
See references/agents-md-template.md for templates.
Step 7 — Connect to MCP and VS Code
- Add
.vscode/mcp.json for MCP server auto-discovery
- Add
chat.agentFilesLocations in settings.json if agents live in non-standard paths
- Ensure
copilot-instructions.md is in root .github/ for GitHub-hosted projects
Step 8 — Verify
Checklist before considering the agentic setup complete:
Workspace File Structure (Reference)
monorepo-root/
├── AGENTS.md ← Monorepo index (shared context)
├── .github/
│ ├── copilot-instructions.md ← Repo-wide Copilot context
│ ├── agents/ ← Shared agents (all projects)
│ │ ├── Orchestrator.agent.md
│ │ ├── Research.agent.md
│ │ ├── Plan.agent.md
│ │ └── Review.agent.md
│ ├── instructions/ ← Cross-project path rules
│ │ ├── typescript.instructions.md ← applyTo: "**/*.ts"
│ │ └── testing.instructions.md ← applyTo: "**/tests/**"
│ ├── prompts/ ← Shared reusable prompts
│ │ ├── smart-commit.prompt.md
│ │ └── code-review.prompt.md
│ └── skills/ ← Optional project-specific skills
│
├── project-a/
│ ├── AGENTS.md ← Project-specific index (overrides root)
│ └── .github/
│ ├── agents/ ← Project-specific agents
│ ├── instructions/ ← Project-specific path rules
│ └── skills/ ← Project-specific skills
│
└── project-b/
├── AGENTS.md
└── .github/
└── instructions/
Anti-Patterns to Avoid
| Anti-Pattern |
Problem |
Fix |
| Duplicate AGENTS.md at multiple levels with same content |
Context confusion, drift risk |
Root = index, project = detail, no duplication |
| Monolithic agent doing Research + Plan + Review |
Violates SRP, context bloat |
Split into specialized agents with handoffs |
| Hardcoded project info in global skills |
Global skills become un-reusable |
Keep global skills generic, project context in local skills |
Missing applyTo on instructions |
Instructions activate everywhere, pollute context |
Always set applyTo to narrowest appropriate glob |
| Agent with all tools (editFile + search + terminal) |
No guardrails, risky agent |
Scope tools by role (read-only for Research/Plan/Review) |
| Skills > 500 lines in SKILL.md |
Context overload |
Move detail to references/ subdirectory |
| Prompts tightly coupled to one agent |
Reduces reusability |
Use agent: "agent" default, or bind explicitly per use case |
| No handoff graph |
Agents are isolated silos |
Define explicit handoffs with clear labels and prompts |
See Also
references/agent-template.md — .agent.md format with all fields documented
references/skill-template.md — SKILL.md format per agentskills.io spec
references/agents-md-template.md — AGENTS.md templates (monorepo root, project, standalone)
references/instruction-template.md — .instructions.md template with applyTo patterns
references/prompt-template.md — .prompt.md template and best practices
references/architecture-patterns.md — 8 SOTA agent patterns with decision matrix
1---2name: agentic-workspace3description: Set up and maintain SOTA agentic architectures in VS Code workspaces with multiple projects. Use when: setting up agents, agentic architecture, multi-project workspace, agent hierarchy, context engineering, prompt engineering, skills ecosystem, AGENTS.md, copilot instructions, agent handoffs, orchestrator pattern, progressive disclosure, workspace agent structure. Teaches agent taxonomy design, skill ecosystems, instruction layering, handoff graphs following anthropics/skills, OpenAI Agents SDK, and GitHub Copilot custom agent standards (VS Code 1.106+).4license: MIT5---67# Agentic Workspace Skill89Expert guide for designing and implementing SOTA agentic architectures in multi-project10VS Code workspaces. Covers the full stack: agents, skills, instructions, prompts, context11engineering, and the interplay between them.1213---1415## Core Principles1617### 1. Progressive Disclosure (Token Efficiency)18Context is expensive. Load the minimum at startup, expand on demand:1920| Tier | What | When | Token Budget |21|------|------|------|-------------|22| **Metadata** | `name` + `description` | Always (startup) | ~100 tokens/skill |23| **Instructions** | Full `SKILL.md` body | On activation | < 5 000 tokens |24| **Resources** | `references/`, `scripts/`, `assets/` | On demand | As needed |2526**Rule:** Every piece of context should earn its token cost. Challenge each element: "Does this justify its presence?"2728### 2. Layered Context Architecture29Context flows from general to specific. More specific layers override less specific ones.3031```32Layer 1 User-level instructions (~/.agents/skills/, VS Code userdata)33Layer 2 Repository root AGENTS.md + .github/copilot-instructions.md34Layer 3 Project root project/AGENTS.md (nearest-file-wins)35Layer 4 Path-specific instructions .github/instructions/*.instructions.md (applyTo globs)36Layer 5 Skills (triggered) ~/.agents/skills/ + .github/skills/ (on activation)37Layer 6 Agents (when invoked) .github/agents/*.agent.md38Layer 7 Prompts (when invoked) .github/prompts/*.prompt.md39```4041**Nearest-file-wins:** The nearest `AGENTS.md` in the directory tree takes precedence.4243### 3. Separation of Concerns4445| Artifact | Purpose | Scope | Activation |46|----------|---------|-------|------------|47| **Skill** | Reusable capability with scripts/resources | CrossProject portable | Dynamically by task relevance |48| **Instruction** | Project-specific coding rules | Path-scoped or repo-wide | Auto by file match (`applyTo`) |49| **Prompt** | Reusable template for specific task | Workspace or user | Manually invoked |50| **Agent** | Role/persona with tools + handoffs | Workspace or user | Manually selected or via handoff |51| **AGENTS.md** | Context index and entry point for agents | Per directory tree | Always included |5253---5455## Protocol — Setting Up an Agentic Workspace5657### Step 1 — Audit Current State58- List all existing `.agent.md`, `SKILL.md`, `.instructions.md`, `.prompt.md`, `AGENTS.md` files59- Map the project structure (monorepo? multi-root? packages?)60- Identify duplications, gaps, and context pollution risks61- Check if global skills (`~/.agents/skills/`) are in lock file6263### Step 2 — Design the Agent Hierarchy64Choose the right architecture pattern (see `references/architecture-patterns.md`):65- **Linear Pipeline**: Research → Plan → Implement → Review (simple, predictable)66- **Orchestrator-Workers**: Supervisor routes to specialists (flexible, SOTA for complex tasks)67- **Swarm/Handoffs**: Lightweight specialist handoffs (good for well-defined roles)6869For most workspaces: **Orchestrator at root** + **specialists per project/domain**.7071### Step 3 — Define Agent Taxonomy7273```74Root (shared across all projects)75├── Orchestrator — task analysis + routing76├── Research — web + codebase research, freshness validation77├── Plan — read-only exploration + structured planning78└── Review — QA, architecture compliance, testing validation7980Project-specific (override or extend root agents)81├── Deploy — deployment workflows82├── Migration — database/API migrations83└── <domain> — domain-specific specialist84```8586**Tool scoping by agent role:**87- Research: `['search', 'fetch', 'codebase', 'problems']` — read-only88- Plan: `['search', 'codebase', 'problems']` — read-only89- Review: `['search', 'codebase', 'problems', 'diagnostics']` — read-only90- Implement: `['editFile', 'createFile', 'terminal', 'search', 'codebase']` — full access91- Orchestrator: `['search', 'codebase']` — routing only (minimal tools)9293### Step 4 — Design the Skill Ecosystem9495```96Global skills (~/.agents/skills/) — cross-project, install via skills.sh or manual97Project skills (.github/skills/) — project-specific, committed to repo98```99100**Decision criteria:**101- Will this skill be useful in >1 project? → Global102- Is this tightly coupled to this project's stack? → Project-local103- Does it need scripts or data files? → Use `scripts/`, `references/`, `assets/` subdirs104105### Step 5 — Write Instructions (Path-Specific Context Injection)106107Instructions auto-activate based on `applyTo` glob patterns. Cover every significant directory:108109```yaml110# Standard instruction set for a TypeScript project111applyTo: "src/core/**" → domain rules (zero deps, Result pattern)112applyTo: "src/adapters/**" → adapter rules (implement ports, DI injection) 113applyTo: "src/cli/**" → CLI conventions (framework, one-file-per-command)114applyTo: "**/tests/**" → test rules (Vitest, no infra deps for unit tests)115applyTo: "**/*.test.ts" → same as above116```117118### Step 6 — Write AGENTS.md Files119120One per project + one at monorepo root (if applicable):121- **Root AGENTS.md**: Monorepo index (projects, shared agents, global skills, architecture)122- **Project AGENTS.md**: Project-specific details (stack, commands, build/test, local skills)123124See `references/agents-md-template.md` for templates.125126### Step 7 — Connect to MCP and VS Code127128- Add `.vscode/mcp.json` for MCP server auto-discovery129- Add `chat.agentFilesLocations` in `settings.json` if agents live in non-standard paths130- Ensure `copilot-instructions.md` is in root `.github/` for GitHub-hosted projects131132### Step 8 — Verify133134Checklist before considering the agentic setup complete:135- [ ] Nearest-file-wins works (test by opening files in different subprojects)136- [ ] All agents appear in Copilot Chat agents dropdown137- [ ] Skills trigger correctly by description keyword match138- [ ] Instructions activate only for matching `applyTo` patterns139- [ ] AGENTS.md at each level is non-redundant with parent AGENTS.md140- [ ] No secrets or credentials in any agent/skill/instruction file141- [ ] Tool scoping is correct (read-only agents can't edit files)142143---144145## Workspace File Structure (Reference)146147```148monorepo-root/149├── AGENTS.md ← Monorepo index (shared context)150├── .github/151│ ├── copilot-instructions.md ← Repo-wide Copilot context152│ ├── agents/ ← Shared agents (all projects)153│ │ ├── Orchestrator.agent.md154│ │ ├── Research.agent.md155│ │ ├── Plan.agent.md156│ │ └── Review.agent.md157│ ├── instructions/ ← Cross-project path rules158│ │ ├── typescript.instructions.md ← applyTo: "**/*.ts"159│ │ └── testing.instructions.md ← applyTo: "**/tests/**"160│ ├── prompts/ ← Shared reusable prompts161│ │ ├── smart-commit.prompt.md162│ │ └── code-review.prompt.md163│ └── skills/ ← Optional project-specific skills164│165├── project-a/166│ ├── AGENTS.md ← Project-specific index (overrides root)167│ └── .github/168│ ├── agents/ ← Project-specific agents169│ ├── instructions/ ← Project-specific path rules170│ └── skills/ ← Project-specific skills171│172└── project-b/173 ├── AGENTS.md174 └── .github/175 └── instructions/176```177178---179180## Anti-Patterns to Avoid181182| Anti-Pattern | Problem | Fix |183|---|---|---|184| Duplicate AGENTS.md at multiple levels with same content | Context confusion, drift risk | Root = index, project = detail, no duplication |185| Monolithic agent doing Research + Plan + Review | Violates SRP, context bloat | Split into specialized agents with handoffs |186| Hardcoded project info in global skills | Global skills become un-reusable | Keep global skills generic, project context in local skills |187| Missing `applyTo` on instructions | Instructions activate everywhere, pollute context | Always set `applyTo` to narrowest appropriate glob |188| Agent with all tools (editFile + search + terminal) | No guardrails, risky agent | Scope tools by role (read-only for Research/Plan/Review) |189| Skills > 500 lines in SKILL.md | Context overload | Move detail to `references/` subdirectory |190| Prompts tightly coupled to one agent | Reduces reusability | Use `agent: "agent"` default, or bind explicitly per use case |191| No handoff graph | Agents are isolated silos | Define explicit handoffs with clear labels and prompts |192193---194195## See Also196197- `references/agent-template.md` — `.agent.md` format with all fields documented198- `references/skill-template.md` — `SKILL.md` format per agentskills.io spec199- `references/agents-md-template.md` — `AGENTS.md` templates (monorepo root, project, standalone)200- `references/instruction-template.md` — `.instructions.md` template with `applyTo` patterns201- `references/prompt-template.md` — `.prompt.md` template and best practices202- `references/architecture-patterns.md` — 8 SOTA agent patterns with decision matrix