forge-workflow 0.0.3 → 0.0.5

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 (209) hide show
  1. package/.claude/commands/dev.md +340 -314
  2. package/.claude/commands/plan.md +521 -478
  3. package/.claude/commands/premerge.md +176 -179
  4. package/.claude/commands/research.md +42 -42
  5. package/.claude/commands/review.md +442 -442
  6. package/.claude/commands/rollback.md +721 -721
  7. package/.claude/commands/ship.md +164 -134
  8. package/.claude/commands/sonarcloud.md +152 -152
  9. package/.claude/commands/status.md +48 -77
  10. package/.claude/commands/validate.md +282 -237
  11. package/.claude/commands/verify.md +221 -221
  12. package/.claude/rules/greptile-review-process.md +285 -285
  13. package/.claude/rules/workflow.md +105 -105
  14. package/.claude/scripts/greptile-resolve.sh +526 -526
  15. package/.claude/scripts/load-env.sh +32 -32
  16. package/.cline/workflows/dev.md +337 -311
  17. package/.cline/workflows/plan.md +518 -475
  18. package/.cline/workflows/premerge.md +173 -176
  19. package/.cline/workflows/research.md +39 -39
  20. package/.cline/workflows/review.md +439 -439
  21. package/.cline/workflows/rollback.md +718 -718
  22. package/.cline/workflows/ship.md +161 -131
  23. package/.cline/workflows/sonarcloud.md +146 -146
  24. package/.cline/workflows/status.md +45 -74
  25. package/.cline/workflows/validate.md +279 -234
  26. package/.cline/workflows/verify.md +218 -218
  27. package/.codex/config.toml +11 -11
  28. package/.codex/skills/dev/SKILL.md +340 -314
  29. package/.codex/skills/plan/SKILL.md +521 -478
  30. package/.codex/skills/premerge/SKILL.md +176 -179
  31. package/.codex/skills/research/SKILL.md +42 -42
  32. package/.codex/skills/review/SKILL.md +442 -442
  33. package/.codex/skills/rollback/SKILL.md +721 -721
  34. package/.codex/skills/ship/SKILL.md +164 -134
  35. package/.codex/skills/sonarcloud/SKILL.md +149 -149
  36. package/.codex/skills/status/SKILL.md +48 -77
  37. package/.codex/skills/validate/SKILL.md +282 -237
  38. package/.codex/skills/verify/SKILL.md +221 -221
  39. package/.cursor/commands/dev.md +337 -311
  40. package/.cursor/commands/plan.md +518 -475
  41. package/.cursor/commands/premerge.md +173 -176
  42. package/.cursor/commands/research.md +39 -39
  43. package/.cursor/commands/review.md +439 -439
  44. package/.cursor/commands/rollback.md +718 -718
  45. package/.cursor/commands/ship.md +161 -131
  46. package/.cursor/commands/sonarcloud.md +146 -146
  47. package/.cursor/commands/status.md +45 -74
  48. package/.cursor/commands/validate.md +279 -234
  49. package/.cursor/commands/verify.md +218 -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 +342 -316
  54. package/.github/prompts/plan.prompt.md +523 -480
  55. package/.github/prompts/premerge.prompt.md +178 -181
  56. package/.github/prompts/research.prompt.md +44 -44
  57. package/.github/prompts/review.prompt.md +444 -444
  58. package/.github/prompts/rollback.prompt.md +723 -723
  59. package/.github/prompts/ship.prompt.md +166 -136
  60. package/.github/prompts/sonarcloud.prompt.md +151 -151
  61. package/.github/prompts/status.prompt.md +50 -79
  62. package/.github/prompts/validate.prompt.md +284 -239
  63. package/.github/prompts/verify.prompt.md +223 -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 +341 -315
  67. package/.kilocode/workflows/plan.md +522 -479
  68. package/.kilocode/workflows/premerge.md +177 -180
  69. package/.kilocode/workflows/research.md +43 -43
  70. package/.kilocode/workflows/review.md +443 -443
  71. package/.kilocode/workflows/rollback.md +722 -722
  72. package/.kilocode/workflows/ship.md +165 -135
  73. package/.kilocode/workflows/sonarcloud.md +150 -150
  74. package/.kilocode/workflows/status.md +49 -78
  75. package/.kilocode/workflows/validate.md +283 -238
  76. package/.kilocode/workflows/verify.md +222 -222
  77. package/.mcp.json.example +12 -12
  78. package/.opencode/commands/dev.md +340 -314
  79. package/.opencode/commands/plan.md +521 -478
  80. package/.opencode/commands/premerge.md +176 -179
  81. package/.opencode/commands/research.md +42 -42
  82. package/.opencode/commands/review.md +442 -442
  83. package/.opencode/commands/rollback.md +721 -721
  84. package/.opencode/commands/ship.md +164 -134
  85. package/.opencode/commands/sonarcloud.md +149 -149
  86. package/.opencode/commands/status.md +48 -77
  87. package/.opencode/commands/validate.md +282 -237
  88. package/.opencode/commands/verify.md +221 -221
  89. package/.roo/commands/dev.md +341 -315
  90. package/.roo/commands/plan.md +522 -479
  91. package/.roo/commands/premerge.md +177 -180
  92. package/.roo/commands/research.md +43 -43
  93. package/.roo/commands/review.md +443 -443
  94. package/.roo/commands/rollback.md +722 -722
  95. package/.roo/commands/ship.md +165 -135
  96. package/.roo/commands/sonarcloud.md +150 -150
  97. package/.roo/commands/status.md +49 -78
  98. package/.roo/commands/validate.md +283 -238
  99. package/.roo/commands/verify.md +222 -222
  100. package/AGENTS.md +175 -169
  101. package/CLAUDE.md +100 -99
  102. package/LICENSE +21 -21
  103. package/README.md +429 -414
  104. package/bin/forge-cmd.js +313 -313
  105. package/bin/{forge-validate.js → forge-preflight.js} +309 -303
  106. package/bin/forge.js +4596 -4232
  107. package/docs/AGENT_INSTALL_PROMPT.md +342 -342
  108. package/docs/BEADS_GITHUB_SYNC.md +251 -0
  109. package/docs/ENHANCED_ONBOARDING.md +602 -602
  110. package/docs/EXAMPLES.md +482 -482
  111. package/docs/GREPTILE_SETUP.md +400 -400
  112. package/docs/MANUAL_REVIEW_GUIDE.md +106 -106
  113. package/docs/ROADMAP.md +359 -359
  114. package/docs/SETUP.md +663 -632
  115. package/docs/TOOLCHAIN.md +630 -630
  116. package/docs/VALIDATION.md +363 -363
  117. package/install.sh +40 -1058
  118. package/lefthook.yml +39 -39
  119. package/lib/agents/README.md +198 -198
  120. package/lib/agents/claude.plugin.json +28 -28
  121. package/lib/agents/cline.plugin.json +22 -22
  122. package/lib/agents/codex.plugin.json +19 -19
  123. package/lib/agents/copilot.plugin.json +24 -24
  124. package/lib/agents/cursor.plugin.json +25 -25
  125. package/lib/agents/kilocode.plugin.json +22 -22
  126. package/lib/agents/opencode.plugin.json +20 -20
  127. package/lib/agents/roo.plugin.json +23 -23
  128. package/lib/agents-config.js +2112 -2112
  129. package/lib/beads-health-check.js +143 -0
  130. package/lib/beads-setup.js +341 -0
  131. package/lib/beads-sync-scaffold.js +260 -0
  132. package/lib/commands/dev.js +513 -513
  133. package/lib/commands/plan.js +692 -692
  134. package/lib/commands/recommend.js +119 -119
  135. package/lib/commands/ship.js +377 -377
  136. package/lib/commands/status.js +378 -378
  137. package/lib/commands/validate.js +602 -602
  138. package/lib/context-merge.js +359 -359
  139. package/lib/dep-guard/analyzer.js +294 -294
  140. package/lib/dep-guard/behavior-detector.js +98 -98
  141. package/lib/dep-guard/contract-detector.js +162 -162
  142. package/lib/dep-guard/import-detector.js +498 -498
  143. package/lib/dep-guard/path-utils.js +13 -13
  144. package/lib/dep-guard/rubric.js +120 -120
  145. package/lib/dep-guard/task-parser.js +318 -318
  146. package/lib/detect-agent.js +191 -0
  147. package/lib/detect-worktree.js +47 -0
  148. package/lib/file-hash.js +26 -0
  149. package/lib/husky-migration.js +450 -0
  150. package/lib/lefthook-check.js +65 -0
  151. package/lib/pat-setup.js +207 -0
  152. package/lib/plugin-catalog.js +350 -350
  153. package/lib/plugin-manager.js +166 -166
  154. package/lib/plugin-recommender.js +141 -141
  155. package/lib/project-discovery.js +491 -491
  156. package/lib/setup-action-log.js +139 -0
  157. package/lib/setup-summary-renderer.js +106 -0
  158. package/lib/setup-utils.js +96 -0
  159. package/lib/setup.js +192 -118
  160. package/lib/smart-merge.js +64 -0
  161. package/lib/symlink-utils.js +81 -0
  162. package/lib/workflow-profiles.js +197 -197
  163. package/package.json +131 -129
  164. package/scripts/beads-context.sh +291 -0
  165. package/scripts/beads-context.test.js +563 -0
  166. package/scripts/behavioral-judge.sh +378 -0
  167. package/scripts/benchmark.js +85 -0
  168. package/scripts/branch-protection.js +183 -0
  169. package/scripts/check-agents.js +172 -0
  170. package/scripts/commitlint.js +42 -0
  171. package/scripts/conflict-detect.sh +323 -0
  172. package/scripts/dep-guard-analyze.js +71 -0
  173. package/scripts/dep-guard.sh +811 -0
  174. package/scripts/eval_win.py +249 -0
  175. package/scripts/file-index.sh +399 -0
  176. package/scripts/github-beads-sync/comment.mjs +64 -0
  177. package/scripts/github-beads-sync/config.mjs +148 -0
  178. package/scripts/github-beads-sync/github-api.mjs +131 -0
  179. package/scripts/github-beads-sync/index.mjs +332 -0
  180. package/scripts/github-beads-sync/label-mapper.mjs +54 -0
  181. package/scripts/github-beads-sync/mapping.mjs +78 -0
  182. package/scripts/github-beads-sync/reverse-sync-cli.mjs +31 -0
  183. package/scripts/github-beads-sync/reverse-sync.mjs +138 -0
  184. package/scripts/github-beads-sync/run-bd.mjs +159 -0
  185. package/scripts/github-beads-sync/sanitize.mjs +121 -0
  186. package/scripts/github-beads-sync.config.json +26 -0
  187. package/scripts/improve-command.js +375 -0
  188. package/scripts/lib/eval-runner.js +229 -0
  189. package/scripts/lib/eval-schema.js +135 -0
  190. package/scripts/lib/eval-storage.js +78 -0
  191. package/scripts/lib/grading.js +203 -0
  192. package/scripts/lib/transcript-parser.js +63 -0
  193. package/scripts/lint.js +47 -0
  194. package/scripts/migrate-to-bun-test.js +412 -0
  195. package/scripts/run-command-eval.js +236 -0
  196. package/scripts/smart-status.sh +782 -0
  197. package/scripts/sync-commands.js +571 -0
  198. package/scripts/sync-utils.sh +460 -0
  199. package/scripts/test-dashboard.js +123 -0
  200. package/scripts/test.js +44 -0
  201. package/scripts/validate.sh +94 -0
  202. package/skills/parallel-deep-research/SKILL.md +108 -108
  203. package/skills/parallel-deep-research/evals/README.md +27 -27
  204. package/skills/parallel-deep-research/evals/evals.json +62 -62
  205. package/skills/sonarcloud-analysis/SKILL.md +171 -171
  206. package/skills/sonarcloud-analysis/evals/README.md +27 -27
  207. package/skills/sonarcloud-analysis/evals/evals.json +50 -50
  208. package/skills/sonarcloud-analysis/references/api-reference.md +466 -466
  209. package/docs/WORKFLOW.md +0 -400
