vibe-forge 0.4.0 → 0.8.2

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 (129) hide show
  1. package/.claude/commands/clear-attention.md +63 -63
  2. package/.claude/commands/compact-context.md +52 -0
  3. package/.claude/commands/configure-vcs.md +5 -5
  4. package/.claude/commands/forge.md +50 -3
  5. package/.claude/commands/need-help.md +77 -77
  6. package/.claude/commands/update-status.md +64 -64
  7. package/.claude/commands/worker-loop.md +106 -106
  8. package/.claude/hooks/worker-loop.js +37 -4
  9. package/.claude/scripts/setup-worker-loop.sh +45 -45
  10. package/.claude/settings.json +89 -0
  11. package/LICENSE +21 -21
  12. package/README.md +211 -232
  13. package/agents/aegis/personality.md +35 -1
  14. package/agents/anvil/personality.md +39 -1
  15. package/agents/architect/personality.md +26 -0
  16. package/agents/crucible/personality.md +54 -1
  17. package/agents/crucible-x/personality.md +210 -0
  18. package/agents/ember/personality.md +29 -1
  19. package/agents/flux/personality.md +248 -0
  20. package/agents/furnace/personality.md +52 -1
  21. package/agents/herald/personality.md +3 -1
  22. package/agents/loki/personality.md +108 -0
  23. package/agents/oracle/personality.md +284 -0
  24. package/agents/pixel/personality.md +140 -0
  25. package/agents/planning-hub/personality.md +222 -0
  26. package/agents/scribe/personality.md +3 -1
  27. package/agents/slag/personality.md +268 -0
  28. package/agents/{sentinel → temper}/personality.md +85 -9
  29. package/bin/cli.js +77 -30
  30. package/bin/dashboard/api/agents.js +333 -0
  31. package/bin/dashboard/api/dispatch.js +507 -0
  32. package/bin/dashboard/api/tasks.js +416 -0
  33. package/bin/dashboard/public/assets/index-BpHfsx1r.js +2 -0
  34. package/bin/dashboard/public/assets/index-QODv4Zn9.css +1 -0
  35. package/bin/dashboard/public/index.html +14 -0
  36. package/bin/dashboard/server.js +645 -0
  37. package/bin/forge-daemon.sh +176 -550
  38. package/bin/forge-setup.sh +28 -11
  39. package/bin/forge-spawn.sh +5 -5
  40. package/bin/forge.cmd +83 -83
  41. package/bin/forge.sh +210 -31
  42. package/config/agent-manifest.yaml +237 -243
  43. package/config/agents.json +207 -132
  44. package/config/task-types.yaml +111 -106
  45. package/context/agent-overrides/README.md +41 -0
  46. package/context/architecture.md +42 -0
  47. package/context/modern-conventions.md +129 -129
  48. package/docs/agents.md +473 -409
  49. package/docs/architecture.md +194 -162
  50. package/docs/commands.md +451 -388
  51. package/docs/security.md +195 -144
  52. package/package.json +38 -11
  53. package/src/lib/check-aliases.js +50 -0
  54. package/{bin → src}/lib/colors.sh +2 -1
  55. package/src/lib/config.sh +347 -0
  56. package/{bin → src}/lib/constants.sh +48 -13
  57. package/src/lib/daemon/budgets.sh +107 -0
  58. package/src/lib/daemon/dependencies.sh +146 -0
  59. package/src/lib/daemon/display.sh +128 -0
  60. package/src/lib/daemon/notifications.sh +273 -0
  61. package/src/lib/daemon/routing.sh +93 -0
  62. package/src/lib/daemon/state.sh +163 -0
  63. package/src/lib/daemon/sync.sh +103 -0
  64. package/{bin → src}/lib/database.sh +52 -0
  65. package/src/lib/frontmatter.js +106 -0
  66. package/src/lib/heimdall-setup.js +113 -0
  67. package/src/lib/heimdall.js +265 -0
  68. package/src/lib/index.sh +25 -0
  69. package/{bin → src}/lib/json.sh +7 -1
  70. package/{bin → src}/lib/terminal.js +7 -1
  71. package/.claude/settings.local.json +0 -33
  72. package/agents/forge-master/capabilities.md +0 -144
  73. package/agents/forge-master/context-template.md +0 -128
  74. package/agents/forge-master/personality.md +0 -138
  75. package/bin/lib/config.sh +0 -313
  76. package/config/task-template.md +0 -87
  77. package/context/forge-state.yaml +0 -19
  78. package/docs/TODO.md +0 -150
  79. package/docs/getting-started.md +0 -243
  80. package/docs/npm-publishing.md +0 -95
  81. package/docs/workflows/README.md +0 -32
  82. package/docs/workflows/azure-devops.md +0 -108
  83. package/docs/workflows/bitbucket.md +0 -104
  84. package/docs/workflows/git-only.md +0 -130
  85. package/docs/workflows/gitea.md +0 -168
  86. package/docs/workflows/github.md +0 -103
  87. package/docs/workflows/gitlab.md +0 -105
  88. package/docs/workflows.md +0 -454
  89. package/tasks/completed/ARCH-001-duplicate-agent-config.md +0 -121
  90. package/tasks/completed/ARCH-002-mixed-bash-node-implementation.md +0 -88
  91. package/tasks/completed/ARCH-003-worker-loop-hook-duplication.md +0 -77
  92. package/tasks/completed/ARCH-009-test-organization.md +0 -78
  93. package/tasks/completed/ARCH-011-jq-vs-nodejs-json.md +0 -94
  94. package/tasks/completed/ARCH-012-tmp-files-in-root.md +0 -71
  95. package/tasks/completed/ARCH-013-exit-code-constants.md +0 -65
  96. package/tasks/completed/ARCH-014-sed-incompatibility.md +0 -96
  97. package/tasks/completed/ARCH-015-docs-todo-tracking.md +0 -83
  98. package/tasks/completed/CLEAN-001.md +0 -38
  99. package/tasks/completed/CLEAN-003.md +0 -47
  100. package/tasks/completed/CLEAN-004.md +0 -56
  101. package/tasks/completed/CLEAN-005.md +0 -75
  102. package/tasks/completed/CLEAN-006.md +0 -47
  103. package/tasks/completed/CLEAN-007.md +0 -34
  104. package/tasks/completed/CLEAN-008.md +0 -49
  105. package/tasks/completed/CLEAN-012.md +0 -58
  106. package/tasks/completed/CLEAN-013.md +0 -45
  107. package/tasks/completed/SEC-001-sql-injection-fix.md +0 -58
  108. package/tasks/completed/SEC-002-notification-injection-fix.md +0 -45
  109. package/tasks/completed/SEC-003-eval-injection-fix.md +0 -54
  110. package/tasks/completed/SEC-004-pid-race-condition-fix.md +0 -49
  111. package/tasks/completed/SEC-005-worker-loop-path-fix.md +0 -51
  112. package/tasks/completed/SEC-006-eval-agent-names.md +0 -55
  113. package/tasks/completed/SEC-007-spawn-escaping.md +0 -67
  114. package/tasks/pending/ARCH-004-git-bash-detection-duplication.md +0 -72
  115. package/tasks/pending/ARCH-005-missing-src-directory.md +0 -95
  116. package/tasks/pending/ARCH-006-task-template-location.md +0 -64
  117. package/tasks/pending/ARCH-007-daemon-monolith.md +0 -91
  118. package/tasks/pending/ARCH-008-forge-master-vs-hub.md +0 -81
  119. package/tasks/pending/ARCH-010-missing-index-files.md +0 -84
  120. package/tasks/pending/CLEAN-002.md +0 -29
  121. package/tasks/pending/CLEAN-009.md +0 -31
  122. package/tasks/pending/CLEAN-010.md +0 -30
  123. package/tasks/pending/CLEAN-011.md +0 -30
  124. package/tasks/pending/CLEAN-014.md +0 -32
  125. package/tasks/review/task-001.md +0 -78
  126. /package/{bin → src}/lib/agents.sh +0 -0
  127. /package/{bin → src}/lib/util.sh +0 -0
  128. /package/{bin → src}/lib/vcs.js +0 -0
  129. /package/{context → templates}/project-context-template.md +0 -0
