vibe-forge 0.1.0 → 0.2.1
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/.claude/commands/forge.md +147 -0
- package/.claude/settings.local.json +7 -0
- package/LICENSE +21 -21
- package/README.md +230 -211
- package/agents/forge-master/capabilities.md +144 -144
- package/agents/forge-master/context-template.md +128 -128
- package/bin/cli.js +3 -1
- package/bin/forge-daemon.sh +195 -71
- package/bin/forge-setup.sh +6 -6
- package/bin/forge-spawn.sh +46 -46
- package/bin/forge.sh +76 -127
- package/bin/lib/agents.sh +157 -0
- package/bin/lib/colors.sh +44 -0
- package/bin/lib/config.sh +259 -0
- package/bin/lib/constants.sh +143 -0
- package/config/agents.json +76 -0
- package/config/task-template.md +87 -87
- package/docs/TODO.md +65 -0
- package/docs/security.md +144 -0
- package/package.json +11 -2
package/docs/TODO.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Vibe Forge - Future Improvements
|
|
2
|
+
|
|
3
|
+
This document tracks issues identified during code reviews that are deferred for future sessions.
|
|
4
|
+
|
|
5
|
+
## Security (From Aegis Review - Round 2)
|
|
6
|
+
|
|
7
|
+
### Medium Priority
|
|
8
|
+
- **M-1: eval() of external data in load_agents_from_json()**
|
|
9
|
+
- File: `bin/lib/config.sh` line 95
|
|
10
|
+
- Issue: If agents.json is compromised, malicious agent names could execute shell commands via `eval "$agent_data"`
|
|
11
|
+
- Fix: Add input validation in Node.js script to reject agent names containing shell metacharacters
|
|
12
|
+
|
|
13
|
+
### Low Priority
|
|
14
|
+
- **L-1: Windows Terminal command escaping**
|
|
15
|
+
- File: `bin/forge-spawn.sh` lines 55-57
|
|
16
|
+
- Issue: `$display_name` and `$FORGE_ROOT` not escaped for nested shell invocation
|
|
17
|
+
- Fix: Use `printf %q` for proper escaping
|
|
18
|
+
|
|
19
|
+
- **L-2: Terminal escape sequences in task parsing**
|
|
20
|
+
- File: `bin/forge-daemon.sh` lines 147-149
|
|
21
|
+
- Issue: ANSI escape sequences in task files could affect terminal
|
|
22
|
+
- Fix: Add `| tr -d '\033'` to strip escape sequences
|
|
23
|
+
|
|
24
|
+
- **L-3: Workflow version injection**
|
|
25
|
+
- File: `.github/workflows/publish.yml` lines 32-33
|
|
26
|
+
- Issue: Version input not validated before use in npm command
|
|
27
|
+
- Fix: Add semver regex validation
|
|
28
|
+
|
|
29
|
+
## Architecture (From Sage Review - Round 2)
|
|
30
|
+
|
|
31
|
+
### P1 Priority
|
|
32
|
+
- **sed -i incompatibility in forge-setup.sh**
|
|
33
|
+
- Lines: 205, 249, 291, 380, 381, 384, 388
|
|
34
|
+
- Issue: macOS/BSD sed requires `sed -i ''` but script uses `sed -i`
|
|
35
|
+
- Fix: Add platform detection or create `sed_inplace()` helper
|
|
36
|
+
|
|
37
|
+
- **Silent error suppression for JSON loading**
|
|
38
|
+
- Files: `bin/forge.sh` line 44, `bin/forge-spawn.sh` line 34
|
|
39
|
+
- Issue: `2>/dev/null || true` silently ignores JSON parsing errors
|
|
40
|
+
- Fix: Log warning when fallback is used
|
|
41
|
+
|
|
42
|
+
- **Inconsistent exit codes**
|
|
43
|
+
- Issue: All errors exit with code 1, no differentiation
|
|
44
|
+
- Fix: Define exit code constants in `constants.sh`
|
|
45
|
+
|
|
46
|
+
### P2 Priority
|
|
47
|
+
- **Hardcoded agent list in cmd_help()**
|
|
48
|
+
- File: `bin/forge.sh` lines 253-260
|
|
49
|
+
- Fix: Generate dynamically using `show_available_agents()`
|
|
50
|
+
|
|
51
|
+
- **Raw echo -e instead of log_* functions**
|
|
52
|
+
- File: `bin/forge-setup.sh` (multiple lines)
|
|
53
|
+
- Fix: Replace with appropriate `log_*` calls
|
|
54
|
+
|
|
55
|
+
- **Duplicate color definitions in cli.js**
|
|
56
|
+
- File: `bin/cli.js` lines 24-31
|
|
57
|
+
- Fix: Document as intentional or extract to shared config
|
|
58
|
+
|
|
59
|
+
## Testing (From Crucible Review - Round 2)
|
|
60
|
+
|
|
61
|
+
### Low Priority Gaps
|
|
62
|
+
- `show_available_agents()` not tested
|
|
63
|
+
- `setup_windows_env()` not tested (hard to test in CI)
|
|
64
|
+
- `colors.sh` log functions not tested (display-only)
|
|
65
|
+
- CLI `init`/`update` commands not tested (side effects)
|
package/docs/security.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Vibe Forge Security Documentation
|
|
2
|
+
|
|
3
|
+
This document explains security considerations and intentional design decisions in Vibe Forge.
|
|
4
|
+
|
|
5
|
+
## The `--dangerously-skip-permissions` Flag
|
|
6
|
+
|
|
7
|
+
### What It Does
|
|
8
|
+
|
|
9
|
+
When starting agents, Vibe Forge uses Claude Code's `--dangerously-skip-permissions` flag:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
claude --dangerously-skip-permissions --system-prompt "$system_prompt" "startup"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This flag disables Claude Code's permission prompts for file operations, command execution, and other actions that would normally require user confirmation.
|
|
16
|
+
|
|
17
|
+
### Why We Use It
|
|
18
|
+
|
|
19
|
+
Vibe Forge is designed for **terminal-native vibe coding** - a workflow where you launch multiple AI agents that work autonomously on your codebase. The typical workflow involves:
|
|
20
|
+
|
|
21
|
+
1. Starting a Planning Hub that coordinates work
|
|
22
|
+
2. Spawning worker agents (frontend, backend, testing, etc.) in separate terminals
|
|
23
|
+
3. Agents working autonomously on assigned tasks
|
|
24
|
+
4. Human review at defined checkpoints
|
|
25
|
+
|
|
26
|
+
With permission prompts enabled, each agent would constantly interrupt for confirmation, breaking the autonomous workflow that makes Vibe Forge effective.
|
|
27
|
+
|
|
28
|
+
### Security Mitigations
|
|
29
|
+
|
|
30
|
+
We implement several security measures to offset the risks:
|
|
31
|
+
|
|
32
|
+
#### 1. Agent Whitelist Validation
|
|
33
|
+
|
|
34
|
+
All agent names go through strict whitelist validation before execution:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# bin/lib/constants.sh
|
|
38
|
+
VALID_AGENTS=("anvil" "furnace" "crucible" ...)
|
|
39
|
+
|
|
40
|
+
# bin/lib/agents.sh
|
|
41
|
+
resolve_agent() {
|
|
42
|
+
local canonical="${AGENT_ALIASES[$normalized]:-}"
|
|
43
|
+
if [[ -n "$canonical" ]]; then
|
|
44
|
+
echo "$canonical"
|
|
45
|
+
return 0
|
|
46
|
+
fi
|
|
47
|
+
return 1 # Reject unknown agents
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This prevents command injection through agent names.
|
|
52
|
+
|
|
53
|
+
#### 2. Path Traversal Protection
|
|
54
|
+
|
|
55
|
+
Personality file paths are validated to ensure they remain within the expected directory:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
get_agent_personality_path() {
|
|
59
|
+
local real_path=$(cd "$(dirname "$personality_path")" && pwd)/$(basename "$personality_path")
|
|
60
|
+
local agents_dir=$(cd "$forge_root/agents" && pwd)
|
|
61
|
+
|
|
62
|
+
if [[ "$real_path" != "$agents_dir"/* ]]; then
|
|
63
|
+
echo "Security error: Path traversal detected" >&2
|
|
64
|
+
return 1
|
|
65
|
+
fi
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### 3. Safe JSON Parsing
|
|
70
|
+
|
|
71
|
+
We use Node.js for JSON parsing instead of `grep`/`cut` which could be vulnerable to injection:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
json_get_string() {
|
|
75
|
+
node -e "
|
|
76
|
+
const fs = require('fs');
|
|
77
|
+
const data = JSON.parse(fs.readFileSync('$file', 'utf8'));
|
|
78
|
+
if (data['$key'] !== undefined) console.log(String(data['$key']));
|
|
79
|
+
"
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### 4. Daemon Security
|
|
84
|
+
|
|
85
|
+
The background daemon includes multiple protections:
|
|
86
|
+
|
|
87
|
+
- **Symlink protection**: Skips symlinks to prevent symlink attacks
|
|
88
|
+
- **Path validation**: Verifies destinations are within FORGE_ROOT
|
|
89
|
+
- **Atomic operations**: Uses temp files + move for safe writes
|
|
90
|
+
- **Lock files**: Prevents multiple daemon instances
|
|
91
|
+
- **Log rotation**: Bounded log growth prevents disk exhaustion
|
|
92
|
+
|
|
93
|
+
### Risks to Be Aware Of
|
|
94
|
+
|
|
95
|
+
Even with mitigations, understand these risks:
|
|
96
|
+
|
|
97
|
+
1. **AI agents can modify any file** in your project without confirmation
|
|
98
|
+
2. **AI agents can execute any command** without confirmation
|
|
99
|
+
3. **Malicious prompts** could potentially be injected if context files are compromised
|
|
100
|
+
4. **Network access** is unrestricted - agents could make API calls
|
|
101
|
+
|
|
102
|
+
### Recommendations
|
|
103
|
+
|
|
104
|
+
1. **Use in development environments only** - Don't run on production systems
|
|
105
|
+
2. **Use with version control** - Git makes it easy to review and revert changes
|
|
106
|
+
3. **Review at checkpoints** - Check agent work during task transitions
|
|
107
|
+
4. **Understand the personality files** - They define agent behavior
|
|
108
|
+
5. **Keep project context secure** - Don't include secrets in context files
|
|
109
|
+
6. **Run in isolated environments** - Consider containers for sensitive projects
|
|
110
|
+
|
|
111
|
+
### Alternative: Manual Approval Mode
|
|
112
|
+
|
|
113
|
+
If you prefer permission prompts, you can modify the agent startup in `bin/forge.sh`:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Change this:
|
|
117
|
+
claude --dangerously-skip-permissions --system-prompt "$system_prompt" "startup"
|
|
118
|
+
|
|
119
|
+
# To this (removes the flag):
|
|
120
|
+
claude --system-prompt "$system_prompt" "startup"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Note: This will significantly impact the autonomous workflow.
|
|
124
|
+
|
|
125
|
+
## Reporting Security Issues
|
|
126
|
+
|
|
127
|
+
If you discover a security vulnerability in Vibe Forge:
|
|
128
|
+
|
|
129
|
+
1. **Do not open a public issue**
|
|
130
|
+
2. Email security concerns to the maintainers
|
|
131
|
+
3. Include steps to reproduce
|
|
132
|
+
4. Allow time for a fix before public disclosure
|
|
133
|
+
|
|
134
|
+
## Security Checklist for Contributors
|
|
135
|
+
|
|
136
|
+
When contributing to Vibe Forge:
|
|
137
|
+
|
|
138
|
+
- [ ] Never pass user input directly to shell commands
|
|
139
|
+
- [ ] Always validate agent names against the whitelist
|
|
140
|
+
- [ ] Use safe JSON parsing (Node.js, not grep/cut)
|
|
141
|
+
- [ ] Validate file paths don't traverse outside expected directories
|
|
142
|
+
- [ ] Use atomic file operations where race conditions are possible
|
|
143
|
+
- [ ] Add tests for security-sensitive functions
|
|
144
|
+
- [ ] Document any new security considerations
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibe-forge",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Multi-agent development orchestration system for terminal-native vibe coding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vibe-coding",
|
|
@@ -31,8 +31,17 @@
|
|
|
31
31
|
"agents/",
|
|
32
32
|
"config/",
|
|
33
33
|
"context/",
|
|
34
|
-
"tasks/"
|
|
34
|
+
"tasks/",
|
|
35
|
+
".claude/",
|
|
36
|
+
"docs/"
|
|
35
37
|
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "jest tests/js/",
|
|
40
|
+
"test:js": "jest tests/js/"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"jest": "^29.7.0"
|
|
44
|
+
},
|
|
36
45
|
"engines": {
|
|
37
46
|
"node": ">=16.0.0"
|
|
38
47
|
}
|