Skip to content

Conversation

@paulpreibisch
Copy link
Contributor

@paulpreibisch paulpreibisch commented Nov 27, 2025

Summary

  • Fixes npm prefix environment variable inheritance issue when BMAD is invoked with --prefix flag
  • Clears ALL npm_config_* and npm_package_* environment variables before spawning AgentVibes installer subprocess
  • Swaps bmad-master and pm (John) voice assignments for better persona fit
  • Moves AgentVibes TTS prompt after tool selection with smart defaults (Y if Claude Code selected)
  • Generates voice map CSV with intro messages for party mode agent introductions
  • Updates party mode to have agents introduce themselves automatically on activation

Problem

When BMAD is invoked with npm --prefix /some/path install, npm sets many environment variables that get inherited by child processes. This caused the AgentVibes installer to fail with:

ENOENT: no such file or directory, lstat '/home/fire/claude/BMAD-METHOD/lib'

Solution

1. Clean npm environment

Filter out all npm configuration environment variables before calling npx agentvibes@latest install:

const cleanEnv = Object.fromEntries(
  Object.entries(process.env).filter(
    ([key]) => !key.startsWith('npm_config_') && !key.startsWith('npm_package_')
  ),
);

2. Voice assignment swap

  • bmad-master: en_US-ryan-high -> en_US-lessac-medium
  • pm (John): en_US-lessac-medium -> en_US-ryan-high

3. Smart AgentVibes prompt

  • Move TTS prompt to after IDE/tool selection
  • Default to Y if Claude Code is selected (AgentVibes only works with Claude Code)
  • Default to N if Claude Code is not selected

4. Voice map with intros

  • Generate _cfg/agent-voice-map.csv during BMAD install
  • Include intro column with personality-specific introduction messages
  • Party mode now automatically has 3-4 agents introduce themselves on activation

Test plan

  • Install BMAD using npm --prefix /some/test/dir install bmad-method
  • Verify AgentVibes installer launches successfully without path errors
  • Verify installation completes in the correct target directory
  • Verify voice map CSV is generated with correct voice assignments
  • Verify party mode agents introduce themselves automatically

🤖 Generated with Claude Code

Paul Preibisch and others added 5 commits December 6, 2025 12:02
When BMAD is invoked with --prefix flag, npm sets many npm_config_*
and npm_package_* environment variables. These caused npx agentvibes
to look for files in the wrong directory (/prefix/lib instead of cwd).

Changes:
- tools/cli/commands/install.js: Filter out ALL npm_config_* and
  npm_package_* env vars before calling npx agentvibes
- tools/cli/installers/lib/core/installer.js: Add AgentVibes prompt
  to Quick Update flow so existing installations can enable TTS
- tools/cli/installers/lib/core/manifest-generator.js: Track
  agentVibes configuration in manifest.yaml

This ensures AgentVibes runs in a clean environment regardless of
how BMAD was invoked (with or without --prefix flag).

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

Co-Authored-By: Claude <[email protected]>
- bmad-master: en_US-ryan-high → en_US-lessac-medium
- pm (john): en_US-lessac-medium → en_US-ryan-high

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

Co-Authored-By: Claude <[email protected]>
- Move AgentVibes TTS prompt to after IDE/tool selection
- Default to Y if Claude Code is selected (since AgentVibes only works with Claude Code)
- Default to N if Claude Code is not selected
- Remove mid-install warning about AgentVibes not being installed (handled at end)
- Pass configured IDEs to quick update flow for consistent behavior

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

Co-Authored-By: Claude <[email protected]>
- Generate _cfg/agent-voice-map.csv during BMAD install with voice and intro columns
- Update party mode instructions to have 3-4 agents introduce themselves on activation
- Each agent speaks their personalized intro message via TTS

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

Co-Authored-By: Claude <[email protected]>
Previously, BMAD would skip the AgentVibes installer if it detected
existing hook files (.claude/hooks/bmad-speak.sh and play-tts.sh).
This prevented users from getting AgentVibes updates.

Now when user says "Yes" to AgentVibes, it always runs the installer,
ensuring users get the latest version with new features and fixes.

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

Co-Authored-By: Claude <[email protected]>
@paulpreibisch paulpreibisch force-pushed the fix/agentvibes-npm-env-inheritance branch from 6d5d32a to ba2d6c5 Compare December 6, 2025 19:21
Paul Preibisch and others added 4 commits December 6, 2025 12:51
- Add optional `tts` section to agent schema with intro and voices
- Update manifest-generator.js to read TTS from YAML and generate provider-aware CSV
- Add TTS configuration to all 9 agent YAML files with Piper and macOS voices
- Voice map CSV now auto-generated from agent YAML instead of hardcoded
- Provider-aware: auto-selects correct voice based on active TTS (Piper/macOS)

Benefits:
- Declarative: voice config lives with agent definition
- Loose coupling: AgentVibes reads CSV, no YAML dependency
- Extensible: new agents automatically get voice mapping

Related:
- Created comprehensive test suite in AgentVibes repo (test/unit/bmad-voice-map.bats)
- All 10 tests passing (8 pass, 2 skip future features)
- Validates BMAD → AgentVibes voice configuration pipeline

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove 'elevenlabs' fallback from providerVoiceField mapping
- ElevenLabs is no longer supported in AgentVibes
- Only Piper and macOS providers remain

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
bmadcode
bmadcode previously approved these changes Dec 7, 2025

Build complete agent roster with merged personalities for conversation orchestration.

### Voice Map Loading (Optional)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove (optional) - if not, especially codex, will choose to just skip the whole section without even looking at the if condition within the section.

Paul Preibisch and others added 2 commits December 7, 2025 15:14
- Resolved .gitignore merge conflict (kept both changes)
- Removed '(Optional)' from Voice Map Loading section in party-mode workflow per code review feedback

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Addresses code review feedback - removing (Optional) prevents agents from
skipping the section without evaluating the conditional logic within.

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Dec 7, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Automatically includes --with-audio parameter when installing AgentVibes
for the first time (detects by checking if .agentvibes directory exists).
This ensures new users get audio tracks downloaded automatically.

Updates skip --with-audio to avoid re-downloading existing audio files.

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@paulpreibisch
Copy link
Contributor Author

✅ Test Results

All BMAD tests passing successfully:

Schema Validation Tests

  • 49/49 tests passed
  • All agent schema validations working correctly
  • Invalid schema tests catching errors as expected
  • Valid schema tests passing

Installation Component Tests

  • 13/13 tests passed
  • Agent compilation working correctly
  • Customization merging functioning properly
  • Path variable resolution validated
  • TEA agent compilation verified

Schema Validation

  • 21/21 agent files validated
  • All core and module agents passing validation

Linting

  • ESLint passed with 0 warnings

Note: The only minor issue is a permission error on markdownlint-cli2, which doesn't affect the core functionality.

All critical tests are passing for PR #987! ✨

Paul Preibisch and others added 2 commits December 12, 2025 00:16
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.
**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 bmad-code-org#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants