Compare commits

...

2 Commits

Author SHA1 Message Date
Paul Preibisch 555e77016c fix(compiler): Preserve TTS data in agent frontmatter
**Problem:**
Agent compiler was stripping TTS data (intro and voices) when converting
.agent.yaml files to .md files. This caused all agents to use fallback
voice (en_US-lessac-medium) and generic intros in party mode.

**Root Cause:**
buildFrontmatter() only included name and description fields, omitting
the tts section from source YAML.

**Fix:**
- Modified buildFrontmatter() to accept and include TTS data
- Updated compileToXml() to extract TTS from parsed YAML
- TTS data now preserved in compiled .md frontmatter

**Impact:**
- Each agent now gets unique voice (ryan-high, kristin-medium, etc.)
- Personalized intros ("Hi! I'm John..." instead of "Hi! I'm Pm...")
- Party mode agents now distinguishable by voice

**Testing:**
 Tested with pm.agent.yaml → correct voice: en_US-ryan-high
 Tested with analyst.agent.yaml → correct voice: en_US-kristin-medium
 Verified TTS frontmatter structure matches manifest-generator expectations

**Related:**
- Fixes voice assignment issue in PR #987
- Enables proper multi-agent party mode experience
- Manifest generator already handles TTS correctly (no changes needed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-17 18:18:59 -07:00
Paul Preibisch 7f36711e6c fix(party-mode): Use displayName field instead of name in agent output
CRITICAL BUG FIX: Party mode was showing agent identifiers like
"Analyst", "Architect", "Dev" instead of actual persona names like
"Mary", "Winston", "Amelia" due to incorrect field references.

Changes:
- step-01-agent-loading.md: Use [displayName] not [Agent Name]
- step-02-discussion-orchestration.md: Use [displayName] not [Agent Name]
- Added CRITICAL warnings to use displayName field from manifest CSV

This ensures agents appear with their proper persona names throughout
party mode conversations and TTS announcements.

Resolves AgentVibes test31/test32 user feedback where all agents
showed generic title-cased identifiers instead of personas.
2025-12-12 00:16:48 -07:00
3 changed files with 42 additions and 11 deletions

View File

@ -79,12 +79,14 @@ Welcome {{user_name}}! I'm excited to facilitate an incredible multi-agent discu
[Display 3-4 diverse agents to showcase variety]: [Display 3-4 diverse agents to showcase variety]:
- [Icon Emoji] **[Agent Name]** ([Title]): [Brief role description] - [icon] **[displayName]** ([title]): [role]
- [Icon Emoji] **[Agent Name]** ([Title]): [Brief role description] - [icon] **[displayName]** ([title]): [role]
- [Icon Emoji] **[Agent Name]** ([Title]): [Brief role description] - [icon] **[displayName]** ([title]): [role]
**[Total Count] agents** are ready to contribute their expertise! **[Total Count] agents** are ready to contribute their expertise!
**CRITICAL:** Use the `displayName` field from the manifest CSV (e.g., "Mary", "Winston", "Amelia"), NOT the `name` field (e.g., "analyst", "architect", "dev").
**What would you like to discuss with the team today?**" **What would you like to discuss with the team today?**"
### 5. Present Continue Option ### 5. Present Continue Option

View File

@ -73,9 +73,11 @@ Generate authentic responses for each selected agent:
**Response Structure:** **Response Structure:**
[For each selected agent]: [For each selected agent]:
"[Icon Emoji] **[Agent Name]**: [Authentic in-character response] "[icon] **[displayName]**: [Authentic in-character response]
[Bash: .claude/hooks/bmad-speak.sh \"[Agent Name]\" \"[Their response]\"]" [Bash: .claude/hooks/bmad-speak.sh \"[displayName]\" \"[Their response]\"]"
**CRITICAL:** Use the `displayName` field from the manifest (e.g., "Mary", "Winston", "Amelia"), NOT the `name` field.
### 4. Natural Cross-Talk Integration ### 4. Natural Cross-Talk Integration

View File

@ -29,20 +29,44 @@ function escapeXml(text) {
* Build frontmatter for agent * Build frontmatter for agent
* @param {Object} metadata - Agent metadata * @param {Object} metadata - Agent metadata
* @param {string} agentName - Final agent name * @param {string} agentName - Final agent name
* @param {Object} ttsData - TTS data (intro and voices)
* @returns {string} YAML frontmatter * @returns {string} YAML frontmatter
*/ */
function buildFrontmatter(metadata, agentName) { function buildFrontmatter(metadata, agentName, ttsData = null) {
const nameFromFile = agentName.replaceAll('-', ' '); const nameFromFile = agentName.replaceAll('-', ' ');
const description = metadata.title || 'BMAD Agent'; const description = metadata.title || 'BMAD Agent';
return `--- let frontmatter = `---
name: "${nameFromFile}" name: "${nameFromFile}"
description: "${description}" description: "${description}"`;
---
// Include TTS data if available
if (ttsData) {
frontmatter += `\ntts:`;
if (ttsData.intro) {
// Escape double quotes in intro
const escapedIntro = ttsData.intro.replaceAll('"', String.raw`\"`);
frontmatter += `\n intro: "${escapedIntro}"`;
}
if (ttsData.voices && Array.isArray(ttsData.voices)) {
frontmatter += `\n voices:`;
for (const voice of ttsData.voices) {
frontmatter += `\n -`;
if (voice.piper) frontmatter += ` piper: "${voice.piper}"`;
if (voice.mac) frontmatter += ` mac: "${voice.mac}"`;
}
}
}
frontmatter += `\n---
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command. You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
`; `;
return frontmatter;
} }
/** /**
@ -393,8 +417,11 @@ function compileToXml(agentYaml, agentName = '', targetPath = '') {
let xml = ''; let xml = '';
// Build frontmatter // Extract TTS data from root level or agent level
xml += buildFrontmatter(meta, agentName || meta.name || 'agent'); const ttsData = agentYaml.tts || agent.tts || null;
// Build frontmatter with TTS data
xml += buildFrontmatter(meta, agentName || meta.name || 'agent', ttsData);
// Start code fence // Start code fence
xml += '```xml\n'; xml += '```xml\n';