vibe-forge 0.3.6 → 0.3.10
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/clear-attention.md +63 -0
- package/.claude/commands/forge.md +4 -0
- package/.claude/commands/need-help.md +77 -0
- package/.claude/commands/worker-loop.md +106 -0
- package/.claude/hooks/worker-loop.sh +141 -0
- package/.claude/scripts/setup-worker-loop.sh +45 -0
- package/.claude/settings.local.json +13 -0
- package/bin/cli.js +49 -0
- package/bin/forge-daemon.sh +122 -7
- package/bin/forge-setup.sh +43 -0
- package/bin/forge-spawn.sh +25 -7
- package/bin/forge.sh +88 -11
- package/bin/lib/agents.sh +20 -0
- package/bin/lib/config.sh +12 -0
- package/bin/lib/constants.sh +27 -0
- package/config/agents.json +18 -9
- package/context/modern-conventions.md +129 -0
- package/docs/TODO.md +121 -10
- package/package.json +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Modern Development Conventions
|
|
2
|
+
|
|
3
|
+
Reference for up-to-date tooling and naming conventions. Knowledge cutoffs can cause outdated suggestions - prefer these modern approaches.
|
|
4
|
+
|
|
5
|
+
## Docker & Containers
|
|
6
|
+
|
|
7
|
+
### Compose (V2+, 2021)
|
|
8
|
+
|
|
9
|
+
- **File name:** `compose.yml` or `compose.yaml` (NOT `docker-compose.yml`)
|
|
10
|
+
- **Command:** `docker compose` (NOT `docker-compose`)
|
|
11
|
+
- Compose V2 is built into Docker CLI, no separate install needed
|
|
12
|
+
- `docker-compose` (hyphenated) is legacy V1
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
# compose.yml (modern)
|
|
16
|
+
services:
|
|
17
|
+
app:
|
|
18
|
+
build: .
|
|
19
|
+
ports:
|
|
20
|
+
- "3000:3000"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Docker Best Practices
|
|
24
|
+
|
|
25
|
+
- Use multi-stage builds for smaller images
|
|
26
|
+
- Prefer `COPY` over `ADD` unless extracting archives
|
|
27
|
+
- Use `.dockerignore` to exclude node_modules, .git, etc.
|
|
28
|
+
- Pin base image versions (e.g., `node:20-alpine`, not `node:latest`)
|
|
29
|
+
|
|
30
|
+
## Package Managers
|
|
31
|
+
|
|
32
|
+
### Node.js
|
|
33
|
+
|
|
34
|
+
- **npm:** v7+ supports workspaces, lockfile v2
|
|
35
|
+
- **pnpm:** Preferred for monorepos, faster, stricter
|
|
36
|
+
- **Bun:** Fast runtime + package manager, growing adoption
|
|
37
|
+
|
|
38
|
+
### Python
|
|
39
|
+
|
|
40
|
+
- **uv:** Modern, fast replacement for pip/pip-tools (2024+)
|
|
41
|
+
- **poetry:** Dependency management + packaging
|
|
42
|
+
- **pipx:** For CLI tools (don't pip install globally)
|
|
43
|
+
|
|
44
|
+
## TypeScript
|
|
45
|
+
|
|
46
|
+
- **Config:** `tsconfig.json` with `"moduleResolution": "bundler"` for modern bundlers
|
|
47
|
+
- **Strict mode:** Always enable `"strict": true`
|
|
48
|
+
- **Node types:** `@types/node` version should match Node.js version
|
|
49
|
+
|
|
50
|
+
## Testing
|
|
51
|
+
|
|
52
|
+
### JavaScript/TypeScript
|
|
53
|
+
|
|
54
|
+
- **Vitest:** Modern, fast, Vite-native (preferred for new projects)
|
|
55
|
+
- **Jest:** Still widely used, v30+ reduces deprecated deps
|
|
56
|
+
- **Playwright:** E2E testing, cross-browser
|
|
57
|
+
|
|
58
|
+
### Python
|
|
59
|
+
|
|
60
|
+
- **pytest:** Standard, use over unittest
|
|
61
|
+
- **pytest-cov:** Coverage reporting
|
|
62
|
+
|
|
63
|
+
## CI/CD
|
|
64
|
+
|
|
65
|
+
### GitHub Actions
|
|
66
|
+
|
|
67
|
+
- Use `actions/checkout@v4`, `actions/setup-node@v4` (latest major versions)
|
|
68
|
+
- Prefer `npm ci` over `npm install` in CI
|
|
69
|
+
- Use job matrices for cross-platform testing
|
|
70
|
+
|
|
71
|
+
## Linting & Formatting
|
|
72
|
+
|
|
73
|
+
### JavaScript/TypeScript
|
|
74
|
+
|
|
75
|
+
- **ESLint v9+:** Flat config (`eslint.config.js`, not `.eslintrc`)
|
|
76
|
+
- **Prettier:** Code formatting (or use ESLint with stylistic rules)
|
|
77
|
+
- **Biome:** Fast all-in-one linter + formatter (Rust-based)
|
|
78
|
+
|
|
79
|
+
### Python
|
|
80
|
+
|
|
81
|
+
- **Ruff:** Fast linter + formatter (replaces flake8, black, isort)
|
|
82
|
+
- **mypy:** Type checking
|
|
83
|
+
|
|
84
|
+
## API Design
|
|
85
|
+
|
|
86
|
+
### REST
|
|
87
|
+
|
|
88
|
+
- Use plural nouns for collections (`/users`, not `/user`)
|
|
89
|
+
- HTTP methods: GET (read), POST (create), PUT/PATCH (update), DELETE
|
|
90
|
+
- Status codes: 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error
|
|
91
|
+
|
|
92
|
+
### Authentication
|
|
93
|
+
|
|
94
|
+
- **JWTs:** Short expiry + refresh tokens, store in httpOnly cookies (not localStorage)
|
|
95
|
+
- **OAuth 2.0 / OIDC:** For third-party auth
|
|
96
|
+
- **Passkeys/WebAuthn:** Modern passwordless option
|
|
97
|
+
|
|
98
|
+
## Database
|
|
99
|
+
|
|
100
|
+
### ORMs
|
|
101
|
+
|
|
102
|
+
- **Prisma:** Type-safe, great DX for Node.js/TypeScript
|
|
103
|
+
- **Drizzle:** Lightweight, SQL-like syntax
|
|
104
|
+
- **SQLAlchemy 2.0:** Python standard (note: 2.0 syntax differs from 1.x)
|
|
105
|
+
|
|
106
|
+
### Migrations
|
|
107
|
+
|
|
108
|
+
- Always use migrations, never manual schema changes in production
|
|
109
|
+
- Version control migration files
|
|
110
|
+
|
|
111
|
+
## Frontend
|
|
112
|
+
|
|
113
|
+
### React
|
|
114
|
+
|
|
115
|
+
- **React 18+:** Concurrent features, Suspense
|
|
116
|
+
- Prefer function components + hooks over class components
|
|
117
|
+
- Use React Server Components where appropriate (Next.js 13+)
|
|
118
|
+
|
|
119
|
+
### State Management
|
|
120
|
+
|
|
121
|
+
- Start with React Context + useReducer
|
|
122
|
+
- **Zustand:** Simple, minimal boilerplate
|
|
123
|
+
- **TanStack Query:** For server state (caching, refetching)
|
|
124
|
+
|
|
125
|
+
## Monorepos
|
|
126
|
+
|
|
127
|
+
- **Turborepo:** Fast builds, caching
|
|
128
|
+
- **Nx:** Full-featured, good for enterprise
|
|
129
|
+
- **pnpm workspaces:** Native package manager support
|
package/docs/TODO.md
CHANGED
|
@@ -5,61 +5,172 @@ This document tracks issues identified during code reviews that are deferred for
|
|
|
5
5
|
## Security (From Aegis Review - Round 2)
|
|
6
6
|
|
|
7
7
|
### Medium Priority
|
|
8
|
+
|
|
8
9
|
- **M-1: eval() of external data in load_agents_from_json()**
|
|
9
10
|
- File: `bin/lib/config.sh` line 95
|
|
10
11
|
- Issue: If agents.json is compromised, malicious agent names could execute shell commands via `eval "$agent_data"`
|
|
11
12
|
- Fix: Add input validation in Node.js script to reject agent names containing shell metacharacters
|
|
12
13
|
|
|
13
14
|
### Low Priority
|
|
15
|
+
|
|
14
16
|
- **L-1: Windows Terminal command escaping**
|
|
15
17
|
- File: `bin/forge-spawn.sh` lines 55-57
|
|
16
18
|
- Issue: `$display_name` and `$FORGE_ROOT` not escaped for nested shell invocation
|
|
17
19
|
- Fix: Use `printf %q` for proper escaping
|
|
18
20
|
|
|
19
|
-
-
|
|
21
|
+
- ~~**L-2: Terminal escape sequences in task parsing**~~ ✅ Fixed in 0.3.7
|
|
20
22
|
- File: `bin/forge-daemon.sh` lines 147-149
|
|
21
23
|
- Issue: ANSI escape sequences in task files could affect terminal
|
|
22
|
-
- Fix:
|
|
24
|
+
- Fix: Added `| tr -d '\033' | sed 's/\[[0-9;]*m//g'` to strip escape sequences
|
|
23
25
|
|
|
24
|
-
-
|
|
26
|
+
- ~~**L-3: Workflow version injection**~~ ✅ Fixed in 0.3.7
|
|
25
27
|
- File: `.github/workflows/publish.yml` lines 32-33
|
|
26
28
|
- Issue: Version input not validated before use in npm command
|
|
27
|
-
- Fix:
|
|
29
|
+
- Fix: Added semver regex validation step
|
|
28
30
|
|
|
29
31
|
## Architecture (From Sage Review - Round 2)
|
|
30
32
|
|
|
31
33
|
### P1 Priority
|
|
34
|
+
|
|
32
35
|
- **sed -i incompatibility in forge-setup.sh**
|
|
33
36
|
- Lines: 205, 249, 291, 380, 381, 384, 388
|
|
34
37
|
- Issue: macOS/BSD sed requires `sed -i ''` but script uses `sed -i`
|
|
35
38
|
- Fix: Add platform detection or create `sed_inplace()` helper
|
|
36
39
|
|
|
37
|
-
-
|
|
40
|
+
- ~~**Silent error suppression for JSON loading**~~ ✅ Fixed in 0.3.7
|
|
38
41
|
- Files: `bin/forge.sh` line 44, `bin/forge-spawn.sh` line 34
|
|
39
42
|
- Issue: `2>/dev/null || true` silently ignores JSON parsing errors
|
|
40
|
-
- Fix:
|
|
43
|
+
- Fix: Now logs warning when fallback is used
|
|
41
44
|
|
|
42
45
|
- **Inconsistent exit codes**
|
|
43
46
|
- Issue: All errors exit with code 1, no differentiation
|
|
44
47
|
- Fix: Define exit code constants in `constants.sh`
|
|
45
48
|
|
|
46
49
|
### P2 Priority
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
- ~~**Hardcoded agent list in cmd_help()**~~ ✅ Fixed in 0.3.7
|
|
48
52
|
- File: `bin/forge.sh` lines 253-260
|
|
49
|
-
- Fix:
|
|
53
|
+
- Fix: Now uses `show_available_agents()` dynamically
|
|
50
54
|
|
|
51
55
|
- **Raw echo -e instead of log_* functions**
|
|
52
56
|
- File: `bin/forge-setup.sh` (multiple lines)
|
|
53
57
|
- Fix: Replace with appropriate `log_*` calls
|
|
54
58
|
|
|
55
|
-
-
|
|
59
|
+
- ~~**Duplicate color definitions in cli.js**~~ ✅ Fixed in 0.3.7
|
|
56
60
|
- File: `bin/cli.js` lines 24-31
|
|
57
|
-
- Fix:
|
|
61
|
+
- Fix: Documented as intentional (cli.js runs standalone via npx)
|
|
58
62
|
|
|
59
63
|
## Testing (From Crucible Review - Round 2)
|
|
60
64
|
|
|
61
65
|
### Low Priority Gaps
|
|
66
|
+
|
|
62
67
|
- `show_available_agents()` not tested
|
|
63
68
|
- `setup_windows_env()` not tested (hard to test in CI)
|
|
64
69
|
- `colors.sh` log functions not tested (display-only)
|
|
65
70
|
- CLI `init`/`update` commands not tested (side effects)
|
|
71
|
+
|
|
72
|
+
## UX Improvements
|
|
73
|
+
|
|
74
|
+
### Consider Re-adding
|
|
75
|
+
|
|
76
|
+
- **Auto status on /forge startup**
|
|
77
|
+
- Removed in 0.3.6 to reduce 45s→~15s startup time
|
|
78
|
+
- Could re-add if startup is fast enough after optimization
|
|
79
|
+
- Alternative: Add "show status on startup" config option
|
|
80
|
+
|
|
81
|
+
### Shell Tests
|
|
82
|
+
|
|
83
|
+
- BATS tests disabled in CI due to bash associative array limitations
|
|
84
|
+
- Need to refactor tests to avoid `declare -A` in subshell contexts
|
|
85
|
+
|
|
86
|
+
## Feature Ideas
|
|
87
|
+
|
|
88
|
+
### Worker Loop (Ralph-style Persistent Workers) - Added in 0.3.9
|
|
89
|
+
|
|
90
|
+
Implemented in `.claude/hooks/worker-loop.sh` and `.claude/commands/worker-loop.md`.
|
|
91
|
+
|
|
92
|
+
Workers can now run in persistent loop mode:
|
|
93
|
+
|
|
94
|
+
- `/worker-loop anvil` - Start Anvil in persistent mode
|
|
95
|
+
- Worker checks for tasks, works on them, loops back
|
|
96
|
+
- Only exits after N idle checks with no tasks found
|
|
97
|
+
- Based on the Ralph Loop technique from Anthropic's plugins
|
|
98
|
+
|
|
99
|
+
### LSP/Tooling Selection During Init
|
|
100
|
+
|
|
101
|
+
- Add multi-select during `vibe-forge init` for tech stack
|
|
102
|
+
- Options could include:
|
|
103
|
+
- **Languages:** TypeScript, Python, Rust, Go, Java, C#
|
|
104
|
+
- **Frameworks:** React, Vue, Next.js, FastAPI, Django, Express
|
|
105
|
+
- **Infrastructure:** Docker, Kubernetes, Terraform, AWS, GCP
|
|
106
|
+
- **Databases:** PostgreSQL, MongoDB, Redis, SQLite
|
|
107
|
+
- Generate customized `context/project-stack.md` based on selections
|
|
108
|
+
- Include relevant LSP configs, linter recommendations, modern conventions
|
|
109
|
+
- Auto-detect from existing files (package.json, pyproject.toml, Cargo.toml, etc.)
|
|
110
|
+
- Store selections in `.forge/config.json` for future reference
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## V2 Architecture (Major Refactor)
|
|
115
|
+
|
|
116
|
+
### Problem
|
|
117
|
+
|
|
118
|
+
Current design clones the entire vibe-forge repo into each project as `_vibe-forge/`. This has issues:
|
|
119
|
+
|
|
120
|
+
- Commits 50+ tool files into user's repo that aren't their code
|
|
121
|
+
- Updates are awkward (re-run init? git pull?)
|
|
122
|
+
- Pollutes git history with tool internals
|
|
123
|
+
- Merge conflicts when updating
|
|
124
|
+
|
|
125
|
+
### Proposed Solution: Tool vs Data Separation
|
|
126
|
+
|
|
127
|
+
**Tool** (from npm, NOT committed):
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
npx vibe-forge ... # Runs from npm cache
|
|
131
|
+
~/.vibe-forge/ # Or global install location
|
|
132
|
+
├── bin/ # Scripts
|
|
133
|
+
├── agents/ # Agent personalities
|
|
134
|
+
└── config/ # Default configs
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Project Data** (committed, project-specific):
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
your-project/
|
|
141
|
+
├── .forge/ # Local config (gitignored)
|
|
142
|
+
│ ├── config.json # Terminal type, paths, preferences
|
|
143
|
+
│ └── state.yaml # Current session state
|
|
144
|
+
└── .vibe-forge/ # Project data (committed)
|
|
145
|
+
├── tasks/ # Task files
|
|
146
|
+
│ ├── pending/
|
|
147
|
+
│ ├── in-progress/
|
|
148
|
+
│ └── completed/
|
|
149
|
+
├── context/ # Project context
|
|
150
|
+
│ └── project-context.md
|
|
151
|
+
└── overrides/ # Optional: project-specific agent tweaks
|
|
152
|
+
└── agents.json # Override default agent config
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Benefits
|
|
156
|
+
|
|
157
|
+
1. **Clean git history** - Only project data committed, not tool code
|
|
158
|
+
2. **Easy updates** - `npm update -g vibe-forge` or `npx vibe-forge@latest`
|
|
159
|
+
3. **Single source of truth** - Tool version consistent across projects
|
|
160
|
+
4. **Smaller footprint** - ~10 files vs 50+
|
|
161
|
+
5. **No vendoring** - Don't commit dependencies into your repo
|
|
162
|
+
|
|
163
|
+
### Migration Path
|
|
164
|
+
|
|
165
|
+
1. **v0.4.x (current)**: Add `.gitignore` entries for tool internals (stopgap)
|
|
166
|
+
2. **v1.0**: Refactor to proper tool/data separation
|
|
167
|
+
- Tool runs from npm package directly
|
|
168
|
+
- Only `.vibe-forge/` folder in project
|
|
169
|
+
- Backward compat: detect old `_vibe-forge/` and migrate
|
|
170
|
+
|
|
171
|
+
### Implementation Notes
|
|
172
|
+
|
|
173
|
+
- `npx vibe-forge` already works - just need to make scripts runnable from npm location
|
|
174
|
+
- Agent personalities loaded from npm package by default, with project overrides
|
|
175
|
+
- Tasks/context remain project-local
|
|
176
|
+
- `.forge/config.json` stays gitignored (machine-specific)
|