Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ description: "<required>" # For agent picker and subagent discovery
name: "Agent Name" # Optional, defaults to filename
tools: ["search", "web"] # Optional: aliases, MCP (<server>/*), extension tools
model: "Claude Sonnet 4" # Optional, uses picker default
argument-hint: "Task..." # Optional, input guidance
agents: ["Agent1", "Agent2"] # Optional, restrict allowed subagents by name (omit = all, [] = none)
infer: "all" # Optional: "all"|true, "user"|false, "agent", "hidden"
handoffs: [...] # Optional, transitions to other agents
---
Expand Down
14 changes: 14 additions & 0 deletions src/extension/agents/vscode-node/planAgentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ interface PlanAgentConfig {
tools: string[];
model?: string;
target?: string;
infer?: string;
agents?: string[];
handoffs: PlanAgentHandoff[];
body: string;
}
Expand All @@ -45,6 +47,8 @@ const BASE_PLAN_AGENT_CONFIG: PlanAgentConfig = {
description: 'Researches and outlines multi-step plans',
argumentHint: 'Outline the goal or problem to research',
target: 'vscode',
infer: 'user',
agents: [],
tools: [
'agent',
'search',
Expand Down Expand Up @@ -93,6 +97,9 @@ export function buildAgentMarkdown(config: PlanAgentConfig): string {
if (config.target) {
lines.push(`target: ${config.target}`);
}
if (config.infer) {
lines.push(`infer: ${config.infer}`);
}

// Tools array - flow style for readability
// Escape single quotes by doubling them (YAML spec)
Expand All @@ -101,6 +108,12 @@ export function buildAgentMarkdown(config: PlanAgentConfig): string {
lines.push(`tools: [${quotedTools}]`);
}

// Agents array - same format as tools (empty array = no subagents allowed)
if (config.agents) {
const quotedAgents = config.agents.map(a => `'${a.replace(/'/g, '\'\'')}'`).join(', ');
lines.push(`agents: [${quotedAgents}]`);
}

// Handoffs - block style for complex nested objects
// Escape prompts using single quotes (with doubled single quotes for internal quotes)
if (config.handoffs.length > 0) {
Expand Down Expand Up @@ -228,6 +241,7 @@ MANDATORY: Instruct the subagent to work autonomously following <research_instru
<research_instructions>
- Research the user's task comprehensively using read-only tools.
- Start with high-level code searches before reading specific files.
- Pay special attention to instructions and skills made available by the developers to understand best practices and intended usage.
- Identify missing information, conflicting requirements, or technical unknowns.
- DO NOT draft a full plan yet — focus on discovery and feasibility.
</research_instructions>
Expand Down