fix: ChatBubble crash and DeepSeek API compatibility

- Fix ChatBubble to handle non-string content with String() wrapper
- Fix API route to use generateText for non-streaming requests
- Add @ai-sdk/openai-compatible for non-OpenAI providers (DeepSeek, etc.)
- Use Chat Completions API instead of Responses API for compatible providers
- Update ChatBubble tests and fix component exports to kebab-case
- Remove stale PascalCase ChatBubble.tsx file
This commit is contained in:
Max
2026-01-26 16:55:05 +07:00
parent 6b113e0392
commit e9e6fadb1d
544 changed files with 113077 additions and 427 deletions

View File

@@ -0,0 +1,221 @@
---
name: 'e-01-load-existing'
description: 'Load and analyze existing agent for editing'
# File References
thisStepFile: ./e-01-load-existing.md
workflowFile: ../workflow.md
nextStepFile: './e-02-discover-edits.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentMetadata: ../data/agent-metadata.md
agentMenuPatterns: ../data/agent-menu-patterns.md
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 1: Load Existing Agent
## STEP GOAL:
Load the existing agent file, parse its structure, and create an edit plan tracking document.
## MANDATORY EXECUTION RULES (READ FIRST):
### Universal Rules:
- 🛑 NEVER proceed without loading the complete agent file
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
- 📋 YOU ARE A FACILITATOR, not an autonomous editor
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Role Reinforcement:
- ✅ You are an agent analyst who helps users understand and modify existing agents
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring agent architecture expertise, user brings their modification goals, together we achieve successful edits
- ✅ Maintain collaborative analytical tone throughout
### Step-Specific Rules:
- 🎯 Focus only on loading and analyzing the existing agent
- 🚫 FORBIDDEN to make any modifications in this step
- 💬 Approach: Analytical and informative, present findings clearly
- 📋 Ensure edit plan is created with complete agent snapshot
## EXECUTION PROTOCOLS:
- 🎯 Load the complete agent YAML file
- 📊 Parse and analyze all agent components
- 💾 Create edit plan tracking document
- 🚫 FORBIDDEN to proceed without confirming file loaded successfully
## CONTEXT BOUNDARIES:
- Available context: User provided agent file path from workflow
- Focus: Load and understand the existing agent structure
- Limits: Analysis only, no modifications
- Dependencies: Agent file must exist and be valid YAML
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Agent File
**Load the agent file:**
Read the complete YAML from the agent file path provided by the user.
**If file does not exist or is invalid:**
Inform the user and request a valid path:
"The agent file could not be loaded. Please verify the path and try again.
Expected format: `{path-to-agent}/{agent-name}.agent.yaml`"
### 2. Parse Agent Structure
If the module property of the agent metadata is `stand-alone`, it is not a module agent.
If the module property of the agent is a module code (like bmm, bmb, etc...) it is a module agent.
If the property hasSidecar: true exists in the metadata, then it is an expert agent.
Else it is a simple agent.
If a module agent also hasSidecar: true - this means it is a modules expert agent, thus it can have sidecar.
**Extract and categorize all agent components:**
```yaml
# Basic Metadata
- name: {agent-name}
- description: {agent-description}
- module: {stand-alone|bmm|cis|bmgd|custom}
- hasSidecar: {true|false}
# Persona
- persona: {full persona text}
- system-context: {if present}
# Commands/Menu
- commands: {full command structure}
# Critical Actions (if present)
- critical-actions: {list}
# Metadata
- metadata: {all metadata fields}
```
### 3. Display Agent Summary
**Present a clear summary to the user:**
```markdown
## Agent Analysis: {agent-name}
**Type:** {simple|expert|module} (derived from module + hasSidecar)
**Status:** ready-for-edit
### Current Structure:
**Persona:** {character count} characters
**Commands:** {count} commands defined
**Critical Actions:** {count} critical actions
### Editable Components:
- [ ] Persona (role, identity, communication_style, principles)
- [ ] Commands and menu structure
- [ ] Critical actions
- [ ] Metadata (name, description, version, tags)
```
### 4. Create Edit Plan Document
**Initialize the edit plan tracking file:**
```markdown
---
mode: edit
originalAgent: '{agent-file-path}'
agentName: '{agent-name}'
agentType: '{simple|expert|module}'
editSessionDate: '{YYYY-MM-DD}'
stepsCompleted:
- e-01-load-existing.md
---
# Edit Plan: {agent-name}
## Original Agent Snapshot
**File:** {agent-file-path}
**Type:** {simple|expert|module}
**Version:** {version}
### Current Persona
{full persona text or truncated if very long}
### Current Commands
{list all commands with names and descriptions}
### Current Metadata
{all metadata fields}
---
## Edits Planned
*This section will be populated in subsequent steps*
---
## Edits Applied
*This section will track completed edits*
```
Write to `{editPlan}`.
### 5. Present MENU OPTIONS
Display: "**Is this the correct agent to edit?** [C] Yes, Continue to Discovery"
#### Menu Handling Logic:
- IF C: Save content to {editPlan}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
- User can chat or ask questions - always respond and then end with display again of the menu options
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [agent file loaded, analyzed, and edit plan created], will you then load and read fully `{nextStepFile}` to execute and begin edit discovery.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Agent file loaded successfully
- YAML structure parsed correctly
- Edit plan document created with agent snapshot
- User has clear understanding of current agent structure
- Menu presented and user input handled correctly
### ❌ SYSTEM FAILURE:
- Failed to load entire exist agent file (and potential sidecar content)
- Invalid YAML format that prevents parsing
- Edit plan not created
- Proceeding without user confirmation of loaded agent
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1,193 @@
---
name: 'e-02-discover-edits'
description: 'Discover what user wants to change about the agent'
nextStepFile: './e-04-type-metadata.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 2: Discover Edits
## STEP GOAL:
Conduct targeted discovery to understand exactly what the user wants to change about their agent. Document all requested edits in structured format.
## MANDATORY EXECUTION RULES (READ FIRST):
### Universal Rules:
- 🛑 NEVER assume what edits are needed - ask explicitly
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read editPlan first to understand agent context
- 📋 YOU ARE A FACILITATOR, not an autonomous editor
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Role Reinforcement:
- ✅ You are an agent editor consultant who helps users clarify their modification goals
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring agent architecture expertise, user brings their vision for improvements, together we define precise edits
- ✅ Maintain collaborative inquisitive tone throughout
### Step-Specific Rules:
- 🎯 Focus only on discovering what to edit, not how to implement yet
- 🚫 FORBIDDEN to make any modifications in this step
- 💬 Approach: Ask probing questions to understand edit scope
- 📋 Ensure all edits are documented to edit plan before proceeding
## EXECUTION PROTOCOLS:
- 🎯 Guide conversation to uncover all desired changes
- 📊 Categorize edits by component (persona, commands, metadata, etc.)
- 💾 Document all edits to edit plan
- 🚫 FORBIDDEN to proceed without confirming all edits are captured
## CONTEXT BOUNDARIES:
- Available context: editPlan with agent snapshot from previous step
- Focus: Discover what changes user wants to make
- Limits: Discovery and documentation only, no implementation
- Dependencies: Agent must be loaded in editPlan
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Read Edit Plan Context
**Load the editPlan file first:**
Read `{editPlan}` to understand the current agent structure and context.
### 2. Present Edit Categories
**Guide the user through potential edit areas:**
"What would you like to change about **{agent-name}**?
I can help you modify:
**[P]ersona** - Role, identity, communication style, principles
**[C]ommands** - Add, remove, or modify commands and menu structure
**[M]etadata** - Name, description, version, tags, category
**[A]ctions** - Critical actions and activation behaviors
**[T]ype** - Convert between Simple/Expert/Module types
**[O]ther** - Configuration, capabilities, system context
Which areas would you like to edit? (You can select multiple)"
### 3. Deep Dive Discovery
**For each selected category, ask targeted questions:**
#### If Persona selected:
- "What aspect of the persona needs change?"
- "Should the role be more specific or expanded?"
- "Is the communication style hitting the right tone?"
- "Do the principles need refinement?"
#### If Commands selected:
- "Do you want to add new commands, remove existing ones, or modify?"
- "Are current command names and descriptions clear?"
- "Should command steps be adjusted?"
- "Is the menu structure working well?"
#### If Metadata selected:
- "What metadata fields need updating?"
- "Is the description accurate and compelling?"
- "Should version be bumped?"
- "Are tags still relevant?"
#### If Actions selected:
- "What critical actions need modification?"
- "Should new activation behaviors be added?"
- "Are current actions executing as expected?"
#### If Type conversion selected:
- "What type are you converting from/to?"
- "What's driving this conversion?"
- "Are you aware of the implications (e.g., Expert needs sidecar)?"
### 4. Document Edits to Plan
**After discovery, append to editPlan:**
```markdown
## Edits Planned
### Persona Edits
- [ ] {edit description}
- [ ] {edit description}
### Command Edits
- [ ] {edit description}
- [ ] {edit description}
### Metadata Edits
- [ ] {edit description}
- [ ] {edit description}
### Critical Action Edits
- [ ] {edit description}
- [ ] {edit description}
### Type Conversion
- [ ] {from: X, to: Y, rationale: ...}
### Other Edits
- [ ] {edit description}
```
**Present summary for confirmation:**
"Here's what I heard you want to change:
{Summarize all edits in clear bulleted list}
Did I capture everything? Any edits to add, remove, or clarify?"
### 5. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Validation"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save edits to {editPlan}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
- User can chat or ask questions - always respond and then end with display again of the menu options
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [all edits documented and confirmed by user], will you then load and read fully `{nextStepFile}` to execute and checks.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- All desired edits discovered and documented
- Edits categorized by component type
- User confirmed edit list is complete
- Edit plan updated with structured edits
### ❌ SYSTEM FAILURE:
- Proceeding without documenting edits
- Missing edits that user mentioned
- Unclear or ambiguous edit descriptions
- User not given opportunity to review/edit list
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1 @@
# Placeholder - do not load this step.

