forge-workflow 0.0.4 → 0.0.6

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 (248) hide show
  1. package/.claude/commands/dev.md +345 -340
  2. package/.claude/commands/plan.md +566 -521
  3. package/.claude/commands/premerge.md +186 -176
  4. package/.claude/commands/research.md +42 -42
  5. package/.claude/commands/review.md +448 -442
  6. package/.claude/commands/rollback.md +721 -721
  7. package/.claude/commands/ship.md +212 -164
  8. package/.claude/commands/sonarcloud.md +152 -152
  9. package/.claude/commands/status.md +90 -48
  10. package/.claude/commands/validate.md +288 -282
  11. package/.claude/commands/verify.md +269 -221
  12. package/.claude/rules/greptile-review-process.md +285 -285
  13. package/.claude/rules/workflow.md +121 -105
  14. package/.claude/scripts/greptile-resolve.sh +558 -526
  15. package/.claude/scripts/load-env.sh +32 -32
  16. package/.cline/workflows/dev.md +342 -337
  17. package/.cline/workflows/plan.md +563 -518
  18. package/.cline/workflows/premerge.md +183 -173
  19. package/.cline/workflows/research.md +39 -39
  20. package/.cline/workflows/review.md +445 -439
  21. package/.cline/workflows/rollback.md +718 -718
  22. package/.cline/workflows/ship.md +209 -161
  23. package/.cline/workflows/sonarcloud.md +146 -146
  24. package/.cline/workflows/status.md +87 -45
  25. package/.cline/workflows/validate.md +285 -279
  26. package/.cline/workflows/verify.md +266 -218
  27. package/.codex/config.toml +11 -11
  28. package/.codex/skills/dev/SKILL.md +345 -340
  29. package/.codex/skills/plan/SKILL.md +566 -521
  30. package/.codex/skills/premerge/SKILL.md +186 -176
  31. package/.codex/skills/research/SKILL.md +42 -42
  32. package/.codex/skills/review/SKILL.md +448 -442
  33. package/.codex/skills/rollback/SKILL.md +721 -721
  34. package/.codex/skills/ship/SKILL.md +212 -164
  35. package/.codex/skills/sonarcloud/SKILL.md +149 -149
  36. package/.codex/skills/status/SKILL.md +90 -48
  37. package/.codex/skills/validate/SKILL.md +288 -282
  38. package/.codex/skills/verify/SKILL.md +269 -221
  39. package/.cursor/commands/dev.md +342 -337
  40. package/.cursor/commands/plan.md +563 -518
  41. package/.cursor/commands/premerge.md +183 -173
  42. package/.cursor/commands/research.md +39 -39
  43. package/.cursor/commands/review.md +445 -439
  44. package/.cursor/commands/rollback.md +718 -718
  45. package/.cursor/commands/ship.md +209 -161
  46. package/.cursor/commands/sonarcloud.md +146 -146
  47. package/.cursor/commands/status.md +87 -45
  48. package/.cursor/commands/validate.md +285 -279
  49. package/.cursor/commands/verify.md +266 -218
  50. package/.cursor/rules/permissions-guidance.mdc +37 -37
  51. package/.forge/hooks/check-tdd.js +240 -240
  52. package/.github/PLUGIN_TEMPLATE.json +32 -32
  53. package/.github/prompts/dev.prompt.md +347 -342
  54. package/.github/prompts/plan.prompt.md +568 -523
  55. package/.github/prompts/premerge.prompt.md +188 -178
  56. package/.github/prompts/research.prompt.md +44 -44
  57. package/.github/prompts/review.prompt.md +450 -444
  58. package/.github/prompts/rollback.prompt.md +723 -723
  59. package/.github/prompts/ship.prompt.md +214 -166
  60. package/.github/prompts/sonarcloud.prompt.md +151 -151
  61. package/.github/prompts/status.prompt.md +92 -50
  62. package/.github/prompts/validate.prompt.md +290 -284
  63. package/.github/prompts/verify.prompt.md +271 -223
  64. package/.github/workflows/beads-to-github.yml +56 -0
  65. package/.github/workflows/github-to-beads.yml +97 -0
  66. package/.kilocode/workflows/dev.md +346 -341
  67. package/.kilocode/workflows/plan.md +567 -522
  68. package/.kilocode/workflows/premerge.md +187 -177
  69. package/.kilocode/workflows/research.md +43 -43
  70. package/.kilocode/workflows/review.md +449 -443
  71. package/.kilocode/workflows/rollback.md +722 -722
  72. package/.kilocode/workflows/ship.md +213 -165
  73. package/.kilocode/workflows/sonarcloud.md +150 -150
  74. package/.kilocode/workflows/status.md +91 -49
  75. package/.kilocode/workflows/validate.md +289 -283
  76. package/.kilocode/workflows/verify.md +270 -222
  77. package/.mcp.json.example +12 -12
  78. package/.opencode/commands/dev.md +345 -340
  79. package/.opencode/commands/plan.md +566 -521
  80. package/.opencode/commands/premerge.md +186 -176
  81. package/.opencode/commands/research.md +42 -42
  82. package/.opencode/commands/review.md +448 -442
  83. package/.opencode/commands/rollback.md +721 -721
  84. package/.opencode/commands/ship.md +212 -164
  85. package/.opencode/commands/sonarcloud.md +149 -149
  86. package/.opencode/commands/status.md +90 -48
  87. package/.opencode/commands/validate.md +288 -282
  88. package/.opencode/commands/verify.md +269 -221
  89. package/.roo/commands/dev.md +346 -341
  90. package/.roo/commands/plan.md +567 -522
  91. package/.roo/commands/premerge.md +187 -177
  92. package/.roo/commands/research.md +43 -43
  93. package/.roo/commands/review.md +449 -443
  94. package/.roo/commands/rollback.md +722 -722
  95. package/.roo/commands/ship.md +213 -165
  96. package/.roo/commands/sonarcloud.md +150 -150
  97. package/.roo/commands/status.md +91 -49
  98. package/.roo/commands/validate.md +289 -283
  99. package/.roo/commands/verify.md +270 -222
  100. package/AGENTS.md +272 -175
  101. package/CLAUDE.md +110 -100
  102. package/README.md +429 -416
  103. package/bin/forge-cmd.js +317 -313
  104. package/bin/forge-preflight.js +322 -309
  105. package/bin/forge.js +4765 -4303
  106. package/docs/AGENT_INSTALL_PROMPT.md +342 -342
  107. package/docs/BEADS_GITHUB_SYNC.md +251 -251
  108. package/docs/ENHANCED_ONBOARDING.md +612 -602
  109. package/docs/EXAMPLES.md +482 -482
  110. package/docs/GREPTILE_SETUP.md +400 -400
  111. package/docs/MANUAL_REVIEW_GUIDE.md +106 -106
  112. package/docs/ROADMAP.md +359 -359
  113. package/docs/SETUP.md +663 -631
  114. package/docs/TOOLCHAIN.md +653 -630
  115. package/docs/VALIDATION.md +363 -363
  116. package/install.sh +40 -1056
  117. package/lefthook.yml +50 -39
  118. package/lib/agents/README.md +198 -198
  119. package/lib/agents/claude.plugin.json +28 -28
  120. package/lib/agents/cline.plugin.json +22 -22
  121. package/lib/agents/codex.plugin.json +19 -19
  122. package/lib/agents/copilot.plugin.json +24 -24
  123. package/lib/agents/cursor.plugin.json +25 -25
  124. package/lib/agents/kilocode.plugin.json +22 -22
  125. package/lib/agents/opencode.plugin.json +20 -20
  126. package/lib/agents/roo.plugin.json +23 -23
  127. package/lib/agents-config.js +2112 -2112
  128. package/lib/beads-health-check.js +143 -0
  129. package/lib/beads-setup.js +341 -0
  130. package/lib/beads-sync-scaffold.js +260 -0
  131. package/lib/commands/_registry.js +134 -0
  132. package/lib/commands/clean.js +181 -0
  133. package/lib/commands/dev.js +571 -513
  134. package/lib/commands/plan.js +692 -692
  135. package/lib/commands/push.js +196 -0
  136. package/lib/commands/recommend.js +119 -119
  137. package/lib/commands/ship.js +377 -377
  138. package/lib/commands/status.js +378 -378
  139. package/lib/commands/sync.js +55 -0
  140. package/lib/commands/team.js +37 -0
  141. package/lib/commands/test.js +207 -0
  142. package/lib/commands/validate.js +602 -602
  143. package/lib/commands/worktree.js +310 -0
  144. package/lib/context-merge.js +359 -359
  145. package/lib/dep-guard/analyzer.js +294 -294
  146. package/lib/dep-guard/behavior-detector.js +98 -98
  147. package/lib/dep-guard/contract-detector.js +162 -162
  148. package/lib/dep-guard/import-detector.js +498 -498
  149. package/lib/dep-guard/path-utils.js +13 -13
  150. package/lib/dep-guard/rubric.js +120 -120
  151. package/lib/dep-guard/task-parser.js +318 -318
  152. package/lib/detect-agent.js +191 -191
  153. package/lib/detect-worktree.js +47 -47
  154. package/lib/docs-command.js +51 -0
  155. package/lib/docs-copy.js +50 -0
  156. package/lib/file-hash.js +26 -26
  157. package/lib/freshness-token.js +148 -0
  158. package/lib/greptile-match.js +80 -0
  159. package/lib/husky-migration.js +450 -0
  160. package/lib/lefthook-check.js +65 -0
  161. package/lib/pat-setup.js +207 -0
  162. package/lib/plugin-catalog.js +350 -350
  163. package/lib/plugin-manager.js +166 -166
  164. package/lib/plugin-recommender.js +141 -141
  165. package/lib/project-discovery.js +491 -491
  166. package/lib/reset.js +309 -0
  167. package/lib/setup-action-log.js +139 -139
  168. package/lib/setup-summary-renderer.js +106 -106
  169. package/lib/setup-utils.js +96 -0
  170. package/lib/setup.js +192 -192
  171. package/lib/smart-merge.js +64 -0
  172. package/lib/symlink-utils.js +81 -0
  173. package/lib/task-ownership.js +117 -0
  174. package/lib/workflow-profiles.js +197 -197
  175. package/package.json +131 -128
  176. package/scripts/beads-context.sh +426 -0
  177. package/scripts/beads-context.test.js +567 -0
  178. package/scripts/behavioral-judge.sh +378 -0
  179. package/scripts/benchmark.js +85 -0
  180. package/scripts/branch-protection.js +183 -0
  181. package/scripts/check-agents.js +172 -0
  182. package/scripts/check-forge-token.js +98 -0
  183. package/scripts/commitlint.js +42 -0
  184. package/scripts/conflict-detect.sh +323 -0
  185. package/scripts/dep-guard-analyze.js +71 -0
  186. package/scripts/dep-guard.sh +789 -0
  187. package/scripts/eval_win.py +249 -0
  188. package/scripts/file-index.sh +493 -0
  189. package/scripts/forge-team/index.sh +86 -0
  190. package/scripts/forge-team/lib/agent-prompt.sh +52 -0
  191. package/scripts/forge-team/lib/claim.sh +256 -0
  192. package/scripts/forge-team/lib/dashboard.sh +341 -0
  193. package/scripts/forge-team/lib/epic.sh +332 -0
  194. package/scripts/forge-team/lib/hooks.sh +253 -0
  195. package/scripts/forge-team/lib/identity.sh +235 -0
  196. package/scripts/forge-team/lib/sync-github.sh +317 -0
  197. package/scripts/forge-team/lib/verify.sh +284 -0
  198. package/scripts/forge-team/lib/workload.sh +296 -0
  199. package/scripts/forge-team/tests/agent-prompt.test.sh +72 -0
  200. package/scripts/forge-team/tests/claim.test.sh +179 -0
  201. package/scripts/forge-team/tests/dashboard.test.sh +170 -0
  202. package/scripts/forge-team/tests/dispatcher.test.sh +79 -0
  203. package/scripts/forge-team/tests/epic.test.sh +176 -0
  204. package/scripts/forge-team/tests/hooks.test.sh +239 -0
  205. package/scripts/forge-team/tests/identity.test.sh +176 -0
  206. package/scripts/forge-team/tests/integration.test.sh +371 -0
  207. package/scripts/forge-team/tests/sync-github.test.sh +209 -0
  208. package/scripts/forge-team/tests/verify.test.sh +314 -0
  209. package/scripts/forge-team/tests/workflow-integration.test.sh +43 -0
  210. package/scripts/forge-team/tests/workload.test.sh +209 -0
  211. package/scripts/github-beads-sync/comment.mjs +64 -0
  212. package/scripts/github-beads-sync/config.mjs +148 -0
  213. package/scripts/github-beads-sync/github-api.mjs +131 -0
  214. package/scripts/github-beads-sync/index.mjs +332 -0
  215. package/scripts/github-beads-sync/label-mapper.mjs +54 -0
  216. package/scripts/github-beads-sync/mapping.mjs +78 -0
  217. package/scripts/github-beads-sync/reverse-sync-cli.mjs +31 -0
  218. package/scripts/github-beads-sync/reverse-sync.mjs +138 -0
  219. package/scripts/github-beads-sync/run-bd.mjs +159 -0
  220. package/scripts/github-beads-sync/sanitize.mjs +121 -0
  221. package/scripts/github-beads-sync.config.json +26 -0
  222. package/scripts/improve-command.js +375 -0
  223. package/scripts/lib/eval-runner.js +268 -0
  224. package/scripts/lib/eval-schema.js +135 -0
  225. package/scripts/lib/eval-storage.js +78 -0
  226. package/scripts/lib/grading.js +203 -0
  227. package/scripts/lib/jsonl-lock.sh +48 -0
  228. package/scripts/lib/sanitize.sh +116 -0
  229. package/scripts/lib/transcript-parser.js +63 -0
  230. package/scripts/lint.js +47 -0
  231. package/scripts/migrate-to-bun-test.js +412 -0
  232. package/scripts/pr-coordinator.sh +706 -0
  233. package/scripts/run-command-eval.js +236 -0
  234. package/scripts/smart-status.sh +809 -0
  235. package/scripts/sync-commands.js +571 -0
  236. package/scripts/sync-utils.sh +455 -0
  237. package/scripts/test-dashboard.js +123 -0
  238. package/scripts/test.js +46 -0
  239. package/scripts/validate.sh +94 -0
  240. package/skills/parallel-deep-research/SKILL.md +108 -108
  241. package/skills/parallel-deep-research/evals/README.md +27 -27
  242. package/skills/parallel-deep-research/evals/evals.json +62 -62
  243. package/skills/sonarcloud-analysis/SKILL.md +171 -171
  244. package/skills/sonarcloud-analysis/evals/README.md +27 -27
  245. package/skills/sonarcloud-analysis/evals/evals.json +50 -50
  246. package/skills/sonarcloud-analysis/references/api-reference.md +466 -466
  247. package/.cursor/hooks/state/continual-learning-index.json +0 -19
  248. package/.cursor/hooks/state/continual-learning.json +0 -8