package/docs/security.md CHANGED
@@ -1,144 +1,195 @@
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
1
+ # Vibe Forge Security Documentation
2
+
3
+ This document explains security considerations and intentional design decisions in Vibe Forge.
4
+
5
+ ## Agent Permission Model
6
+
7
+ ### How It Works
8
+
9
+ Vibe Forge agents run with **allowlist-based permissions** defined in `.claude/settings.json`. This replaces the previous `--dangerously-skip-permissions` approach with a defense-in-depth model:
10
+
11
+ 1. **Allowlist** (`.claude/settings.json`) - Pre-approves safe operations (file reads, writes, git, npm, etc.)
12
+ 2. **Heimdall** (pre-tool hook) - Intercepts and gates forge-specific policy (branch protection, etc.)
13
+ 3. **Claude Code native prompts** - Anything not in the allowlist still requires user approval
14
+
15
+ ```
16
+ Agent wants to run a command
17
+ |
18
+ v
19
+ ┌─────────────────┐
20
+ │ Allowlist check │──── Not allowed ──> User prompted
21
+ └────────┬────────┘
22
+ Allowed
23
+ v
24
+ ┌─────────────────┐
25
+ │ Heimdall hook │──── Policy violation ──> Blocked
26
+ └────────┬────────┘
27
+ │ Pass
28
+ v
29
+ Executed
30
+ ```
31
+
32
+ ### What Agents Can Do Without Prompting
33
+
34
+ The allowlist covers normal development operations:
35
+ - Read, write, and edit files
36
+ - Search with glob/grep
37
+ - Run git commands (status, diff, add, commit, push, branch, etc.)
38
+ - Run GitHub CLI (PRs, runs, workflows)
39
+ - Run npm (test, install, audit, build)
40
+ - Run node/npx scripts
41
+ - File operations (ls, cp, mv, mkdir, find)
42
+ - SQLite operations
43
+
44
+ ### What Still Requires Approval
45
+
46
+ Anything not in the allowlist prompts the user:
47
+ - Installing system packages (apt, brew, etc.)
48
+ - Running unfamiliar binaries
49
+ - Network operations (curl, wget) unless via node
50
+ - Destructive operations not covered by git (rm -rf, etc.)
51
+
52
+ ### Heimdall Policy Layer
53
+
54
+ Heimdall is a pre-tool hook that enforces forge-specific rules on top of the allowlist:
55
+ - Blocks direct pushes to main/master
56
+ - Enforces branch naming conventions
57
+ - Gates security-sensitive operations
58
+
59
+ Heimdall runs on every Bash tool call regardless of allowlist status.
60
+
61
+ ### Why Not --dangerously-skip-permissions?
62
+
63
+ The `--dsp` flag disables ALL permission checks. The allowlist approach is better because:
64
+ - Only known-safe operations are pre-approved
65
+ - Unknown commands still prompt for approval
66
+ - Heimdall policies still enforce forge rules
67
+ - The security posture is auditable (read `.claude/settings.json`)
68
+
69
+ Users who prefer the fully autonomous workflow can still use `--dsp` in their own terminals.
70
+
71
+ ### Trust Boundary: Shared Allowlist
72
+
73
+ All forge agents share a single allowlist defined in `.claude/settings.json`. There are no per-agent permission boundaries. This means:
74
+
75
+ - **Anvil** (frontend) has the same file-write permissions as **Aegis** (security)
76
+ - A compromised or confused agent personality cannot be contained by permissions alone
77
+ - Heimdall policies provide some per-agent gating (e.g. branch protection) but do not restrict filesystem scope
78
+
79
+ This is an accepted architectural trade-off. Per-agent permission boundaries would require separate `settings.json` files per agent and a launcher that selects the correct one, which adds complexity without proportional security benefit in a single-developer, local-only workflow.
80
+
81
+ **Mitigations:**
82
+ - Version control (git) makes all file changes reviewable and revertible
83
+ - Heimdall enforces structural policies (no direct push to main, naming conventions)
84
+ - Sentinel code review catches inappropriate changes before merge
85
+ - The dashboard provides visibility into what each agent is doing
86
+
87
+ **Future consideration:** If Vibe Forge supports multi-developer or remote execution (T3-4), per-agent permission boundaries should be revisited.
88
+
89
+ ## Dashboard Security
90
+
91
+ ### Session Token Authentication
92
+
93
+ The dashboard server generates a cryptographic session token at startup:
94
+ - Written to `.forge/dashboard.token` with mode 0600
95
+ - All API endpoints require `X-Forge-Token` header
96
+ - WebSocket connections require `?token=` query parameter
97
+ - Token is cleaned up on server shutdown
98
+ - `/api/health` is exempt (monitoring probes)
99
+
100
+ ### Same-Origin Protection
101
+
102
+ The dashboard serves no CORS headers. Browsers enforce same-origin policy, meaning:
103
+ - Only the dashboard UI (served from the same origin) can call the API
104
+ - Cross-origin requests from malicious websites are blocked
105
+ - The `/api/token` bootstrap endpoint is protected by same-origin policy
106
+
107
+ ### Why This Matters
108
+
109
+ Without these protections, any website you visit could dispatch tasks to your forge agents via cross-origin API calls. Combined with agent permissions, this would allow arbitrary code execution. The session token + same-origin combination eliminates this attack vector.
110
+
111
+ ## Additional Security Measures
112
+
113
+ ### Agent Whitelist Validation
114
+
115
+ All agent names go through strict whitelist validation before execution:
116
+
117
+ ```bash
118
+ resolve_agent() {
119
+ local canonical="${AGENT_ALIASES[$normalized]:-}"
120
+ if [[ -n "$canonical" ]]; then
121
+ echo "$canonical"
122
+ return 0
123
+ fi
124
+ return 1 # Reject unknown agents
125
+ }
126
+ ```
127
+
128
+ ### Path Traversal Protection
129
+
130
+ Personality file paths are validated to remain within expected directories:
131
+
132
+ ```bash
133
+ get_agent_personality_path() {
134
+ local real_path=$(cd "$(dirname "$personality_path")" && pwd)/$(basename "$personality_path")
135
+ local agents_dir=$(cd "$forge_root/agents" && pwd)
136
+ if [[ "$real_path" != "$agents_dir"/* ]]; then
137
+ echo "Security error: Path traversal detected" >&2
138
+ return 1
139
+ fi
140
+ }
141
+ ```
142
+
143
+ ### Daemon Security
144
+
145
+ The background daemon includes:
146
+ - **Symlink protection**: Skips symlinks to prevent symlink attacks
147
+ - **Path validation**: Verifies destinations within FORGE_ROOT
148
+ - **Atomic operations**: Temp files + move for safe writes
149
+ - **Lock files**: Prevents multiple daemon instances
150
+ - **SQL escaping**: All database inputs go through `db_escape()`
151
+ - **Input sanitization**: Frontmatter extraction strips shell metacharacters
152
+
153
+ ### Alias Collision Detection
154
+
155
+ Agent alias collisions are checked at three levels:
156
+ - Pre-commit hook (local development)
157
+ - CI lint job (GitHub Actions)
158
+ - `forge init` (project setup)
159
+
160
+ ## Risks to Be Aware Of
161
+
162
+ 1. **Allowlisted operations execute without confirmation** - agents can modify files, run tests, and push code
163
+ 2. **Prompt injection** - crafted task files or context could influence agent behavior
164
+ 3. **Heimdall is not exhaustive** - it enforces known policies, not all possible risks
165
+ 4. **Local network exposure** - the dashboard binds to localhost only; changing this has security implications
166
+
167
+ ## Recommendations
168
+
169
+ 1. **Use in development environments only**
170
+ 2. **Use with version control** - git makes it easy to review and revert
171
+ 3. **Review at checkpoints** - check agent work during task transitions
172
+ 4. **Keep project context secure** - don't include secrets in context files
173
+ 5. **Audit the allowlist** - review `.claude/settings.json` for your comfort level
174
+ 6. **Run in isolated environments** - consider containers for sensitive projects
175
+
176
+ ## Reporting Security Issues
177
+
178
+ If you discover a security vulnerability in Vibe Forge:
179
+
180
+ 1. **Do not open a public issue**
181
+ 2. Email security concerns to the maintainers
182
+ 3. Include steps to reproduce
183
+ 4. Allow time for a fix before public disclosure
184
+
185
+ ## Security Checklist for Contributors
186
+
187
+ When contributing to Vibe Forge:
188
+
189
+ - [ ] Never pass user input directly to shell commands
190
+ - [ ] Always validate agent names against the whitelist
191
+ - [ ] Use safe JSON parsing (Node.js, not grep/cut)
192
+ - [ ] Validate file paths don't traverse outside expected directories
193
+ - [ ] Use atomic file operations where race conditions are possible
194
+ - [ ] Add tests for security-sensitive functions
195
+ - [ ] Document any new security considerations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-forge",
3
- "version": "0.4.0",
3
+ "version": "0.8.2",
4
4
  "description": "Multi-agent development orchestration system for terminal-native vibe coding",