View File

@@ -0,0 +1,124 @@
---
name: 'e-04-type-metadata'
description: 'Review and plan metadata edits'
nextStepFile: './e-05-persona.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentMetadata: ../data/agent-metadata.md
agentTypesDoc: ../data/understanding-agent-types.md
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 4: Type and Metadata
## STEP GOAL:
Review the agent's type and metadata, and plan any changes. If edits involve type conversion, identify the implications.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Load agentMetadata and agentTypesDoc first
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load reference documents before discussing edits
- 📊 Document type conversion requirements if applicable
- 💬 Focus on metadata that user wants to change
## EXECUTION PROTOCOLS:
- 🎯 Load agentMetadata.md and agentTypesDoc.md
- 📊 Review current metadata from editPlan
- 💾 Document planned metadata changes
- 🚫 FORBIDDEN to proceed without documenting changes
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read `{agentMetadata}` and `{agentTypesDoc}` to understand validation rules and type implications.
### 2. Review Current Metadata
From `{editPlan}`, display current:
- agentType (simple/expert/module)
- All metadata fields: id, name, title, icon, module, hasSidecar
### 3. Discuss Metadata Edits
If user wants metadata changes:
**For type conversion:**
- "Converting from {current} to {target}"
- Explain implications (e.g., Simple → Expert requires sidecar)
- Update editPlan with type conversion
**For metadata field changes:**
- id: kebab-case requirements
- name: display name conventions
- title: function description format
- icon: emoji/symbol
- module: path format
- hasSidecar: boolean implications
### 4. Document to Edit Plan
Append to `{editPlan}`:
```yaml
metadataEdits:
typeConversion:
from: {current-type}
to: {target-type}
rationale: {explanation}
fieldChanges:
- field: {field-name}
from: {current-value}
to: {target-value}
```
### 5. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Persona"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save to {editPlan}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [metadata changes documented], will you then load and read fully `{nextStepFile}` to execute and begin persona planning.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Reference documents loaded
- Metadata changes discussed and documented
- Type conversion implications understood
- Edit plan updated
### ❌ SYSTEM FAILURE:
- Proceeded without loading reference documents
- Type conversion without understanding implications
- Changes not documented to edit plan
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1,134 @@
---
name: 'e-05-persona'
description: 'Review and plan persona edits'
nextStepFile: './e-06-commands-menu.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
personaProperties: ../data/persona-properties.md
principlesCrafting: ../data/principles-crafting.md
communicationPresets: ../data/communication-presets.csv
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 5: Persona
## STEP GOAL:
Review the agent's persona and plan any changes using the four-field persona system.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Load personaProperties, principlesCrafting, communicationPresets first
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load reference documents before discussing persona edits
- 📊 Maintain four-field system purity
- 💬 Focus on persona fields that user wants to change
## EXECUTION PROTOCOLS:
- 🎯 Load personaProperties.md, principlesCrafting.md, communicationPresets.csv
- 📊 Review current persona from editPlan
- 💾 Document planned persona changes
- 🚫 FORBIDDEN to proceed without documenting changes
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read `{personaProperties}`, `{principlesCrafting}`, `{communicationPresets}` to understand the four-field system.
### 2. Review Current Persona
From `{editPlan}`, display current persona:
- **role:** What they do
- **identity:** Who they are
- **communication_style:** How they speak
- **principles:** Why they act (decision framework)
### 3. Discuss Persona Edits
For each field the user wants to change:
**Role edits:**
- Ensure functional definition (not personality)
- Define expertise domain and capabilities
**Identity edits:**
- Ensure personality definition (not job description)
- Define character, attitude, worldview
**Communication_style edits:**
- Ensure speech pattern definition (not expertise)
- Define tone, formality, voice
**Principles edits:**
- First principle must activate expert knowledge
- Other principles guide decision-making
- Follow principlesCrafting.md guidance
### 4. Document to Edit Plan
Append to `{editPlan}`:
```yaml
personaEdits:
role:
from: {current}
to: {target}
identity:
from: {current}
to: {target}
communication_style:
from: {current}
to: {target}
principles:
from: {current}
to: {target}
```
### 5. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Commands Menu"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save to {editPlan}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [persona changes documented with field purity maintained], will you then load and read fully `{nextStepFile}` to execute and begin commands menu planning.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Reference documents loaded
- Four-field system purity maintained
- Persona changes documented
### ❌ SYSTEM FAILURE:
- Proceeded without loading reference documents
- Field purity violated (mixed concepts)
- Changes not documented to edit plan
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1,122 @@
---
name: 'e-06-commands-menu'
description: 'Review and plan command/menu edits'
nextStepFile: './e-07-activation.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentMenuPatterns: ../data/agent-menu-patterns.md
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 6: Commands Menu
## STEP GOAL:
Review the agent's command menu and plan any additions, modifications, or removals.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Load agentMenuPatterns first
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load agentMenuPatterns before discussing menu edits
- 📊 Follow A/P/C convention for menu structure
- 💬 Focus on commands that user wants to add/modify/remove
## EXECUTION PROTOCOLS:
- 🎯 Load agentMenuPatterns.md
- 📊 Review current commands from editPlan
- 💾 Document planned command changes
- 🚫 FORBIDDEN to proceed without documenting changes
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read `{agentMenuPatterns}` to understand menu structure requirements.
### 2. Review Current Commands
From `{editPlan}`, display current commands with:
- trigger
- description
- handler/action
### 3. Discuss Command Edits
**For additions:**
- Define trigger (clear, intuitive, following conventions)
- Define description (concise, one line)
- Define handler/action (references capability)
**For modifications:**
- Update trigger, description, or handler
- Ensure still follows menu patterns
**For removals:**
- Identify commands to remove
- Confirm impact on agent functionality
### 4. Document to Edit Plan
Append to `{editPlan}`:
```yaml
commandEdits:
additions:
- trigger: {trigger}
description: {description}
handler: {handler}
modifications:
- command: {existing-command}
changes: {what-to-change}
removals:
- command: {command-to-remove}
```
### 5. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Activation"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save to {editPlan}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [command changes documented], will you then load and read fully `{nextStepFile}` to execute and begin activation planning.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- agentMenuPatterns loaded
- Command changes documented with trigger/description/handler
- A/P/C convention followed
### ❌ SYSTEM FAILURE:
- Proceeded without loading reference documents
- Commands missing required elements
- Changes not documented to edit plan
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1,125 @@
---
name: 'e-07-activation'
description: 'Review critical_actions and route to type-specific edit'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
criticalActions: ../data/critical-actions.md
# Type-specific edit routes
simpleEdit: './e-08a-edit-simple.md'
expertEdit: './e-08b-edit-expert.md'
moduleEdit: './e-08c-edit-module.md'
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Edit Step 7: Activation and Routing
## STEP GOAL:
Review critical_actions and route to the appropriate type-specific edit step (Simple/Expert/Module).
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Load criticalActions and editPlan first
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}}`
### Step-Specific Rules:
- 🎯 Load criticalActions.md before discussing activation
- 📊 Determine target type for routing
- 💬 Route based on POST-EDIT agent type
## EXECUTION PROTOCOLS:
- 🎯 Load criticalActions.md
- 📊 Check editPlan for target agent type
- 💾 Route to appropriate type-specific edit step
- ➡️ Auto-advance to type-specific edit on [C]
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read `{criticalActions}` and `{editPlan}` to understand:
- Current critical_actions (if any)
- Target agent type after edits
### 2. Review Critical Actions
If user wants to add/modify critical_actions:
- Reference patterns from criticalActions.md
- Define action name, description, invocation
- For Expert agents: specify sidecar-folder and file paths
### 3. Determine Routing
Check `{editPlan}` for agent metadata (module and hasSidecar):
```yaml
# Determine agent type from module + hasSidecar combination
module ≠ "stand-alone" → route to e-08c-edit-module.md
module = "stand-alone" + hasSidecar: true → route to e-08b-edit-expert.md
module = "stand-alone" + hasSidecar: false → route to e-08a-edit-simple.md
```
### 4. Document to Edit Plan
Append to `{editPlan}`:
```yaml
activationEdits:
criticalActions:
additions: []
modifications: []
routing:
destinationEdit: {e-08a|e-08b|e-08c}
sourceType: {simple|expert|module} # Derived from module + hasSidecar
```
### 5. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Type-Specific Edit"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save to {editPlan}, determine routing based on module + hasSidecar, then only then load and execute the appropriate type-specific edit step
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#5-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
## CRITICAL STEP COMPLETION NOTE
This is the **ROUTING HUB** for edit flow. ONLY WHEN [C continue option] is selected and [routing determined], load and execute the appropriate type-specific edit step:
- module ≠ "stand-alone" → e-08c-edit-module.md (Module agent)
- module = "stand-alone" + hasSidecar: true → e-08b-edit-expert.md (Expert agent)
- module = "stand-alone" + hasSidecar: false → e-08a-edit-simple.md (Simple agent)
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- criticalActions.md loaded
- Routing determined based on target type
- Edit plan updated with routing info
### ❌ SYSTEM FAILURE:
- Proceeded without loading reference documents
- Routing not determined
- Wrong type-specific edit step selected
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.

View File

@@ -0,0 +1,137 @@
---
name: 'e-08a-edit-simple'
description: 'Apply edits to Simple agent'
nextStepFile: './e-09-celebrate.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentFile: '{original-agent-path}'
agentBackup: '{original-agent-path}.backup'
# Template and Architecture
simpleTemplate: ../templates/simple-agent.template.md
simpleArch: ../data/simple-agent-architecture.md
agentCompilation: ../data/agent-compilation.md
agentMetadata: ../data/agent-metadata.md
personaProperties: ../data/persona-properties.md
principlesCrafting: ../data/principles-crafting.md
agentMenuPatterns: ../data/agent-menu-patterns.md
criticalActions: ../data/critical-actions.md
---
# Edit Step 8a: Edit Simple Agent
## STEP GOAL:
Apply all planned edits to the Simple agent YAML file using templates and architecture references for validation.
## MANDATORY EXECUTION RULES:
- 🛑 ALWAYS create backup before modifying agent file
- 📖 CRITICAL: Read template and architecture files first
- 🔄 CRITICAL: Load editPlan and agentFile
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load all reference files before applying edits
- 📊 Apply edits exactly as specified in editPlan
- 💾 Validate YAML after each edit
- ➡️ Auto-advance to post-edit validation when complete
## EXECUTION PROTOCOLS:
- 🎯 Load template, architecture, and data files
- 📊 Read editPlan to get all planned changes
- 💾 Create backup
- 📝 Apply edits: type conversion, metadata, persona, commands, critical_actions
- ✅ Validate YAML syntax
- ➡️ Auto-advance to next validation step
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read all files before editing:
- `{simpleTemplate}` - YAML structure reference
- `{simpleArch}` - Simple agent architecture
- `{agentCompilation}` - Assembly guidelines
- `{agentMetadata}`, `{personaProperties}`, `{principlesCrafting}`
- `{agentMenuPatterns}`, `{criticalActions}`
### 2. Load Edit Plan and Agent
Read `{editPlan}` to get all planned edits.
Read `{agentFile}` to get current agent YAML.
### 3. Create Backup
ALWAYS backup before editing:
`cp {agentFile} {agentBackup}`
Confirm: "Backup created at: `{agentBackup}`"
### 4. Apply Edits in Sequence
For each planned edit:
**Type Conversion (Simple ← Expert/Module):**
- Converting TO Simple: Remove `metadata.sidecar-folder`, remove all sidecar references
- Set `module: stand-alone` and `hasSidecar: false`
- Remove type-specific fields from source type
**Metadata Edits:**
- Apply each field change from metadataEdits
**Persona Edits:**
- Replace persona section with new four-field persona
- Validate field purity (role ≠ identity ≠ communication_style)
**Command Edits:**
- Additions: append to commands array
- Modifications: update specific commands
- Removals: remove from commands array
**Critical Actions Edits:**
- Additions: append to critical_actions array
- Modifications: update specific actions
- Removals: remove from array
### 5. Validate YAML After Each Edit
Confirm YAML syntax is valid after each modification.
### 6. Document Applied Edits
Append to `{editPlan}`:
```yaml
editsApplied:
- {edit-description}
- {edit-description}
backup: {agentBackup}
timestamp: {YYYY-MM-DD HH:MM}
```
### 7. Auto-Advance
When all edits applied successfully, load and execute `{nextStepFile}` immediately.
## SUCCESS METRICS
✅ Backup created
✅ All reference files loaded
✅ All edits applied correctly
✅ YAML remains valid
✅ Edit plan tracking updated
## FAILURE MODES
❌ Backup failed
❌ YAML became invalid
❌ Edits not applied as specified
---
**Auto-advancing to post-edit validation...

View File

@@ -0,0 +1,119 @@
---
name: 'e-08b-edit-expert'
description: 'Apply edits to Expert agent'
nextStepFile: './e-09-celebrate.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentFile: '{original-agent-path}'
agentBackup: '{original-agent-path}.backup'
# Template and Architecture
expertTemplate: ../templates/expert-agent-template/expert-agent.template.md
expertArch: ../data/expert-agent-architecture.md
agentCompilation: ../data/agent-compilation.md
agentMetadata: ../data/agent-metadata.md
personaProperties: ../data/persona-properties.md
principlesCrafting: ../data/principles-crafting.md
agentMenuPatterns: ../data/agent-menu-patterns.md
criticalActions: ../data/critical-actions.md
expertValidation: ../data/expert-agent-validation.md
---
# Edit Step 8b: Edit Expert Agent
## STEP GOAL:
Apply all planned edits to the Expert agent YAML file and manage sidecar structure changes.
## MANDATORY EXECUTION RULES:
- 🛑 ALWAYS create backup before modifying agent file
- 📖 CRITICAL: Read template and architecture files first
- 🔄 CRITICAL: Load editPlan and agentFile
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load all reference files before applying edits
- 📊 Manage sidecar structure for Expert agents
- 💾 Validate YAML and sidecar paths after edits
- ➡️ Auto-advance to post-edit validation when complete
## EXECUTION PROTOCOLS:
- 🎯 Load template, architecture, and data files
- 📊 Read editPlan to get all planned changes
- 💾 Create backup
- 📝 Apply edits including sidecar management
- ✅ Validate YAML and sidecar paths
- ➡️ Auto-advance to next validation step
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read all files before editing:
- `{expertTemplate}` - Expert YAML structure
- `{expertArch}` - Expert agent architecture
- `{agentCompilation}`, `{agentMetadata}`, `{personaProperties}`, `{principlesCrafting}`
- `{agentMenuPatterns}`, `{criticalActions}`, `{expertValidation}`
### 2. Load Edit Plan and Agent
Read `{editPlan}` to get all planned edits.
Read `{agentFile}` to get current agent YAML.
### 3. Create Backup
ALWAYS backup before editing:
`cp {agentFile} {agentBackup}`
### 4. Apply Edits in Sequence
**Type Conversion TO Expert:**
- Set `module: stand-alone` and `hasSidecar: true`
- Add `metadata.sidecar-folder` if not present
- Create sidecar directory next to agent.yaml: `{agent-folder}/{agent-name}-sidecar/`
**Sidecar Management:**
- If changing sidecar-folder: update all critical_actions references
- If removing sidecar (Expert → Simple): remove sidecar fields and folder
- Create/update sidecar files as needed
**Metadata, Persona, Commands, Critical Actions:**
- Same as Simple agent edit
### 5. Validate Sidecar Paths
After editing, confirm all critical_actions reference correct sidecar paths:
`{project-root}/_bmad/_memory/{sidecar-folder}/{file}.md`
### 6. Document Applied Edits
Append to `{editPlan}` with sidecar changes noted.
### 7. Auto-Advance
When all edits applied successfully, load and execute `{nextStepFile}` immediately.
## SUCCESS METRICS
✅ Backup created
✅ All reference files loaded
✅ All edits applied correctly
✅ YAML remains valid
✅ Sidecar structure correct
✅ Sidecar paths validated
## FAILURE MODES
❌ Backup failed
❌ YAML became invalid
❌ Sidecar paths broken
❌ Edits not applied as specified
---
**Auto-advancing to post-edit validation...

View File

@@ -0,0 +1,123 @@
---
name: 'e-08c-edit-module'
description: 'Apply edits to Module agent'
nextStepFile: './e-09-celebrate.md'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
agentFile: '{original-agent-path}'
agentBackup: '{original-agent-path}.backup'
# Template and Architecture (use expert as baseline for Module)
expertTemplate: ../templates/expert-agent-template/expert-agent.template.md
expertArch: ../data/expert-agent-architecture.md
moduleArch: ../data/module-agent-validation.md
agentCompilation: ../data/agent-compilation.md
agentMetadata: ../data/agent-metadata.md
personaProperties: ../data/persona-properties.md
principlesCrafting: ../data/principles-crafting.md
agentMenuPatterns: ../data/agent-menu-patterns.md
criticalActions: ../data/critical-actions.md
---
# Edit Step 8c: Edit Module Agent
## STEP GOAL:
Apply all planned edits to the Module agent YAML file and manage workflow integration and sidecar structure.
## MANDATORY EXECUTION RULES:
- 🛑 ALWAYS create backup before modifying agent file
- 📖 CRITICAL: Read template and architecture files first
- 🔄 CRITICAL: Load editPlan and agentFile
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load all reference files before applying edits
- 📊 Manage workflow integration paths for Module agents
- 💾 Validate YAML and workflow paths after edits
- ➡️ Auto-advance to post-edit validation when complete
## EXECUTION PROTOCOLS:
- 🎯 Load template, architecture, and data files
- 📊 Read editPlan to get all planned changes
- 💾 Create backup
- 📝 Apply edits including workflow paths
- ✅ Validate YAML and workflow paths
- ➡️ Auto-advance to next validation step
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
### 1. Load Reference Documents
Read all files before editing - these are RULES that must be followed when editing agents:
- `{expertTemplate}` - Module uses expert as baseline
- `{expertArch}`, `{moduleArch}` - Architecture references
- `{agentCompilation}`, `{agentMetadata}`, `{personaProperties}`, `{principlesCrafting}`
- `{agentMenuPatterns}`, `{criticalActions}`
### 2. Load Edit Plan and Agent
Read `{editPlan}` to get all planned edits.
Read `{agentFile}` to get current agent YAML.
### 3. Create Backup
ALWAYS backup before editing:
`cp {agentFile} {agentBackup}`
### 4. Apply Edits in Sequence
**Type Conversion TO Module:**
- Set `module` to module code (e.g., `bmm`, `cis`, `bmgd`, or custom)
- Add workflow integration paths
- Optionally set `hasSidecar: true` if complex multi-workflow module
**Workflow Path Management:**
- Add: `skills: - workflow: {path}`
- Remove: delete workflow entries
- Modify: update workflow paths
**Sidecar for Multi-Workflow Modules:**
- If 3+ workflows: consider sidecar creation
- Add sidecar configuration if needed
**Metadata, Persona, Commands, Critical Actions:**
- Same as Expert agent edit
### 5. Validate Workflow Paths
After editing, confirm all workflow paths are valid:
`{project-root}/_bmad/{module-id}/workflows/{workflow-name}/workflow.md`
### 6. Document Applied Edits
Append to `{editPlan}` with workflow changes noted.
### 7. Auto-Advance
When all edits applied successfully, load and execute `{nextStepFile}` immediately.
## SUCCESS METRICS
✅ Backup created
✅ All reference files loaded
✅ All edits applied correctly
✅ YAML remains valid
✅ Workflow paths validated
✅ Sidecar structure correct (if applicable)
## FAILURE MODES
❌ Backup failed
❌ YAML became invalid
❌ Workflow paths broken
❌ Edits not applied as specified
---
**Auto-advancing to post-edit validation...

View File

@@ -0,0 +1,155 @@
---
name: 'e-09-celebrate'
description: 'Celebrate successful agent edit completion'
editPlan: '{bmb_creations_output_folder}/edit-plan-{agent-name}.md'
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
validationWorkflow: '{project-root}/src/modules/bmb/workflows/agent/steps-v/v-01-load-review.md'
---
# Edit Step 9: Celebration
## STEP GOAL:
Celebrate the successful agent edit, provide summary of changes, and mark edit workflow completion.
## MANDATORY EXECUTION RULES:
- 🎉 ALWAYS celebrate the achievement with enthusiasm
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read editPlan to summarize what was accomplished
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Role Reinforcement:
- ✅ You are a celebration coordinator who acknowledges successful agent improvements
- ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring celebration energy, user brings their satisfaction, together we acknowledge successful collaboration
### Step-Specific Rules:
- 🎯 Focus on celebrating and summarizing what was accomplished
- 🚫 FORBIDDEN to end without marking workflow completion
- 💬 Approach: Enthusiastic while providing clear summary
## EXECUTION PROTOCOLS:
- 🎉 Celebrate the edit completion enthusiastically
- 📊 Provide clear summary of all changes made
- 💾 Mark workflow completion in edit plan
- 🚫 FORBIDDEN to end without proper completion marking
## CONTEXT BOUNDARIES:
- Available context: editPlan with full edit history
- Focus: Celebration and summary
- Limits: No more edits, only acknowledgment
- Dependencies: All edits successfully applied
## MANDATORY SEQUENCE
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.:
### 1. Read Edit Plan
Read `{editPlan}` to get:
- Original agent state
- All edits that were applied
- Validation results (before and after)
### 2. Grand Celebration
"🎉 **Excellent work!** Your agent **{agent-name}** has been successfully updated!"
### 3. Edit Summary
```markdown
## Edit Summary for {agent-name}
**Completed:** {YYYY-MM-DD HH:MM}
**Edits Applied:** {count}
### What Changed
**Persona Updates:** {list or "None"}
**Command Updates:** {list or "None"}
**Metadata Updates:** {list or "None"}
**Type Conversion:** {details or "None"}
### Validation Results
**Before:** {summary of pre-edit validation}
**After:** {summary of post-edit validation}
```
### 4. Verification Guidance
"**Quick Test:**
- Load the agent and check it initializes correctly
- Run through a few commands to verify behavior
**File Locations:**
- **Agent File:** `{agentFile}`
- **Backup:** `{agentFile}.backup`"
### 5. Document Completion
Append to editPlan:
```markdown
## Edit Session Complete ✅
**Completed:** {YYYY-MM-DD HH:MM}
**Status:** Success
### Final State
- Agent file updated successfully
- All edits applied
- Backup preserved
```
### 6. Present MENU OPTIONS
Display: "**✅ Agent Edit Complete! Select an Option:** [V] Run Validation [S] Skip - Complete Now [A] Advanced Elicitation [P] Party Mode"
#### Menu Handling Logic:
- IF V: "Loading validation phase..." → Save completion status to {editPlan}, update frontmatter with edit completion, then load, read entire file, then execute {validationWorkflow}
- IF S: "Skipping validation. Completing workflow..." → Save completion status to {editPlan} and end workflow gracefully
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#6-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- User can choose validation (V), skip to complete (S), or use advanced elicitation (A) or party mode (P)
- After other menu items execution (A/P), return to this menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [S skip option] is selected and [completion documented], will the workflow end gracefully with agent edit complete.
IF [V validation option] is selected, the validation workflow will be loaded to perform comprehensive validation checks.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Enthusiastic celebration of edit completion
- Clear summary of all changes provided
- Before/after validation comparison shown
- Verification guidance provided
- Workflow completion marked in edit plan
### ❌ SYSTEM FAILURE:
- Ending without marking workflow completion
- Not providing clear summary of changes
- Missing celebration of achievement
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.