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
@@ -1,162 +1,194 @@
1
- # Vibe Forge Architecture
2
-
3
- This document describes the architectural decisions and structure of the Vibe Forge codebase.
4
-
5
- ## Language Strategy
6
-
7
- Vibe Forge uses a **hybrid Bash/Node.js architecture** with the following rationale:
8
-
9
- ### Bash (Primary for Scripts)
10
-
11
- The core CLI and daemon are implemented in Bash because:
12
-
13
- 1. **Native shell integration** - Vibe Forge orchestrates terminal sessions and Claude Code processes, which are inherently shell operations
14
- 2. **Unix philosophy** - Small composable scripts that can be debugged, piped, and modified easily
15
- 3. **Transparency** - Users can inspect and modify scripts without build steps
16
- 4. **Git Bash compatibility** - Windows users with Git Bash can run the same scripts
17
-
18
- Files in Bash:
19
- - `bin/forge.sh` - Main CLI entry point
20
- - `bin/forge-setup.sh` - Setup and initialization
21
- - `bin/forge-spawn.sh` - Terminal spawning orchestration
22
- - `bin/forge-daemon.sh` - Background daemon for task monitoring
23
- - `bin/lib/*.sh` - Shared libraries (colors, config, agents, database, json, util)
24
-
25
- ### Node.js (Cross-Platform Utilities)
26
-
27
- Node.js is used where cross-platform compatibility or complex logic is needed:
28
-
29
- 1. **npx installer** - `bin/cli.js` runs via npx before Vibe Forge is installed
30
- 2. **Terminal detection** - `bin/lib/terminal.js` detects and spawns terminals across Windows/macOS/Linux
31
- 3. **JSON parsing** - All Bash scripts use Node.js for JSON via `bin/lib/json.sh` wrapper
32
- 4. **Claude hooks** - `.claude/hooks/worker-loop.js` runs as Claude Code hook
33
-
34
- ### Design Principles
35
-
36
- 1. **Single Source of Truth** - Configuration in `config/agents.json`, loaded by both languages
37
- 2. **Node.js for JSON** - All JSON parsing uses `bin/lib/json.sh` which calls Node.js (no jq dependency)
38
- 3. **Bash for orchestration** - Process management, file watching, terminal control
39
- 4. **Thin wrappers** - `forge.cmd` on Windows calls Bash via Git Bash
40
-
41
- ### JSON Handling
42
-
43
- All JSON operations use the `json.sh` library which provides:
44
-
45
- ```bash
46
- # Reading JSON
47
- value=$(json_read "$file" "key" "default")
48
-
49
- # Reading multiple keys efficiently
50
- read -r name status task <<< "$(json_read_multi "$file" name status task)"
51
-
52
- # Writing JSON
53
- json_write "$file" "key" "value"
54
- json_write_bool "$file" "enabled" true
55
-
56
- # Pretty printing
57
- json_pretty "$file"
58
-
59
- # Key existence check
60
- if json_has_key "$file" "key"; then ...
61
- ```
62
-
63
- This eliminates the jq dependency while maintaining security (arguments passed to Node.js, not interpolated).
64
-
65
- ## Directory Structure
66
-
67
- ```
68
- vibe-forge/
69
- ├── agents/ # Agent personality definitions
70
- ├── anvil/
71
- │ └── personality.md
72
- ├── furnace/
73
- └── ...
74
- ├── bin/ # Executables
75
- ├── cli.js # npx entry point (Node.js)
76
- │ ├── forge.sh # Main CLI (Bash)
77
- │ ├── forge.cmd # Windows wrapper
78
- │ ├── forge-setup.sh # Setup script
79
- │ ├── forge-spawn.sh # Terminal spawning
80
- │ ├── forge-daemon.sh # Background daemon
81
- └── lib/ # Shared libraries
82
- ├── agents.sh # Agent resolution
83
- ├── colors.sh # Terminal colors
84
- ├── config.sh # Configuration loading
85
- ├── constants.sh # Constants (fallback)
86
- ├── database.sh # SQLite operations
87
- ├── json.sh # JSON utilities (Node.js based)
88
- ├── terminal.js # Terminal detection (Node.js)
89
- └── util.sh # Utility functions
90
- ├── config/ # Configuration files
91
- ├── agents.json # Agent roster (source of truth)
92
- │ └── agent-manifest.yaml # Rich documentation (non-normative)
93
- ├── context/ # Runtime context
94
- ├── agent-status/ # Agent status files
95
- └── forge-state.yaml # Current forge state
96
- ├── docs/ # Documentation
97
- ├── tasks/ # Task lifecycle folders
98
- ├── pending/
99
- ├── in-progress/
100
- ├── completed/
101
- │ └── ...
102
- └── tests/ # Test suites
103
- ├── unit/ # Jest unit tests (shell functions tested via child_process)
104
- └── helpers/ # Test utilities
105
- ```
106
-
107
- ## Data Flow
108
-
109
- ```
110
- ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
111
- CLI Input --> │ forge.sh │ --> │ Command │
112
- (user) │ │ (dispatch) │ │ Handler │
113
- └──────────────┘ └────────────────┘ └──────────────┘
114
-
115
- v
116
- ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
117
- │ Claude │ <-- │ forge-spawn.sh │ <-- │ Terminal │
118
- │ Code │ │ + terminal.js │ │ Spawning │
119
- └──────────────┘ └────────────────┘ └──────────────┘
120
-
121
- v
122
- ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
123
- Tasks <-> forge-daemon <-> SQLite
124
- │ (files) │ │ (monitor) │ │ Database │
125
- └──────────────┘ └────────────────┘ └──────────────┘
126
- ```
127
-
128
- ## Future Considerations
129
-
130
- ### Potential Node.js Migration
131
-
132
- While Option B (hybrid) is the current strategy, a future Node.js migration could provide:
133
-
134
- 1. **Better Windows support** - Native Node.js without Git Bash dependency
135
- 2. **Unified codebase** - Single language to maintain
136
- 3. **Type safety** - TypeScript for larger refactors
137
- 4. **npm ecosystem** - Libraries for terminal control, process management
138
-
139
- Migration path if pursued:
140
- 1. `src/lib/config.ts` - Configuration management
141
- 2. `src/lib/agents.ts` - Agent resolution
142
- 3. `src/lib/database.ts` - SQLite operations
143
- 4. `src/daemon.ts` - Background daemon
144
- 5. `src/forge.ts` - Main CLI (keeping forge.sh as thin wrapper initially)
145
-
146
- ### Requirements for Migration
147
-
148
- Before pursuing full Node.js migration:
149
- - Ensure all Bash-specific functionality can be replicated
150
- - Maintain transparency (scripts users can inspect)
151
- - Keep startup time fast (current scripts are instant)
152
- - Preserve Unix composability where valuable
153
-
154
- ## ADR Summary
155
-
156
- | Decision | Choice | Rationale |
157
- |----------|--------|-----------|
158
- | Primary language | Bash | Native shell integration, transparency |
159
- | JSON parsing | Node.js via json.sh | Security, cross-platform |
160
- | Terminal detection | Node.js | Cross-platform compatibility |
161
- | Windows support | Git Bash + forge.cmd | Maintains Unix-like experience |
162
- | Configuration | JSON (agents.json) | Machine-readable, single source |
1
+ # Vibe Forge Architecture
2
+
3
+ This document describes the architectural decisions and structure of the Vibe Forge codebase.
4
+
5
+ ## Language Strategy
6
+
7
+ Vibe Forge uses a **hybrid Bash/Node.js architecture** with the following rationale:
8
+
9
+ ### Bash (Primary for Scripts)
10
+
11
+ The core CLI and daemon are implemented in Bash because:
12
+
13
+ 1. **Native shell integration** - Vibe Forge orchestrates terminal sessions and Claude Code processes, which are inherently shell operations
14
+ 2. **Unix philosophy** - Small composable scripts that can be debugged, piped, and modified easily
15
+ 3. **Transparency** - Users can inspect and modify scripts without build steps
16
+ 4. **Git Bash compatibility** - Windows users with Git Bash can run the same scripts
17
+
18
+ Files in Bash:
19
+ - `bin/forge.sh` - Main CLI entry point
20
+ - `bin/forge-setup.sh` - Setup and initialization
21
+ - `bin/forge-spawn.sh` - Terminal spawning orchestration
22
+ - `bin/forge-daemon.sh` - Background daemon for task monitoring
23
+ - `bin/lib/*.sh` - Shared libraries (colors, config, agents, database, json, util)
24
+
25
+ ### Node.js (Cross-Platform Utilities)
26
+
27
+ Node.js is used where cross-platform compatibility or complex logic is needed:
28
+
29
+ 1. **npx installer** - `bin/cli.js` runs via npx before Vibe Forge is installed
30
+ 2. **Terminal detection** - `bin/lib/terminal.js` detects and spawns terminals across Windows/macOS/Linux
31
+ 3. **JSON parsing** - All Bash scripts use Node.js for JSON via `bin/lib/json.sh` wrapper
32
+ 4. **Claude hooks** - `.claude/hooks/worker-loop.js` runs as Claude Code hook
33
+ 5. **Dashboard server** - `bin/dashboard/server.js` provides HTTP + WebSocket for the web UI
34
+
35
+ ### Design Principles
36
+
37
+ 1. **Single Source of Truth** - Configuration in `config/agents.json`, loaded by both languages
38
+ 2. **Node.js for JSON** - All JSON parsing uses `bin/lib/json.sh` which calls Node.js (no jq dependency)
39
+ 3. **Bash for orchestration** - Process management, file watching, terminal control
40
+ 4. **Thin wrappers** - `forge.cmd` on Windows calls Bash via Git Bash
41
+
42
+ ### JSON Handling
43
+
44
+ All JSON operations use the `json.sh` library which provides:
45
+
46
+ ```bash
47
+ # Reading JSON
48
+ value=$(json_read "$file" "key" "default")
49
+
50
+ # Reading multiple keys efficiently
51
+ read -r name status task <<< "$(json_read_multi "$file" name status task)"
52
+
53
+ # Writing JSON
54
+ json_write "$file" "key" "value"
55
+ json_write_bool "$file" "enabled" true
56
+
57
+ # Pretty printing
58
+ json_pretty "$file"
59
+
60
+ # Key existence check
61
+ if json_has_key "$file" "key"; then ...
62
+ ```
63
+
64
+ This eliminates the jq dependency while maintaining security (arguments passed to Node.js, not interpolated).
65
+
66
+ ## Directory Structure
67
+
68
+ ```
69
+ vibe-forge/
70
+ ├── agents/ # Agent personality definitions
71
+ ├── anvil/
72
+ │ └── personality.md
73
+ ├── furnace/
74
+ │ └── ...
75
+ ├── bin/ # Executables
76
+ │ ├── cli.js # npx entry point (Node.js)
77
+ │ ├── forge.sh # Main CLI (Bash)
78
+ │ ├── forge.cmd # Windows wrapper
79
+ │ ├── forge-setup.sh # Setup script
80
+ │ ├── forge-spawn.sh # Terminal spawning
81
+ ├── forge-daemon.sh # Background daemon
82
+ ├── dashboard/ # Web dashboard (Node.js)
83
+ ├── server.js # HTTP + WebSocket server
84
+ ├── api/ # REST API endpoints
85
+ │ │ ├── tasks.js # Task CRUD
86
+ │ │ ├── agents.js # Agent status
87
+ │ │ └── dispatch.js # Task dispatch
88
+ │ └── public/ # Frontend assets
89
+ ├── index.html # Dashboard UI
90
+ │ │ ├── style.css # Styles (dark mode)
91
+ │ └── app.js # Frontend logic
92
+ │ └── lib/ # Shared libraries
93
+ ├── agents.sh # Agent resolution
94
+ ├── colors.sh # Terminal colors
95
+ ├── config.sh # Configuration loading
96
+ ├── constants.sh # Constants (fallback)
97
+ ├── database.sh # SQLite operations
98
+ ├── json.sh # JSON utilities (Node.js based)
99
+ ├── terminal.js # Terminal detection (Node.js)
100
+ └── util.sh # Utility functions
101
+ ├── config/ # Configuration files
102
+ │ ├── agents.json # Agent roster (source of truth)
103
+ │ └── agent-manifest.yaml # Rich documentation (non-normative)
104
+ ├── context/ # Runtime context
105
+ │ ├── agent-status/ # Agent status files
106
+ │ └── forge-state.yaml # Current forge state
107
+ ├── docs/ # Documentation
108
+ ├── tasks/ # Task lifecycle folders
109
+ │ ├── pending/
110
+ │ ├── in-progress/
111
+ ├── completed/
112
+ └── ...
113
+ └── tests/ # Test suites
114
+ ├── unit/ # Jest unit tests (shell functions tested via child_process)
115
+ └── helpers/ # Test utilities
116
+ ```
117
+
118
+ ## Data Flow
119
+
120
+ ```
121
+ ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
122
+ │ CLI Input │ --> │ forge.sh │ --> │ Command │
123
+ (user) (dispatch) Handler
124
+ └──────────────┘ └────────────────┘ └──────────────┘
125
+
126
+ v
127
+ ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
128
+ │ Claude │ <-- │ forge-spawn.sh │ <-- │ Terminal │
129
+ │ Code │ │ + terminal.js │ │ Spawning │
130
+ └──────────────┘ └────────────────┘ └──────────────┘
131
+
132
+ v
133
+ ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
134
+ │ Tasks │ <-> forge-daemon │ <-> │ SQLite │
135
+ │ (files) │ │ (monitor) │ │ Database │
136
+ └──────────────┘ └────────────────┘ └──────────────┘
137
+ ^ ^
138
+ │ │
139
+ └─────────────────┬─────────────────────────┘
140
+
141
+ v
142
+ ┌────────────────────┐
143
+ │ Dashboard Server │ <-- Browser (http://localhost:2800)
144
+ (port 2800 🔥)
145
+ │ + WebSocket /ws │
146
+ └────────────────────┘
147
+ ```
148
+
149
+ ### Dashboard Architecture
150
+
151
+ The dashboard is a self-contained Node.js server that provides:
152
+
153
+ 1. **Static file serving** - HTML, CSS, JS from `bin/dashboard/public/`
154
+ 2. **REST API** - Task management, agent status, dispatch at `/api/*`
155
+ 3. **WebSocket** - Real-time updates at `/ws`
156
+ 4. **Issue detection** - Stale docs, failing tests, security issues
157
+
158
+ Port **2800** was chosen as the default because it's the operating temperature of a forge in degrees Fahrenheit. 🔥
159
+
160
+ ## Future Considerations
161
+
162
+ ### Potential Node.js Migration
163
+
164
+ While Option B (hybrid) is the current strategy, a future Node.js migration could provide:
165
+
166
+ 1. **Better Windows support** - Native Node.js without Git Bash dependency
167
+ 2. **Unified codebase** - Single language to maintain
168
+ 3. **Type safety** - TypeScript for larger refactors
169
+ 4. **npm ecosystem** - Libraries for terminal control, process management
170
+
171
+ Migration path if pursued:
172
+ 1. `src/lib/config.ts` - Configuration management
173
+ 2. `src/lib/agents.ts` - Agent resolution
174
+ 3. `src/lib/database.ts` - SQLite operations
175
+ 4. `src/daemon.ts` - Background daemon
176
+ 5. `src/forge.ts` - Main CLI (keeping forge.sh as thin wrapper initially)
177
+
178
+ ### Requirements for Migration
179
+
180
+ Before pursuing full Node.js migration:
181
+ - Ensure all Bash-specific functionality can be replicated
182
+ - Maintain transparency (scripts users can inspect)
183
+ - Keep startup time fast (current scripts are instant)
184
+ - Preserve Unix composability where valuable
185
+
186
+ ## ADR Summary
187
+
188
+ | Decision | Choice | Rationale |
189
+ |----------|--------|-----------|
190
+ | Primary language | Bash | Native shell integration, transparency |
191
+ | JSON parsing | Node.js via json.sh | Security, cross-platform |
192
+ | Terminal detection | Node.js | Cross-platform compatibility |
193
+ | Windows support | Git Bash + forge.cmd | Maintains Unix-like experience |
194
+ | Configuration | JSON (agents.json) | Machine-readable, single source |