package/docs/TOOLCHAIN.md CHANGED
@@ -1,630 +1,630 @@
1
- # Forge Toolchain Reference
2
-
3
- Complete reference for all tools integrated with the Forge workflow.
4
-
5
- ## Overview
6
-
7
- ```
8
- ┌─────────────────────────────────────────────────────────────────┐
9
- │ FORGE TOOLCHAIN │
10
- ├─────────────────────────────────────────────────────────────────┤
11
- │ │
12
- │ ┌─────────────┐ ┌─────────────────────┐ │
13
- │ │ BEADS │ │ EXTERNAL SERVICES │ │
14
- │ │ (bd) │ │ │ │
15
- │ │ │ │ Parallel AI │ │
16
- │ │ Git-backed │ │ Greptile │ │
17
- │ │ Issue │ │ SonarCloud │ │
18
- │ │ Tracking │ │ GitHub CLI │ │
19
- │ └─────────────┘ └─────────────────────┘ │
20
- │ │ │ │
21
- │ └─────────────────────┘ │
22
- │ │ │
23
- │ ┌─────▼─────┐ │
24
- │ │ FORGE │ │
25
- │ │ 7-Stage │ │
26
- │ │ Workflow │ │
27
- │ └───────────┘ │
28
- │ │
29
- └─────────────────────────────────────────────────────────────────┘
30
- ```
31
-
32
- ---
33
-
34
- ## Beads - Git-Backed Issue Tracking
35
-
36
- **Package**: `@beads/bd`
37
- **Repository**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
38
- **Purpose**: Distributed issue tracking designed for AI coding agents
39
-
40
- ### Why Beads?
41
-
42
- - **Persists across sessions** - Issues survive context clearing, compaction, new chats
43
- - **Git-backed** - Version controlled, mergeable, team-shareable
44
- - **Dependency tracking** - Know what blocks what
45
- - **Ready detection** - `bd ready` finds unblocked work automatically
46
- - **AI-optimized** - JSON output, semantic compaction, audit trails
47
-
48
- ### Installation
49
-
50
- **Auto-installation** (Recommended):
51
- ```bash
52
- bunx forge setup
53
- # Prompts: "Install Beads? (y/n)"
54
- # Automatically installs and initializes
55
- # On Windows: uses PowerShell installer (npm @beads/bd has an EPERM bug on Windows)
56
- ```
57
-
58
- **Manual installation**:
59
- ```bash
60
- # macOS / Linux (global)
61
- bun add -g @beads/bd
62
- bd init
63
-
64
- # macOS / Linux (local)
65
- bun add -d @beads/bd
66
- bunx bd init
67
-
68
- # Windows (global) — use PowerShell installer, NOT npm/bun add -g
69
- irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
70
- bd init
71
-
72
- # Or with bunx (macOS/Linux, no install needed)
73
- bunx @beads/bd init
74
- ```
75
-
76
- > **Windows note**: The `npm install -g @beads/bd` postinstall script uses `Expand-Archive`, which triggers an EPERM file-locking error on Windows (issue #1031, closed "not planned"). Use the PowerShell installer above instead.
77
-
78
- ### File Structure
79
-
80
- After `bd init`, creates `.beads/` directory:
81
-
82
- ```
83
- .beads/
84
- ├── issues.jsonl # Issue data (git-tracked, one JSON per line)
85
- ├── beads.db # SQLite cache (git-ignored, fast queries)
86
- ├── metadata.json # Database metadata
87
- ├── config.yaml # User configuration
88
- ├── interactions.jsonl # Agent audit log
89
- └── .gitignore # Ignores beads.db
90
- ```
91
-
92
- **Dual-database architecture**: JSONL for git versioning, SQLite for fast local queries. Background daemon keeps them in sync.
93
-
94
- ### Complete Command Reference
95
-
96
- #### Initialization
97
-
98
- ```bash
99
- bd init # Initialize in project
100
- bd init --stealth # Local-only (don't commit to repo)
101
- bd init --contributor # Contributor mode
102
- bd init --prefix PROJ # Custom issue prefix (PROJ-xxx)
103
- ```
104
-
105
- #### Issue Management
106
-
107
- ```bash
108
- # Create issues
109
- bd create "Title" # Basic issue
110
- bd create "Title" --type feature # With type (feature, bug, chore, etc.)
111
- bd create "Title" --priority 1 # With priority (0=critical, 4=backlog)
112
- bd create "Title" -p 0 -l "urgent,backend" # P0 with labels
113
-
114
- # View issues
115
- bd show <id> # Detailed view with audit trail
116
- bd list # All issues
117
- bd list --status open # Filter by status
118
- bd list --priority 1 # Filter by priority
119
- bd list --assignee bob # Filter by assignee
120
- bd list --label bug # Filter by label (AND logic)
121
- bd list --label-any bug,urgent # Filter by label (OR logic)
122
- bd list --type feature # Filter by type
123
- bd list --title-contains "auth" # Search titles
124
- bd list --limit 10 # Limit results
125
-
126
- # Update issues
127
- bd update <id> --status in_progress # Change status
128
- bd update <id> --priority 2 # Change priority
129
- bd update <id> --assignee bob # Assign
130
- bd update <id> --title "New title" # Update title
131
- bd update <id> --description "..." # Update description
132
- bd update <id> --notes "..." # Add notes
133
- bd update <id> --label-add urgent # Add label
134
-
135
- # Complete issues
136
- bd close <id> # Close single issue
137
- bd close <id1> <id2> <id3> # Close multiple (efficient)
138
- bd close <id> --reason "Completed auth" # Close with reason
139
- bd delete <id> # Delete issue
140
- bd delete <id> --cascade # Delete with dependents
141
- ```
142
-
143
- #### Workflow Commands
144
-
145
- ```bash
146
- # Find work
147
- bd ready # Issues with NO open blockers (start here!)
148
- bd ready --priority 1 # Filter ready work by priority
149
- bd blocked # Issues that ARE blocked
150
-
151
- # Dependencies
152
- bd dep add <child> <parent> # child depends on parent (blocks)
153
- bd dep add <child> <parent> --type related # Soft reference (no blocking)
154
- bd dep add <child> <parent> --type parent-child # Hierarchical
155
- bd dep remove <child> <parent> # Remove dependency
156
- bd dep tree <id> # Visualize dependency tree
157
- bd dep cycles # Detect cycles
158
-
159
- # Comments
160
- bd comments <id> # View comments
161
- bd comments <id> "Comment text" # Add comment
162
-
163
- # Git sync
164
- bd sync # Export to JSONL, commit, push
165
- bd sync --status # Check sync status
166
- bd hooks install # Install git hooks for auto-sync
167
-
168
- # Maintenance
169
- bd stats # Project statistics
170
- bd doctor # Check for issues
171
- bd admin compact --days 90 # Compact old closed issues
172
- ```
173
-
174
- #### Issue Statuses
175
-
176
- - `open` - Not started
177
- - `in_progress` - Being worked on
178
- - `blocked` - Waiting on something
179
- - `completed` - Done
180
- - `on_hold` - Paused
181
- - `cancelled` - Won't do
182
-
183
- #### Priority Levels
184
-
185
- | Priority | Meaning | Usage |
186
- |----------|---------|-------|
187
- | 0 (P0) | Critical | Drop everything, fix now |
188
- | 1 (P1) | High | Do this sprint |
189
- | 2 (P2) | Medium | Planned work |
190
- | 3 (P3) | Low | Nice to have |
191
- | 4 (P4) | Backlog | Someday/maybe |
192
-
193
- #### Dependency Types
194
-
195
- | Type | Blocks Ready? | Use Case |
196
- |------|---------------|----------|
197
- | `blocks` | YES | Hard dependency |
198
- | `related` | NO | Soft reference |
199
- | `parent-child` | YES | Hierarchy |
200
- | `discovered-from` | NO | Found during work |
201
-
202
- ### Session Workflow
203
-
204
- ```bash
205
- # Start of session
206
- bd ready # What can I work on?
207
- bd show <id> # Review the issue
208
- bd update <id> --status in_progress
209
-
210
- # During work
211
- bd comments <id> "Progress update"
212
- bd update <id> --notes "Found edge case"
213
-
214
- # End of session
215
- bd close <id> # If done, or:
216
- bd update <id> --status blocked --comment "Needs API response"
217
- bd sync # Always sync at end!
218
- ```
219
-
220
- ---
221
-
222
- ## MCP Servers
223
-
224
- ### Context7 - Library Documentation
225
-
226
- **Package**: `@upstash/context7-mcp@2` (pin to major version, not `@latest`)
227
- **Purpose**: Up-to-date documentation and code examples for any programming library
228
- **Used in**: `/plan` stage (Phase 2 research); any library lookup
229
-
230
- Context7 provides current documentation that may be more recent than the AI's training data.
231
-
232
- **Installation**:
233
-
234
- **Claude Code**: Add to `.mcp.json` in your project root:
235
-
236
-
237
- ```json
238
- {
239
- "mcpServers": {
240
- "context7": {
241
- "command": "bunx",
242
- "args": ["--bun", "@upstash/context7-mcp@latest"]
243
- }
244
- }
245
- }
246
- ```
247
-
248
- **Cline (VSCode)**:
249
- 1. Open VSCode Settings
250
- 2. Search for "Cline MCP"
251
- 3. Add Context7 server configuration
252
-
253
- **Cursor**: Check Cursor Settings → MCP Servers for configuration options
254
-
255
- **Other agents**: If your agent supports MCP, configure using the JSON format above
256
-
257
- **Usage**:
258
- ```
259
- # The AI will automatically use Context7 when you ask about libraries
260
- "How do I use React Query's useMutation hook?"
261
- "What's the latest Next.js App Router API?"
262
- "Show me Supabase RLS policy examples"
263
- ```
264
-
265
- **When to use Context7**:
266
- - Before implementing a library feature
267
- - When official docs may have changed since AI training
268
- - To verify API signatures and patterns
269
- - For current best practices
270
-
271
- ### grep.app - Code Search
272
-
273
- **Package**: `@ai-tools-all/grep_app_mcp` (recommended) or `@galprz/grep-mcp`
274
- **Website**: [grep.app](https://grep.app)
275
- **Purpose**: Search across 1M+ public GitHub repositories for real-world code examples
276
- **Used in**: `/plan` stage (Phase 2 research); finding implementation patterns
277
-
278
- grep.app provides code search across public GitHub repositories to find real-world examples and patterns.
279
-
280
- **Installation (Claude Code)**:
281
-
282
- Add to `.mcp.json` in your project root:
283
-
284
- ```json
285
- {
286
- "mcpServers": {
287
- "context7": {
288
- "command": "bunx",
289
- "args": ["--bun", "@upstash/context7-mcp@latest"]
290
- },
291
- "grep-app": {
292
- "command": "bunx",
293
- "args": ["--bun", "@ai-tools-all/grep_app_mcp"]
294
- }
295
- }
296
- }
297
- ```
298
-
299
- **Usage**:
300
- ```
301
- # The AI will use grep.app when you need real-world examples
302
- "Find examples of React useEffect cleanup patterns"
303
- "Show me how others implement JWT authentication in Express"
304
- "Search for rate limiting implementations in Node.js"
305
- ```
306
-
307
- **When to use grep.app**:
308
-
309
- - Finding real-world implementation examples
310
- - Discovering coding patterns in production code
311
- - Validating implementation approaches
312
- - Learning from open source projects
313
-
314
- **Context7 vs grep.app**:
315
-
316
- | Tool | Purpose | Use When |
317
- |----------------|--------------------------------|-------------------------------------------|
318
- | **Context7** | Official library documentation | You need API reference, official patterns |
319
- | **grep.app** | Real code in the wild | You want to see how others solve problems |
320
-
321
- ---
322
-
323
- ## External Services
324
-
325
- ### Parallel AI - Web Research
326
-
327
- **Website**: [platform.parallel.ai](https://platform.parallel.ai)
328
- **Used in**: `/plan` stage (Phase 2 research)
329
-
330
- 4 APIs for research:
331
- - **Search** - Web search with AI analysis
332
- - **Extract** - Scrape specific URLs
333
- - **Task** - Structured data enrichment
334
- - **Deep Research** - Multi-source analysis
335
-
336
- ```bash
337
- # Setup
338
- # 1. Get key from https://platform.parallel.ai
339
- # 2. Add to .env.local
340
- PARALLEL_API_KEY=your-key
341
-
342
- # Test
343
- API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
344
- curl -s -X POST "https://api.parallel.ai/v1beta/search" \
345
- -H "x-api-key: $API_KEY" \
346
- -H "Content-Type: application/json" \
347
- -H "parallel-beta: search-extract-2025-10-10" \
348
- -d '{"objective": "Next.js authentication best practices 2026"}'
349
- ```
350
-
351
- ---
352
-
353
- ## Code Review Tools
354
-
355
- Choose ONE code review tool based on your needs:
356
-
357
- | Tool | Pricing | Best For | Setup |
358
- |------|---------|----------|-------|
359
- | **GitHub Code Quality** | FREE | All GitHub repos | Built-in, zero setup |
360
- | **CodeRabbit** | FREE (OSS) | Open source projects | GitHub App |
361
- | **Greptile** | $99+/mo | Enterprise | API key |
362
-
363
- ### Option 1: GitHub Code Quality (FREE, Recommended)
364
-
365
- **Status**: Built-in to GitHub
366
- **Used in**: `/review` stage
367
-
368
- Zero setup required - GitHub's code quality features are enabled by default.
369
-
370
- Features:
371
- - Automatic code scanning
372
- - Dependency vulnerability alerts
373
- - Secret scanning
374
- - Code navigation
375
-
376
- ### Option 2: CodeRabbit (FREE for Open Source)
377
-
378
- **Website**: [coderabbit.ai](https://coderabbit.ai)
379
- **Used in**: `/review` stage
380
-
381
- AI-powered code review with deep context understanding.
382
-
383
- ```bash
384
- # Setup
385
- # 1. Go to https://coderabbit.ai
386
- # 2. Install the GitHub App
387
- # 3. Enable for your repositories
388
-
389
- # Configuration (optional)
390
- # Create .coderabbit.yaml in repo root
391
- ```
392
-
393
- ### Option 3: Greptile (Paid - Enterprise)
394
-
395
- **Website**: [greptile.com](https://greptile.com)
396
- **Used in**: `/review` stage
397
-
398
- Enterprise-grade AI code review that understands your codebase.
399
-
400
- ```bash
401
- # Setup
402
- # 1. Get key from https://app.greptile.com
403
- # 2. Add to .env.local
404
- GREPTILE_API_KEY=your-key
405
-
406
- # 3. Index repository (one-time)
407
- curl -X POST "https://api.greptile.com/v2/repositories" \
408
- -H "Authorization: Bearer $GREPTILE_API_KEY" \
409
- -H "Content-Type: application/json" \
410
- -d '{"remote": "github", "repository": "owner/repo"}'
411
- ```
412
-
413
- ---
414
-
415
- ## Code Quality Tools
416
-
417
- Choose ONE code quality scanner based on your needs:
418
-
419
- | Tool | Pricing | Best For | Requirement |
420
- |------|---------|----------|-------------|
421
- | **ESLint** | FREE | All projects | Built-in |
422
- | **SonarCloud** | 50k LoC free | Cloud-first teams | API key |
423
- | **SonarQube Community** | FREE | Self-hosted, unlimited | Docker |
424
-
425
- ### Option 1: ESLint Only (FREE, Recommended)
426
-
427
- **Status**: Built-in
428
- **Used in**: `/validate` stage
429
-
430
- No external server required - uses your project's linting configuration.
431
-
432
- ```bash
433
- # Already configured via package.json or eslint.config.js
434
- bun run lint
435
- ```
436
-
437
- ### Option 2: SonarCloud (Cloud-Hosted)
438
-
439
- **Website**: [sonarcloud.io](https://sonarcloud.io)
440
- **Used in**: `/validate` stage
441
- **Free Tier**: 50,000 lines of code
442
-
443
- Static analysis for bugs, vulnerabilities, code smells.
444
-
445
- ```bash
446
- # Setup
447
- # 1. Create project at https://sonarcloud.io
448
- # 2. Get token from Security settings
449
- # 3. Add to .env.local
450
- SONAR_TOKEN=your-token
451
- SONAR_ORGANIZATION=your-org
452
- SONAR_PROJECT_KEY=your-project
453
-
454
- # 4. Create sonar-project.properties
455
- echo "sonar.organization=$SONAR_ORGANIZATION
456
- sonar.projectKey=$SONAR_PROJECT_KEY
457
- sonar.sources=src" > sonar-project.properties
458
-
459
- # 5. Run analysis
460
- bunx sonarqube-scanner
461
- ```
462
-
463
- ### Option 3: SonarQube Community (Self-Hosted, FREE)
464
-
465
- **Website**: [sonarqube.org](https://www.sonarsource.com/products/sonarqube/)
466
- **Used in**: `/validate` stage
467
- **Pricing**: FREE, unlimited lines of code
468
-
469
- Self-hosted code quality analysis - no cloud dependency.
470
-
471
- ```bash
472
- # Setup with Docker
473
- docker run -d --name sonarqube \
474
- -p 9000:9000 \
475
- sonarqube:community
476
-
477
- # Access at http://localhost:9000
478
- # Default credentials: admin/admin
479
-
480
- # Add to .env.local
481
- SONARQUBE_URL=http://localhost:9000
482
- SONARQUBE_TOKEN=your-token # Generate in SonarQube UI
483
-
484
- # Create sonar-project.properties
485
- echo "sonar.host.url=$SONARQUBE_URL
486
- sonar.login=$SONARQUBE_TOKEN
487
- sonar.projectKey=your-project
488
- sonar.sources=src" > sonar-project.properties
489
-
490
- # Run analysis
491
- bunx sonarqube-scanner
492
- ```
493
-
494
- **Docker Compose (Production)**:
495
- ```yaml
496
- # docker-compose.yml
497
- version: '3'
498
- services:
499
- sonarqube:
500
- image: sonarqube:community
501
- ports:
502
- - "9000:9000"
503
- environment:
504
- - SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
505
- volumes:
506
- - sonarqube_data:/opt/sonarqube/data
507
- - sonarqube_logs:/opt/sonarqube/logs
508
-
509
- volumes:
510
- sonarqube_data:
511
- sonarqube_logs:
512
- ```
513
-
514
- ---
515
-
516
- ### GitHub CLI - PR Workflow
517
-
518
- **Installation**: [cli.github.com](https://cli.github.com)
519
- **Used in**: `/ship`, `/review`, `/premerge` stages
520
-
521
- ```bash
522
- # Install
523
- # macOS: brew install gh
524
- # Windows: winget install GitHub.cli
525
- # Linux: sudo apt install gh
526
-
527
- # Authenticate
528
- gh auth login
529
-
530
- # Common commands
531
- gh pr create --title "..." --body "..."
532
- gh pr view <number>
533
- gh pr checks <number>
534
- gh pr merge <number> --squash --delete-branch
535
- gh issue create --title "..." --body "..."
536
- ```
537
-
538
- ---
539
-
540
- ## Integration with Forge Stages
541
-
542
- | Stage | Tools Used |
543
- |-------|------------|
544
- | `/status` | `bd ready`, `bd list`, `git status` |
545
- | `/plan` (Phase 2) | Parallel AI, Context7, grep.app, codebase exploration |
546
- | `/plan` | `bd create`, `git checkout -b` |
547
- | `/dev` | Tests, code, `bd update`, `/tasks save` |
548
- | `/validate` | Type check, lint, tests, SonarCloud |
549
- | `/ship` | `bd update --status done`, `gh pr create` |
550
- | `/review` | `gh pr view`, Greptile, SonarCloud |
551
- | `/premerge` | `bd sync`, doc updates, hand off PR |
552
- | `/verify` | Documentation cross-check |
553
-
554
- ---
555
-
556
- ## Quick Reference Card
557
-
558
- ### Beads (Issue Tracking)
559
-
560
- ```bash
561
- bd init # Initialize
562
- bd ready # Find unblocked work
563
- bd create "Title" # Create issue
564
- bd show <id> # View details
565
- bd update <id> --status X # Update status
566
- bd dep add <a> <b> # a depends on b
567
- bd close <id> # Complete
568
- bd sync # Git sync
569
- ```
570
-
571
- ### GitHub CLI
572
-
573
- ```bash
574
- gh auth login # Authenticate
575
- gh pr create # Create PR
576
- gh pr view <n> # View PR
577
- gh pr checks <n> # Check status
578
- gh pr merge <n> --squash # Merge
579
- ```
580
-
581
- ---
582
-
583
- ## Troubleshooting
584
-
585
- ### Beads
586
-
587
- **"bd: command not found"**
588
- ```bash
589
- # macOS / Linux
590
- bun add -g @beads/bd
591
- # Or use bunx @beads/bd <command>
592
-
593
- # Windows — use PowerShell installer
594
- irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
595
- ```
596
-
597
- **Windows EPERM error during `npm install -g @beads/bd`**
598
- ```bash
599
- # npm @beads/bd has a known EPERM bug on Windows (Issue #1031)
600
- # Use the PowerShell installer instead:
601
- irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
602
- ```
603
-
604
- **"database locked"**
605
- ```bash
606
- bd sync --force
607
- ```
608
-
609
- **Issues not showing after git pull**
610
- ```bash
611
- bd sync # Re-imports from JSONL
612
- ```
613
-
614
- ### GitHub CLI
615
-
616
- **"gh: not authenticated"**
617
- ```bash
618
- gh auth login
619
- gh auth status
620
- ```
621
-
622
- ---
623
-
624
- ## Resources
625
-
626
- - **Beads**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
627
- - **Parallel AI**: [platform.parallel.ai](https://platform.parallel.ai)
628
- - **Greptile**: [greptile.com](https://greptile.com)
629
- - **SonarCloud**: [sonarcloud.io](https://sonarcloud.io)
630
- - **GitHub CLI**: [cli.github.com](https://cli.github.com)
1
+ # Forge Toolchain Reference
2
+
3
+ Complete reference for all tools integrated with the Forge workflow.
4
+
5
+ ## Overview
6
+
7
+ ```
8
+ ┌─────────────────────────────────────────────────────────────────┐
9
+ │ FORGE TOOLCHAIN │
10
+ ├─────────────────────────────────────────────────────────────────┤
11
+ │ │
12
+ │ ┌─────────────┐ ┌─────────────────────┐ │
13
+ │ │ BEADS │ │ EXTERNAL SERVICES │ │
14
+ │ │ (bd) │ │ │ │
15
+ │ │ │ │ Parallel AI │ │
16
+ │ │ Git-backed │ │ Greptile │ │
17
+ │ │ Issue │ │ SonarCloud │ │
18
+ │ │ Tracking │ │ GitHub CLI │ │
19
+ │ └─────────────┘ └─────────────────────┘ │
20
+ │ │ │ │
21
+ │ └─────────────────────┘ │
22
+ │ │ │
23
+ │ ┌─────▼─────┐ │
24
+ │ │ FORGE │ │
25
+ │ │ 7-Stage │ │
26
+ │ │ Workflow │ │
27
+ │ └───────────┘ │
28
+ │ │
29
+ └─────────────────────────────────────────────────────────────────┘
30
+ ```
31
+
32
+ ---
33
+
34
+ ## Beads - Git-Backed Issue Tracking
35
+
36
+ **Package**: `@beads/bd`
37
+ **Repository**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
38
+ **Purpose**: Distributed issue tracking designed for AI coding agents
39
+
40
+ ### Why Beads?
41
+
42
+ - **Persists across sessions** - Issues survive context clearing, compaction, new chats
43
+ - **Git-backed** - Version controlled, mergeable, team-shareable
44
+ - **Dependency tracking** - Know what blocks what
45
+ - **Ready detection** - `bd ready` finds unblocked work automatically
46
+ - **AI-optimized** - JSON output, semantic compaction, audit trails
47
+
48
+ ### Installation
49
+
50
+ **Auto-installation** (Recommended):
51
+ ```bash
52
+ bunx forge setup
53
+ # Prompts: "Install Beads? (y/n)"
54
+ # Automatically installs and initializes
55
+ # On Windows: uses PowerShell installer (npm @beads/bd has an EPERM bug on Windows)
56
+ ```
57
+
58
+ **Manual installation**:
59
+ ```bash
60
+ # macOS / Linux (global)
61
+ bun add -g @beads/bd
62
+ bd init
63
+
64
+ # macOS / Linux (local)
65
+ bun add -d @beads/bd
66
+ bunx bd init
67
+
68
+ # Windows (global) — use PowerShell installer, NOT npm/bun add -g
69
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
70
+ bd init
71
+
72
+ # Or with bunx (macOS/Linux, no install needed)
73
+ bunx @beads/bd init
74
+ ```
75
+
76
+ > **Windows note**: The `npm install -g @beads/bd` postinstall script uses `Expand-Archive`, which triggers an EPERM file-locking error on Windows (issue #1031, closed "not planned"). Use the PowerShell installer above instead.
77
+
78
+ ### File Structure
79
+
80
+ After `bd init`, creates `.beads/` directory:
81
+
82
+ ```
83
+ .beads/
84
+ ├── issues.jsonl # Issue data (git-tracked, one JSON per line)
85
+ ├── beads.db # SQLite cache (git-ignored, fast queries)
86
+ ├── metadata.json # Database metadata
87
+ ├── config.yaml # User configuration
88
+ ├── interactions.jsonl # Agent audit log
89
+ └── .gitignore # Ignores beads.db
90
+ ```
91
+
92
+ **Dual-database architecture**: JSONL for git versioning, SQLite for fast local queries. Background daemon keeps them in sync.
93
+
94
+ ### Complete Command Reference
95
+
96
+ #### Initialization
97
+
98
+ ```bash
99
+ bd init # Initialize in project
100
+ bd init --stealth # Local-only (don't commit to repo)
101
+ bd init --contributor # Contributor mode
102
+ bd init --prefix PROJ # Custom issue prefix (PROJ-xxx)
103
+ ```
104
+
105
+ #### Issue Management
106
+
107
+ ```bash
108
+ # Create issues
109
+ bd create "Title" # Basic issue
110
+ bd create "Title" --type feature # With type (feature, bug, chore, etc.)
111
+ bd create "Title" --priority 1 # With priority (0=critical, 4=backlog)
112
+ bd create "Title" -p 0 -l "urgent,backend" # P0 with labels
113
+
114
+ # View issues
115
+ bd show <id> # Detailed view with audit trail
116
+ bd list # All issues
117
+ bd list --status open # Filter by status
118
+ bd list --priority 1 # Filter by priority
119
+ bd list --assignee bob # Filter by assignee
120
+ bd list --label bug # Filter by label (AND logic)
121
+ bd list --label-any bug,urgent # Filter by label (OR logic)
122
+ bd list --type feature # Filter by type
123
+ bd list --title-contains "auth" # Search titles
124
+ bd list --limit 10 # Limit results
125
+
126
+ # Update issues
127
+ bd update <id> --status in_progress # Change status
128
+ bd update <id> --priority 2 # Change priority
129
+ bd update <id> --assignee bob # Assign
130
+ bd update <id> --title "New title" # Update title
131
+ bd update <id> --description "..." # Update description
132
+ bd update <id> --notes "..." # Add notes
133
+ bd update <id> --label-add urgent # Add label
134
+
135
+ # Complete issues
136
+ bd close <id> # Close single issue
137
+ bd close <id1> <id2> <id3> # Close multiple (efficient)
138
+ bd close <id> --reason "Completed auth" # Close with reason
139
+ bd delete <id> # Delete issue
140
+ bd delete <id> --cascade # Delete with dependents
141
+ ```
142
+
143
+ #### Workflow Commands
144
+
145
+ ```bash
146
+ # Find work
147
+ bd ready # Issues with NO open blockers (start here!)
148
+ bd ready --priority 1 # Filter ready work by priority
149
+ bd blocked # Issues that ARE blocked
150
+
151
+ # Dependencies
152
+ bd dep add <child> <parent> # child depends on parent (blocks)
153
+ bd dep add <child> <parent> --type related # Soft reference (no blocking)
154
+ bd dep add <child> <parent> --type parent-child # Hierarchical
155
+ bd dep remove <child> <parent> # Remove dependency
156
+ bd dep tree <id> # Visualize dependency tree
157
+ bd dep cycles # Detect cycles
158
+
159
+ # Comments
160
+ bd comments <id> # View comments
161
+ bd comments <id> "Comment text" # Add comment
162
+
163
+ # Git sync
164
+ bd sync # Export to JSONL, commit, push
165
+ bd sync --status # Check sync status
166
+ bd hooks install # Install git hooks for auto-sync
167
+
168
+ # Maintenance
169
+ bd stats # Project statistics
170
+ bd doctor # Check for issues
171
+ bd admin compact --days 90 # Compact old closed issues
172
+ ```
173
+
174
+ #### Issue Statuses
175
+
176
+ - `open` - Not started
177
+ - `in_progress` - Being worked on
178
+ - `blocked` - Waiting on something
179
+ - `completed` - Done
180
+ - `on_hold` - Paused
181
+ - `cancelled` - Won't do
182
+
183
+ #### Priority Levels
184
+
185
+ | Priority | Meaning | Usage |
186
+ |----------|---------|-------|
187
+ | 0 (P0) | Critical | Drop everything, fix now |
188
+ | 1 (P1) | High | Do this sprint |
189
+ | 2 (P2) | Medium | Planned work |
190
+ | 3 (P3) | Low | Nice to have |
191
+ | 4 (P4) | Backlog | Someday/maybe |
192
+
193
+ #### Dependency Types
194
+
195
+ | Type | Blocks Ready? | Use Case |
196
+ |------|---------------|----------|
197
+ | `blocks` | YES | Hard dependency |
198
+ | `related` | NO | Soft reference |
199
+ | `parent-child` | YES | Hierarchy |
200
+ | `discovered-from` | NO | Found during work |
201
+
202
+ ### Session Workflow
203
+
204
+ ```bash
205
+ # Start of session
206
+ bd ready # What can I work on?
207
+ bd show <id> # Review the issue
208
+ bd update <id> --status in_progress
209
+
210
+ # During work
211
+ bd comments <id> "Progress update"
212
+ bd update <id> --notes "Found edge case"
213
+
214
+ # End of session
215
+ bd close <id> # If done, or:
216
+ bd update <id> --status blocked --comment "Needs API response"
217
+ bd sync # Always sync at end!
218
+ ```
219
+
220
+ ---
221
+
222
+ ## MCP Servers
223
+
224
+ ### Context7 - Library Documentation
225
+
226
+ **Package**: `@upstash/context7-mcp@2` (pin to major version, not `@latest`)
227
+ **Purpose**: Up-to-date documentation and code examples for any programming library
228
+ **Used in**: `/plan` stage (Phase 2 research); any library lookup
229
+
230
+ Context7 provides current documentation that may be more recent than the AI's training data.
231
+
232
+ **Installation**:
233
+
234
+ **Claude Code**: Add to `.mcp.json` in your project root:
235
+
236
+
237
+ ```json
238
+ {
239
+ "mcpServers": {
240
+ "context7": {
241
+ "command": "bunx",
242
+ "args": ["--bun", "@upstash/context7-mcp@latest"]
243
+ }
244
+ }
245
+ }
246
+ ```
247
+
248
+ **Cline (VSCode)**:
249
+ 1. Open VSCode Settings
250
+ 2. Search for "Cline MCP"
251
+ 3. Add Context7 server configuration
252
+
253
+ **Cursor**: Check Cursor Settings → MCP Servers for configuration options
254
+
255
+ **Other agents**: If your agent supports MCP, configure using the JSON format above
256
+
257
+ **Usage**:
258
+ ```
259
+ # The AI will automatically use Context7 when you ask about libraries
260
+ "How do I use React Query's useMutation hook?"
261
+ "What's the latest Next.js App Router API?"
262
+ "Show me Supabase RLS policy examples"
263
+ ```
264
+
265
+ **When to use Context7**:
266
+ - Before implementing a library feature
267
+ - When official docs may have changed since AI training
268
+ - To verify API signatures and patterns
269
+ - For current best practices
270
+
271
+ ### grep.app - Code Search
272
+
273
+ **Package**: `@ai-tools-all/grep_app_mcp` (recommended) or `@galprz/grep-mcp`
274
+ **Website**: [grep.app](https://grep.app)
275
+ **Purpose**: Search across 1M+ public GitHub repositories for real-world code examples
276
+ **Used in**: `/plan` stage (Phase 2 research); finding implementation patterns
277
+
278
+ grep.app provides code search across public GitHub repositories to find real-world examples and patterns.
279
+
280
+ **Installation (Claude Code)**:
281
+
282
+ Add to `.mcp.json` in your project root:
283
+
284
+ ```json
285
+ {
286
+ "mcpServers": {
287
+ "context7": {
288
+ "command": "bunx",
289
+ "args": ["--bun", "@upstash/context7-mcp@latest"]
290
+ },
291
+ "grep-app": {
292
+ "command": "bunx",
293
+ "args": ["--bun", "@ai-tools-all/grep_app_mcp"]
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ **Usage**:
300
+ ```
301
+ # The AI will use grep.app when you need real-world examples
302
+ "Find examples of React useEffect cleanup patterns"
303
+ "Show me how others implement JWT authentication in Express"
304
+ "Search for rate limiting implementations in Node.js"
305
+ ```
306
+
307
+ **When to use grep.app**:
308
+
309
+ - Finding real-world implementation examples
310
+ - Discovering coding patterns in production code
311
+ - Validating implementation approaches
312
+ - Learning from open source projects
313
+
314
+ **Context7 vs grep.app**:
315
+
316
+ | Tool | Purpose | Use When |
317
+ |----------------|--------------------------------|-------------------------------------------|
318
+ | **Context7** | Official library documentation | You need API reference, official patterns |
319
+ | **grep.app** | Real code in the wild | You want to see how others solve problems |
320
+
321
+ ---
322
+
323
+ ## External Services
324
+
325
+ ### Parallel AI - Web Research
326
+
327
+ **Website**: [platform.parallel.ai](https://platform.parallel.ai)
328
+ **Used in**: `/plan` stage (Phase 2 research)
329
+
330
+ 4 APIs for research:
331
+ - **Search** - Web search with AI analysis
332
+ - **Extract** - Scrape specific URLs
333
+ - **Task** - Structured data enrichment
334
+ - **Deep Research** - Multi-source analysis
335
+
336
+ ```bash
337
+ # Setup
338
+ # 1. Get key from https://platform.parallel.ai
339
+ # 2. Add to .env.local
340
+ PARALLEL_API_KEY=your-key
341
+
342
+ # Test
343
+ API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
344
+ curl -s -X POST "https://api.parallel.ai/v1beta/search" \
345
+ -H "x-api-key: $API_KEY" \
346
+ -H "Content-Type: application/json" \
347
+ -H "parallel-beta: search-extract-2025-10-10" \
348
+ -d '{"objective": "Next.js authentication best practices 2026"}'
349
+ ```
350
+
351
+ ---
352
+
353
+ ## Code Review Tools
354
+
355
+ Choose ONE code review tool based on your needs:
356
+
357
+ | Tool | Pricing | Best For | Setup |
358
+ |------|---------|----------|-------|
359
+ | **GitHub Code Quality** | FREE | All GitHub repos | Built-in, zero setup |
360
+ | **CodeRabbit** | FREE (OSS) | Open source projects | GitHub App |
361
+ | **Greptile** | $99+/mo | Enterprise | API key |
362
+
363
+ ### Option 1: GitHub Code Quality (FREE, Recommended)
364
+
365
+ **Status**: Built-in to GitHub
366
+ **Used in**: `/review` stage
367
+
368
+ Zero setup required - GitHub's code quality features are enabled by default.
369
+
370
+ Features:
371
+ - Automatic code scanning
372
+ - Dependency vulnerability alerts
373
+ - Secret scanning
374
+ - Code navigation
375
+
376
+ ### Option 2: CodeRabbit (FREE for Open Source)
377
+
378
+ **Website**: [coderabbit.ai](https://coderabbit.ai)
379
+ **Used in**: `/review` stage
380
+
381
+ AI-powered code review with deep context understanding.
382
+
383
+ ```bash
384
+ # Setup
385
+ # 1. Go to https://coderabbit.ai
386
+ # 2. Install the GitHub App
387
+ # 3. Enable for your repositories
388
+
389
+ # Configuration (optional)
390
+ # Create .coderabbit.yaml in repo root
391
+ ```
392
+
393
+ ### Option 3: Greptile (Paid - Enterprise)
394
+
395
+ **Website**: [greptile.com](https://greptile.com)
396
+ **Used in**: `/review` stage
397
+
398
+ Enterprise-grade AI code review that understands your codebase.
399
+
400
+ ```bash
401
+ # Setup
402
+ # 1. Get key from https://app.greptile.com
403
+ # 2. Add to .env.local
404
+ GREPTILE_API_KEY=your-key
405
+
406
+ # 3. Index repository (one-time)
407
+ curl -X POST "https://api.greptile.com/v2/repositories" \
408
+ -H "Authorization: Bearer $GREPTILE_API_KEY" \
409
+ -H "Content-Type: application/json" \
410
+ -d '{"remote": "github", "repository": "owner/repo"}'
411
+ ```
412
+
413
+ ---
414
+
415
+ ## Code Quality Tools
416
+
417
+ Choose ONE code quality scanner based on your needs:
418
+
419
+ | Tool | Pricing | Best For | Requirement |
420
+ |------|---------|----------|-------------|
421
+ | **ESLint** | FREE | All projects | Built-in |
422
+ | **SonarCloud** | 50k LoC free | Cloud-first teams | API key |
423
+ | **SonarQube Community** | FREE | Self-hosted, unlimited | Docker |
424
+
425
+ ### Option 1: ESLint Only (FREE, Recommended)
426
+
427
+ **Status**: Built-in
428
+ **Used in**: `/validate` stage
429
+
430
+ No external server required - uses your project's linting configuration.
431
+
432
+ ```bash
433
+ # Already configured via package.json or eslint.config.js
434
+ bun run lint
435
+ ```
436
+
437
+ ### Option 2: SonarCloud (Cloud-Hosted)
438
+
439
+ **Website**: [sonarcloud.io](https://sonarcloud.io)
440
+ **Used in**: `/validate` stage
441
+ **Free Tier**: 50,000 lines of code
442
+
443
+ Static analysis for bugs, vulnerabilities, code smells.
444
+
445
+ ```bash
446
+ # Setup
447
+ # 1. Create project at https://sonarcloud.io
448
+ # 2. Get token from Security settings
449
+ # 3. Add to .env.local
450
+ SONAR_TOKEN=your-token
451
+ SONAR_ORGANIZATION=your-org
452
+ SONAR_PROJECT_KEY=your-project
453
+
454
+ # 4. Create sonar-project.properties
455
+ echo "sonar.organization=$SONAR_ORGANIZATION
456
+ sonar.projectKey=$SONAR_PROJECT_KEY
457
+ sonar.sources=src" > sonar-project.properties
458
+
459
+ # 5. Run analysis
460
+ bunx sonarqube-scanner
461
+ ```
462
+
463
+ ### Option 3: SonarQube Community (Self-Hosted, FREE)
464
+
465
+ **Website**: [sonarqube.org](https://www.sonarsource.com/products/sonarqube/)
466
+ **Used in**: `/validate` stage
467
+ **Pricing**: FREE, unlimited lines of code
468
+
469
+ Self-hosted code quality analysis - no cloud dependency.
470
+
471
+ ```bash
472
+ # Setup with Docker
473
+ docker run -d --name sonarqube \
474
+ -p 9000:9000 \
475
+ sonarqube:community
476
+
477
+ # Access at http://localhost:9000
478
+ # Default credentials: admin/admin
479
+
480
+ # Add to .env.local
481
+ SONARQUBE_URL=http://localhost:9000
482
+ SONARQUBE_TOKEN=your-token # Generate in SonarQube UI
483
+
484
+ # Create sonar-project.properties
485
+ echo "sonar.host.url=$SONARQUBE_URL
486
+ sonar.login=$SONARQUBE_TOKEN
487
+ sonar.projectKey=your-project
488
+ sonar.sources=src" > sonar-project.properties
489
+
490
+ # Run analysis
491
+ bunx sonarqube-scanner
492
+ ```
493
+
494
+ **Docker Compose (Production)**:
495
+ ```yaml
496
+ # docker-compose.yml
497
+ version: '3'
498
+ services:
499
+ sonarqube:
500
+ image: sonarqube:community
501
+ ports:
502
+ - "9000:9000"
503
+ environment:
504
+ - SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
505
+ volumes:
506
+ - sonarqube_data:/opt/sonarqube/data
507
+ - sonarqube_logs:/opt/sonarqube/logs
508
+
509
+ volumes:
510
+ sonarqube_data:
511
+ sonarqube_logs:
512
+ ```
513
+
514
+ ---
515
+
516
+ ### GitHub CLI - PR Workflow
517
+
518
+ **Installation**: [cli.github.com](https://cli.github.com)
519
+ **Used in**: `/ship`, `/review`, `/premerge` stages
520
+
521
+ ```bash
522
+ # Install
523
+ # macOS: brew install gh
524
+ # Windows: winget install GitHub.cli
525
+ # Linux: sudo apt install gh
526
+
527
+ # Authenticate
528
+ gh auth login
529
+
530
+ # Common commands
531
+ gh pr create --title "..." --body "..."
532
+ gh pr view <number>
533
+ gh pr checks <number>
534
+ gh pr merge <number> --squash --delete-branch
535
+ gh issue create --title "..." --body "..."
536
+ ```
537
+
538
+ ---
539
+
540
+ ## Integration with Forge Stages
541
+
542
+ | Stage | Tools Used |
543
+ |-------|------------|
544
+ | `/status` | `bd ready`, `bd list`, `git status` |
545
+ | `/plan` (Phase 2) | Parallel AI, Context7, grep.app, codebase exploration |
546
+ | `/plan` | `bd create`, `git checkout -b` |
547
+ | `/dev` | Tests, code, `bd update`, `/tasks save` |
548
+ | `/validate` | Type check, lint, tests, SonarCloud |
549
+ | `/ship` | `bd update --status done`, `gh pr create` |
550
+ | `/review` | `gh pr view`, Greptile, SonarCloud |
551
+ | `/premerge` | `bd sync`, doc updates, hand off PR |
552
+ | `/verify` | Documentation cross-check |
553
+
554
+ ---
555
+
556
+ ## Quick Reference Card
557
+
558
+ ### Beads (Issue Tracking)
559
+
560
+ ```bash
561
+ bd init # Initialize
562
+ bd ready # Find unblocked work
563
+ bd create "Title" # Create issue
564
+ bd show <id> # View details
565
+ bd update <id> --status X # Update status
566
+ bd dep add <a> <b> # a depends on b
567
+ bd close <id> # Complete
568
+ bd sync # Git sync
569
+ ```
570
+
571
+ ### GitHub CLI
572
+
573
+ ```bash
574
+ gh auth login # Authenticate
575
+ gh pr create # Create PR
576
+ gh pr view <n> # View PR
577
+ gh pr checks <n> # Check status
578
+ gh pr merge <n> --squash # Merge
579
+ ```
580
+
581
+ ---
582
+
583
+ ## Troubleshooting
584
+
585
+ ### Beads
586
+
587
+ **"bd: command not found"**
588
+ ```bash
589
+ # macOS / Linux
590
+ bun add -g @beads/bd
591
+ # Or use bunx @beads/bd <command>
592
+
593
+ # Windows — use PowerShell installer
594
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
595
+ ```
596
+
597
+ **Windows EPERM error during `npm install -g @beads/bd`**
598
+ ```bash
599
+ # npm @beads/bd has a known EPERM bug on Windows (Issue #1031)
600
+ # Use the PowerShell installer instead:
601
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
602
+ ```
603
+
604
+ **"database locked"**
605
+ ```bash
606
+ bd sync --force
607
+ ```
608
+
609
+ **Issues not showing after git pull**
610
+ ```bash
611
+ bd sync # Re-imports from JSONL
612
+ ```
613
+
614
+ ### GitHub CLI
615
+
616
+ **"gh: not authenticated"**
617
+ ```bash
618
+ gh auth login
619
+ gh auth status
620
+ ```
621
+
622
+ ---
623
+
624
+ ## Resources
625
+
626
+ - **Beads**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
627
+ - **Parallel AI**: [platform.parallel.ai](https://platform.parallel.ai)
628
+ - **Greptile**: [greptile.com](https://greptile.com)
629
+ - **SonarCloud**: [sonarcloud.io](https://sonarcloud.io)
630
+ - **GitHub CLI**: [cli.github.com](https://cli.github.com)