improvement: separate Agent Definition and Prompt in Sub-Agent node#687
improvement: separate Agent Definition and Prompt in Sub-Agent node#687breaking-brake merged 4 commits intomainbreaking-brake/cc-wf-studio:mainfrom improvement/separate-agent-definition-and-promptbreaking-brake/cc-wf-studio:improvement/separate-agent-definition-and-promptCopy head branch name to clipboard
Conversation
… node - Add agentDefinition field to SubAgentData for agent role/capabilities (exported as .md file body) - Add prompt field for task instructions (exported in execution instructions) - Route all Sub-Agent creation flows through SubAgentFormDialog for prompt input - Show agent name + prompt preview on canvas node instead of description + agent definition - Parse YAML frontmatter when selecting existing commands (extract model/tools/memory) - Add i18n support for new fields across all 5 languages Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove new agent auto-creation path from aiGenerationGuidance steps - Add useCases and whenToUse for each built-in agent type (explore/plan/general-purpose) - Remove list_available_agents from default AI editing flow - Custom agents only used when user explicitly specifies one Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove verbose field descriptions (type/enum sufficient) - Simplify builtInAgents to flat useCases arrays - Remove frontmatterFormat, workflow key, whenToUse - Remove custom agent example (built-in only) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces a new required Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
resources/workflow-schema.json (1)
967-971:⚠️ Potential issue | 🟡 MinorExample subAgent nodes are missing the new required
agentDefinitionfield.The schema declares
agentDefinitionas required (line 52), but the example workflows contain subAgent nodes without this field. This inconsistency will cause confusion for AI generation and validation.Affected examples:
- Line 967-971: "analyzer" agent in "Simple Data Analysis"
- Line 1017-1019: "scanner" in "Code Review with Priority"
- Line 1039-1044, 1049-1055: "critical-fixer" and "all-fixer"
- Line 1109-1114, 1133-1138, 1143-1148: agents in "Document Processing Pipeline"
- Line 1167-1171, 1177-1181, 1187-1190: format agents
🔧 Example fix for the "analyzer" agent
"data": { "description": "Analyze data", + "agentDefinition": "General-purpose data analysis agent with full tool access.", "prompt": "Analyze data and generate insights.", "model": "sonnet", "outputPorts": 1 }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@resources/workflow-schema.json` around lines 967 - 971, The example subAgent nodes (e.g., the "analyzer" node in "Simple Data Analysis", "scanner" in "Code Review with Priority", "critical-fixer" and "all-fixer", and the various Document Processing and format agents) are missing the required agentDefinition field; update each subAgent entry to include an agentDefinition object that conforms to the schema (e.g., include fields such as name, description, type/model and any required config keys) so examples validate against the declared schema; locate the subAgent objects by their "id" or "data.name" values ("analyzer", "scanner", "critical-fixer", "all-fixer", etc.) and add the appropriate agentDefinition payload to each example node.
🧹 Nitpick comments (1)
resources/ai-editing-skill-template.md (1)
9-11: Make Step 4 explicitly include required sub-agent fields.To reduce validation/retry churn, explicitly require
subAgent.data.agentDefinitionandsubAgent.data.promptin generated JSON.Suggested wording tweak
-4. Generate workflow JSON: use built-in sub-agents (builtInType: explore/plan/general-purpose) by default. Only call `list_available_agents` when the user explicitly asks to use an existing custom sub-agent. +4. Generate workflow JSON: use built-in sub-agents (builtInType: explore/plan/general-purpose) by default. For every `subAgent` node, include required `data.agentDefinition` and `data.prompt`. Only call `list_available_agents` when the user explicitly asks to use an existing custom sub-agent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@resources/ai-editing-skill-template.md` around lines 9 - 11, Update Step 4 text so the generated workflow JSON explicitly requires the sub-agent fields subAgent.data.agentDefinition and subAgent.data.prompt (in addition to using builtInType: explore/plan/general-purpose by default), and only invoke list_available_agents when the user explicitly requests an existing custom sub-agent; wording should state these fields are mandatory and should be included in the generated JSON to avoid validation/retry churn, and reference the builtInType default and list_available_agents behavior for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/extension/services/export-service.ts`:
- Around line 275-278: The export currently sets agentDefinition =
data.agentDefinition || '' which can produce an empty agent body; change the
return logic in export-service.ts to fall back to the legacy prompt when
agentDefinition is missing by using data.prompt (or data.agent?.prompt) as a
fallback, e.g., build the body as (data.agentDefinition ?? data.prompt ?? '')
and return frontmatter.join('\n') + that body so legacy sub-agents that only
have prompt export a valid agent file; update references to agentDefinition
accordingly.
In `@src/shared/types/workflow-definition.ts`:
- Around line 115-118: The workflow type now requires agentDefinition but legacy
workflows may only have prompt, so add a fallback in the migration and/or
validation: in migrate-workflow.ts ensure any SubAgent/SubAgentData entries set
agentDefinition = agentDefinition ?? prompt (or copy prompt into
agentDefinition) for legacy nodes, and in validate-workflow.ts (the
extension-side validator that checks SubAgent builtInType) add a presence/length
check for SubAgentData.agentDefinition (same 1-10000 char bounds) so missing
agentDefinition either gets backfilled or validation fails fast; update
validateWorkflowFile() to include SubAgentData validation or call the new
validator so old workflows don’t silently pass.
In `@src/webview/src/components/dialogs/SubAgentCreationDialog.tsx`:
- Around line 125-136: The hardcoded prompt string in the SubAgentCreationDialog
should be replaced with a translatable key: update the call that sets
formInitialData (within the block using parseAgentFrontmatter and
setFormInitialData) to use the translation function (e.g. t('...')) instead of
the literal 'Execute the following task:', add the new i18n key/value to each
locale file, and ensure selectedCommand.promptContent fallback behavior remains
unchanged; references to parseAgentFrontmatter, setFormInitialData,
setIsFormDialogOpen and selectedCommand.promptContent should help you locate and
update the correct spot.
In `@src/webview/src/utils/agent-frontmatter.ts`:
- Around line 9-20: The frontmatter regex and line-splitting assume LF-only
newlines, causing Windows CRLF files to fail; update the frontmatter match to
handle CRLF by using a CR-optional pattern (e.g. change the regex used in match
to /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/) and split the yamlBlock using
/\r?\n/ (or normalize CRs via .replace(/\r\n/g, '\n') beforehand), and ensure
body trimming removes any leftover '\r' so variables like match, yamlBlock, body
and the frontmatter parsing loop correctly handle CRLF files.
---
Outside diff comments:
In `@resources/workflow-schema.json`:
- Around line 967-971: The example subAgent nodes (e.g., the "analyzer" node in
"Simple Data Analysis", "scanner" in "Code Review with Priority",
"critical-fixer" and "all-fixer", and the various Document Processing and format
agents) are missing the required agentDefinition field; update each subAgent
entry to include an agentDefinition object that conforms to the schema (e.g.,
include fields such as name, description, type/model and any required config
keys) so examples validate against the declared schema; locate the subAgent
objects by their "id" or "data.name" values ("analyzer", "scanner",
"critical-fixer", "all-fixer", etc.) and add the appropriate agentDefinition
payload to each example node.
---
Nitpick comments:
In `@resources/ai-editing-skill-template.md`:
- Around line 9-11: Update Step 4 text so the generated workflow JSON explicitly
requires the sub-agent fields subAgent.data.agentDefinition and
subAgent.data.prompt (in addition to using builtInType:
explore/plan/general-purpose by default), and only invoke list_available_agents
when the user explicitly requests an existing custom sub-agent; wording should
state these fields are mandatory and should be included in the generated JSON to
avoid validation/retry churn, and reference the builtInType default and
list_available_agents behavior for clarity.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6dce3302-fab1-4814-8fad-2068f145a5e6
📒 Files selected for processing (21)
resources/ai-editing-skill-template.mdresources/workflow-schema.jsonresources/workflow-schema.toonsrc/extension/commands/command-operations.tssrc/extension/services/export-service.tssrc/extension/services/mcp-server-tools.tssrc/shared/constants/built-in-sub-agents.tssrc/shared/types/messages.tssrc/shared/types/workflow-definition.tssrc/webview/src/components/NodePalette.tsxsrc/webview/src/components/PropertyOverlay.tsxsrc/webview/src/components/dialogs/SubAgentCreationDialog.tsxsrc/webview/src/components/dialogs/SubAgentFormDialog.tsxsrc/webview/src/components/nodes/SubAgentNode.tsxsrc/webview/src/i18n/translation-keys.tssrc/webview/src/i18n/translations/en.tssrc/webview/src/i18n/translations/ja.tssrc/webview/src/i18n/translations/ko.tssrc/webview/src/i18n/translations/zh-CN.tssrc/webview/src/i18n/translations/zh-TW.tssrc/webview/src/utils/agent-frontmatter.ts
| /** Agent definition: describes what this agent IS, its capabilities and role. Exported as .md file body. */ | ||
| agentDefinition: string; | ||
| /** Task prompt: describes what to TELL this agent to do. Exported in execution instructions. */ | ||
| prompt: string; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Find all Sub-Agent load/parse/migrate touch points
rg -n --type=ts --type=tsx -C2 '\b(agentDefinition|subAgent|migrate|schemaVersion|importWorkflow|openWorkflow)\b' src
# 2) Specifically verify fallback logic for legacy sub-agent payloads
rg -n --type=ts --type=tsx -C3 'agentDefinition\s*\?\?=|if\s*\(!.*agentDefinition|agentDefinition\s*:\s*.*prompt|prompt\s*:\s*.*agentDefinition' src
# 3) Inspect JSON/schema validators for required fields handling
rg -n --type=json --type=ts --type=tsx -C2 'agentDefinition|required' resources srcRepository: breaking-brake/cc-wf-studio
Length of output: 98
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Find all Sub-Agent load/parse/migrate touch points in TypeScript files
rg -n --type=ts -C2 '\b(agentDefinition|subAgent|migrate|schemaVersion|importWorkflow|openWorkflow|import.*Workflow|load.*Workflow)\b' src
# 2) Specifically verify fallback logic for legacy sub-agent payloads
rg -n --type=ts -C3 'agentDefinition\s*\?\?=|if\s*\(!.*agentDefinition|agentDefinition\s*:\s*.*prompt|prompt.*agentDefinition' src
# 3) Inspect schema validators for required fields handling
rg -n --type=ts -C2 'agentDefinition|required' resources src 2>/dev/null || trueRepository: breaking-brake/cc-wf-studio
Length of output: 50384
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Find the workflow-definition.ts file and read lines 624-625 and surrounding context
echo "=== Lines 620-630 from workflow-definition.ts ==="
wc -l src/shared/types/workflow-definition.ts
sed -n '620,630p' src/shared/types/workflow-definition.ts
# 2) Search for SubAgentData type definition
echo -e "\n=== SubAgentData type definition ==="
rg -n 'interface SubAgentData|type SubAgentData' src --type=ts -A 15
# 3) Search for workflow load/import/parse functions
echo -e "\n=== Load/import/parse functions ==="
rg -n '\b(loadWorkflow|importWorkflow|parseWorkflow|deserializeWorkflow|migrateWorkflow)' src --type=ts -B 2 -A 8 | head -100
# 4) Search for validation/schema enforcement
echo -e "\n=== Validation/schema functions ==="
rg -n '\b(validateWorkflow|validateSubAgent|validateSchema)' src --type=ts -B 2 -A 5Repository: breaking-brake/cc-wf-studio
Length of output: 36741
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find and read the migrate-workflow.ts file
echo "=== Finding migrate-workflow.ts ==="
fd -n migrate-workflow src
# Read the migrate-workflow function
echo -e "\n=== Contents of migrate-workflow.ts ==="
if [ -f "src/extension/utils/migrate-workflow.ts" ]; then
head -200 src/extension/utils/migrate-workflow.ts
fi
# Check if migration is applied before validation in open-editor
echo -e "\n=== Migration flow in open-editor.ts ==="
sed -n '930,960p' src/extension/commands/open-editor.tsRepository: breaking-brake/cc-wf-studio
Length of output: 354
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find migrate-workflow.ts file
echo "=== Finding migrate-workflow.ts ==="
find src -name "*migrate*workflow*" -type f
# Read the migrate-workflow function
echo -e "\n=== Contents of migrate-workflow.ts ==="
find src -name "*migrate*workflow*" -type f -exec cat {} \;Repository: breaking-brake/cc-wf-studio
Length of output: 859
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check the exact order in open-editor.ts where workflows are loaded
echo "=== Load path in open-editor.ts (lines 925-950) ==="
sed -n '925,950p' src/extension/commands/open-editor.ts
# Check workflow-preview-editor-provider.ts for the load order
echo -e "\n=== Load path in workflow-preview-editor-provider.ts (lines 170-195) ==="
sed -n '170,195p' src/extension/editors/workflow-preview-editor-provider.ts
# Check slack-import-workflow.ts load order
echo -e "\n=== Load path in slack-import-workflow.ts (lines 50-75) ==="
sed -n '50,75p' src/extension/commands/slack-import-workflow.tsRepository: breaking-brake/cc-wf-studio
Length of output: 2918
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Read the validateWorkflowFile function to see what it validates
echo "=== validateWorkflowFile implementation ==="
sed -n '35,150p' src/extension/utils/workflow-validator.ts
# Also check validate-workflow.ts for node validation
echo -e "\n=== SubAgent node validation ==="
rg -n 'SubAgentData|agentDefinition.*required|subAgent.*validate' src/extension/utils/validate-workflow.ts -B 2 -A 5 | head -60Repository: breaking-brake/cc-wf-studio
Length of output: 3088
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for SubAgent node validation specifically
echo "=== SubAgent node validation in validate-workflow.ts ==="
rg -n 'NodeType.SubAgent|case.*SubAgent' src/extension/utils/validate-workflow.ts -B 3 -A 15
# Also check what validateNodeData does
echo -e "\n=== validateNodeData function ==="
rg -n 'validateNodeData|validateNode' src/extension/utils/validate-workflow.ts -A 30 | head -80Repository: breaking-brake/cc-wf-studio
Length of output: 5822
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if SubAgentData fields are validated in PropertyOverlay or other UI components
echo "=== PropertyOverlay SubAgent validation ==="
rg -n 'agentDefinition.*valid|description.*valid|prompt.*valid' src/webview/src/components/PropertyOverlay.tsx -B 2 -A 5
# Check if validation uses VALIDATION_RULES for SubAgent
echo -e "\n=== PropertyOverlay VALIDATION_RULES usage for SubAgent ==="
rg -n 'VALIDATION_RULES.SUB_AGENT|SubAgentData' src/webview/src/components/PropertyOverlay.tsx -B 2 -A 8 | head -100
# Check the form validation for subagent
echo -e "\n=== SubAgent form validation ==="
fd -t f -n '*ubAgent*' src/webview/src/components/dialogs | xargs rg -l 'agentDefinition|validateSubAgent' | head -3Repository: breaking-brake/cc-wf-studio
Length of output: 114
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find SubAgent form/dialog files
echo "=== SubAgent form/dialog files ==="
find src/webview/src/components -name "*SubAgent*" -type f
# Check the SubAgent dialog file
echo -e "\n=== SubAgentDialog validation logic ==="
rg -n 'agentDefinition|isValid|validate' src/webview/src/components/dialogs/SubAgentDialog.tsx -B 2 -A 5 | head -120
# Check for form field validation
echo -e "\n=== Form field validation in SubAgentDialog ==="
sed -n '1,100p' src/webview/src/components/dialogs/SubAgentDialog.tsx 2>/dev/null | tail -50 || echo "File read failed, checking with rg"
rg -n 'required.*agentDefinition|error.*agentDefinition' src --type=ts -B 2 -A 2Repository: breaking-brake/cc-wf-studio
Length of output: 539
🏁 Script executed:
#!/bin/bash
set -euo pipefixpipe
# Check SubAgentFormDialog for validation
echo "=== SubAgentFormDialog validation logic ==="
rg -n 'agentDefinition|isValid|required|error' src/webview/src/components/dialogs/SubAgentFormDialog.tsx -B 2 -A 3 | head -150Repository: breaking-brake/cc-wf-studio
Length of output: 127
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check SubAgentFormDialog for validation
echo "=== SubAgentFormDialog validation logic ==="
rg -n 'agentDefinition|isValid|required|error' src/webview/src/components/dialogs/SubAgentFormDialog.tsx -B 2 -A 3 | head -150Repository: breaking-brake/cc-wf-studio
Length of output: 6055
Confirmed: No fallback logic for legacy workflows missing agentDefinition.
At lines 115-118, agentDefinition is a required, non-optional string field. Line 620-625 enforces validation bounds (1-10,000 chars). However, the migration function (src/extension/utils/migrate-workflow.ts) is empty—it contains only a comment stating "All legacy migrations have been removed after sufficient deprecation periods" with no backfill logic.
Additionally, validateWorkflowFile() only checks top-level workflow fields (id, name, version, nodes, connections) and does not validate SubAgentData field presence. The extension-side node validation in validate-workflow.ts (line 311+) only validates SubAgent's builtInType enum, not the required agentDefinition field. This means old workflows saved with only a prompt field will pass validation and load silently despite the type now requiring agentDefinition.
Action required: Add explicit fallback logic during migration (e.g., agentDefinition ??= prompt) or enforce field validation in validate-workflow.ts for SubAgent nodes to fail fast rather than allow silent mismatches.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/shared/types/workflow-definition.ts` around lines 115 - 118, The workflow
type now requires agentDefinition but legacy workflows may only have prompt, so
add a fallback in the migration and/or validation: in migrate-workflow.ts ensure
any SubAgent/SubAgentData entries set agentDefinition = agentDefinition ??
prompt (or copy prompt into agentDefinition) for legacy nodes, and in
validate-workflow.ts (the extension-side validator that checks SubAgent
builtInType) add a presence/length check for SubAgentData.agentDefinition (same
1-10000 char bounds) so missing agentDefinition either gets backfilled or
validation fails fast; update validateWorkflowFile() to include SubAgentData
validation or call the new validator so old workflows don’t silently pass.
There was a problem hiding this comment.
Not needed — The export fallback (added in 8543483) handles legacy workflows that only have prompt. Full migration infrastructure is overkill for this change.
| const { frontmatter, body } = parseAgentFrontmatter(selectedCommand.promptContent || ''); | ||
| setFormInitialData({ | ||
| description: frontmatter.description || selectedCommand.description || selectedCommand.name, | ||
| agentDefinition: body, | ||
| prompt: 'Execute the following task:', | ||
| agentType: 'claudeCode', | ||
| model: (frontmatter.model as 'sonnet' | 'opus' | 'haiku' | 'inherit') || 'sonnet', | ||
| tools: frontmatter.tools || '', | ||
| memory: (frontmatter.memory as 'user' | 'project' | 'local' | '') || '', | ||
| }); | ||
| setIsFormDialogOpen(true); | ||
| } |
There was a problem hiding this comment.
Hardcoded prompt string should be internationalized.
Line 129 uses a hardcoded English string 'Execute the following task:' instead of using the translation function. This is inconsistent with the rest of the i18n-aware codebase and will not display correctly for non-English users.
🌐 Proposed fix
setFormInitialData({
description: frontmatter.description || selectedCommand.description || selectedCommand.name,
agentDefinition: body,
- prompt: 'Execute the following task:',
+ prompt: t('subAgent.form.defaultPromptForCommand'),
agentType: 'claudeCode',Add the corresponding i18n key to each translation file.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const { frontmatter, body } = parseAgentFrontmatter(selectedCommand.promptContent || ''); | |
| setFormInitialData({ | |
| description: frontmatter.description || selectedCommand.description || selectedCommand.name, | |
| agentDefinition: body, | |
| prompt: 'Execute the following task:', | |
| agentType: 'claudeCode', | |
| model: (frontmatter.model as 'sonnet' | 'opus' | 'haiku' | 'inherit') || 'sonnet', | |
| tools: frontmatter.tools || '', | |
| memory: (frontmatter.memory as 'user' | 'project' | 'local' | '') || '', | |
| }); | |
| setIsFormDialogOpen(true); | |
| } | |
| const { frontmatter, body } = parseAgentFrontmatter(selectedCommand.promptContent || ''); | |
| setFormInitialData({ | |
| description: frontmatter.description || selectedCommand.description || selectedCommand.name, | |
| agentDefinition: body, | |
| prompt: t('subAgent.form.defaultPromptForCommand'), | |
| agentType: 'claudeCode', | |
| model: (frontmatter.model as 'sonnet' | 'opus' | 'haiku' | 'inherit') || 'sonnet', | |
| tools: frontmatter.tools || '', | |
| memory: (frontmatter.memory as 'user' | 'project' | 'local' | '') || '', | |
| }); | |
| setIsFormDialogOpen(true); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/webview/src/components/dialogs/SubAgentCreationDialog.tsx` around lines
125 - 136, The hardcoded prompt string in the SubAgentCreationDialog should be
replaced with a translatable key: update the call that sets formInitialData
(within the block using parseAgentFrontmatter and setFormInitialData) to use the
translation function (e.g. t('...')) instead of the literal 'Execute the
following task:', add the new i18n key/value to each locale file, and ensure
selectedCommand.promptContent fallback behavior remains unchanged; references to
parseAgentFrontmatter, setFormInitialData, setIsFormDialogOpen and
selectedCommand.promptContent should help you locate and update the correct
spot.
There was a problem hiding this comment.
Intentional — This was a deliberate decision to keep it English-only. The default prompt is a template for AI agent instructions, not user-facing UI text.
- Fallback to data.prompt when agentDefinition is missing (legacy compat) - Add agentDefinition to all sample subAgent nodes in workflow-schema.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## [3.31.0](v3.30.4...v3.31.0) (2026-03-26) ### Features * add built-in sub-agent presets with cross-platform export support ([#686](#686)) ([8188f84](8188f84)) ### Improvements * add confirm dialog before disabling group highlight ([#685](#685)) ([ba74dff](ba74dff)) * separate Agent Definition and Prompt in Sub-Agent node ([#687](#687)) ([b336890](b336890))
|
🎉 This PR is included in version 3.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Separate the Sub-Agent node's single "Prompt" field into two distinct fields: Agent Definition (what the agent IS) and Prompt (what to tell the agent to do). Also improve AI generation guidance to prioritize built-in agents and slim down the schema.
What Changed
Before
After
.mdfile bodyChanges
src/shared/types/workflow-definition.ts- AddagentDefinitionfield toSubAgentDatasrc/shared/types/messages.ts- AddagentDefinitiontoCreateSubAgentPayloadsrc/shared/constants/built-in-sub-agents.ts- AdddefaultAgentDefinitionKeyto presetsresources/workflow-schema.json- AddagentDefinitionfield, slim down guidance, prioritize built-in agentsresources/ai-editing-skill-template.md- Removelist_available_agentsfrom default flowsrc/webview/src/components/dialogs/SubAgentFormDialog.tsx- Add Agent Definition + Prompt dual fieldssrc/webview/src/components/dialogs/SubAgentCreationDialog.tsx- Route all selections through form dialog, parse YAML frontmattersrc/webview/src/components/nodes/SubAgentNode.tsx- Show agent name + prompt preview, simplify built-in badgesrc/webview/src/components/PropertyOverlay.tsx- Display both Agent Definition and Promptsrc/webview/src/components/NodePalette.tsx- Update handlers for new data flowsrc/webview/src/utils/agent-frontmatter.ts- Extract shared frontmatter parsersrc/extension/services/export-service.ts- UseagentDefinitionfor .md file bodysrc/webview/src/i18n/translation-keys.ts+ 5 language files - Add new translation keysTesting
npm run format && npm run lint && npm run check && npm run build)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation