agentvibes 5.3.0 → 5.4.0

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.
Files changed (219) hide show
  1. package/.agentvibes/LITE-MODE.md +236 -0
  2. package/.agentvibes/README.md +136 -0
  3. package/.agentvibes/backup/session-start-tts.sh.20251210_212814 +141 -0
  4. package/.agentvibes/backups/agents/analyst_20260204_144958.md +78 -0
  5. package/.agentvibes/backups/agents/architect_20260204_144958.md +72 -0
  6. package/.agentvibes/backups/agents/dev_20260204_144958.md +74 -0
  7. package/.agentvibes/backups/agents/pm_20260204_144958.md +72 -0
  8. package/.agentvibes/backups/agents/quick-flow-solo-dev_20260204_144958.md +64 -0
  9. package/.agentvibes/backups/agents/sm_20260204_144958.md +87 -0
  10. package/.agentvibes/backups/agents/tea_20260204_144958.md +79 -0
  11. package/.agentvibes/backups/agents/tech-writer_20260204_144958.md +82 -0
  12. package/.agentvibes/backups/agents/ux-designer_20260204_144958.md +80 -0
  13. package/.agentvibes/bmad/bmad-voices.md +69 -69
  14. package/.agentvibes/config/README-personality-defaults.md +162 -0
  15. package/.agentvibes/config/mode.txt +1 -0
  16. package/.agentvibes/config/personality-voice-defaults.default.json +21 -0
  17. package/.agentvibes/config/save-audio.txt +1 -0
  18. package/.agentvibes/config/voice-metadata.json +160 -0
  19. package/.agentvibes/config.json +24 -15
  20. package/.agentvibes/hooks/help.sh +191 -0
  21. package/.agentvibes/hooks/post-tool-use-lite.sh +111 -0
  22. package/.agentvibes/hooks/save-audio-manager.sh +162 -0
  23. package/.agentvibes/hooks/session-start-full-optimized.sh +102 -0
  24. package/.agentvibes/hooks/session-start-full.sh +142 -0
  25. package/.agentvibes/hooks/session-start-lite-v2.sh +34 -0
  26. package/.agentvibes/hooks/session-start-lite.sh +29 -0
  27. package/.agentvibes/hooks/stop-lite.sh +115 -0
  28. package/.agentvibes/hooks/switch-mode.sh +215 -0
  29. package/.agentvibes/output-styles/audio-summary.md +30 -0
  30. package/.claude/activation-instructions +54 -54
  31. package/.claude/audio/voice-samples/piper/alan.wav +0 -0
  32. package/.claude/audio/voice-samples/piper/amy.wav +0 -0
  33. package/.claude/audio/voice-samples/piper/charlotte.wav +0 -0
  34. package/.claude/audio/voice-samples/piper/joe.wav +0 -0
  35. package/.claude/audio/voice-samples/piper/john.wav +0 -0
  36. package/.claude/audio/voice-samples/piper/katherine.wav +0 -0
  37. package/.claude/audio/voice-samples/piper/kristin.wav +0 -0
  38. package/.claude/audio/voice-samples/piper/linda.wav +0 -0
  39. package/.claude/audio/voice-samples/piper/marcus.wav +0 -0
  40. package/.claude/audio/voice-samples/piper/ryan.wav +0 -0
  41. package/.claude/commands/agent-vibes/add.md +21 -21
  42. package/.claude/commands/agent-vibes/agent-vibes.md +101 -101
  43. package/.claude/commands/agent-vibes/agent.md +79 -79
  44. package/.claude/commands/agent-vibes/background-music.md +111 -111
  45. package/.claude/commands/agent-vibes/bmad.md +198 -198
  46. package/.claude/commands/agent-vibes/clean.md +18 -18
  47. package/.claude/commands/agent-vibes/cleanup.md +18 -18
  48. package/.claude/commands/agent-vibes/commands.json +145 -145
  49. package/.claude/commands/agent-vibes/effects.md +97 -97
  50. package/.claude/commands/agent-vibes/get.md +9 -9
  51. package/.claude/commands/agent-vibes/hide.md +91 -91
  52. package/.claude/commands/agent-vibes/language.md +23 -23
  53. package/.claude/commands/agent-vibes/learn.md +67 -67
  54. package/.claude/commands/agent-vibes/list.md +13 -13
  55. package/.claude/commands/agent-vibes/mute.md +37 -37
  56. package/.claude/commands/agent-vibes/preview.md +17 -17
  57. package/.claude/commands/agent-vibes/provider.md +68 -68
  58. package/.claude/commands/agent-vibes/replay-target.md +14 -14
  59. package/.claude/commands/agent-vibes/sample.md +12 -12
  60. package/.claude/commands/agent-vibes/set-favorite-voice.md +84 -84
  61. package/.claude/commands/agent-vibes/set-pretext.md +65 -65
  62. package/.claude/commands/agent-vibes/set-speed.md +41 -41
  63. package/.claude/commands/agent-vibes/show.md +84 -84
  64. package/.claude/commands/agent-vibes/switch.md +87 -87
  65. package/.claude/commands/agent-vibes/target-voice.md +26 -26
  66. package/.claude/commands/agent-vibes/target.md +30 -30
  67. package/.claude/commands/agent-vibes/translate.md +68 -68
  68. package/.claude/commands/agent-vibes/unmute.md +45 -45
  69. package/.claude/commands/agent-vibes/whoami.md +7 -7
  70. package/.claude/commands/agent-vibes-bmad-voices.md +117 -117
  71. package/.claude/commands/agent-vibes-rdp.md +24 -24
  72. package/.claude/config/audio-effects.cfg +4 -11
  73. package/.claude/config/audio-effects.cfg.sample +52 -52
  74. package/.claude/config/background-music-position.txt +27 -0
  75. package/.claude/config/background-music-volume.txt +1 -1
  76. package/.claude/config/background-music.cfg +1 -0
  77. package/.claude/config/background-music.txt +1 -0
  78. package/.claude/config/tts-speech-rate.txt +1 -4
  79. package/.claude/config/tts-verbosity.txt +1 -0
  80. package/.claude/docs/TERMUX_SETUP.md +408 -408
  81. package/.claude/github-star-reminder.txt +1 -1
  82. package/.claude/hooks/README-TTS-QUEUE.md +135 -135
  83. package/.claude/hooks/audio-cache-utils.sh +0 -0
  84. package/.claude/hooks/audio-processor.sh +60 -14
  85. package/.claude/hooks/background-music-manager.sh +0 -0
  86. package/.claude/hooks/bmad-party-manager.sh +225 -0
  87. package/.claude/hooks/bmad-speak-enhanced.sh +0 -0
  88. package/.claude/hooks/bmad-speak.sh +6 -13
  89. package/.claude/hooks/bmad-tts-injector.sh +0 -0
  90. package/.claude/hooks/bmad-voice-manager.sh +0 -0
  91. package/.claude/hooks/clawdbot-receiver-SECURE.sh +25 -23
  92. package/.claude/hooks/clawdbot-receiver.sh +4 -28
  93. package/.claude/hooks/clean-audio-cache.sh +0 -0
  94. package/.claude/hooks/cleanup-cache.sh +0 -0
  95. package/.claude/hooks/configure-rdp-mode.sh +0 -0
  96. package/.claude/hooks/download-extra-voices.sh +0 -0
  97. package/.claude/hooks/effects-manager.sh +0 -0
  98. package/.claude/hooks/github-star-reminder.sh +0 -0
  99. package/.claude/hooks/language-manager.sh +0 -0
  100. package/.claude/hooks/learn-manager.sh +0 -0
  101. package/.claude/hooks/macos-voice-manager.sh +0 -0
  102. package/.claude/hooks/migrate-background-music.sh +0 -0
  103. package/.claude/hooks/migrate-to-agentvibes.sh +0 -0
  104. package/.claude/hooks/optimize-background-music.sh +0 -0
  105. package/.claude/hooks/personality-manager.sh +0 -0
  106. package/.claude/hooks/piper-download-voices.sh +0 -0
  107. package/.claude/hooks/piper-installer.sh +1 -1
  108. package/.claude/hooks/piper-multispeaker-registry.sh +0 -0
  109. package/.claude/hooks/piper-voice-manager.sh +0 -0
  110. package/.claude/hooks/play-tts-enhanced.sh +0 -0
  111. package/.claude/hooks/play-tts-macos.sh +6 -12
  112. package/.claude/hooks/play-tts-piper.sh +50 -79
  113. package/.claude/hooks/play-tts-soprano.sh +9 -43
  114. package/.claude/hooks/play-tts-ssh-remote.sh +43 -215
  115. package/.claude/hooks/play-tts-termux-ssh.sh +0 -0
  116. package/.claude/hooks/play-tts.sh +31 -31
  117. package/.claude/hooks/post-response.sh +41 -0
  118. package/.claude/hooks/prepare-release.sh +0 -0
  119. package/.claude/hooks/provider-commands.sh +0 -0
  120. package/.claude/hooks/provider-manager.sh +0 -0
  121. package/.claude/hooks/replay-target-audio.sh +0 -0
  122. package/.claude/hooks/requirements.txt +6 -6
  123. package/.claude/hooks/sentiment-manager.sh +0 -0
  124. package/.claude/hooks/session-start-tts.sh +56 -39
  125. package/.claude/hooks/soprano-gradio-synth.py +139 -139
  126. package/.claude/hooks/speed-manager.sh +0 -0
  127. package/.claude/hooks/stop.sh +63 -0
  128. package/.claude/hooks/termux-installer.sh +0 -0
  129. package/.claude/hooks/translate-manager.sh +0 -0
  130. package/.claude/hooks/translator.py +237 -237
  131. package/.claude/hooks/tts-queue-worker.sh +0 -0
  132. package/.claude/hooks/tts-queue.sh +0 -0
  133. package/.claude/hooks/verbosity-manager.sh +0 -0
  134. package/.claude/hooks/voice-manager.sh +26 -4
  135. package/.claude/hooks-windows/audio-cache-utils.ps1 +119 -119
  136. package/.claude/hooks-windows/bmad-party-speak.ps1 +278 -278
  137. package/.claude/hooks-windows/bmad-speak.ps1 +264 -264
  138. package/.claude/hooks-windows/clean-audio-cache.ps1 +53 -53
  139. package/.claude/hooks-windows/effects-manager.ps1 +294 -294
  140. package/.claude/hooks-windows/language-manager.ps1 +193 -193
  141. package/.claude/hooks-windows/learn-manager.ps1 +241 -241
  142. package/.claude/hooks-windows/personality-manager.ps1 +266 -266
  143. package/.claude/hooks-windows/play-tts-soprano.ps1 +5 -5
  144. package/.claude/hooks-windows/play-tts-termux-ssh.ps1 +138 -138
  145. package/.claude/hooks-windows/play-tts-windows-piper.ps1 +164 -0
  146. package/.claude/hooks-windows/play-tts-windows-sapi.ps1 +108 -0
  147. package/.claude/hooks-windows/play-tts.ps1 +104 -513
  148. package/.claude/hooks-windows/provider-manager.ps1 +158 -192
  149. package/.claude/hooks-windows/session-start-tts.ps1 +55 -46
  150. package/.claude/hooks-windows/soprano-gradio-synth.py +153 -153
  151. package/.claude/hooks-windows/speed-manager.ps1 +166 -166
  152. package/.claude/hooks-windows/voice-manager-windows.ps1 +176 -260
  153. package/.claude/output-styles/agent-vibes.md +202 -202
  154. package/.claude/personalities/angry.md +14 -14
  155. package/.claude/personalities/annoying.md +14 -14
  156. package/.claude/personalities/crass.md +14 -14
  157. package/.claude/personalities/dramatic.md +14 -14
  158. package/.claude/personalities/dry-humor.md +50 -50
  159. package/.claude/personalities/flirty.md +20 -20
  160. package/.claude/personalities/funny.md +14 -14
  161. package/.claude/personalities/grandpa.md +32 -32
  162. package/.claude/personalities/millennial.md +14 -14
  163. package/.claude/personalities/moody.md +14 -14
  164. package/.claude/personalities/normal.md +16 -16
  165. package/.claude/personalities/pirate.md +14 -14
  166. package/.claude/personalities/poetic.md +14 -14
  167. package/.claude/personalities/professional.md +14 -14
  168. package/.claude/personalities/rapper.md +55 -55
  169. package/.claude/personalities/robot.md +14 -14
  170. package/.claude/personalities/sarcastic.md +38 -38
  171. package/.claude/personalities/sassy.md +14 -14
  172. package/.claude/personalities/surfer-dude.md +14 -14
  173. package/.claude/personalities/zen.md +14 -14
  174. package/.claude/piper-voices-dir.txt +1 -0
  175. package/.claude/settings.json +25 -15
  176. package/.claude/verbosity.txt +1 -1
  177. package/.clawdbot/README.md +105 -105
  178. package/.clawdbot/skill/SKILL.md +149 -145
  179. package/.mcp.json +30 -11
  180. package/CLAUDE.md +170 -215
  181. package/README.md +206 -525
  182. package/RELEASE_NOTES.md +1132 -1976
  183. package/WINDOWS-SETUP.md +208 -208
  184. package/bin/agent-vibes +0 -0
  185. package/bin/agentvibes-voice-browser.js +64 -1289
  186. package/bin/agentvibes.js +0 -0
  187. package/bin/ensure-soprano-running.sh +43 -0
  188. package/bin/mcp-server.js +121 -121
  189. package/bin/mcp-server.sh +0 -0
  190. package/bin/test-bmad-pr +78 -78
  191. package/mcp-server/QUICK_START.md +203 -203
  192. package/mcp-server/README.md +345 -345
  193. package/mcp-server/WINDOWS_SETUP.md +260 -260
  194. package/mcp-server/docs/troubleshooting-audio.md +313 -313
  195. package/mcp-server/examples/claude_desktop_config.json +11 -11
  196. package/mcp-server/examples/claude_desktop_config_piper.json +9 -9
  197. package/mcp-server/examples/custom_instructions.md +169 -169
  198. package/mcp-server/install-deps.js +130 -130
  199. package/mcp-server/pyproject.toml +52 -52
  200. package/mcp-server/requirements.txt +2 -2
  201. package/mcp-server/server.py +1451 -1578
  202. package/mcp-server/test_server.py +395 -395
  203. package/package.json +1 -3
  204. package/setup-windows.ps1 +815 -815
  205. package/src/installer.js +42 -5
  206. package/templates/agentvibes-receiver.sh +158 -483
  207. package/templates/audio/welcome-music.mp3 +0 -0
  208. package/.agentvibes/bmad-voice-map.json +0 -104
  209. package/.agentvibes/copilot-sessions.log +0 -4
  210. package/.claude/config/audio-effects-bmad.cfg +0 -50
  211. package/.claude/config/background-music-enabled.txt +0 -1
  212. package/.claude/config/intro-text.txt +0 -1
  213. package/.claude/config/personality.txt +0 -1
  214. package/.claude/config/piper-speech-rate.txt +0 -4
  215. package/.claude/config/piper-target-speech-rate.txt +0 -1
  216. package/.claude/config/reverb-level.txt +0 -1
  217. package/.claude/config/tts-target-speech-rate.txt +0 -1
  218. package/voice-assignments.json +0 -8245
  219. /package/{.claude → .agentvibes}/config/agentvibes.json +0 -0
