agentvibes 2.0.10 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,196 @@
1
+ # /agent-vibes:bmad Command
2
+
3
+ Complete BMAD voice integration - assigns unique voices to each BMAD agent AND makes them speak when activated.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /agent-vibes:bmad <subcommand> [arguments]
9
+ ```
10
+
11
+ ## Subcommands
12
+
13
+ ### `enable`
14
+ Enables voice assignment for BMAD agents AND automatically injects TTS into agent activation instructions.
15
+
16
+ **What it does:**
17
+ 1. ✅ Enables BMAD voice plugin (assigns voices to agents)
18
+ 2. ✅ Backs up current voice/personality settings
19
+ 3. ✅ Injects TTS hooks into all BMAD agent files
20
+ 4. ✅ BMAD agents will now SPEAK when they activate!
21
+
22
+ **Example:**
23
+ ```
24
+ /agent-vibes:bmad enable
25
+ ```
26
+
27
+ **Output:**
28
+ ```
29
+ ✅ BMAD voice plugin enabled
30
+ 💾 Previous settings backed up:
31
+ Voice: Aria
32
+ Personality: normal
33
+
34
+ 📊 BMAD Agent Voice Mappings:
35
+ pm → Matthew Schmitz [professional]
36
+ dev → Jessica Anne Bogart [normal]
37
+ qa → Ralf Eisend [professional]
38
+
39
+ 🎤 Automatically enabling TTS for BMAD agents...
40
+
41
+ ✅ Injected TTS into: pm.md → Voice: Matthew Schmitz
42
+ ✅ Injected TTS into: dev.md → Voice: Jessica Anne Bogart
43
+ ✅ Injected TTS into: qa.md → Voice: Ralf Eisend
44
+
45
+ 🎉 TTS enabled for 10 agents
46
+ 💡 BMAD agents will now speak when activated!
47
+ ```
48
+
49
+ ### `disable`
50
+ Disables BMAD voice plugin AND removes TTS from all BMAD agents.
51
+
52
+ **What it does:**
53
+ 1. ✅ Restores your previous voice/personality settings
54
+ 2. ✅ Removes TTS hooks from all BMAD agent files
55
+ 3. ✅ Disables BMAD voice plugin
56
+ 4. ✅ Agents return to normal (silent) behavior
57
+
58
+ **Example:**
59
+ ```
60
+ /agent-vibes:bmad disable
61
+ ```
62
+
63
+ **Output:**
64
+ ```
65
+ ❌ BMAD voice plugin disabled
66
+ 🔄 Restoring previous settings:
67
+ Voice: Aria
68
+ Personality: normal
69
+
70
+ 🔇 Automatically disabling TTS for BMAD agents...
71
+
72
+ ✅ Removed TTS from: pm.md
73
+ ✅ Removed TTS from: dev.md
74
+ ✅ Removed TTS from: qa.md
75
+
76
+ ✅ TTS disabled for 10 agents
77
+ ```
78
+
79
+ ### `status`
80
+ Shows plugin status and current voice mappings.
81
+
82
+ **Example:**
83
+ ```
84
+ /agent-vibes:bmad status
85
+ ```
86
+
87
+ **Output:**
88
+ ```
89
+ ✅ BMAD voice plugin: ENABLED
90
+
91
+ 📊 BMAD Agent Voice Mappings:
92
+ pm → Matthew Schmitz [professional]
93
+ dev → Jessica Anne Bogart [normal]
94
+ qa → Ralf Eisend [professional]
95
+ ...
96
+ ```
97
+
98
+ ### `list`
99
+ Lists all BMAD agents and their assigned voices.
100
+
101
+ **Example:**
102
+ ```
103
+ /agent-vibes:bmad list
104
+ ```
105
+
106
+ ### `set <agent-id> <voice> [personality]`
107
+ Quickly change voice for specific agent.
108
+
109
+ **Examples:**
110
+ ```
111
+ /agent-vibes:bmad set pm "Aria"
112
+ /agent-vibes:bmad set dev "Cowboy Bob" sarcastic
113
+ /agent-vibes:bmad set qa "Northern Terry" professional
114
+ ```
115
+
116
+ **Arguments:**
117
+ - `agent-id`: BMAD agent identifier (pm, dev, qa, architect, po, analyst, sm, ux-expert, bmad-master, bmad-orchestrator)
118
+ - `voice`: Valid AgentVibes voice name
119
+ - `personality` (optional): Personality to apply (default: normal)
120
+
121
+ ### `edit`
122
+ Opens `.claude/plugins/bmad-voices.md` for manual editing.
123
+
124
+ **Example:**
125
+ ```
126
+ /agent-vibes:bmad edit
127
+ ```
128
+
129
+ **Usage:**
130
+ Edit the markdown table directly to change voice mappings.
131
+
132
+ ## How It Works
133
+
134
+ ### Voice Assignment
135
+ 1. **Plugin File**: `.claude/plugins/bmad-voices.md` contains voice-to-agent mappings
136
+ 2. **Activation Flag**: `.claude/plugins/bmad-voices-enabled.flag` enables/disables the plugin
137
+
138
+ ### TTS Injection (Automatic)
139
+ When you run `/agent-vibes:bmad enable`, the system automatically:
140
+
141
+ 1. **Scans BMAD agents**: Finds all `.md` files in `.bmad-core/agents/` or `bmad-core/agents/`
142
+ 2. **Injects TTS hooks**: Modifies each agent's `activation-instructions` YAML block
143
+ 3. **Assigns voices**: Uses the voice mapping from the plugin file
144
+ 4. **Creates backups**: Saves `.backup-pre-tts` files before modifying
145
+
146
+ **What gets injected:**
147
+ ```yaml
148
+ activation-instructions:
149
+ - STEP 4: Greet user with your name/role and immediately run `*help`
150
+ - # AGENTVIBES-TTS-INJECTION: Speak agent greeting with assigned voice
151
+ - Run this bash command to announce activation: .claude/hooks/play-tts.sh "Agent pm activated and ready" "Matthew Schmitz"
152
+ ```
153
+
154
+ **Result**: When you activate a BMAD agent with `/BMad:agents:pm`, you'll hear:
155
+ 🔊 "Agent pm activated and ready" (spoken in Matthew Schmitz's voice)
156
+
157
+ ### Provider Support
158
+ The TTS injection works with **any configured TTS provider**:
159
+ - ✅ **ElevenLabs** - Uses AI voices with full voice mapping
160
+ - ✅ **Piper TTS** - Uses neural voices (free, offline)
161
+
162
+ The system automatically detects your configured provider via `/agent-vibes:provider info` and uses the appropriate TTS engine. You can switch providers anytime with `/agent-vibes:provider switch` and the BMAD agents will continue speaking using the new provider.
163
+
164
+ ## Available BMAD Agents
165
+
166
+ | Agent ID | Role | Default Voice |
167
+ |----------|------|---------------|
168
+ | pm | Product Manager | Matthew Schmitz |
169
+ | dev | Developer | Jessica Anne Bogart |
170
+ | qa | QA Engineer | Ralf Eisend |
171
+ | architect | Architect | Michael |
172
+ | po | Product Owner | Amy |
173
+ | analyst | Analyst | Lutz Laugh |
174
+ | sm | Scrum Master | Ms. Walker |
175
+ | ux-expert | UX Expert | Aria |
176
+ | bmad-master | BMAD Master | Aria |
177
+ | bmad-orchestrator | Orchestrator | Ms. Walker |
178
+
179
+ ## Implementation Details
180
+
181
+ **For AgentVibes Developers:**
182
+
183
+ The plugin integrates with the Agent Vibes output style through bash hooks:
184
+
185
+ ```bash
186
+ # Check if BMAD agent is active
187
+ BMAD_AGENT_ID=$(echo "$COMMAND" | grep -oP '/BMad:agents:\K[a-z-]+')
188
+
189
+ # Get voice from plugin if enabled
190
+ if [[ -n "$BMAD_AGENT_ID" ]]; then
191
+ MAPPED_VOICE=$(.claude/hooks/bmad-voice-manager.sh get-voice "$BMAD_AGENT_ID")
192
+ if [[ -n "$MAPPED_VOICE" ]]; then
193
+ .claude/hooks/play-tts.sh "message" "$MAPPED_VOICE"
194
+ fi
195
+ fi
196
+ ```
@@ -0,0 +1,333 @@
1
+ #!/bin/bash
2
+ #
3
+ # @fileoverview BMAD TTS Injection Manager
4
+ # @context Automatically patches BMAD agent files to include AgentVibes TTS hooks
5
+ # @architecture Modifies agent YAML activation-instructions to call play-tts.sh
6
+ # @why Enables BMAD agents to speak their greetings and questions via TTS
7
+ #
8
+
9
+ set -e # Exit on error
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ CLAUDE_DIR="$(dirname "$SCRIPT_DIR")"
13
+
14
+ # Colors for output
15
+ GREEN='\033[0;32m'
16
+ YELLOW='\033[1;33m'
17
+ RED='\033[0;31m'
18
+ CYAN='\033[0;36m'
19
+ GRAY='\033[0;90m'
20
+ NC='\033[0m' # No Color
21
+
22
+ # Detect BMAD installation
23
+ detect_bmad() {
24
+ local bmad_core_dir=""
25
+
26
+ # Check current directory first
27
+ if [[ -d ".bmad-core" ]]; then
28
+ bmad_core_dir=".bmad-core"
29
+ # Check parent directory
30
+ elif [[ -d "../.bmad-core" ]]; then
31
+ bmad_core_dir="../.bmad-core"
32
+ # Check for bmad-core (without dot prefix)
33
+ elif [[ -d "bmad-core" ]]; then
34
+ bmad_core_dir="bmad-core"
35
+ elif [[ -d "../bmad-core" ]]; then
36
+ bmad_core_dir="../bmad-core"
37
+ else
38
+ echo -e "${RED}❌ BMAD installation not found${NC}" >&2
39
+ echo -e "${GRAY} Looked for .bmad-core or bmad-core directory${NC}" >&2
40
+ return 1
41
+ fi
42
+
43
+ echo "$bmad_core_dir"
44
+ }
45
+
46
+ # Find all BMAD agents
47
+ find_agents() {
48
+ local bmad_core="$1"
49
+ local agents_dir="$bmad_core/agents"
50
+
51
+ if [[ ! -d "$agents_dir" ]]; then
52
+ echo -e "${RED}❌ Agents directory not found: $agents_dir${NC}"
53
+ return 1
54
+ fi
55
+
56
+ find "$agents_dir" -name "*.md" -type f
57
+ }
58
+
59
+ # Check if agent has TTS injection
60
+ has_tts_injection() {
61
+ local agent_file="$1"
62
+
63
+ if grep -q "# AGENTVIBES-TTS-INJECTION" "$agent_file" 2>/dev/null; then
64
+ return 0
65
+ fi
66
+ return 1
67
+ }
68
+
69
+ # Extract agent ID from file
70
+ get_agent_id() {
71
+ local agent_file="$1"
72
+
73
+ # Look for "id: <agent-id>" in YAML block
74
+ local agent_id=$(grep -E "^ id:" "$agent_file" | head -1 | awk '{print $2}' | tr -d '"' | tr -d "'")
75
+
76
+ if [[ -z "$agent_id" ]]; then
77
+ # Fallback: use filename without extension
78
+ agent_id=$(basename "$agent_file" .md)
79
+ fi
80
+
81
+ echo "$agent_id"
82
+ }
83
+
84
+ # Get voice for agent from BMAD voice mapping
85
+ get_agent_voice() {
86
+ local agent_id="$1"
87
+
88
+ # Use bmad-voice-manager.sh to get voice
89
+ if [[ -f "$SCRIPT_DIR/bmad-voice-manager.sh" ]]; then
90
+ local voice=$("$SCRIPT_DIR/bmad-voice-manager.sh" get-voice "$agent_id" 2>/dev/null || echo "")
91
+ echo "$voice"
92
+ fi
93
+ }
94
+
95
+ # Inject TTS hook into agent activation instructions
96
+ inject_tts() {
97
+ local agent_file="$1"
98
+ local agent_id=$(get_agent_id "$agent_file")
99
+ local agent_voice=$(get_agent_voice "$agent_id")
100
+
101
+ # Check if already injected
102
+ if has_tts_injection "$agent_file"; then
103
+ echo -e "${YELLOW}⚠️ TTS already injected in: $(basename "$agent_file")${NC}"
104
+ return 0
105
+ fi
106
+
107
+ # Create backup
108
+ cp "$agent_file" "$agent_file.backup-pre-tts"
109
+
110
+ # Find the activation-instructions section
111
+ if ! grep -q "activation-instructions:" "$agent_file"; then
112
+ echo -e "${RED}❌ No activation-instructions found in: $(basename "$agent_file")${NC}"
113
+ return 1
114
+ fi
115
+
116
+ # Create TTS injection script for activation
117
+ local activation_injection=""
118
+ local persona_injection=""
119
+
120
+ if [[ -n "$agent_voice" ]]; then
121
+ activation_injection=" - # AGENTVIBES-TTS-INJECTION: STEP 3.5 - Announce activation with TTS and set context
122
+ - STEP 3.5a: Use Bash tool to create context file: echo \"${agent_id}\" > .bmad-agent-context
123
+ - STEP 3.5b: Use Bash tool to speak: .claude/hooks/play-tts.sh \"Agent ${agent_id} activated and ready\" \"${agent_voice}\"
124
+ - AGENTVIBES-TTS-INJECTION: MANDATORY RESPONSE PROTOCOL - Before showing ANY response to user, execute this workflow:
125
+ - AGENTVIBES-TTS-STEP 1: Draft your complete response text
126
+ - AGENTVIBES-TTS-STEP 2: Scan response for questions (lines with ? or numbered lists or phrases like What/Should/Would)
127
+ - AGENTVIBES-TTS-STEP 3: If questions found, use Bash tool to speak them: .claude/hooks/play-tts.sh \"question text\" \"${agent_voice}\"
128
+ - AGENTVIBES-TTS-STEP 4: Show the response text to user
129
+ - AGENTVIBES-TTS-INJECTION: On exit command (*exit), use Bash tool FIRST to cleanup: rm -f .bmad-agent-context"
130
+ persona_injection=" - AGENTVIBES-TTS-INJECTION: Before every response, scan for questions and speak them using Bash tool"
131
+ else
132
+ activation_injection=" - # AGENTVIBES-TTS-INJECTION: STEP 3.5 - Announce activation with TTS and set context
133
+ - STEP 3.5a: Use Bash tool to create context file: echo \"${agent_id}\" > .bmad-agent-context
134
+ - STEP 3.5b: Use Bash tool to speak: .claude/hooks/play-tts.sh \"Agent ${agent_id} activated and ready\"
135
+ - AGENTVIBES-TTS-INJECTION: MANDATORY RESPONSE PROTOCOL - Before showing ANY response to user, execute this workflow:
136
+ - AGENTVIBES-TTS-STEP 1: Draft your complete response text
137
+ - AGENTVIBES-TTS-STEP 2: Scan response for questions (lines with ? or numbered lists or phrases like What/Should/Would)
138
+ - AGENTVIBES-TTS-STEP 3: If questions found, use Bash tool to speak them: .claude/hooks/play-tts.sh \"question text\"
139
+ - AGENTVIBES-TTS-STEP 4: Show the response text to user
140
+ - AGENTVIBES-TTS-INJECTION: On exit command (*exit), use Bash tool FIRST to cleanup: rm -f .bmad-agent-context"
141
+ persona_injection=" - AGENTVIBES-TTS-INJECTION: Before every response, scan for questions and speak them using Bash tool"
142
+ fi
143
+
144
+ # Insert activation TTS call after "STEP 4: Greet user" line
145
+ # Insert persona TTS instruction in core_principles section
146
+ awk -v activation="$activation_injection" -v persona="$persona_injection" '
147
+ /STEP 4:.*[Gg]reet/ {
148
+ print
149
+ print activation
150
+ next
151
+ }
152
+ /^ core_principles:/ {
153
+ print
154
+ print persona
155
+ next
156
+ }
157
+ { print }
158
+ ' "$agent_file" > "$agent_file.tmp"
159
+
160
+ mv "$agent_file.tmp" "$agent_file"
161
+
162
+ echo -e "${GREEN}✅ Injected TTS into: $(basename "$agent_file") → Voice: ${agent_voice:-default}${NC}"
163
+ }
164
+
165
+ # Remove TTS injection from agent
166
+ remove_tts() {
167
+ local agent_file="$1"
168
+
169
+ # Check if has injection
170
+ if ! has_tts_injection "$agent_file"; then
171
+ echo -e "${GRAY} No TTS in: $(basename "$agent_file")${NC}"
172
+ return 0
173
+ fi
174
+
175
+ # Create backup
176
+ cp "$agent_file" "$agent_file.backup-tts-removal"
177
+
178
+ # Remove TTS injection lines
179
+ sed -i.bak '/# AGENTVIBES-TTS-INJECTION/,+1d' "$agent_file"
180
+ rm -f "$agent_file.bak"
181
+
182
+ echo -e "${GREEN}✅ Removed TTS from: $(basename "$agent_file")${NC}"
183
+ }
184
+
185
+ # Show status of TTS injections
186
+ show_status() {
187
+ local bmad_core=$(detect_bmad)
188
+ if [[ -z "$bmad_core" ]]; then
189
+ return 1
190
+ fi
191
+
192
+ echo -e "${CYAN}📊 BMAD TTS Injection Status:${NC}"
193
+ echo ""
194
+
195
+ local agents=$(find_agents "$bmad_core")
196
+ local enabled_count=0
197
+ local disabled_count=0
198
+
199
+ while IFS= read -r agent_file; do
200
+ local agent_id=$(get_agent_id "$agent_file")
201
+ local agent_name=$(basename "$agent_file" .md)
202
+
203
+ if has_tts_injection "$agent_file"; then
204
+ local voice=$(get_agent_voice "$agent_id")
205
+ echo -e " ${GREEN}✅${NC} $agent_name (${agent_id}) → Voice: ${voice:-default}"
206
+ ((enabled_count++))
207
+ else
208
+ echo -e " ${GRAY}❌ $agent_name (${agent_id})${NC}"
209
+ ((disabled_count++))
210
+ fi
211
+ done <<< "$agents"
212
+
213
+ echo ""
214
+ echo -e "${CYAN}Summary:${NC} $enabled_count enabled, $disabled_count disabled"
215
+ }
216
+
217
+ # Enable TTS for all agents
218
+ enable_all() {
219
+ local bmad_core=$(detect_bmad)
220
+ if [[ -z "$bmad_core" ]]; then
221
+ return 1
222
+ fi
223
+
224
+ echo -e "${CYAN}🎤 Enabling TTS for all BMAD agents...${NC}"
225
+ echo ""
226
+
227
+ local agents=$(find_agents "$bmad_core")
228
+ local success_count=0
229
+ local skip_count=0
230
+
231
+ while IFS= read -r agent_file; do
232
+ if has_tts_injection "$agent_file"; then
233
+ ((skip_count++))
234
+ continue
235
+ fi
236
+
237
+ if inject_tts "$agent_file"; then
238
+ ((success_count++))
239
+ fi
240
+ done <<< "$agents"
241
+
242
+ echo ""
243
+ echo -e "${GREEN}🎉 TTS enabled for $success_count agents${NC}"
244
+ [[ $skip_count -gt 0 ]] && echo -e "${YELLOW} Skipped $skip_count agents (already enabled)${NC}"
245
+ echo ""
246
+ echo -e "${CYAN}💡 BMAD agents will now speak when activated!${NC}"
247
+ }
248
+
249
+ # Disable TTS for all agents
250
+ disable_all() {
251
+ local bmad_core=$(detect_bmad)
252
+ if [[ -z "$bmad_core" ]]; then
253
+ return 1
254
+ fi
255
+
256
+ echo -e "${CYAN}🔇 Disabling TTS for all BMAD agents...${NC}"
257
+ echo ""
258
+
259
+ local agents=$(find_agents "$bmad_core")
260
+ local success_count=0
261
+
262
+ while IFS= read -r agent_file; do
263
+ if remove_tts "$agent_file"; then
264
+ ((success_count++))
265
+ fi
266
+ done <<< "$agents"
267
+
268
+ echo ""
269
+ echo -e "${GREEN}✅ TTS disabled for $success_count agents${NC}"
270
+ }
271
+
272
+ # Restore from backup
273
+ restore_backup() {
274
+ local bmad_core=$(detect_bmad)
275
+ if [[ -z "$bmad_core" ]]; then
276
+ return 1
277
+ fi
278
+
279
+ echo -e "${CYAN}🔄 Restoring agents from backup...${NC}"
280
+ echo ""
281
+
282
+ local agents_dir="$bmad_core/agents"
283
+ local backup_count=0
284
+
285
+ for backup_file in "$agents_dir"/*.backup-pre-tts; do
286
+ if [[ -f "$backup_file" ]]; then
287
+ local original_file="${backup_file%.backup-pre-tts}"
288
+ cp "$backup_file" "$original_file"
289
+ echo -e "${GREEN}✅ Restored: $(basename "$original_file")${NC}"
290
+ ((backup_count++))
291
+ fi
292
+ done
293
+
294
+ if [[ $backup_count -eq 0 ]]; then
295
+ echo -e "${YELLOW}⚠️ No backups found${NC}"
296
+ else
297
+ echo ""
298
+ echo -e "${GREEN}✅ Restored $backup_count agents from backup${NC}"
299
+ fi
300
+ }
301
+
302
+ # Main command dispatcher
303
+ case "${1:-help}" in
304
+ enable)
305
+ enable_all
306
+ ;;
307
+ disable)
308
+ disable_all
309
+ ;;
310
+ status)
311
+ show_status
312
+ ;;
313
+ restore)
314
+ restore_backup
315
+ ;;
316
+ help|*)
317
+ echo -e "${CYAN}AgentVibes BMAD TTS Injection Manager${NC}"
318
+ echo ""
319
+ echo "Usage: bmad-tts-injector.sh {enable|disable|status|restore}"
320
+ echo ""
321
+ echo "Commands:"
322
+ echo " enable Inject TTS hooks into all BMAD agents"
323
+ echo " disable Remove TTS hooks from all BMAD agents"
324
+ echo " status Show TTS injection status for all agents"
325
+ echo " restore Restore agents from backup (undo changes)"
326
+ echo ""
327
+ echo "What it does:"
328
+ echo " • Automatically patches BMAD agent activation instructions"
329
+ echo " • Adds TTS calls when agents greet users"
330
+ echo " • Uses voice mapping from AgentVibes BMAD plugin"
331
+ echo " • Creates backups before modifying files"
332
+ ;;
333
+ esac
@@ -111,6 +111,23 @@ EOF
111
111
  [[ -n "$CURRENT_SENTIMENT" ]] && echo " Sentiment: $CURRENT_SENTIMENT"
112
112
  echo ""
113
113
  list_mappings
114
+
115
+ # Automatically inject TTS into BMAD agents
116
+ echo ""
117
+ echo "🎤 Automatically enabling TTS for BMAD agents..."
118
+ echo ""
119
+
120
+ # Get the directory where this script is located
121
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
122
+
123
+ # Check if bmad-tts-injector.sh exists
124
+ if [[ -f "$SCRIPT_DIR/bmad-tts-injector.sh" ]]; then
125
+ # Run the TTS injector
126
+ "$SCRIPT_DIR/bmad-tts-injector.sh" enable
127
+ else
128
+ echo "⚠️ TTS injector not found at: $SCRIPT_DIR/bmad-tts-injector.sh"
129
+ echo " You can manually enable TTS with: /agent-vibes:bmad-tts enable"
130
+ fi
114
131
  }
115
132
 
116
133
  # Disable plugin
@@ -151,6 +168,23 @@ disable_plugin() {
151
168
  fi
152
169
 
153
170
  rm -f "$ENABLED_FLAG"
171
+
172
+ # Automatically remove TTS from BMAD agents
173
+ echo ""
174
+ echo "🔇 Automatically disabling TTS for BMAD agents..."
175
+ echo ""
176
+
177
+ # Get the directory where this script is located
178
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
179
+
180
+ # Check if bmad-tts-injector.sh exists
181
+ if [[ -f "$SCRIPT_DIR/bmad-tts-injector.sh" ]]; then
182
+ # Run the TTS injector disable
183
+ "$SCRIPT_DIR/bmad-tts-injector.sh" disable
184
+ else
185
+ echo "⚠️ TTS injector not found"
186
+ echo " You can manually disable TTS with: /agent-vibes:bmad-tts disable"
187
+ fi
154
188
  }
155
189
 
156
190
  # List all mappings
@@ -128,55 +128,71 @@ You: "✅ That bug be walkin' the plank now, arr!"
128
128
 
129
129
  ## BMAD Plugin Integration
130
130
 
131
- **Automatic voice switching for BMAD agents:**
131
+ **Automatic voice switching and question detection for BMAD agents:**
132
132
 
133
- When a BMAD agent is activated (e.g., `/BMad:agents:pm`), AgentVibes will automatically:
133
+ When a BMAD agent is active, AgentVibes will automatically detect and speak questions.
134
134
 
135
- 1. **Detect BMAD agent from command/context**
136
- 2. **Check if BMAD plugin is enabled** (`.claude/plugins/bmad-voices-enabled.flag`)
135
+ ### Detection Method:
136
+ 1. **Check for `.bmad-agent-context` file** - Contains agent ID if BMAD agent is active
137
+ 2. **Check if BMAD plugin is enabled** - `.claude/plugins/bmad-voices-enabled.flag` exists
137
138
  3. **Look up voice mapping** from `.claude/plugins/bmad-voices.md`
138
- 4. **Apply agent's assigned voice** for all TTS acknowledgments/completions
139
- 5. **Apply agent's personality** from the mapping (if specified)
140
139
 
141
- **Implementation:**
142
- ```bash
143
- # At the start of acknowledgment/completion:
144
- # Try to detect BMAD agent ID from current context
145
- BMAD_AGENT_ID=""
140
+ ### MANDATORY BMAD QUESTION TTS PROTOCOL
146
141
 
