-
Notifications
You must be signed in to change notification settings - Fork 497
Description
Summary
Add agent frontmatter option to the SlashCommandOptions submenu for specifying which agent type to use when context: fork is set.
Background
Claude Code supports an agent frontmatter option that specifies which agent type to use when forking execution. This option is only applicable when combined with context: fork.
Reference: Claude Code Slash Commands Documentation
Current State
The SlashCommandOptionsDropdown currently supports:
allowed-toolsargument-hintcontext(default/fork)model(default/inherit/haiku/sonnet/opus)disable-model-invocationhooks
Proposed Changes
1. Type Definition Updates
File: src/shared/types/workflow-definition.ts
Add new type and update SlashCommandOptions:
/** Agent type options for Slash Command execution (only applicable with context: fork) */
export type SlashCommandAgent = 'default' | 'coder' | 'researcher' | 'planner';
export interface SlashCommandOptions {
// ... existing fields
/** Agent type to use when context: fork is set. Only applicable with context: fork. */
agent?: SlashCommandAgent;
}2. UI Component Updates
File: src/webview/src/components/toolbar/SlashCommandOptionsDropdown.tsx
Add new submenu for agent selection:
- Display options: default, coder, researcher, planner (or fetch from Claude Code if dynamic)
- Only enable when
context: forkis selected - Show visual indicator when disabled (context !== 'fork')
3. Export Service Updates
File: src/extension/services/export-service.ts
Update generateSlashCommandFile() to include agent in frontmatter when:
context: forkis set, ANDagentis not 'default'
4. Store Updates
File: src/webview/src/stores/workflow-store.ts
Add state management for agent option.
Acceptance Criteria
-
agentoption appears in SlashCommandOptions dropdown -
agentsubmenu is visually disabled whencontextis notfork - Selecting an agent when
context: forkexports correct frontmatter - Selecting an agent when
context: defaultdoes NOT export agent frontmatter - Workflow JSON correctly saves/loads
agentoption
Notes
- Need to confirm the exact list of valid agent types from Claude Code documentation
- Consider adding tooltip explaining the dependency on
context: fork