package/.mcp.json CHANGED
@@ -1,19 +1,38 @@
1
1
  {
2
2
  "mcpServers": {
3
- "firecrawl-mcp": {
3
+ "context7": {
4
4
  "command": "npx",
5
- "args": [
6
- "-y",
7
- "firecrawl-mcp"
8
- ]
5
+ "args": ["@upstash/context7-mcp"]
9
6
  },
10
- "agentvibes": {
11
- "command": "npx",
7
+ "sonarqube": {
8
+ "command": "docker",
12
9
  "args": [
13
- "-y",
14
- "--package=agentvibes",
15
- "agentvibes-mcp-server"
16
- ]
10
+ "run",
11
+ "-i",
12
+ "--name",
13
+ "sonarqube-mcp-server-agentvibes",
14
+ "--rm",
15
+ "--dns",
16
+ "8.8.8.8",
17
+ "--dns",
18
+ "8.8.4.4",
19
+ "-e",
20
+ "SONARQUBE_TOKEN",
21
+ "-e",
22
+ "SONARQUBE_ORG",
23
+ "-e",
24
+ "STORAGE_PATH",
25
+ "mcp/sonarqube"
26
+ ],
27
+ "env": {
28
+ "SONARQUBE_TOKEN": "${SONARQUBE_TOKEN}",
29
+ "SONARQUBE_ORG": "${SONARQUBE_ORG}",
30
+ "STORAGE_PATH": "${STORAGE_PATH}"
31
+ }
32
+ },
33
+ "vercel": {
34
+ "type": "sse",
35
+ "url": "https://mcp.vercel.com"
17
36
  }
18
37
  }
19
38
  }
package/CLAUDE.md CHANGED
@@ -1,215 +1,170 @@
1
- # AgentVibes Development Guidelines
2
-
3
- **Version:** 3.0
4
- **Updated:** 2026-02-15
5
- **Status:** Active (Using BMAD Methodology)
6
-
7
- ## Overview
8
-
9
- AgentVibes is a Text-to-Speech system for AI assistants with personality support.
10
-
11
- ### Time Estimates
12
-
13
- Always estimate in **AI time** Paul does not write code, that's Claude's job. "30 minutes" means 30 human minutes; the AI equivalent is seconds to a few minutes. When giving estimates, say things like "~10 minutes of AI work" or "quick — a few minutes tops."
14
-
15
- ### Project Uses BMAD Methodology
16
-
17
- This project follows **BMAD (BMM - Business Model Methodology)** for all story development:
18
- - Use `/sprint-planning` to initialize sprint tracking
19
- - Use `/dev-story` for each story implementation (NOT manual commits)
20
- - `/dev-story` handles: implementation → testing → code review → auto-fixes status updates
21
- - All stories tracked in `docs/implementation-artifacts/sprint-status.yaml`
22
- - Status updates: `ready-for-dev` → `in-progress` → `complete`
23
-
24
- **Required Reading:** See `BMAD-STORY-DEVELOPMENT.md` for complete workflow.
25
-
26
- ## Critical Rules
27
-
28
- ### MANDATORY: Use BMAD Workflow
29
- 1. **Initialize sprint:** Run `/sprint-planning` once per sprint
30
- 2. **Develop each story:** Run `/dev-story` (NOT manual coding)
31
- 3. **Never skip workflow steps** - Workflow enforces quality gates
32
- 4. **Update sprint-status.yaml** automatically via `/dev-story`
33
- 5. **Code review included** - Built into `/dev-story` workflow
34
-
35
- ### Git Workflow (ONLY Outside BMAD)
36
- For changes outside story development:
37
- 1. Describe changes before acting
38
- 2. Get explicit user approval before commits/pushes
39
- 3. Test locally before pushing
40
- 4. Exception: Changes made by `/dev-story` auto-commit
41
-
42
- ### 🚫 RELEASE: MANDATORY HUMAN APPROVAL BEFORE ANY PUSH
43
-
44
- **NEVER run `git push`, `git push --follow-tags`, or `npm publish` during a release without first stopping and showing the user:**
45
-
46
- 1. The full content of `RELEASE_NOTES.md` for that release
47
- 2. The updated section of `README.md`
48
- 3. Explicitly asking: **"Please review — type 'approve' to push, or request changes."**
49
-
50
- **Wait for explicit approval. Do NOT push speculatively.** It doesn't matter how clean the content is. The human-in-the-loop checkpoint is non-negotiable.
51
-
52
- This rule was added after Claude pushed v4.6.5 without pausing for review.
53
-
54
- ## Security Requirements (SonarCloud Compliance)
55
-
56
- ### Core Security Rules (NO EXCEPTIONS)
57
- 1. **No hardcoded credentials** - Never commit API keys, passwords, tokens
58
- 2. **Validate all external input** - User input, files, environment variables
59
- 3. **Secure temp directories** - Use `$XDG_RUNTIME_DIR` or user-specific `/tmp`
60
- 4. **Verify file ownership** - Check before processing external files (uid check)
61
- 5. **Prevent path traversal** - Validate paths stay within expected directories (use `path.resolve()`)
62
- 6. **Never log sensitive data** - Mask credentials in logs
63
-
64
- ### Bash/Shell Security
65
- ```bash
66
- set -euo pipefail # REQUIRED: Always use strict mode
67
-
68
- # Secure temp with proper permissions
69
- TEMP_DIR="${XDG_RUNTIME_DIR:-/tmp}/agentvibes-$RANDOM"
70
- mkdir -p "$TEMP_DIR"; chmod 700 "$TEMP_DIR"
71
-
72
- # Verify file ownership before processing
73
- [[ $(stat -c '%u' "$file" 2>/dev/null || stat -f '%u' "$file" 2>/dev/null) == $(id -u) ]] || exit 1
74
-
75
- trap 'rm -f "$TEMP_FILE"' EXIT # Clean up: use single quotes for deferred expansion
76
-
77
- # Validate input
78
- [[ "$VALUE" =~ ^[0-9]+$ ]] || exit 1 # Only allow numbers
79
-
80
- echo "$VARIABLE" # GOOD: Quoted
81
- echo $VARIABLE # BAD: Vulnerable to word splitting
82
- ```
83
-
84
- ### JavaScript/Node.js Security
85
- ```javascript
86
- // Path safety: ALWAYS use path.resolve()
87
- const safePath = path.resolve(userInput);
88
- function isPathSafe(target, base) {
89
- const r = path.resolve(target), b = path.resolve(base);
90
- return r === b || r.startsWith(b + path.sep);
91
- }
92
-
93
- // Never log credentials - ALWAYS mask
94
- console.log('Key: ' + apiKey.substring(0, 3) + '...'); // Good
95
- console.log(`Key: ${apiKey}`); // BAD
96
-
97
- // Resource cleanup with try-finally
98
- let proc;
99
- try {
100
- proc = spawn(...);
101
- } finally {
102
- if (proc && !proc.killed) proc.kill();
103
- }
104
- ```
105
-
106
- ### Python Security
107
- ```python
108
- # Resource cleanup
109
- process = None
110
- try:
111
- process = subprocess.Popen(...)
112
- finally:
113
- if process and process.poll() is None:
114
- process.kill()
115
-
116
- # Graceful error handling
117
- try:
118
- content = path.read_text()
119
- except (PermissionError, UnicodeDecodeError, OSError) as e:
120
- print(f"Warning: {e}", file=sys.stderr)
121
- return default_value
122
- ```
123
-
124
- ## Blessed TUI Color Rules (CRITICAL)
125
-
126
- Paul's terminal does **not** render hex colors — they all fall back to white. Always use **named ANSI colors**.
127
-
128
- ### Two coloring mechanisms use the right one:
129
-
130
- **1. Content tags (`tags: true` on the widget) — for text elements:**
131
- ```js
132
- blessed.text({
133
- tags: true,
134
- content: `{yellow-fg}some text{/yellow-fg} {magenta-fg}other text{/magenta-fg}`,
135
- style: { bg: COLORS.headerBg },
136
- });
137
- ```
138
- - Works: `{yellow-fg}`, `{cyan-fg}`, `{magenta-fg}`, `{white-fg}`, `{green-fg}`, `{blue-fg}`
139
- - Broken: `{#ffff00-fg}`, `{#90a4ae-fg}` hex tags render as white
140
-
141
- **2. Style objects for list `selected`, `item`, widget `style`:**
142
- ```js
143
- style: {
144
- selected: { bg: 'blue', fg: 'yellow' }, // ✅ named only
145
- item: { fg: 'white' },
146
- }
147
- ```
148
- - Works: `'yellow'`, `'blue'`, `'cyan'`, `'magenta'`, `'green'`, `'white'`
149
- - Broken: `'#ffff00'`, `'#4a148c'` — hex in style objects renders as white
150
-
151
- **Direct screen children render tags correctly.** Elements parented to a `blessed.box` with `tags: false` may not render tags even if the child has `tags: true` — attach directly to `this.screen` instead (same pattern as tab bar items).
152
-
153
- ## Code Quality Standards
154
-
155
- - **Error handling:** No silent failures - always handle errors explicitly
156
- - ✅ **Defensive programming:** Check preconditions and validate inputs
157
- - **Resource cleanup:** Always clean up files, processes, connections
158
- - ✅ **Race conditions:** Use file locking for shared resources
159
- - **Comments:** Security-critical code only (explain WHY, not WHAT)
160
- - **Single responsibility:** Keep functions focused and testable
161
-
162
- ## Testing Requirements
163
-
164
- - Run `npm test` before committing (REQUIRED)
165
- - Write tests for: input validation, path handling, edge cases
166
- - Code review via `/dev-story` includes test validation
167
- - Target: 80%+ code coverage for new features
168
-
169
- ## Definition of Done (Checked by /dev-story)
170
-
171
- - [ ] All tests pass (`npm test`)
172
- - [ ] No Sonar security hotspots
173
- - [ ] Code follows project patterns (project-context.md)
174
- - [ ] Credentials masked in logs
175
- - [ ] Paths validated (no traversal)
176
- - [ ] File operations safe (ownership checked)
177
- - [ ] Shell scripts use strict mode
178
- - [ ] Resources properly cleaned up
179
- - [ ] Acceptance criteria satisfied
180
-
181
- ## Story Development Workflow (REQUIRED)
182
-
183
- ### For Each Sprint:
184
- 1. Run `/sprint-planning` to initialize sprint-status.yaml
185
- 2. For each story, run `/dev-story` (handles everything)
186
- 3. Check progress anytime with `/sprint-status`
187
-
188
- ### What /dev-story Does:
189
- - Finds next ready-for-dev story
190
- - Loads story file with acceptance criteria
191
- - Implements tasks with code + tests
192
- - **Runs adversarial code review** (finds 3-10 issues)
193
- - **Auto-fixes HIGH and MEDIUM severity issues**
194
- - Validates against project-context.md
195
- - Updates sprint-status.yaml automatically
196
- - Marks story complete when all ACs satisfied
197
-
198
- **Never bypass the workflow** - it enforces all quality gates.
199
-
200
- ## Important Files
201
-
202
- | File | Purpose |
203
- |------|---------|
204
- | `CLAUDE.md` | Development standards (this file) |
205
- | `BMAD-STORY-DEVELOPMENT.md` | How to use BMAD methodology |
206
- | `project-context.md` | Project-specific patterns (if exists) |
207
- | `docs/epics.md` | All epics and stories |
208
- | `docs/implementation-artifacts/sprint-status.yaml` | Sprint progress tracking |
209
- | `_bmad/core/tasks/workflow.xml` | BMAD execution engine (read-only) |
210
-
211
- ## References
212
-
213
- - **BMAD Methodology:** See `/sprint-planning`, `/dev-story`, `/sprint-status` workflows
214
- - **Security Standards:** [SonarCloud Rules](https://rules.sonarsource.com/javascript/type/Security_Hotspot), [OWASP Top 10](https://owasp.org/www-project-top-ten/)
215
- - **Bash Best Practices:** [Shellharden](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md)
1
+ # AgentVibes Development Guidelines
2
+
3
+ **Version:** 3.0
4
+ **Updated:** 2026-02-15
5
+ **Status:** Active (Using BMAD Methodology)
6
+
7
+ ## Overview
8
+
9
+ AgentVibes is a Text-to-Speech system for AI assistants with personality support.
10
+
11
+ ### Project Uses BMAD Methodology
12
+
13
+ This project follows **BMAD (BMM - Business Model Methodology)** for all story development:
14
+ - Use `/sprint-planning` to initialize sprint tracking
15
+ - Use `/dev-story` for each story implementation (NOT manual commits)
16
+ - `/dev-story` handles: implementation → testing → code review → auto-fixes → status updates
17
+ - All stories tracked in `docs/implementation-artifacts/sprint-status.yaml`
18
+ - Status updates: `ready-for-dev` `in-progress` `complete`
19
+
20
+ **Required Reading:** See `BMAD-STORY-DEVELOPMENT.md` for complete workflow.
21
+
22
+ ## Critical Rules
23
+
24
+ ### MANDATORY: Use BMAD Workflow
25
+ 1. **Initialize sprint:** Run `/sprint-planning` once per sprint
26
+ 2. **Develop each story:** Run `/dev-story` (NOT manual coding)
27
+ 3. **Never skip workflow steps** - Workflow enforces quality gates
28
+ 4. **Update sprint-status.yaml** automatically via `/dev-story`
29
+ 5. **Code review included** - Built into `/dev-story` workflow
30
+
31
+ ### Git Workflow (ONLY Outside BMAD)
32
+ For changes outside story development:
33
+ 1. Describe changes before acting
34
+ 2. Get explicit user approval before commits/pushes
35
+ 3. Test locally before pushing
36
+ 4. Exception: Changes made by `/dev-story` auto-commit
37
+
38
+ ## Security Requirements (SonarCloud Compliance)
39
+
40
+ ### Core Security Rules (NO EXCEPTIONS)
41
+ 1. **No hardcoded credentials** - Never commit API keys, passwords, tokens
42
+ 2. **Validate all external input** - User input, files, environment variables
43
+ 3. **Secure temp directories** - Use `$XDG_RUNTIME_DIR` or user-specific `/tmp`
44
+ 4. **Verify file ownership** - Check before processing external files (uid check)
45
+ 5. **Prevent path traversal** - Validate paths stay within expected directories (use `path.resolve()`)
46
+ 6. **Never log sensitive data** - Mask credentials in logs
47
+
48
+ ### Bash/Shell Security
49
+ ```bash
50
+ set -euo pipefail # REQUIRED: Always use strict mode
51
+
52
+ # Secure temp with proper permissions
53
+ TEMP_DIR="${XDG_RUNTIME_DIR:-/tmp}/agentvibes-$RANDOM"
54
+ mkdir -p "$TEMP_DIR"; chmod 700 "$TEMP_DIR"
55
+
56
+ # Verify file ownership before processing
57
+ [[ $(stat -c '%u' "$file" 2>/dev/null || stat -f '%u' "$file" 2>/dev/null) == $(id -u) ]] || exit 1
58
+
59
+ trap 'rm -f "$TEMP_FILE"' EXIT # Clean up: use single quotes for deferred expansion
60
+
61
+ # Validate input
62
+ [[ "$VALUE" =~ ^[0-9]+$ ]] || exit 1 # Only allow numbers
63
+
64
+ echo "$VARIABLE" # GOOD: Quoted
65
+ echo $VARIABLE # BAD: Vulnerable to word splitting
66
+ ```
67
+
68
+ ### JavaScript/Node.js Security
69
+ ```javascript
70
+ // Path safety: ALWAYS use path.resolve()
71
+ const safePath = path.resolve(userInput);
72
+ function isPathSafe(target, base) {
73
+ const r = path.resolve(target), b = path.resolve(base);
74
+ return r === b || r.startsWith(b + path.sep);
75
+ }
76
+
77
+ // Never log credentials - ALWAYS mask
78
+ console.log('Key: ' + apiKey.substring(0, 3) + '...'); // Good
79
+ console.log(`Key: ${apiKey}`); // BAD
80
+
81
+ // Resource cleanup with try-finally
82
+ let proc;
83
+ try {
84
+ proc = spawn(...);
85
+ } finally {
86
+ if (proc && !proc.killed) proc.kill();
87
+ }
88
+ ```
89
+
90
+ ### Python Security
91
+ ```python
92
+ # Resource cleanup
93
+ process = None
94
+ try:
95
+ process = subprocess.Popen(...)
96
+ finally:
97
+ if process and process.poll() is None:
98
+ process.kill()
99
+
100
+ # Graceful error handling
101
+ try:
102
+ content = path.read_text()
103
+ except (PermissionError, UnicodeDecodeError, OSError) as e:
104
+ print(f"Warning: {e}", file=sys.stderr)
105
+ return default_value
106
+ ```
107
+
108
+ ## Code Quality Standards
109
+
110
+ - ✅ **Error handling:** No silent failures - always handle errors explicitly
111
+ - **Defensive programming:** Check preconditions and validate inputs
112
+ - ✅ **Resource cleanup:** Always clean up files, processes, connections
113
+ - **Race conditions:** Use file locking for shared resources
114
+ - ✅ **Comments:** Security-critical code only (explain WHY, not WHAT)
115
+ - ✅ **Single responsibility:** Keep functions focused and testable
116
+
117
+ ## Testing Requirements
118
+
119
+ - Run `npm test` before committing (REQUIRED)
120
+ - Write tests for: input validation, path handling, edge cases
121
+ - Code review via `/dev-story` includes test validation
122
+ - Target: 80%+ code coverage for new features
123
+
124
+ ## Definition of Done (Checked by /dev-story)
125
+
126
+ - [ ] All tests pass (`npm test`)
127
+ - [ ] No Sonar security hotspots
128
+ - [ ] Code follows project patterns (project-context.md)
129
+ - [ ] Credentials masked in logs
130
+ - [ ] Paths validated (no traversal)
131
+ - [ ] File operations safe (ownership checked)
132
+ - [ ] Shell scripts use strict mode
133
+ - [ ] Resources properly cleaned up
134
+ - [ ] Acceptance criteria satisfied
135
+
136
+ ## Story Development Workflow (REQUIRED)
137
+
138
+ ### For Each Sprint:
139
+ 1. Run `/sprint-planning` to initialize sprint-status.yaml
140
+ 2. For each story, run `/dev-story` (handles everything)
141
+ 3. Check progress anytime with `/sprint-status`
142
+
143
+ ### What /dev-story Does:
144
+ - Finds next ready-for-dev story
145
+ - Loads story file with acceptance criteria
146
+ - Implements tasks with code + tests
147
+ - **Runs adversarial code review** (finds 3-10 issues)
148
+ - **Auto-fixes HIGH and MEDIUM severity issues**
149
+ - Validates against project-context.md
150
+ - Updates sprint-status.yaml automatically
151
+ - Marks story complete when all ACs satisfied
152
+
153
+ **Never bypass the workflow** - it enforces all quality gates.
154
+
155
+ ## Important Files
156
+
157
+ | File | Purpose |
158
+ |------|---------|
159
+ | `CLAUDE.md` | Development standards (this file) |
160
+ | `BMAD-STORY-DEVELOPMENT.md` | How to use BMAD methodology |
161
+ | `project-context.md` | Project-specific patterns (if exists) |
162
+ | `docs/epics.md` | All epics and stories |
163
+ | `docs/implementation-artifacts/sprint-status.yaml` | Sprint progress tracking |
164
+ | `_bmad/core/tasks/workflow.xml` | BMAD execution engine (read-only) |
165
+
166
+ ## References
167
+
168
+ - **BMAD Methodology:** See `/sprint-planning`, `/dev-story`, `/sprint-status` workflows
169
+ - **Security Standards:** [SonarCloud Rules](https://rules.sonarsource.com/javascript/type/Security_Hotspot), [OWASP Top 10](https://owasp.org/www-project-top-ten/)
170
+ - **Bash Best Practices:** [Shellharden](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md)