5
5
  "keywords": [
6
6
  "vibe-coding",
@@ -13,38 +13,65 @@
13
13
  "terminal",
14
14
  "cli"
15
15
  ],
16
- "author": "SpasticPalate",
16
+ "author": "sugar-crash-studios",
17
17
  "license": "MIT",
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/SpasticPalate/vibe-forge.git"
20
+ "url": "git+https://github.com/sugar-crash-studios/vibe-forge.git"
21
21
  },
22
- "homepage": "https://github.com/SpasticPalate/vibe-forge#readme",
22
+ "homepage": "https://github.com/sugar-crash-studios/vibe-forge#readme",
23
23
  "bugs": {
24
- "url": "https://github.com/SpasticPalate/vibe-forge/issues"
24
+ "url": "https://github.com/sugar-crash-studios/vibe-forge/issues"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
25
28
  },
26
29
  "bin": {
27
30
  "vibe-forge": "bin/cli.js"
28
31
  },
29
32
  "files": [
30
- "bin/",
33
+ "bin/cli.js",
34
+ "src/lib/",
35
+ "bin/forge.cmd",
36
+ "bin/forge.sh",
37
+ "bin/forge-daemon.sh",
38
+ "bin/forge-setup.sh",
39
+ "bin/forge-spawn.sh",
40
+ "bin/dashboard/server.js",
41
+ "bin/dashboard/api/",
42
+ "bin/dashboard/public/",
31
43
  "agents/",
32
44
  "config/",
33
- "context/",
34
- "tasks/",
35
- ".claude/",
36
- "docs/"
45
+ "templates/project-context-template.md",
46
+ "context/architecture.md",
47
+ "context/modern-conventions.md",
48
+ "context/agent-overrides/README.md",
49
+ ".claude/commands/",
50
+ ".claude/hooks/",
51
+ ".claude/scripts/",
52
+ ".claude/settings.json",
53
+ "docs/security.md",
54
+ "docs/architecture.md",
55
+ "docs/agents.md",
56
+ "docs/commands.md"
37
57
  ],
