feat: add Sub-Agent creation dialog with deferred file creation#646
feat: add Sub-Agent creation dialog with deferred file creation#646breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom feat/sub-agent-creation-dialogbreaking-brake/cc-wf-studio:feat/sub-agent-creation-dialogCopy head branch name to clipboard
Conversation
- Add SubAgentCreationDialog for browsing existing .claude/commands - Add SubAgentFormDialog for creating new Sub-Agent nodes - Add command-browser-service and command-operations - Move "Create New" buttons next to filter input in both SubAgent and Skill dialogs - Change SubAgent dialog title to "Browse Sub-Agent" - Set default model to "Inherit" for new Sub-Agent creation - Add i18n translations for all Sub-Agent dialog strings (en/ja/ko/zh-CN/zh-TW) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Dialog - Split autoCreateSubAgentFiles into planSubAgentFiles + executeSubAgentFileCreation - Add PlannedSubAgentFile type and pass plannedFiles through MCP payload - Show "Files to be created" section in DiffPreviewDialog with file paths - Add schema fields (commandFilePath, commandScope, agentType, aiGenerationGuidance) - Add commandScope validation and export-service reference model support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR extends the workflow system to support reusing existing sub-agents from external command definitions. It adds command discovery services, new MCP tools for listing available commands, planning/creation workflows for sub-agent files, linked command referencing, and corresponding UI components for browsing, selecting, and creating sub-agents with field support for agentType, commandFilePath, and commandScope. Changes
Sequence DiagramsequenceDiagram
participant User
participant Webview
participant Extension as Extension Host
participant FileSystem as File System
User->>Webview: Click "Browse Existing Sub-Agents"
Webview->>Webview: Open SubAgentCreationDialog
Webview->>Extension: BROWSE_COMMANDS (requestId)
Extension->>FileSystem: Scan ~/.claude/agents/*.md
Extension->>FileSystem: Scan {workspace}/.claude/agents/*.md
FileSystem-->>Extension: List of .md files
Extension->>Extension: Extract metadata (name, description, promptContent)
Extension-->>Webview: COMMAND_LIST_LOADED (CommandReference[], counts)
Webview->>Webview: Render filtered command list by scope
User->>Webview: Select command or choose "Create New"
alt User selects existing command
Webview->>Webview: Parse frontmatter from command.promptContent
Webview->>Webview: Populate SubAgent node data
else User creates new sub-agent
User->>Webview: Fill SubAgentFormDialog (description, prompt, model, tools, memory)
Webview->>Extension: CREATE_SUB_AGENT (CreateSubAgentPayload)
Extension->>FileSystem: Write .claude/agents/{name}.md
FileSystem-->>Extension: File created
Extension-->>Webview: SUB_AGENT_CREATION_SUCCESS (filePath)
end
Webview->>Webview: Add SubAgent node with commandFilePath reference
Webview->>Webview: Workflow now includes linked sub-agent
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related issues
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable sequence diagrams in the walkthrough.Disable the |
## [3.28.0](v3.27.1...v3.28.0) (2026-03-16) ### Features * add Sub-Agent creation dialog with deferred file creation ([#646](#646)) ([f6d8b9f](f6d8b9f))
|
🎉 This PR is included in version 3.28.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Add a Sub-Agent creation dialog that supports both "Create New" and "Use Existing" flows, plus deferred file creation in the DiffPreviewDialog for MCP
apply_workflow.Closes #636
Motivation
CC Workflow Studio previously only supported inline Sub-Agent definitions. Users with existing
.claude/agents/*.mdcommand files had to recreate them manually. Additionally,apply_workflowwrote Sub-Agent.mdfiles to disk before user review — rejected changes left orphan files.Changes
New Files:
src/webview/src/components/dialogs/SubAgentCreationDialog.tsx- Browse/create dialog with two tabs (Create New / Use Existing)src/webview/src/components/dialogs/SubAgentFormDialog.tsx- Form for creating new sub-agent with all fieldssrc/webview/src/services/command-browser-service.ts- Service for browsing.claude/agents/commandssrc/extension/commands/command-operations.ts- Extension host handlers for command scanningsrc/extension/services/command-service.ts- Command file scanner (user/project scopes)src/extension/utils/path-utils.ts- Path utilities for.claude/agents/directoriesModified Files:
src/extension/services/mcp-server-tools.ts- SplitautoCreateSubAgentFilesintoplanSubAgentFiles(no disk write) +executeSubAgentFileCreation(post-approval)src/extension/services/mcp-server-service.ts- PassplannedFilesthrough MCP payloadsrc/shared/types/messages.ts- AddPlannedSubAgentFiletype and message types for command scanningsrc/webview/src/components/dialogs/DiffPreviewDialog.tsx- Add "Files to be created" sectionsrc/webview/src/App.tsx- WireplannedFilesto DiffPreviewDialogresources/workflow-schema.json/.toon- AddcommandFilePath,commandScope,agentType,aiGenerationGuidanceresources/ai-editing-skill-template.md- Addlist_available_commandsstepsrc/extension/utils/validate-workflow.ts- AddcommandScopevalidationsrc/extension/services/export-service.ts- Reference model support in exportTesting
npm run format && npm run lint && npm run check && npm run buildpasses🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements
Documentation