package/docs/SETUP.md CHANGED
@@ -1,631 +1,663 @@
1
- # Forge Setup Guide
2
-
3
- Complete setup instructions for all AI agents and optional toolchain.
4
-
5
- ---
6
-
7
- ## Table of Contents
8
-
9
- - [Installation Options](#installation-options)
10
- - [Agent-Specific Setup](#agent-specific-setup)
11
- - [Prerequisites](#prerequisites)
12
- - [Toolchain Setup](#toolchain-setup)
13
- - [External Services](#external-services)
14
- - [Troubleshooting](#troubleshooting)
15
-
16
- ---
17
-
18
- ## Installation Options
19
-
20
- ### Option 1: Bun (Recommended)
21
-
22
- ```bash
23
- # Step 1: Install the package
24
- bun add forge-workflow
25
-
26
- # Step 2: Interactive setup
27
- bunx forge setup
28
- ```
29
-
30
- **Interactive prompts**:
31
- 1. Which agents do you use?
32
- 2. Install Beads? (y/n) - Git-backed issue tracking
33
- 3. Configure external services? (optional)
34
-
35
- **What gets created**:
36
- - `AGENTS.md` - Universal instructions (always)
37
- - Agent-specific files based on your selection
38
- - `docs/` folder with workflow guides
39
-
40
- ### Option 2: Specify Agents Directly
41
-
42
- ```bash
43
- # Install for specific agents
44
- bunx forge setup --agents claude,cursor,codex
45
-
46
- # Install for all agents
47
- bunx forge setup --all
48
- ```
49
-
50
- ### Option 3: curl (One-Command Install)
51
-
52
- ```bash
53
- curl -fsSL https://raw.githubusercontent.com/harshanandak/forge/main/install.sh | bash
54
- ```
55
-
56
- **Interactive prompts**:
57
- 1. Which agents do you use?
58
- 2. Install Beads? (y/n)
59
-
60
- ### Option 4: bun
61
-
62
- ```bash
63
- bun add forge-workflow
64
- bunx forge setup
65
- ```
66
-
67
- ---
68
-
69
- ## Agent-Specific Setup
70
-
71
- ### Claude Code
72
-
73
- **Files created**:
74
- - `CLAUDE.md` → Linked to `AGENTS.md`
75
- - `.claude/commands/` → 7 slash commands
76
- - `.claude/rules/workflow.md` → Workflow rules
77
- - `.claude/skills/forge-workflow/` → Skill files
78
-
79
- **Usage**:
80
- ```bash
81
- /status
82
- /plan feature-name
83
- /dev
84
- /validate
85
- # ... etc
86
- ```
87
-
88
- **Skills available**:
89
- - `forge-workflow` - All 7 stages
90
- - `parallel-deep-research` - Deep analysis and web research (if PARALLEL_API_KEY configured)
91
- - `sonarcloud-analysis` - Code quality (if SONARCLOUD_TOKEN configured)
92
-
93
- ---
94
-
95
- ### Cursor
96
-
97
- **Files created**:
98
- - `.cursorrules` → Linked to `AGENTS.md`
99
- - `.cursor/rules/forge-workflow.mdc` → MDC rules
100
- - `.cursor/skills/forge-workflow/`Skill files
101
-
102
- **Usage**:
103
- Cursor reads `.cursorrules` and follows the 7-stage workflow.
104
-
105
- **Commands**:
106
- Use Composer or Chat to reference stages:
107
- ```
108
- "I'm at the /dev stage - help me write tests first"
109
- ```
110
-
111
- ---
112
-
113
- ### GitHub Copilot
114
-
115
- **Files created**:
116
- - `.github/copilot-instructions.md` → Linked to `AGENTS.md`
117
- - `.github/prompts/` → Workflow prompts
118
-
119
- **Usage**:
120
- Copilot reads instructions from `.github/copilot-instructions.md`.
121
-
122
- **In Copilot Chat**:
123
- ```
124
- @workspace I'm starting a new feature, help me with the /plan stage
125
- ```
126
-
127
- ---
128
-
129
- ### Codex CLI
130
-
131
- **Files created**:
132
- - `AGENTS.md` → Primary instructions
133
-
134
- **Usage**:
135
- Codex CLI reads `AGENTS.md` and follows the documented workflow.
136
-
137
- **Example**:
138
- ```
139
- codex "Let's follow the Forge workflow. Start with /plan login-button."
140
- ```
141
-
142
- ---
143
-
144
- ### Kilo Code, OpenCode, Goose
145
-
146
- **Files created**:
147
- - Agent-specific config pointing to `AGENTS.md`
148
- - Skill files in agent's skill directory
149
-
150
- **Usage**:
151
- All agents read `AGENTS.md` and follow the documented workflow.
152
-
153
- **Example (any agent)**:
154
- ```
155
- "Let's follow the Forge workflow. I want to add a login button.
156
- Start with the /plan stage."
157
- ```
158
-
159
- ---
160
-
161
- ## Prerequisites
162
-
163
- ### Required
164
-
165
- #### Git
166
-
167
- ```bash
168
- # Verify installation
169
- git --version
170
-
171
- # If not installed:
172
- # macOS: brew install git
173
- # Windows: winget install Git.Git
174
- # Linux: sudo apt install git
175
- ```
176
-
177
- #### GitHub CLI
178
-
179
- **Required for** `/ship`, `/review`, `/premerge` commands.
180
-
181
- ```bash
182
- # macOS
183
- brew install gh
184
-
185
- # Windows
186
- winget install GitHub.cli
187
-
188
- # Linux
189
- sudo apt install gh
190
-
191
- # Authenticate
192
- gh auth login
193
- ```
194
-
195
- **Follow prompts**:
196
- 1. Select "GitHub.com"
197
- 2. Select "HTTPS"
198
- 3. Select "Login with a web browser"
199
- 4. Copy one-time code and paste in browser
200
-
201
- **Verify**:
202
- ```bash
203
- gh auth status
204
- ```
205
-
206
- ---
207
-
208
- ### Recommended
209
-
210
- #### Beads - Issue Tracking
211
-
212
- **Recommended for**: Multi-session work, team collaboration
213
-
214
- ```bash
215
- # Install globally
216
- bun install -g @beads/bd
217
-
218
- # Initialize in your project
219
- cd your-project
220
- bd init
221
-
222
- # Verify
223
- bd list
224
- ```
225
-
226
- **What it does**:
227
- - Git-backed issue tracking
228
- - Survives context clearing
229
- - Dependency tracking
230
- - Team-shareable
231
-
232
- [Full Beads guide in TOOLCHAIN.md](TOOLCHAIN.md#beads---issue-tracking-across-sessions)
233
-
234
- ---
235
-
236
- ## Toolchain Setup
237
-
238
- ### Beads Configuration
239
-
240
- After `bd init`, customize `.beads/config.yaml`:
241
-
242
- ```yaml
243
- # .beads/config.yaml
244
- project:
245
- name: "your-project"
246
- prefix: "PROJ" # Issue IDs: PROJ-1, PROJ-2, etc.
247
-
248
- priorities:
249
- 0: "critical"
250
- 1: "high"
251
- 2: "medium"
252
- 3: "low"
253
- 4: "backlog"
254
-
255
- statuses:
256
- - "open"
257
- - "in_progress"
258
- - "blocked"
259
- - "done"
260
-
261
- labels:
262
- - "bug"
263
- - "feature"
264
- - "chore"
265
- - "security"
266
- ```
267
-
268
- **Custom prefix**:
269
- ```bash
270
- bd init --prefix MYPROJ
271
- ```
272
-
273
- **Stealth mode** (local only, don't commit):
274
- ```bash
275
- bd init --stealth
276
- ```
277
-
278
- ---
279
-
280
- ## External Services
281
-
282
- Forge integrates with external services for enhanced capabilities. **All are optional** - Forge works standalone.
283
-
284
- ### Code Review Tools
285
-
286
- | Tool | Pricing | Best For | Setup Time |
287
- |------|---------|----------|------------|
288
- | **GitHub Code Quality** | FREE | All repos | 0 min (built-in) |
289
- | **CodeRabbit** | FREE (OSS) | Open source | 2 min |
290
- | **Greptile** | $99+/mo | Enterprise | 5 min |
291
-
292
- **Recommendation**: Start with GitHub Code Quality (FREE, no setup).
293
-
294
- #### GitHub Code Quality Setup
295
-
296
- **Already enabled!** Zero configuration required.
297
-
298
- GitHub provides built-in code quality features:
299
- - Code scanning
300
- - Dependabot alerts
301
- - Secret scanning
302
- - Pull request checks
303
-
304
- #### CodeRabbit Setup (FREE for Open Source)
305
-
306
- ```bash
307
- # 1. Visit https://coderabbit.ai
308
- # 2. Click "Sign in with GitHub"
309
- # 3. Install GitHub App
310
- # 4. Select repositories
311
-
312
- # Done! CodeRabbit reviews all PRs automatically.
313
- ```
314
-
315
- #### Greptile Setup (Paid - Enterprise)
316
-
317
- ```bash
318
- # 1. Get API key from https://app.greptile.com
319
- # 2. Add to .env.local
320
- GREPTILE_API_KEY=your-key
321
- CODE_REVIEW_TOOL=greptile
322
-
323
- # 3. Index repository (one-time)
324
- curl -X POST "https://api.greptile.com/v2/repositories" \
325
- -H "Authorization: Bearer $GREPTILE_API_KEY" \
326
- -H "Content-Type: application/json" \
327
- -d '{
328
- "remote": "github",
329
- "repository": "owner/repo",
330
- "branch": "main"
331
- }'
332
- ```
333
-
334
- ---
335
-
336
- ### Code Quality Tools
337
-
338
- | Tool | Pricing | Best For | Setup Time |
339
- |------|---------|----------|------------|
340
- | **ESLint** | FREE | All projects | 0 min (built-in) |
341
- | **SonarCloud** | 50k LoC FREE | Cloud hosting | 10 min |
342
- | **SonarQube** | FREE | Self-hosted | 15 min |
343
-
344
- **Recommendation**: Start with ESLint (FREE, already in your project).
345
-
346
- #### ESLint Setup
347
-
348
- **Already configured!** Just run:
349
-
350
- ```bash
351
- bun run lint
352
- # or: npm run lint
353
- ```
354
-
355
- #### SonarCloud Setup
356
-
357
- ```bash
358
- # 1. Create account at https://sonarcloud.io
359
- # 2. Create new project, select your repo
360
- # 3. Get token from Account → Security
361
- # 4. Add to .env.local
362
- SONAR_TOKEN=your-token
363
- SONAR_ORGANIZATION=your-org
364
- SONAR_PROJECT_KEY=your-project
365
- CODE_QUALITY_TOOL=sonarcloud
366
-
367
- # 5. Create sonar-project.properties
368
- cat > sonar-project.properties << EOF
369
- sonar.organization=$SONAR_ORGANIZATION
370
- sonar.projectKey=$SONAR_PROJECT_KEY
371
- sonar.sources=src
372
- sonar.tests=tests
373
- sonar.test.inclusions=**/*.test.js,**/*.spec.js
374
- sonar.javascript.lcov.reportPaths=coverage/lcov.info
375
- EOF
376
-
377
- # 6. Run analysis locally
378
- bunx sonarqube-scanner
379
-
380
- # 7. Add to CI (.github/workflows/quality.yml)
381
- ```
382
-
383
- **GitHub Actions**:
384
- ```yaml
385
- # .github/workflows/quality.yml
386
- name: Code Quality
387
- on: [push, pull_request]
388
-
389
- jobs:
390
- sonarcloud:
391
- runs-on: ubuntu-latest
392
- steps:
393
- - uses: actions/checkout@v3
394
- with:
395
- fetch-depth: 0
396
- - uses: sonarsource/sonarcloud-github-action@master
397
- env:
398
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
399
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
400
- ```
401
-
402
- #### SonarQube Setup (Self-Hosted)
403
-
404
- ```bash
405
- # 1. Start SonarQube with Docker
406
- docker run -d \
407
- --name sonarqube \
408
- -p 9000:9000 \
409
- sonarqube:community
410
-
411
- # 2. Access at http://localhost:9000
412
- # Default login: admin/admin
413
- # Change password when prompted
414
-
415
- # 3. Create project in SonarQube UI
416
- # 4. Generate token (Administration → Security → Users)
417
- # 5. Add to .env.local
418
- SONARQUBE_URL=http://localhost:9000
419
- SONARQUBE_TOKEN=your-token
420
- CODE_QUALITY_TOOL=sonarqube
421
-
422
- # 6. Create sonar-project.properties
423
- cat > sonar-project.properties << EOF
424
- sonar.host.url=http://localhost:9000
425
- sonar.login=$SONARQUBE_TOKEN
426
- sonar.projectKey=your-project
427
- sonar.sources=src
428
- sonar.tests=tests
429
- EOF
430
-
431
- # 7. Run analysis
432
- bunx sonarqube-scanner
433
- ```
434
-
435
- ---
436
-
437
- ### Research Tools
438
-
439
- #### Parallel AI (Optional - Paid)
440
-
441
- **Used in** `/plan` stage for deep web research.
442
-
443
- ```bash
444
- # 1. Get API key from https://platform.parallel.ai
445
- # 2. Add to .env.local
446
- PARALLEL_API_KEY=your-key
447
-
448
- # 3. Test
449
- API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
450
- curl -s -X POST "https://api.parallel.ai/v1beta/search" \
451
- -H "x-api-key: $API_KEY" \
452
- -H "Content-Type: application/json" \
453
- -H "parallel-beta: search-extract-2025-10-10" \
454
- -d '{"objective": "test query"}'
455
- ```
456
-
457
- **Pricing**: Pay-as-you-go
458
- **Alternative**: Manual web search (FREE)
459
-
460
- ---
461
-
462
- ## Environment Variables
463
-
464
- ### Configuration File
465
-
466
- Create `.env.local` in your project root:
467
-
468
- ```bash
469
- # .env.local (add to .gitignore!)
470
-
471
- # ===== TOOL SELECTION =====
472
- CODE_REVIEW_TOOL=github-code-quality # or: coderabbit, greptile, none
473
- CODE_QUALITY_TOOL=eslint # or: sonarcloud, sonarqube, none
474
-
475
- # ===== REQUIRED: GitHub =====
476
- GITHUB_TOKEN=ghp_xxxxxxxxxxxx
477
-
478
- # ===== OPTIONAL: Research =====
479
- PARALLEL_API_KEY=your-parallel-ai-key
480
-
481
- # ===== OPTIONAL: Code Review (Greptile) =====
482
- GREPTILE_API_KEY=your-greptile-key
483
-
484
- # ===== OPTIONAL: Code Quality (SonarCloud) =====
485
- SONAR_TOKEN=your-sonarcloud-token
486
- SONAR_ORGANIZATION=your-org
487
- SONAR_PROJECT_KEY=your-project
488
-
489
- # ===== OPTIONAL: Code Quality (SonarQube) =====
490
- SONARQUBE_URL=http://localhost:9000
491
- SONARQUBE_TOKEN=your-token
492
- ```
493
-
494
- ### Loading Variables
495
-
496
- **Forge includes a helper**:
497
-
498
- ```bash
499
- # Load all variables
500
- source .claude/scripts/load-env.sh
501
-
502
- # Or manually
503
- export $(grep -v '^#' .env.local | xargs)
504
- ```
505
-
506
- **In Claude Code** (automatic):
507
- Variables are loaded when running commands.
508
-
509
- **Security**:
510
- ```bash
511
- # Add to .gitignore
512
- echo ".env.local" >> .gitignore
513
- ```
514
-
515
- ---
516
-
517
- ## Directory Structure After Setup
518
-
519
- ```
520
- your-project/
521
- ├── AGENTS.md # Universal (always created)
522
- ├── CLAUDE.md # If Claude selected
523
- ├── .cursorrules # If Cursor selected
524
-
525
- ├── .claude/ # Claude Code files
526
- │ ├── commands/ # 7 workflow commands
527
- │ ├── rules/workflow.md
528
- │ ├── skills/forge-workflow/
529
- │ └── scripts/load-env.sh
530
-
531
- ├── .cursor/ # Cursor files
532
- │ ├── rules/forge-workflow.mdc
533
- │ └── skills/forge-workflow/
534
-
535
- ├── docs/
536
- │ ├── TOOLCHAIN.md # Tool reference
537
- │ ├── SETUP.md # This file
538
- │ ├── EXAMPLES.md # Real examples
539
- │ ├── planning/PROGRESS.md # Progress tracking
540
- │ └── research/TEMPLATE.md # Research template
541
-
542
- ├── .beads/ # If Beads installed
543
- │ ├── issues.jsonl
544
- │ ├── config.yaml
545
- │ └── .gitignore
546
-
547
- └── .env.local # Your configuration (add to .gitignore!)
548
- ```
549
-
550
- ---
551
-
552
- ## Troubleshooting
553
-
554
- ### "Command not found: bunx forge"
555
-
556
- ```bash
557
- # Ensure forge-workflow is installed
558
- bun pm ls | grep forge-workflow
559
-
560
- # If not, install
561
- bun add forge-workflow
562
- ```
563
-
564
- ### "Permission denied: gh"
565
-
566
- ```bash
567
- # Authenticate GitHub CLI
568
- gh auth login
569
-
570
- # Or check status
571
- gh auth status
572
- ```
573
-
574
- ### "Beads: command not found"
575
-
576
- ```bash
577
- # Install globally
578
- bun install -g @beads/bd
579
-
580
- # Verify
581
- bd --version
582
- ```
583
-
584
- ### "SonarQube connection refused"
585
-
586
- ```bash
587
- # Check if SonarQube is running
588
- docker ps | grep sonarqube
589
-
590
- # If not, start it
591
- docker start sonarqube
592
-
593
- # Or run fresh
594
- docker run -d --name sonarqube -p 9000:9000 sonarqube:community
595
- ```
596
-
597
- ### "Greptile API rate limit"
598
-
599
- **Wait** for rate limit to reset (usually 1 minute).
600
-
601
- **Or upgrade** to higher tier at https://greptile.com/pricing
602
-
603
- ### "Parallel AI API key invalid"
604
-
605
- ```bash
606
- # Verify key in .env.local
607
- grep PARALLEL_API_KEY .env.local
608
-
609
- # Test key
610
- curl -s -X POST "https://api.parallel.ai/v1beta/search" \
611
- -H "x-api-key: YOUR_KEY" \
612
- -H "Content-Type: application/json" \
613
- -H "parallel-beta: search-extract-2025-10-10" \
614
- -d '{"objective": "test"}'
615
- ```
616
-
617
- ---
618
-
619
- ## Next Steps
620
-
621
- ✅ Setup complete? Try your [first feature](../QUICKSTART.md)
622
-
623
- 📖 Learn the workflow in [AGENTS.md](../AGENTS.md)
624
-
625
- 🛠️ Explore toolchain in [TOOLCHAIN.md](TOOLCHAIN.md)
626
-
627
- 🎯 See examples in [EXAMPLES.md](EXAMPLES.md)
628
-
629
- ---
630
-
631
- **Questions?** [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
1
+ # Forge Setup Guide
2
+
3
+ Complete setup instructions for all AI agents and optional toolchain.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ - [Installation Options](#installation-options)
10
+ - [Agent-Specific Setup](#agent-specific-setup)
11
+ - [Prerequisites](#prerequisites)
12
+ - [Toolchain Setup](#toolchain-setup)
13
+ - [External Services](#external-services)
14
+ - [Troubleshooting](#troubleshooting)
15
+
16
+ ---
17
+
18
+ ## Installation Options
19
+
20
+ ### Option 1: Bun (Recommended)
21
+
22
+ ```bash
23
+ # Step 1: Install the package (as dev dependency)
24
+ bun add -D forge-workflow
25
+
26
+ # Step 2: Interactive setup
27
+ bunx forge setup
28
+ ```
29
+
30
+ **Interactive prompts**:
31
+ 1. Which agents do you use?
32
+ 2. Install Beads? (y/n) - Git-backed issue tracking
33
+ 3. Configure external services? (optional)
34
+
35
+ **What gets created**:
36
+ - `AGENTS.md` - Universal instructions (always)
37
+ - Agent-specific files based on your selection
38
+ - `docs/` folder with workflow guides
39
+
40
+ ### Option 2: Specify Agents Directly
41
+
42
+ ```bash
43
+ # Install for specific agents
44
+ bunx forge setup --agents claude,cursor,codex
45
+
46
+ # Install for all agents
47
+ bunx forge setup --all
48
+ ```
49
+
50
+ ### Option 3: curl (One-Command Install)
51
+
52
+ ```bash
53
+ curl -fsSL https://raw.githubusercontent.com/harshanandak/forge/main/install.sh | bash
54
+ ```
55
+
56
+ > **Note**: `install.sh` is a thin bootstrapper that installs forge-workflow and delegates to `bunx forge setup`. All setup logic lives in the npm package.
57
+
58
+ **Interactive prompts**:
59
+ 1. Which agents do you use?
60
+ 2. Install Beads? (y/n)
61
+
62
+ ### Option 4: bun
63
+
64
+ ```bash
65
+ bun add -D forge-workflow
66
+ bunx forge setup
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Agent-Specific Setup
72
+
73
+ ### Claude Code
74
+
75
+ **Files created**:
76
+ - `CLAUDE.md` → Linked to `AGENTS.md`
77
+ - `.claude/commands/` → 7 slash commands
78
+ - `.claude/rules/workflow.md` → Workflow rules
79
+ - `.claude/skills/forge-workflow/` → Skill files
80
+
81
+ **Usage**:
82
+ ```bash
83
+ /status
84
+ /plan feature-name
85
+ /dev
86
+ /validate
87
+ # ... etc
88
+ ```
89
+
90
+ **Skills available**:
91
+ - `forge-workflow` - All 7 stages
92
+ - `parallel-deep-research` - Deep analysis and web research (if PARALLEL_API_KEY configured)
93
+ - `sonarcloud-analysis` - Code quality (if SONARCLOUD_TOKEN configured)
94
+
95
+ ---
96
+
97
+ ### Cursor
98
+
99
+ **Files created**:
100
+ - `.cursorrules`Linked to `AGENTS.md`
101
+ - `.cursor/rules/forge-workflow.mdc` → MDC rules
102
+ - `.cursor/skills/forge-workflow/` → Skill files
103
+
104
+ **Usage**:
105
+ Cursor reads `.cursorrules` and follows the 7-stage workflow.
106
+
107
+ **Commands**:
108
+ Use Composer or Chat to reference stages:
109
+ ```
110
+ "I'm at the /dev stage - help me write tests first"
111
+ ```
112
+
113
+ ---
114
+
115
+ ### GitHub Copilot
116
+
117
+ **Files created**:
118
+ - `.github/copilot-instructions.md` → Linked to `AGENTS.md`
119
+ - `.github/prompts/` → Workflow prompts
120
+
121
+ **Usage**:
122
+ Copilot reads instructions from `.github/copilot-instructions.md`.
123
+
124
+ **In Copilot Chat**:
125
+ ```
126
+ @workspace I'm starting a new feature, help me with the /plan stage
127
+ ```
128
+
129
+ ---
130
+
131
+ ### Codex CLI
132
+
133
+ **Files created**:
134
+ - `AGENTS.md` → Primary instructions
135
+
136
+ **Usage**:
137
+ Codex CLI reads `AGENTS.md` and follows the documented workflow.
138
+
139
+ **Example**:
140
+ ```
141
+ codex "Let's follow the Forge workflow. Start with /plan login-button."
142
+ ```
143
+
144
+ ---
145
+
146
+ ### Kilo Code, OpenCode, Goose
147
+
148
+ **Files created**:
149
+ - Agent-specific config pointing to `AGENTS.md`
150
+ - Skill files in agent's skill directory
151
+
152
+ **Usage**:
153
+ All agents read `AGENTS.md` and follow the documented workflow.
154
+
155
+ **Example (any agent)**:
156
+ ```
157
+ "Let's follow the Forge workflow. I want to add a login button.
158
+ Start with the /plan stage."
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Prerequisites
164
+
165
+ ### Required
166
+
167
+ #### Git
168
+
169
+ ```bash
170
+ # Verify installation
171
+ git --version
172
+
173
+ # If not installed:
174
+ # macOS: brew install git
175
+ # Windows: winget install Git.Git
176
+ # Linux: sudo apt install git
177
+ ```
178
+
179
+ #### GitHub CLI
180
+
181
+ **Required for** `/ship`, `/review`, `/premerge` commands.
182
+
183
+ ```bash
184
+ # macOS
185
+ brew install gh
186
+
187
+ # Windows
188
+ winget install GitHub.cli
189
+
190
+ # Linux
191
+ sudo apt install gh
192
+
193
+ # Authenticate
194
+ gh auth login
195
+ ```
196
+
197
+ **Follow prompts**:
198
+ 1. Select "GitHub.com"
199
+ 2. Select "HTTPS"
200
+ 3. Select "Login with a web browser"
201
+ 4. Copy one-time code and paste in browser
202
+
203
+ **Verify**:
204
+ ```bash
205
+ gh auth status
206
+ ```
207
+
208
+ ---
209
+
210
+ ### Recommended
211
+
212
+ #### Beads - Issue Tracking
213
+
214
+ **Recommended for**: Multi-session work, team collaboration
215
+
216
+ ```bash
217
+ # Install globally
218
+ bun install -g @beads/bd
219
+
220
+ # Initialize in your project
221
+ cd your-project
222
+ bd init
223
+
224
+ # Verify
225
+ bd list
226
+ ```
227
+
228
+ **What it does**:
229
+ - Git-backed issue tracking
230
+ - Survives context clearing
231
+ - Dependency tracking
232
+ - Team-shareable
233
+
234
+ [Full Beads guide in TOOLCHAIN.md](TOOLCHAIN.md#beads---issue-tracking-across-sessions)
235
+
236
+ ---
237
+
238
+ ## Toolchain Setup
239
+
240
+ ### Beads Configuration
241
+
242
+ After `bd init`, customize `.beads/config.yaml`:
243
+
244
+ ```yaml
245
+ # .beads/config.yaml
246
+ project:
247
+ name: "your-project"
248
+ prefix: "PROJ" # Issue IDs: PROJ-1, PROJ-2, etc.
249
+
250
+ priorities:
251
+ 0: "critical"
252
+ 1: "high"
253
+ 2: "medium"
254
+ 3: "low"
255
+ 4: "backlog"
256
+
257
+ statuses:
258
+ - "open"
259
+ - "in_progress"
260
+ - "blocked"
261
+ - "done"
262
+
263
+ labels:
264
+ - "bug"
265
+ - "feature"
266
+ - "chore"
267
+ - "security"
268
+ ```
269
+
270
+ **Custom prefix**:
271
+ ```bash
272
+ bd init --prefix MYPROJ
273
+ ```
274
+
275
+ **Stealth mode** (local only, don't commit):
276
+ ```bash
277
+ bd init --stealth
278
+ ```
279
+
280
+ ### Beads GitHub Sync
281
+
282
+ The `--sync` flag during setup scaffolds a GitHub Actions workflow that syncs Beads issues with GitHub Issues bidirectionally.
283
+
284
+ ```bash
285
+ # Enable Beads sync during setup
286
+ bunx forge setup --sync
287
+ ```
288
+
289
+ **What gets scaffolded**:
290
+ - `.github/workflows/beads-sync.yml` - GitHub Actions workflow for bidirectional sync
291
+ - PAT (Personal Access Token) configuration via `gh secret set`
292
+
293
+ **PAT requirements**:
294
+ - A GitHub PAT with `repo` scope is required for the sync workflow
295
+ - During setup, Forge prompts to create and store the token as `BEADS_SYNC_TOKEN`
296
+ - The token is stored as a GitHub Actions secret (never committed to the repo)
297
+
298
+ **Manual PAT setup** (if skipped during setup):
299
+ ```bash
300
+ # Create a PAT at https://github.com/settings/tokens
301
+ # Then store it as a repo secret:
302
+ gh secret set BEADS_SYNC_TOKEN --body "ghp_your_token_here"
303
+ ```
304
+
305
+ **How sync works**:
306
+ - On push: Beads issues are synced to GitHub Issues
307
+ - On issue change: GitHub Issues are synced back to Beads
308
+ - Conflict resolution: last-write-wins with timestamps
309
+
310
+ ---
311
+
312
+ ## External Services
313
+
314
+ Forge integrates with external services for enhanced capabilities. **All are optional** - Forge works standalone.
315
+
316
+ ### Code Review Tools
317
+
318
+ | Tool | Pricing | Best For | Setup Time |
319
+ |------|---------|----------|------------|
320
+ | **GitHub Code Quality** | FREE | All repos | 0 min (built-in) |
321
+ | **CodeRabbit** | FREE (OSS) | Open source | 2 min |
322
+ | **Greptile** | $99+/mo | Enterprise | 5 min |
323
+
324
+ **Recommendation**: Start with GitHub Code Quality (FREE, no setup).
325
+
326
+ #### GitHub Code Quality Setup
327
+
328
+ **Already enabled!** Zero configuration required.
329
+
330
+ GitHub provides built-in code quality features:
331
+ - Code scanning
332
+ - Dependabot alerts
333
+ - Secret scanning
334
+ - Pull request checks
335
+
336
+ #### CodeRabbit Setup (FREE for Open Source)
337
+
338
+ ```bash
339
+ # 1. Visit https://coderabbit.ai
340
+ # 2. Click "Sign in with GitHub"
341
+ # 3. Install GitHub App
342
+ # 4. Select repositories
343
+
344
+ # Done! CodeRabbit reviews all PRs automatically.
345
+ ```
346
+
347
+ #### Greptile Setup (Paid - Enterprise)
348
+
349
+ ```bash
350
+ # 1. Get API key from https://app.greptile.com
351
+ # 2. Add to .env.local
352
+ GREPTILE_API_KEY=your-key
353
+ CODE_REVIEW_TOOL=greptile
354
+
355
+ # 3. Index repository (one-time)
356
+ curl -X POST "https://api.greptile.com/v2/repositories" \
357
+ -H "Authorization: Bearer $GREPTILE_API_KEY" \
358
+ -H "Content-Type: application/json" \
359
+ -d '{
360
+ "remote": "github",
361
+ "repository": "owner/repo",
362
+ "branch": "main"
363
+ }'
364
+ ```
365
+
366
+ ---
367
+
368
+ ### Code Quality Tools
369
+
370
+ | Tool | Pricing | Best For | Setup Time |
371
+ |------|---------|----------|------------|
372
+ | **ESLint** | FREE | All projects | 0 min (built-in) |
373
+ | **SonarCloud** | 50k LoC FREE | Cloud hosting | 10 min |
374
+ | **SonarQube** | FREE | Self-hosted | 15 min |
375
+
376
+ **Recommendation**: Start with ESLint (FREE, already in your project).
377
+
378
+ #### ESLint Setup
379
+
380
+ **Already configured!** Just run:
381
+
382
+ ```bash
383
+ bun run lint
384
+ # or: npm run lint
385
+ ```
386
+
387
+ #### SonarCloud Setup
388
+
389
+ ```bash
390
+ # 1. Create account at https://sonarcloud.io
391
+ # 2. Create new project, select your repo
392
+ # 3. Get token from Account → Security
393
+ # 4. Add to .env.local
394
+ SONAR_TOKEN=your-token
395
+ SONAR_ORGANIZATION=your-org
396
+ SONAR_PROJECT_KEY=your-project
397
+ CODE_QUALITY_TOOL=sonarcloud
398
+
399
+ # 5. Create sonar-project.properties
400
+ cat > sonar-project.properties << EOF
401
+ sonar.organization=$SONAR_ORGANIZATION
402
+ sonar.projectKey=$SONAR_PROJECT_KEY
403
+ sonar.sources=src
404
+ sonar.tests=tests
405
+ sonar.test.inclusions=**/*.test.js,**/*.spec.js
406
+ sonar.javascript.lcov.reportPaths=coverage/lcov.info
407
+ EOF
408
+
409
+ # 6. Run analysis locally
410
+ bunx sonarqube-scanner
411
+
412
+ # 7. Add to CI (.github/workflows/quality.yml)
413
+ ```
414
+
415
+ **GitHub Actions**:
416
+ ```yaml
417
+ # .github/workflows/quality.yml
418
+ name: Code Quality
419
+ on: [push, pull_request]
420
+
421
+ jobs:
422
+ sonarcloud:
423
+ runs-on: ubuntu-latest
424
+ steps:
425
+ - uses: actions/checkout@v3
426
+ with:
427
+ fetch-depth: 0
428
+ - uses: sonarsource/sonarcloud-github-action@master
429
+ env:
430
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
431
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
432
+ ```
433
+
434
+ #### SonarQube Setup (Self-Hosted)
435
+
436
+ ```bash
437
+ # 1. Start SonarQube with Docker
438
+ docker run -d \
439
+ --name sonarqube \
440
+ -p 9000:9000 \
441
+ sonarqube:community
442
+
443
+ # 2. Access at http://localhost:9000
444
+ # Default login: admin/admin
445
+ # Change password when prompted
446
+
447
+ # 3. Create project in SonarQube UI
448
+ # 4. Generate token (Administration → Security → Users)
449
+ # 5. Add to .env.local
450
+ SONARQUBE_URL=http://localhost:9000
451
+ SONARQUBE_TOKEN=your-token
452
+ CODE_QUALITY_TOOL=sonarqube
453
+
454
+ # 6. Create sonar-project.properties
455
+ cat > sonar-project.properties << EOF
456
+ sonar.host.url=http://localhost:9000
457
+ sonar.login=$SONARQUBE_TOKEN
458
+ sonar.projectKey=your-project
459
+ sonar.sources=src
460
+ sonar.tests=tests
461
+ EOF
462
+
463
+ # 7. Run analysis
464
+ bunx sonarqube-scanner
465
+ ```
466
+
467
+ ---
468
+
469
+ ### Research Tools
470
+
471
+ #### Parallel AI (Optional - Paid)
472
+
473
+ **Used in** `/plan` stage for deep web research.
474
+
475
+ ```bash
476
+ # 1. Get API key from https://platform.parallel.ai
477
+ # 2. Add to .env.local
478
+ PARALLEL_API_KEY=your-key
479
+
480
+ # 3. Test
481
+ API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
482
+ curl -s -X POST "https://api.parallel.ai/v1beta/search" \
483
+ -H "x-api-key: $API_KEY" \
484
+ -H "Content-Type: application/json" \
485
+ -H "parallel-beta: search-extract-2025-10-10" \
486
+ -d '{"objective": "test query"}'
487
+ ```
488
+
489
+ **Pricing**: Pay-as-you-go
490
+ **Alternative**: Manual web search (FREE)
491
+
492
+ ---
493
+
494
+ ## Environment Variables
495
+
496
+ ### Configuration File
497
+
498
+ Create `.env.local` in your project root:
499
+
500
+ ```bash
501
+ # .env.local (add to .gitignore!)
502
+
503
+ # ===== TOOL SELECTION =====
504
+ CODE_REVIEW_TOOL=github-code-quality # or: coderabbit, greptile, none
505
+ CODE_QUALITY_TOOL=eslint # or: sonarcloud, sonarqube, none
506
+
507
+ # ===== REQUIRED: GitHub =====
508
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxx
509
+
510
+ # ===== OPTIONAL: Research =====
511
+ PARALLEL_API_KEY=your-parallel-ai-key
512
+
513
+ # ===== OPTIONAL: Code Review (Greptile) =====
514
+ GREPTILE_API_KEY=your-greptile-key
515
+
516
+ # ===== OPTIONAL: Code Quality (SonarCloud) =====
517
+ SONAR_TOKEN=your-sonarcloud-token
518
+ SONAR_ORGANIZATION=your-org
519
+ SONAR_PROJECT_KEY=your-project
520
+
521
+ # ===== OPTIONAL: Code Quality (SonarQube) =====
522
+ SONARQUBE_URL=http://localhost:9000
523
+ SONARQUBE_TOKEN=your-token
524
+ ```
525
+
526
+ ### Loading Variables
527
+
528
+ **Forge includes a helper**:
529
+
530
+ ```bash
531
+ # Load all variables
532
+ source .claude/scripts/load-env.sh
533
+
534
+ # Or manually
535
+ export $(grep -v '^#' .env.local | xargs)
536
+ ```
537
+
538
+ **In Claude Code** (automatic):
539
+ Variables are loaded when running commands.
540
+
541
+ **Security**:
542
+ ```bash
543
+ # Add to .gitignore
544
+ echo ".env.local" >> .gitignore
545
+ ```
546
+
547
+ ---
548
+
549
+ ## Directory Structure After Setup
550
+
551
+ ```
552
+ your-project/
553
+ ├── AGENTS.md # Universal (always created)
554
+ ├── CLAUDE.md # If Claude selected
555
+ ├── .cursorrules # If Cursor selected
556
+
557
+ ├── .claude/ # Claude Code files
558
+ │ ├── commands/ # 7 workflow commands
559
+ │ ├── rules/workflow.md
560
+ │ ├── skills/forge-workflow/
561
+ │ └── scripts/load-env.sh
562
+
563
+ ├── .cursor/ # Cursor files
564
+ │ ├── rules/forge-workflow.mdc
565
+ │ └── skills/forge-workflow/
566
+
567
+ ├── docs/
568
+ │ ├── TOOLCHAIN.md # Tool reference
569
+ │ ├── SETUP.md # This file
570
+ │ ├── EXAMPLES.md # Real examples
571
+ │ ├── planning/PROGRESS.md # Progress tracking
572
+ │ └── research/TEMPLATE.md # Research template
573
+
574
+ ├── .beads/ # If Beads installed
575
+ │ ├── issues.jsonl
576
+ │ ├── config.yaml
577
+ │ └── .gitignore
578
+
579
+ └── .env.local # Your configuration (add to .gitignore!)
580
+ ```
581
+
582
+ ---
583
+
584
+ ## Troubleshooting
585
+
586
+ ### "Command not found: bunx forge"
587
+
588
+ ```bash
589
+ # Ensure forge-workflow is installed
590
+ bun pm ls | grep forge-workflow
591
+
592
+ # If not, install
593
+ bun add -D forge-workflow
594
+ ```
595
+
596
+ ### "Permission denied: gh"
597
+
598
+ ```bash
599
+ # Authenticate GitHub CLI
600
+ gh auth login
601
+
602
+ # Or check status
603
+ gh auth status
604
+ ```
605
+
606
+ ### "Beads: command not found"
607
+
608
+ ```bash
609
+ # Install globally
610
+ bun install -g @beads/bd
611
+
612
+ # Verify
613
+ bd --version
614
+ ```
615
+
616
+ ### "SonarQube connection refused"
617
+
618
+ ```bash
619
+ # Check if SonarQube is running
620
+ docker ps | grep sonarqube
621
+
622
+ # If not, start it
623
+ docker start sonarqube
624
+
625
+ # Or run fresh
626
+ docker run -d --name sonarqube -p 9000:9000 sonarqube:community
627
+ ```
628
+
629
+ ### "Greptile API rate limit"
630
+
631
+ **Wait** for rate limit to reset (usually 1 minute).
632
+
633
+ **Or upgrade** to higher tier at https://greptile.com/pricing
634
+
635
+ ### "Parallel AI API key invalid"
636
+
637
+ ```bash
638
+ # Verify key in .env.local
639
+ grep PARALLEL_API_KEY .env.local
640
+
641
+ # Test key
642
+ curl -s -X POST "https://api.parallel.ai/v1beta/search" \
643
+ -H "x-api-key: YOUR_KEY" \
644
+ -H "Content-Type: application/json" \
645
+ -H "parallel-beta: search-extract-2025-10-10" \
646
+ -d '{"objective": "test"}'
647
+ ```
648
+
649
+ ---
650
+
651
+ ## Next Steps
652
+
653
+ ✅ Setup complete? Try your [first feature](../QUICKSTART.md)
654
+
655
+ 📖 Learn the workflow in [AGENTS.md](../AGENTS.md)
656
+
657
+ 🛠️ Explore toolchain in [TOOLCHAIN.md](TOOLCHAIN.md)
658
+
659
+ 🎯 See examples in [EXAMPLES.md](EXAMPLES.md)
660
+
661
+ ---
662
+
663
+ **Questions?** → [GitHub Discussions](https://github.com/harshanandak/forge/discussions)