agentvibes 3.5.9 → 4.0.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.
- package/.agentvibes/bmad/bmad-voices-enabled.flag +0 -0
- package/.agentvibes/bmad/bmad-voices.md +69 -0
- package/.claude/config/audio-effects.cfg +1 -1
- package/.claude/config/background-music-position.txt +1 -27
- package/.claude/github-star-reminder.txt +1 -1
- package/.claude/hooks/audio-processor.sh +32 -17
- package/.claude/hooks/bmad-speak-enhanced.sh +5 -5
- package/.claude/hooks/bmad-speak.sh +4 -4
- package/.claude/hooks/bmad-voice-manager.sh +8 -8
- package/.claude/hooks/clawdbot-receiver-SECURE.sh +23 -25
- package/.claude/hooks/clawdbot-receiver.sh +28 -4
- package/.claude/hooks/language-manager.sh +1 -1
- package/.claude/hooks/path-resolver.sh +60 -0
- package/.claude/hooks/play-tts-agentvibes-receiver-for-voiceless-connections.sh +90 -0
- package/.claude/hooks/play-tts-piper.sh +82 -24
- package/.claude/hooks/play-tts-ssh-remote.sh +13 -15
- package/.claude/hooks/play-tts.sh +16 -5
- package/.claude/hooks/session-start-tts.sh +26 -56
- package/.claude/hooks/soprano-gradio-synth.py +1 -1
- package/.claude/hooks/verbosity-manager.sh +10 -4
- package/.claude/settings.json +1 -1
- package/CLAUDE.md +129 -104
- package/README.md +418 -10
- package/RELEASE_NOTES.md +60 -1036
- package/bin/agentvibes-voice-browser.js +1827 -0
- package/bin/agentvibes.js +100 -0
- package/mcp-server/server.py +67 -3
- package/package.json +11 -2
- package/src/console/app.js +806 -0
- package/src/console/audio-env.js +123 -0
- package/src/console/brand-colors.js +13 -0
- package/src/console/footer-config.js +42 -0
- package/src/console/modals/.gitkeep +0 -0
- package/src/console/modals/modal-overlay.js +247 -0
- package/src/console/navigation.js +60 -0
- package/src/console/tabs/.gitkeep +0 -0
- package/src/console/tabs/agents-tab.js +369 -0
- package/src/console/tabs/help-tab.js +261 -0
- package/src/console/tabs/install-tab.js +990 -0
- package/src/console/tabs/music-tab.js +997 -0
- package/src/console/tabs/placeholder-tab.js +45 -0
- package/src/console/tabs/readme-tab.js +267 -0
- package/src/console/tabs/settings-tab.js +3949 -0
- package/src/console/tabs/voices-tab.js +1574 -0
- package/src/installer/music-file-input.js +304 -0
- package/src/installer.js +1353 -676
- package/src/services/.gitkeep +0 -0
- package/src/services/agent-voice-store.js +163 -0
- package/src/services/config-service.js +240 -0
- package/src/services/navigation-service.js +123 -0
- package/src/services/provider-service.js +132 -0
- package/src/services/verbosity-service.js +157 -0
- package/src/utils/audio-duration-validator.js +298 -0
- package/src/utils/audio-format-validator.js +277 -0
- package/src/utils/dependency-checker.js +3 -3
- package/src/utils/file-ownership-verifier.js +358 -0
- package/src/utils/music-file-validator.js +275 -0
- package/src/utils/preview-list-prompt.js +136 -0
- package/src/utils/provider-validator.js +144 -132
- package/src/utils/secure-music-storage.js +412 -0
- package/templates/agentvibes-receiver.sh +11 -7
- package/voice-assignments.json +8245 -0
- package/.claude/config/background-music-volume.txt +0 -1
- package/.claude/config/background-music.cfg +0 -1
- package/.claude/config/background-music.txt +0 -1
- package/.claude/config/tts-speech-rate.txt +0 -1
- package/.claude/config/tts-verbosity.txt +0 -1
- package/.claude/hooks/bmad-party-manager.sh +0 -225
- package/.claude/hooks/stop.sh +0 -38
- package/.claude/piper-voices-dir.txt +0 -1
- package/.mcp.json +0 -34
package/CLAUDE.md
CHANGED
|
@@ -1,156 +1,181 @@
|
|
|
1
1
|
# AgentVibes Development Guidelines
|
|
2
2
|
|
|
3
|
+
**Version:** 3.0
|
|
4
|
+
**Updated:** 2026-02-15
|
|
5
|
+
**Status:** Active (Using BMAD Methodology)
|
|
6
|
+
|
|
7
|
+
## TTS Protocol (MANDATORY)
|
|
8
|
+
|
|
9
|
+
**ALWAYS call TTS inline (never `run_in_background: true`):**
|
|
10
|
+
```bash
|
|
11
|
+
PULSE_SERVER=unix:/mnt/wslg/PulseServer bash ".claude/hooks/play-tts.sh" "text to speak"
|
|
12
|
+
```
|
|
13
|
+
- Provider: `piper` (WSL bash, NOT Windows PowerShell)
|
|
14
|
+
- Mode: `full` (`.agentvibes/config/mode.txt`) — Claude calls TTS directly, no stop-hook Audio Summary
|
|
15
|
+
- Pretext: configured in `.agentvibes/config/agentvibes.json` (prepended automatically by play-tts.sh)
|
|
16
|
+
- Call at: task acknowledgment + task completion (high verbosity = also reasoning/findings)
|
|
17
|
+
|
|
3
18
|
## Overview
|
|
19
|
+
|
|
4
20
|
AgentVibes is a Text-to-Speech system for AI assistants with personality support.
|
|
5
|
-
This document defines coding standards and quality requirements for all contributions.
|
|
6
21
|
|
|
7
|
-
|
|
22
|
+
### Project Uses BMAD Methodology
|
|
8
23
|
|
|
9
|
-
|
|
24
|
+
This project follows **BMAD (BMM - Business Model Methodology)** for all story development:
|
|
25
|
+
- Use `/sprint-planning` to initialize sprint tracking
|
|
26
|
+
- Use `/dev-story` for each story implementation (NOT manual commits)
|
|
27
|
+
- `/dev-story` handles: implementation → testing → code review → auto-fixes → status updates
|
|
28
|
+
- All stories tracked in `docs/implementation-artifacts/sprint-status.yaml`
|
|
29
|
+
- Status updates: `ready-for-dev` → `in-progress` → `complete`
|
|
10
30
|
|
|
11
|
-
|
|
12
|
-
1. **Always describe the changes first** - Explain what you plan to modify
|
|
13
|
-
2. **Wait for user to test locally** - Do not push until user confirms testing is complete
|
|
14
|
-
3. **Ask before pushing** - Get explicit "yes, push it" or similar confirmation
|
|
15
|
-
4. **If user says "let me know before adding to PR"** - This means STOP and WAIT for approval
|
|
31
|
+
**Required Reading:** See `BMAD-STORY-DEVELOPMENT.md` for complete workflow.
|
|
16
32
|
|
|
17
|
-
|
|
18
|
-
- All commits to any repository
|
|
19
|
-
- All pushes to remote branches
|
|
20
|
-
- All PR updates
|
|
21
|
-
- Any changes to BMAD-METHOD or other external projects
|
|
33
|
+
## Critical Rules
|
|
22
34
|
|
|
23
|
-
|
|
35
|
+
### ✅ MANDATORY: Use BMAD Workflow
|
|
36
|
+
1. **Initialize sprint:** Run `/sprint-planning` once per sprint
|
|
37
|
+
2. **Develop each story:** Run `/dev-story` (NOT manual coding)
|
|
38
|
+
3. **Never skip workflow steps** - Workflow enforces quality gates
|
|
39
|
+
4. **Update sprint-status.yaml** automatically via `/dev-story`
|
|
40
|
+
5. **Code review included** - Built into `/dev-story` workflow
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
### ✅ Git Workflow (ONLY Outside BMAD)
|
|
43
|
+
For changes outside story development:
|
|
44
|
+
1. Describe changes before acting
|
|
45
|
+
2. Get explicit user approval before commits/pushes
|
|
46
|
+
3. Test locally before pushing
|
|
47
|
+
4. Exception: Changes made by `/dev-story` auto-commit
|
|
26
48
|
|
|
27
|
-
|
|
28
|
-
1. **No hardcoded credentials** - API keys, passwords, tokens must NEVER be in code
|
|
29
|
-
2. **Validate all external input** - User input, environment variables, file content
|
|
30
|
-
3. **Use secure temp directories** - Prefer `$XDG_RUNTIME_DIR` with fallback to user-specific `/tmp`
|
|
31
|
-
4. **Verify file ownership** - Before processing files from directories that could be influenced externally
|
|
32
|
-
5. **Prevent path traversal** - Always validate paths are within expected directories
|
|
49
|
+
## Security Requirements (SonarCloud Compliance)
|
|
33
50
|
|
|
34
|
-
###
|
|
51
|
+
### Core Security Rules (NO EXCEPTIONS)
|
|
52
|
+
1. **No hardcoded credentials** - Never commit API keys, passwords, tokens
|
|
53
|
+
2. **Validate all external input** - User input, files, environment variables
|
|
54
|
+
3. **Secure temp directories** - Use `$XDG_RUNTIME_DIR` or user-specific `/tmp`
|
|
55
|
+
4. **Verify file ownership** - Check before processing external files (uid check)
|
|
56
|
+
5. **Prevent path traversal** - Validate paths stay within expected directories (use `path.resolve()`)
|
|
57
|
+
6. **Never log sensitive data** - Mask credentials in logs
|
|
58
|
+
|
|
59
|
+
### Bash/Shell Security
|
|
35
60
|
```bash
|
|
36
|
-
# REQUIRED: Always use strict mode
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
|
|
52
|
-
echo "Error: Directory not owned by current user" >&2
|
|
53
|
-
exit 1
|
|
54
|
-
fi
|
|
55
|
-
|
|
56
|
-
# REQUIRED: Use single quotes in trap to defer variable expansion
|
|
57
|
-
trap 'rm -f "$PID_FILE"' EXIT
|
|
58
|
-
|
|
59
|
-
# REQUIRED: Validate numeric input
|
|
60
|
-
if [[ "$VALUE" =~ ^[0-9]+$ ]]; then
|
|
61
|
-
# Safe to use
|
|
62
|
-
fi
|
|
63
|
-
|
|
64
|
-
# REQUIRED: Quote all variables
|
|
65
|
-
echo "$VARIABLE" # Good
|
|
66
|
-
echo $VARIABLE # Bad - word splitting/globbing risk
|
|
61
|
+
set -euo pipefail # REQUIRED: Always use strict mode
|
|
62
|
+
|
|
63
|
+
# Secure temp with proper permissions
|
|
64
|
+
TEMP_DIR="${XDG_RUNTIME_DIR:-/tmp}/agentvibes-$RANDOM"
|
|
65
|
+
mkdir -p "$TEMP_DIR"; chmod 700 "$TEMP_DIR"
|
|
66
|
+
|
|
67
|
+
# Verify file ownership before processing
|
|
68
|
+
[[ $(stat -c '%u' "$file" 2>/dev/null || stat -f '%u' "$file" 2>/dev/null) == $(id -u) ]] || exit 1
|
|
69
|
+
|
|
70
|
+
trap 'rm -f "$TEMP_FILE"' EXIT # Clean up: use single quotes for deferred expansion
|
|
71
|
+
|
|
72
|
+
# Validate input
|
|
73
|
+
[[ "$VALUE" =~ ^[0-9]+$ ]] || exit 1 # Only allow numbers
|
|
74
|
+
|
|
75
|
+
echo "$VARIABLE" # GOOD: Quoted
|
|
76
|
+
echo $VARIABLE # BAD: Vulnerable to word splitting
|
|
67
77
|
```
|
|
68
78
|
|
|
69
79
|
### JavaScript/Node.js Security
|
|
70
80
|
```javascript
|
|
71
|
-
//
|
|
81
|
+
// Path safety: ALWAYS use path.resolve()
|
|
72
82
|
const safePath = path.resolve(userInput);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const resolved = path.resolve(targetPath);
|
|
77
|
-
const baseResolved = path.resolve(basePath);
|
|
78
|
-
// Check for exact match OR starts with base + separator
|
|
79
|
-
return resolved === baseResolved || resolved.startsWith(baseResolved + path.sep);
|
|
83
|
+
function isPathSafe(target, base) {
|
|
84
|
+
const r = path.resolve(target), b = path.resolve(base);
|
|
85
|
+
return r === b || r.startsWith(b + path.sep);
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
//
|
|
83
|
-
console.log('
|
|
84
|
-
console.log(`
|
|
88
|
+
// Never log credentials - ALWAYS mask
|
|
89
|
+
console.log('Key: ' + apiKey.substring(0, 3) + '...'); // Good
|
|
90
|
+
console.log(`Key: ${apiKey}`); // BAD
|
|
85
91
|
|
|
86
|
-
//
|
|
87
|
-
let
|
|
92
|
+
// Resource cleanup with try-finally
|
|
93
|
+
let proc;
|
|
88
94
|
try {
|
|
89
|
-
|
|
90
|
-
// ... use process
|
|
95
|
+
proc = spawn(...);
|
|
91
96
|
} finally {
|
|
92
|
-
if (
|
|
93
|
-
process.kill();
|
|
94
|
-
}
|
|
97
|
+
if (proc && !proc.killed) proc.kill();
|
|
95
98
|
}
|
|
96
99
|
```
|
|
97
100
|
|
|
98
101
|
### Python Security
|
|
99
102
|
```python
|
|
100
|
-
#
|
|
103
|
+
# Resource cleanup
|
|
101
104
|
process = None
|
|
102
105
|
try:
|
|
103
106
|
process = subprocess.Popen(...)
|
|
104
|
-
# ... use process
|
|
105
107
|
finally:
|
|
106
108
|
if process and process.poll() is None:
|
|
107
109
|
process.kill()
|
|
108
110
|
|
|
109
|
-
#
|
|
111
|
+
# Graceful error handling
|
|
110
112
|
try:
|
|
111
|
-
content =
|
|
113
|
+
content = path.read_text()
|
|
112
114
|
except (PermissionError, UnicodeDecodeError, OSError) as e:
|
|
113
|
-
print(f"Warning:
|
|
115
|
+
print(f"Warning: {e}", file=sys.stderr)
|
|
114
116
|
return default_value
|
|
115
117
|
```
|
|
116
118
|
|
|
117
119
|
## Code Quality Standards
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
### Maintainability
|
|
126
|
-
1. **Add comments for security-critical code** - Explain why, not what
|
|
127
|
-
2. **Keep functions focused** - Single responsibility
|
|
128
|
-
3. **Use meaningful variable names** - Self-documenting code
|
|
121
|
+
- ✅ **Error handling:** No silent failures - always handle errors explicitly
|
|
122
|
+
- ✅ **Defensive programming:** Check preconditions and validate inputs
|
|
123
|
+
- ✅ **Resource cleanup:** Always clean up files, processes, connections
|
|
124
|
+
- ✅ **Race conditions:** Use file locking for shared resources
|
|
125
|
+
- ✅ **Comments:** Security-critical code only (explain WHY, not WHAT)
|
|
126
|
+
- ✅ **Single responsibility:** Keep functions focused and testable
|
|
129
127
|
|
|
130
128
|
## Testing Requirements
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Test Coverage
|
|
138
|
-
- All input validation must have tests
|
|
139
|
-
- All path handling must have tests
|
|
140
|
-
- Edge cases must be covered
|
|
130
|
+
- Run `npm test` before committing (REQUIRED)
|
|
131
|
+
- Write tests for: input validation, path handling, edge cases
|
|
132
|
+
- Code review via `/dev-story` includes test validation
|
|
133
|
+
- Target: 80%+ code coverage for new features
|
|
141
134
|
|
|
142
|
-
##
|
|
135
|
+
## Definition of Done (Checked by /dev-story)
|
|
143
136
|
|
|
144
137
|
- [ ] All tests pass (`npm test`)
|
|
145
|
-
- [ ] No
|
|
146
|
-
- [ ]
|
|
147
|
-
- [ ]
|
|
138
|
+
- [ ] No Sonar security hotspots
|
|
139
|
+
- [ ] Code follows project patterns (project-context.md)
|
|
140
|
+
- [ ] Credentials masked in logs
|
|
141
|
+
- [ ] Paths validated (no traversal)
|
|
142
|
+
- [ ] File operations safe (ownership checked)
|
|
148
143
|
- [ ] Shell scripts use strict mode
|
|
149
|
-
- [ ] Resources
|
|
150
|
-
- [ ]
|
|
144
|
+
- [ ] Resources properly cleaned up
|
|
145
|
+
- [ ] Acceptance criteria satisfied
|
|
146
|
+
|
|
147
|
+
## Story Development Workflow (REQUIRED)
|
|
148
|
+
|
|
149
|
+
### For Each Sprint:
|
|
150
|
+
1. Run `/sprint-planning` to initialize sprint-status.yaml
|
|
151
|
+
2. For each story, run `/dev-story` (handles everything)
|
|
152
|
+
3. Check progress anytime with `/sprint-status`
|
|
153
|
+
|
|
154
|
+
### What /dev-story Does:
|
|
155
|
+
- Finds next ready-for-dev story
|
|
156
|
+
- Loads story file with acceptance criteria
|
|
157
|
+
- Implements tasks with code + tests
|
|
158
|
+
- **Runs adversarial code review** (finds 3-10 issues)
|
|
159
|
+
- **Auto-fixes HIGH and MEDIUM severity issues**
|
|
160
|
+
- Validates against project-context.md
|
|
161
|
+
- Updates sprint-status.yaml automatically
|
|
162
|
+
- Marks story complete when all ACs satisfied
|
|
163
|
+
|
|
164
|
+
**Never bypass the workflow** - it enforces all quality gates.
|
|
165
|
+
|
|
166
|
+
## Important Files
|
|
167
|
+
|
|
168
|
+
| File | Purpose |
|
|
169
|
+
|------|---------|
|
|
170
|
+
| `CLAUDE.md` | Development standards (this file) |
|
|
171
|
+
| `BMAD-STORY-DEVELOPMENT.md` | How to use BMAD methodology |
|
|
172
|
+
| `project-context.md` | Project-specific patterns (if exists) |
|
|
173
|
+
| `docs/epics.md` | All epics and stories |
|
|
174
|
+
| `docs/implementation-artifacts/sprint-status.yaml` | Sprint progress tracking |
|
|
175
|
+
| `_bmad/core/tasks/workflow.xml` | BMAD execution engine (read-only) |
|
|
151
176
|
|
|
152
177
|
## References
|
|
153
178
|
|
|
154
|
-
-
|
|
155
|
-
- [OWASP Top 10](https://owasp.org/www-project-top-ten/)
|
|
156
|
-
-
|
|
179
|
+
- **BMAD Methodology:** See `/sprint-planning`, `/dev-story`, `/sprint-status` workflows
|
|
180
|
+
- **Security Standards:** [SonarCloud Rules](https://rules.sonarsource.com/javascript/type/Security_Hotspot), [OWASP Top 10](https://owasp.org/www-project-top-ten/)
|
|
181
|
+
- **Bash Best Practices:** [Shellharden](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md)
|