38
58
  "scripts": {
59
+ "prepare": "husky",
39
60
  "test": "node --no-warnings node_modules/jest/bin/jest.js tests/unit/",
40
61
  "test:unit": "node --no-warnings node_modules/jest/bin/jest.js tests/unit/",
41
62
  "test:integration": "node --no-warnings node_modules/jest/bin/jest.js tests/integration/",
42
63
  "test:all": "node --no-warnings node_modules/jest/bin/jest.js tests/"
43
64
  },
44
65
  "devDependencies": {
45
- "jest": "^30.0.0"
66
+ "husky": "^9.1.7",
67
+ "jest": "^30.0.0",
68
+ "ws": "^8.18.0"
46
69
  },
47
70
  "engines": {
48
71
  "node": ">=16.0.0"
72
+ },
73
+ "dependencies": {
74
+ "js-yaml": "^4.1.1",
75
+ "msedge-tts": "^2.0.4"
49
76
  }
50
77
  }
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Agent alias collision detector.
4
+ *
5
+ * Used by:
6
+ * - .husky/pre-commit (pre-commit hook)
7
+ * - .github/workflows/ci.yml (CI lint job)
8
+ * - bin/cli.js validateAgentsConfig() (forge init)
9
+ *
10
+ * Exit code 0: no collisions
11
+ * Exit code 1: collisions found (printed to stderr)
12
+ */
13
+
14
+ const path = require('path');
15
+ const fs = require('fs');
16
+
17
+ const configPath = process.argv[2] || path.join(__dirname, '..', '..', 'config', 'agents.json');
18
+
19
+ if (!fs.existsSync(configPath)) {
20
+ // No agents.json is fine (e.g., fresh clone before setup)
21
+ process.exit(0);
22
+ }
23
+
24
+ let config;
25
+ try {
26
+ config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
27
+ } catch (err) {
28
+ console.error(`ERROR: Failed to parse ${configPath}: ${err.message}`);
29
+ process.exit(1);
30
+ }
31
+
32
+ const agents = config.agents || {};
33
+ const seen = {};
34
+ const dupes = [];
35
+
36
+ for (const [name, info] of Object.entries(agents)) {
37
+ for (const alias of [name, ...(info.aliases || [])]) {
38
+ if (seen[alias] && seen[alias] !== name) {
39
+ dupes.push(`${alias} (${seen[alias]} vs ${name})`);
40
+ }
41
+ seen[alias] = name;
42
+ }
43
+ }
44
+
45
+ if (dupes.length) {
46
+ console.error(`ERROR: Alias collision in agents.json: ${dupes.join(', ')}`);
47
+ process.exit(1);
48
+ }
49
+
50
+ console.log(`No alias collisions found (${Object.keys(agents).length} agents checked)`);
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
  #
3
3
  # Vibe Forge - Shared Color Definitions and Logging
4
- # Source this file in other scripts: source "$SCRIPT_DIR/lib/colors.sh"
4
+ # Source this file in other scripts: source "$LIB_DIR/colors.sh"
5
+ # NOTE: JavaScript equivalent exists in bin/cli.js:26-33. Keep in sync.
5
6
  #
6
7
 
7
8
  # Colors (only if terminal supports them)