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-tools
argument-hint
context (default/fork)
model (default/inherit/haiku/sonnet/opus)
disable-model-invocation
hooks
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: fork is 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: fork is set, AND
agent is not 'default'
4. Store Updates
File: src/webview/src/stores/workflow-store.ts
Add state management for agent option.
Acceptance Criteria
Notes
- Need to confirm the exact list of valid agent types from Claude Code documentation
- Consider adding tooltip explaining the dependency on
context: fork
Summary
Add
agentfrontmatter option to the SlashCommandOptions submenu for specifying which agent type to use whencontext: forkis set.Background
Claude Code supports an
agentfrontmatter option that specifies which agent type to use when forking execution. This option is only applicable when combined withcontext: 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-invocationhooksProposed Changes
1. Type Definition Updates
File:
src/shared/types/workflow-definition.tsAdd new type and update
SlashCommandOptions:2. UI Component Updates
File:
src/webview/src/components/toolbar/SlashCommandOptionsDropdown.tsxAdd new submenu for agent selection:
context: forkis selected3. Export Service Updates
File:
src/extension/services/export-service.tsUpdate
generateSlashCommandFile()to includeagentin frontmatter when:context: forkis set, ANDagentis not 'default'4. Store Updates
File:
src/webview/src/stores/workflow-store.tsAdd state management for
agentoption.Acceptance Criteria
agentoption appears in SlashCommandOptions dropdownagentsubmenu is visually disabled whencontextis notforkcontext: forkexports correct frontmattercontext: defaultdoes NOT export agent frontmatteragentoptionNotes
context: fork