147
- # Method 1: Check if we're in a BMAD agent command context
148
- if [[ -f ".bmad-agent-context" ]]; then
149
- BMAD_AGENT_ID=$(cat .bmad-agent-context 2>/dev/null)
150
- fi
142
+ **THIS IS A CRITICAL EXECUTION REQUIREMENT - NOT OPTIONAL**
151
143
 
152
- # Method 2: Parse from command history/context (fallback)
153
- # Note: This detection happens automatically when BMAD agent activates
144
+ When a BMAD agent is active, you MUST follow this EXACT protocol for EVERY response:
154
145
 
155
- # If BMAD agent detected and plugin enabled, use mapped voice
156
- if [[ -n "$BMAD_AGENT_ID" ]] && [[ -f ".claude/plugins/bmad-voices-enabled.flag" ]]; then
146
+ **STEP 1: Check BMAD Context (BEFORE drafting ANY response)**
147
+ ```bash
148
+ if [[ -f ".bmad-agent-context" ]] && [[ -f ".claude/plugins/bmad-voices-enabled.flag" ]]; then
149
+ BMAD_AGENT_ID=$(cat .bmad-agent-context 2>/dev/null)
157
150
  MAPPED_VOICE=$(.claude/hooks/bmad-voice-manager.sh get-voice "$BMAD_AGENT_ID")
158
- MAPPED_PERSONALITY=$(.claude/hooks/bmad-voice-manager.sh get-personality "$BMAD_AGENT_ID")
159
-
160
- if [[ -n "$MAPPED_VOICE" ]]; then
161
- # Use BMAD agent's mapped voice and personality
162
- if [[ -n "$MAPPED_PERSONALITY" ]] && [[ "$MAPPED_PERSONALITY" != "normal" ]]; then
163
- # Read personality instructions from .claude/personalities/${MAPPED_PERSONALITY}.md
164
- # Generate response in that personality style
165
- fi
166
- .claude/hooks/play-tts.sh "message" "$MAPPED_VOICE"
167
- # Exit early - don't use default personality system
168
- return
169
- fi
170
151
  fi
152
+ ```
153
+
154
+ **STEP 2: Draft Your Response**
155
+ - Write your complete response text (don't show to user yet)
156
+
157
+ **STEP 3: Scan for Questions (MANDATORY - DO NOT SKIP)**
158
+ If your response contains ANY of these:
159
+ - Question mark (?)
160
+ - Numbered list (1., 2., 3., etc.)
161
+ - Question phrases: "What would you like", "Should I", "Would you prefer", "Which option", "How should", "Do you want"
171
162
 
172
- # If no BMAD agent or plugin disabled, use standard personality/sentiment system
173
- # ... continue with normal sentiment/personality logic ...
163
+ Then IMMEDIATELY execute STEP 4 BEFORE showing response.
164
+
165
+ **STEP 4: Speak Questions via TTS (MANDATORY)**
166
+ ```bash
167
+ # Extract the question text and speak it
168
+ .claude/hooks/play-tts.sh "the actual question text" "$MAPPED_VOICE"
169
+ ```
170
+
171
+ **STEP 5: Show Response to User**
172
+ - Only NOW display the response text
173
+
174
+ **CRITICAL RULES:**
175
+ 1. This protocol is MANDATORY for EVERY BMAD agent response
176
+ 2. Steps 1-5 must execute in EXACT order
177
+ 3. You MUST use Bash tool to execute TTS in STEP 4
178
+ 4. NEVER skip STEP 3 scanning - it is required
179
+ 5. NEVER show response before speaking questions
180
+
181
+ **Example Execution:**
182
+ ```
183
+ User: "What should we do?"
184
+ [STEP 1: Check context - analyst agent active]
185
+ [STEP 2: Draft response: "What would you like to do next?\n\n1. Option A\n2. Option B"]
186
+ [STEP 3: Scan - FOUND question "What would you like to do next?" and numbered list]
187
+ [STEP 4: Execute Bash: .claude/hooks/play-tts.sh "What would you like to do next" "Ralf Eisend"]
188
+ [STEP 5: Show response to user]
174
189
  ```
175
190
 
176
191
  **BMAD Agent Context Tracking:**
177
- - When a BMAD agent activates, write agent ID to `.bmad-agent-context`
178
- - When agent exits, remove the file
179
- - This allows AgentVibes to know which BMAD agent is active
192
+ - Context file `.bmad-agent-context` contains agent ID when BMAD agent is active
193
+ - Created automatically by STEP 3.5a in activation-instructions
194
+ - Removed automatically when agent exits
195
+ - This allows AgentVibes to detect which BMAD agent is active
180
196
 
181
197
  **Voice Priority (in order):**
182
198
  1. BMAD plugin voice (if agent active and plugin enabled)
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Publish](https://github.com/paulpreibisch/AgentVibes/actions/workflows/publish.yml/badge.svg)](https://github.com/paulpreibisch/AgentVibes/actions/workflows/publish.yml)
12
12
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
13
13
 
14
- **Author**: Paul Preibisch ([@997Fire](https://x.com/997Fire)) | **Version**: v2.0.10
14
+ **Author**: Paul Preibisch ([@997Fire](https://x.com/997Fire)) | **Version**: v2.0.13
15
15
 
16
16
  ---
17
17
 
@@ -45,7 +45,7 @@
45
45
 
46
46
  ## 📰 Latest Release
47
47
 
48
- **[v2.0.0 - The Multi-Provider Revolution](https://github.com/paulpreibisch/AgentVibes/releases/tag/v2.0.10)** 🎉
48
+ **[v2.0.0 - The Multi-Provider Revolution](https://github.com/paulpreibisch/AgentVibes/releases/tag/v2.0.13)** 🎉
49
49
 
50
50
  The biggest update ever! **Multi-provider TTS support** (ElevenLabs + Piper TTS), **30+ languages**, expanded voice library (27+ voices), advanced sentiment system, enhanced BMAD integration, and comprehensive multilingual support. Choose between premium ElevenLabs voices or free offline Piper TTS!
51
51
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "agentvibes",
4
- "version": "2.0.10",
5
- "description": "Bring your Claude Code sessions to life with voice! Professional TTS narration with multi-provider support.",
4
+ "version": "2.0.13",
5
+ "description": "Now your AI Agents can finally talk back! Professional TTS voice for Claude Code with multi-provider support.",
6
6
  "homepage": "https://agentvibes.org",
7
7
  "keywords": [
8
8
  "elevenlabs",
package/src/installer.js CHANGED
@@ -47,7 +47,7 @@ function showWelcome() {
47
47
 
48
48
  console.log(
49
49
  boxen(
50
- chalk.white.bold('🎤 Beautiful ElevenLabs TTS Voice Commands for Claude Code\n\n') +
50
+ chalk.white.bold('🎤 Now your AI Agents can finally talk back! TTS Voice for Claude Code\n\n') +
51
51
  chalk.gray('Add professional text-to-speech narration to your AI coding sessions\n\n') +
52
52
  chalk.cyan('📦 https://github.com/paulpreibisch/AgentVibes'),
53
53
  {
@@ -485,6 +485,36 @@ async function install(options = {}) {
485
485
  }
486
486
  spinner.succeed(chalk.green('Installed output styles!\n'));
487
487
 
488
+ // Copy plugins folder (BMAD voice mappings)
489
+ spinner.start('Installing BMAD plugin files...');
490
+ const srcPluginsDir = path.join(__dirname, '..', '.claude', 'plugins');
491
+ const destPluginsDir = path.join(claudeDir, 'plugins');
492
+
493
+ // Create plugins directory
494
+ await fs.mkdir(destPluginsDir, { recursive: true });
495
+
496
+ // Copy only .md files from plugins directory
497
+ let pluginFiles = [];
498
+ try {
499
+ const allPluginFiles = await fs.readdir(srcPluginsDir);
500
+ for (const file of allPluginFiles) {
501
+ const srcPath = path.join(srcPluginsDir, file);
502
+ const stat = await fs.stat(srcPath);
503
+
504
+ // Only copy .md files, skip .flag files (those are runtime generated)
505
+ if (stat.isFile() && file.endsWith('.md')) {
506
+ pluginFiles.push(file);
507
+ const destPath = path.join(destPluginsDir, file);
508
+ await fs.copyFile(srcPath, destPath);
509
+ console.log(chalk.gray(` ✓ ${file}`));
510
+ }
511
+ }
512
+ spinner.succeed(chalk.green('Installed BMAD plugin files!\n'));
513
+ } catch (error) {
514
+ // Plugins directory might not exist in source - that's okay
515
+ spinner.info(chalk.yellow('No plugin files found (optional)\n'));
516
+ }
517
+
488
518
  // Save provider selection
489
519
  spinner.start('Saving provider configuration...');
490
520
  const providerConfigPath = path.join(claudeDir, 'tts-provider.txt');
@@ -502,8 +532,11 @@ async function install(options = {}) {
502
532
  console.log(chalk.cyan('📦 Installation Summary:'));
503
533
  console.log(chalk.white(` • ${commandFiles.length} slash commands installed`));
504
534
  console.log(chalk.white(` • ${hookFiles.length} TTS scripts installed`));
505
- console.log(chalk.white(` • ${personalityFiles.length} personality templates installed`));
535
+ console.log(chalk.white(` • ${personalityMdFiles.length} personality templates installed`));
506
536
  console.log(chalk.white(` • ${outputStyleFiles.length} output styles installed`));
537
+ if (pluginFiles.length > 0) {
538
+ console.log(chalk.white(` • ${pluginFiles.length} BMAD plugin files installed`));
539
+ }
507
540
  console.log(chalk.white(` • Voice manager ready`));
508
541
 
509
542
  if (selectedProvider === 'elevenlabs') {
@@ -586,6 +619,8 @@ async function install(options = {}) {
586
619
  chalk.yellow.bold('⚠️ IMPORTANT SETUP STEP:\n') +
587
620
  chalk.white('In Claude Code, run this command:\n') +
588
621
  chalk.cyan.bold('/output-style Agent Vibes') + '\n\n' +
622
+ chalk.magenta('💡 Optional: Enable BMAD plugin integration:\n') +
623
+ chalk.magenta('/agent-vibes:bmad enable') + '\n\n' +
589
624
  chalk.white('🎤 Available Commands:\n\n') +
590
625
  chalk.cyan(' /agent-vibes') + chalk.gray(' .................... Show all commands\n') +
591
626
  chalk.cyan(' /agent-vibes:list') + chalk.gray(' ............... List available voices\n') +
@@ -612,7 +647,11 @@ async function install(options = {}) {
612
647
 
613
648
  console.log(chalk.yellow.bold('\n⚠️ REQUIRED SETUP:'));
614
649
  console.log(chalk.white(' 1. In Claude Code, run: ') + chalk.cyan.bold('/output-style Agent Vibes'));
615
- console.log(chalk.gray(' This enables TTS narration for your sessions\n'));
650
+ console.log(chalk.gray(' This enables TTS narration for your sessions'));
651
+ console.log(chalk.magenta('\n 💡 Optional: Enable BMAD plugin integration:'));
652
+ console.log(chalk.white(' 2. In Claude Code, run: ') + chalk.magenta.bold('/agent-vibes:bmad enable'));
653
+ console.log(chalk.gray(' This assigns unique voices to each BMAD agent'));
654
+ console.log(chalk.gray(' Get BMAD: ') + chalk.cyan('https://github.com/bmad-code-org/BMAD-METHOD\n'));
616
655
  console.log(chalk.gray('💡 Then try these commands:'));
617
656
  console.log(chalk.gray(' • /agent-vibes:list - See all available voices'));
618
657
  console.log(chalk.gray(' • /agent-vibes:switch <name> - Change your voice'));
@@ -671,7 +710,7 @@ async function install(options = {}) {
671
710
  // CLI setup
672
711
  program
673
712
  .version(VERSION)
674
- .description('AgentVibes - Beautiful ElevenLabs TTS Voice Commands for Claude Code');
713
+ .description('AgentVibes - Now your AI Agents can finally talk back! TTS Voice for Claude Code');
675
714
 
676
715
  program
677
716
  .command('install')
@@ -727,7 +766,7 @@ program
727
766
  // Welcome box
728
767
  console.log(
729
768
  boxen(
730
- chalk.white('🎤 Beautiful ElevenLabs TTS Voice Commands for Claude Code\n\n') +
769
+ chalk.white('🎤 Now your AI Agents can finally talk back! TTS Voice for Claude Code\n\n') +
731
770
  chalk.gray('Add professional text-to-speech narration to your AI coding sessions\n\n') +
732
771
  chalk.cyan('📦 https://github.com/paulpreibisch/AgentVibes'),
733
772
  {
@@ -908,13 +947,47 @@ program
908
947
  }
909
948
  console.log(chalk.green(`✓ Updated ${outputStyleFiles.length} output styles`));
910
949
 
950
+ // Update plugins folder (BMAD voice mappings)
951
+ spinner.text = 'Updating BMAD plugin files...';
952
+ const srcPluginsDir = path.join(__dirname, '..', '.claude', 'plugins');
953
+ const destPluginsDir = path.join(claudeDir, 'plugins');
954
+
955
+ // Create plugins directory if it doesn't exist
956
+ await fs.mkdir(destPluginsDir, { recursive: true });
957
+
958
+ // Copy only .md files from plugins directory
959
+ let pluginFiles = [];
960
+ try {
961
+ const allPluginFiles = await fs.readdir(srcPluginsDir);
962
+ for (const file of allPluginFiles) {
963
+ const srcPath = path.join(srcPluginsDir, file);
964
+ const stat = await fs.stat(srcPath);
965
+
966
+ // Only copy .md files, skip .flag files (those are runtime generated)
967
+ if (stat.isFile() && file.endsWith('.md')) {
968
+ pluginFiles.push(file);
969
+ const destPath = path.join(destPluginsDir, file);
970
+ await fs.copyFile(srcPath, destPath);
971
+ }
972
+ }
973
+ if (pluginFiles.length > 0) {
974
+ console.log(chalk.green(`✓ Updated ${pluginFiles.length} BMAD plugin files`));
975
+ }
976
+ } catch (error) {
977
+ // Plugins directory might not exist in source - that's okay
978
+ }
979
+
911
980
  spinner.succeed(chalk.green.bold('\n✨ Update complete!\n'));
912
981
 
913
982
  console.log(chalk.cyan('📦 Update Summary:'));
914
983
  console.log(chalk.white(` • ${commandFiles.length} commands updated`));
915
984
  console.log(chalk.white(` • ${hookFiles.length} TTS scripts updated`));
916
985
  console.log(chalk.white(` • ${newPersonalities + updatedPersonalities} personality templates (${newPersonalities} new, ${updatedPersonalities} updated)`));
917
- console.log(chalk.white(` • ${outputStyleFiles.length} output styles updated\n`));
986
+ console.log(chalk.white(` • ${outputStyleFiles.length} output styles updated`));
987
+ if (pluginFiles.length > 0) {
988
+ console.log(chalk.white(` • ${pluginFiles.length} BMAD plugin files updated`));
989
+ }
990
+ console.log('');
918
991
 
919
992
  // Show latest release notes from RELEASE_NOTES_V2.md (v2.0+) or RELEASE_NOTES.md (legacy)
920
993
  try {
@@ -1,132 +0,0 @@
1
- # /agent-vibes:bmad Command
2
-
3
- Manage BMAD voice plugin integration for automatic voice assignment to BMAD agents.
4
-
5
- ## Usage
6
-
7
- ```
8
- /agent-vibes:bmad <subcommand> [arguments]
9
- ```
10
-
11
- ## Subcommands
12
-
13
- ### `enable`
14
- Enables automatic voice assignment for BMAD agents.
15
-
16
- **Example:**
17
- ```
18
- /agent-vibes:bmad enable
19
- ```
20
-
21
- **Output:**
22
- - Creates `.claude/plugins/bmad-voices-enabled.flag`
23
- - Shows current agent voice mappings
24
- - Confirms activation
25
-
26
- ### `disable`
27
- Disables BMAD voice plugin (reverts to default AgentVibes behavior).
28
-
29
- **Example:**
30
- ```
31
- /agent-vibes:bmad disable
32
- ```
33
-
34
- **Output:**
35
- - Removes activation flag
36
- - AgentVibes uses default voice settings
37
-
38
- ### `status`
39
- Shows plugin status and current voice mappings.
40
-
41
- **Example:**
42
- ```
43
- /agent-vibes:bmad status
44
- ```
45
-
46
- **Output:**
47
- ```
48
- ✅ BMAD voice plugin: ENABLED
49
-
50
- 📊 BMAD Agent Voice Mappings:
51
- pm → Matthew Schmitz [professional]
52
- dev → Jessica Anne Bogart [normal]
53
- qa → Ralf Eisend [professional]
54
- ...
55
- ```
56
-
57
- ### `list`
58
- Lists all BMAD agents and their assigned voices.
59
-
60
- **Example:**
61
- ```
62
- /agent-vibes:bmad list
63
- ```
64
-
65
- ### `set <agent-id> <voice> [personality]`
66
- Quickly change voice for specific agent.
67
-
68
- **Examples:**
69
- ```
70
- /agent-vibes:bmad set pm "Aria"
71
- /agent-vibes:bmad set dev "Cowboy Bob" sarcastic
72
- /agent-vibes:bmad set qa "Northern Terry" professional
73
- ```
74
-
75
- **Arguments:**
76
- - `agent-id`: BMAD agent identifier (pm, dev, qa, architect, po, analyst, sm, ux-expert, bmad-master, bmad-orchestrator)
77
- - `voice`: Valid AgentVibes voice name
78
- - `personality` (optional): Personality to apply (default: normal)
79
-
80
- ### `edit`
81
- Opens `.claude/plugins/bmad-voices.md` for manual editing.
82
-
83
- **Example:**
84
- ```
85
- /agent-vibes:bmad edit
86
- ```
87
-
88
- **Usage:**
89
- Edit the markdown table directly to change voice mappings.
90
-
91
- ## How It Works
92
-
93
- 1. **Plugin File**: `.claude/plugins/bmad-voices.md` contains voice mappings
94
- 2. **Activation Flag**: `.claude/plugins/bmad-voices-enabled.flag` enables/disables plugin
95
- 3. **Auto-Detection**: When a BMAD agent activates (e.g., `/BMad:agents:pm`), AgentVibes automatically:
96
- - Detects the agent ID from the command
97
- - Looks up voice mapping in plugin file
98
- - Uses assigned voice for TTS acknowledgments/completions
99
-
100
- ## Available BMAD Agents
101
-
102
- | Agent ID | Role | Default Voice |
103
- |----------|------|---------------|
104
- | pm | Product Manager | Matthew Schmitz |
105
- | dev | Developer | Jessica Anne Bogart |
106
- | qa | QA Engineer | Ralf Eisend |
107
- | architect | Architect | Michael |
108
- | po | Product Owner | Amy |
109
- | analyst | Analyst | Lutz Laugh |
110
- | sm | Scrum Master | Ms. Walker |
111
- | ux-expert | UX Expert | Aria |
112
- | bmad-master | BMAD Master | Aria |
113
- | bmad-orchestrator | Orchestrator | Ms. Walker |
114
-
115
- ## Implementation Details
116
-
117
- **For AgentVibes Developers:**
118
-
119
- The plugin integrates with the Agent Vibes output style through bash hooks:
120
-
121
- ```bash
122
- # Check if BMAD agent is active
123
- BMAD_AGENT_ID=$(echo "$COMMAND" | grep -oP '/BMad:agents:\K[a-z-]+')
124
-
125
- # Get voice from plugin if enabled
126
- if [[ -n "$BMAD_AGENT_ID" ]]; then
127
- MAPPED_VOICE=$(.claude/hooks/bmad-voice-manager.sh get-voice "$BMAD_AGENT_ID")
128
- if [[ -n "$MAPPED_VOICE" ]]; then
129
- .claude/hooks/play-tts.sh "message" "$MAPPED_VOICE"
130
- fi
131
- fi
132
- ```