forge-workflow 0.0.1

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 (105) hide show
  1. package/.claude/commands/dev.md +314 -0
  2. package/.claude/commands/plan.md +389 -0
  3. package/.claude/commands/premerge.md +179 -0
  4. package/.claude/commands/research.md +42 -0
  5. package/.claude/commands/review.md +442 -0
  6. package/.claude/commands/rollback.md +721 -0
  7. package/.claude/commands/ship.md +134 -0
  8. package/.claude/commands/sonarcloud.md +152 -0
  9. package/.claude/commands/status.md +77 -0
  10. package/.claude/commands/validate.md +237 -0
  11. package/.claude/commands/verify.md +221 -0
  12. package/.claude/rules/greptile-review-process.md +285 -0
  13. package/.claude/rules/workflow.md +105 -0
  14. package/.claude/scripts/greptile-resolve.sh +526 -0
  15. package/.claude/scripts/load-env.sh +32 -0
  16. package/.forge/hooks/check-tdd.js +240 -0
  17. package/.github/PLUGIN_TEMPLATE.json +32 -0
  18. package/.mcp.json.example +12 -0
  19. package/AGENTS.md +169 -0
  20. package/CLAUDE.md +99 -0
  21. package/LICENSE +21 -0
  22. package/README.md +414 -0
  23. package/bin/forge-cmd.js +313 -0
  24. package/bin/forge-validate.js +303 -0
  25. package/bin/forge.js +4228 -0
  26. package/docs/AGENT_INSTALL_PROMPT.md +342 -0
  27. package/docs/ENHANCED_ONBOARDING.md +602 -0
  28. package/docs/EXAMPLES.md +482 -0
  29. package/docs/GREPTILE_SETUP.md +400 -0
  30. package/docs/MANUAL_REVIEW_GUIDE.md +106 -0
  31. package/docs/ROADMAP.md +359 -0
  32. package/docs/SETUP.md +632 -0
  33. package/docs/TOOLCHAIN.md +849 -0
  34. package/docs/VALIDATION.md +363 -0
  35. package/docs/WORKFLOW.md +400 -0
  36. package/docs/planning/PROGRESS.md +396 -0
  37. package/docs/plans/.gitkeep +0 -0
  38. package/docs/plans/2026-02-27-forge-test-suite-v2-decisions.md +21 -0
  39. package/docs/plans/2026-02-27-forge-test-suite-v2-design.md +362 -0
  40. package/docs/plans/2026-02-27-forge-test-suite-v2-tasks.md +343 -0
  41. package/docs/plans/2026-03-02-superpowers-gaps-decisions.md +26 -0
  42. package/docs/plans/2026-03-02-superpowers-gaps-design.md +239 -0
  43. package/docs/plans/2026-03-02-superpowers-gaps-tasks.md +260 -0
  44. package/docs/plans/2026-03-04-agent-command-parity-design.md +163 -0
  45. package/docs/plans/2026-03-04-verify-worktree-cleanup-decisions.md +7 -0
  46. package/docs/plans/2026-03-04-verify-worktree-cleanup-design.md +165 -0
  47. package/docs/plans/2026-03-05-forge-uto-decisions.md +6 -0
  48. package/docs/plans/2026-03-05-forge-uto-design.md +116 -0
  49. package/docs/plans/2026-03-05-forge-uto-tasks.md +244 -0
  50. package/docs/plans/2026-03-10-command-creator-and-eval-decisions.md +52 -0
  51. package/docs/plans/2026-03-10-command-creator-and-eval-design.md +350 -0
  52. package/docs/plans/2026-03-10-command-creator-and-eval-tasks.md +426 -0
  53. package/docs/plans/2026-03-10-stale-workflow-refs-decisions.md +8 -0
  54. package/docs/plans/2026-03-10-stale-workflow-refs-design.md +80 -0
  55. package/docs/plans/2026-03-10-stale-workflow-refs-tasks.md +90 -0
  56. package/docs/plans/2026-03-14-beads-plan-context-decisions.md +9 -0
  57. package/docs/plans/2026-03-14-beads-plan-context-design.md +171 -0
  58. package/docs/plans/2026-03-14-beads-plan-context-tasks.md +160 -0
  59. package/docs/plans/2026-03-14-skill-eval-loop-decisions.md +33 -0
  60. package/docs/plans/2026-03-14-skill-eval-loop-design.md +118 -0
  61. package/docs/plans/2026-03-14-skill-eval-loop-results.md +78 -0
  62. package/docs/plans/2026-03-14-skill-eval-loop-tasks.md +160 -0
  63. package/docs/plans/2026-03-15-agent-command-parity-v2-decisions.md +11 -0
  64. package/docs/plans/2026-03-15-agent-command-parity-v2-design.md +145 -0
  65. package/docs/plans/2026-03-15-agent-command-parity-v2-tasks.md +211 -0
  66. package/docs/research/TEMPLATE.md +292 -0
  67. package/docs/research/advanced-testing.md +297 -0
  68. package/docs/research/agent-permissions.md +167 -0
  69. package/docs/research/dependency-chain.md +328 -0
  70. package/docs/research/forge-workflow-v2.md +550 -0
  71. package/docs/research/plugin-architecture.md +772 -0
  72. package/docs/research/pr4-cli-automation.md +326 -0
  73. package/docs/research/premerge-verify-restructure.md +205 -0
  74. package/docs/research/skills-restructure.md +508 -0
  75. package/docs/research/sonarcloud-perfection-plan.md +166 -0
  76. package/docs/research/sonarcloud-quality-gate.md +184 -0
  77. package/docs/research/superpowers-integration.md +403 -0
  78. package/docs/research/superpowers.md +319 -0
  79. package/docs/research/test-environment.md +519 -0
  80. package/install.sh +1062 -0
  81. package/lefthook.yml +39 -0
  82. package/lib/agents/README.md +198 -0
  83. package/lib/agents/claude.plugin.json +28 -0
  84. package/lib/agents/cline.plugin.json +22 -0
  85. package/lib/agents/codex.plugin.json +19 -0
  86. package/lib/agents/copilot.plugin.json +24 -0
  87. package/lib/agents/cursor.plugin.json +25 -0
  88. package/lib/agents/kilocode.plugin.json +22 -0
  89. package/lib/agents/opencode.plugin.json +20 -0
  90. package/lib/agents/roo.plugin.json +23 -0
  91. package/lib/agents-config.js +2112 -0
  92. package/lib/commands/dev.js +513 -0
  93. package/lib/commands/plan.js +696 -0
  94. package/lib/commands/recommend.js +119 -0
  95. package/lib/commands/ship.js +377 -0
  96. package/lib/commands/status.js +378 -0
  97. package/lib/commands/validate.js +602 -0
  98. package/lib/context-merge.js +359 -0
  99. package/lib/plugin-catalog.js +360 -0
  100. package/lib/plugin-manager.js +166 -0
  101. package/lib/plugin-recommender.js +141 -0
  102. package/lib/project-discovery.js +491 -0
  103. package/lib/setup.js +118 -0
  104. package/lib/workflow-profiles.js +203 -0
  105. package/package.json +115 -0
@@ -0,0 +1,849 @@
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 │ │ OPENSPEC │ │ EXTERNAL SERVICES │ │
14
+ │ │ (bd) │ │ (opsx) │ │ │ │
15
+ │ │ │ │ │ │ Parallel AI │ │
16
+ │ │ Git-backed │ │ Spec-driven │ │ Greptile │ │
17
+ │ │ Issue │ │ Development │ │ SonarCloud │ │
18
+ │ │ Tracking │ │ │ │ GitHub CLI │ │
19
+ │ └─────────────┘ └─────────────┘ └─────────────────────┘ │
20
+ │ │ │ │ │
21
+ │ └─────────────────┴─────────────────────┘ │
22
+ │ │ │
23
+ │ ┌─────▼─────┐ │
24
+ │ │ FORGE │ │
25
+ │ │ 9-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
+ ## OpenSpec - Spec-Driven Development
223
+
224
+ **Package**: `@fission-ai/openspec`
225
+ **Repository**: [github.com/Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec)
226
+ **Website**: [openspec.dev](https://openspec.dev)
227
+ **Purpose**: Structured specifications for AI-assisted development
228
+
229
+ ### Why OpenSpec?
230
+
231
+ - **Specs before code** - AI reads requirements, not just vibes
232
+ - **Non-linear workflow** - Commands execute in any order
233
+ - **Git-native** - Specs versioned like code
234
+ - **Multi-agent** - Works with 21+ AI tools
235
+ - **Zero dependencies** - No API keys, no external services
236
+
237
+ ### Installation
238
+
239
+ **Auto-installation** (Recommended):
240
+ ```bash
241
+ bunx forge setup
242
+ # Prompts: "Install OpenSpec? (y/n)"
243
+ # Automatically installs and initializes (if selected)
244
+ ```
245
+
246
+ **Manual installation**:
247
+ ```bash
248
+ # bun (global - requires Node.js 20.19+)
249
+ bun add -g @fission-ai/openspec
250
+ openspec init
251
+
252
+ # bun (local)
253
+ bun add -d @fission-ai/openspec
254
+ bunx openspec init
255
+
256
+ # Or with bunx (no install needed)
257
+ bunx @fission-ai/openspec init
258
+ ```
259
+
260
+ ### File Structure
261
+
262
+ After `openspec init`:
263
+
264
+ ```
265
+ openspec/
266
+ ├── specs/
267
+ │ └── [domain]/
268
+ │ └── spec.md # Source of truth for each domain
269
+
270
+ ├── changes/
271
+ │ ├── [change-name]/
272
+ │ │ ├── proposal.md # Intent, scope, rationale
273
+ │ │ ├── design.md # Technical approach
274
+ │ │ ├── tasks.md # Implementation checklist
275
+ │ │ └── specs/
276
+ │ │ └── [domain]/
277
+ │ │ └── spec.md # Delta specifications
278
+ │ └── archive/ # Completed changes
279
+
280
+ ├── schemas/
281
+ │ └── default.yaml # Workflow schema
282
+
283
+ └── config.yaml # Project configuration
284
+ ```
285
+
286
+ ### CLI Commands
287
+
288
+ ```bash
289
+ # Setup
290
+ openspec init [path] # Initialize OpenSpec
291
+ openspec update # Update after CLI upgrade
292
+
293
+ # Browse
294
+ openspec list # Display changes/specs
295
+ openspec view # Interactive terminal dashboard
296
+ openspec show [name] # Show detailed content
297
+ openspec status # Artifact completion progress
298
+
299
+ # Validation
300
+ openspec validate [name] # Check structural integrity
301
+ openspec validate --strict # Strict validation
302
+
303
+ # Lifecycle
304
+ openspec sync # Merge delta specs into main specs
305
+ openspec archive [name] # Finalize completed changes
306
+
307
+ # Schema
308
+ openspec schema init # Create new schema
309
+ openspec schema fork # Fork existing schema
310
+ openspec schema validate # Validate schema
311
+ openspec schemas # List available schemas
312
+ ```
313
+
314
+ ### AI Slash Commands (Claude Code, Cursor)
315
+
316
+ ```bash
317
+ /opsx:explore # Think through ideas, investigate
318
+ /opsx:new # Start a new change initiative
319
+ /opsx:continue # Create next artifact (incremental)
320
+ /opsx:ff # Fast-forward: generate all planning artifacts
321
+ /opsx:apply # Implement tasks
322
+ /opsx:sync # Merge delta specs into main specs
323
+ /opsx:archive # Mark change complete
324
+ /opsx:verify # Validate implementation matches specs
325
+ /opsx:onboard # Interactive tutorial
326
+ ```
327
+
328
+ ### Spec Format
329
+
330
+ OpenSpec uses structured markdown with normative language:
331
+
332
+ ```markdown
333
+ # Authentication Specification
334
+
335
+ ## Purpose
336
+ Enable secure user identity verification and session management
337
+
338
+ ## Requirements
339
+
340
+ ### Requirement: Session Token Validation
341
+ The system SHALL validate session tokens on every request
342
+
343
+ #### Scenario: Valid Session
344
+ - **GIVEN** user has authenticated
345
+ - **WHEN** request includes valid session token
346
+ - **THEN** process the request
347
+ - **AND** update token expiration time
348
+
349
+ #### Scenario: Expired Session
350
+ - **GIVEN** user had authenticated but 24 hours have passed
351
+ - **WHEN** request includes expired session token
352
+ - **THEN** invalidate the token
353
+ - **AND** redirect to login
354
+ ```
355
+
356
+ ### Delta Format
357
+
358
+ Changes use ADDED/MODIFIED/REMOVED notation:
359
+
360
+ ```markdown
361
+ # Delta for Authentication
362
+
363
+ ## ADDED Requirements
364
+ ### Requirement: Two-Factor Authentication
365
+ The system SHALL support optional 2FA
366
+
367
+ #### Scenario: 2FA Enrollment
368
+ - **GIVEN** user enables 2FA in settings
369
+ - **WHEN** they scan QR code with authenticator app
370
+ - **THEN** 2FA is activated for their account
371
+
372
+ ## MODIFIED Requirements
373
+ ### Requirement: Session Token Validation
374
+ [Updated content here]
375
+
376
+ ## REMOVED Requirements
377
+ ### Requirement: Remember Me Cookie
378
+ ```
379
+
380
+ ### When to Use OpenSpec
381
+
382
+ | Scope | Use OpenSpec? | Example |
383
+ |-------|---------------|---------|
384
+ | **Tactical** (< 1 day) | No | Bug fix, small feature |
385
+ | **Strategic** (architecture) | Yes | New service, API redesign |
386
+ | **Breaking changes** | Yes | Schema migrations |
387
+ | **Multi-session work** | Yes | Large features |
388
+
389
+ ### Workflow Example
390
+
391
+ ```bash
392
+ # 1. Start new change
393
+ /opsx:new
394
+ # Describe: "Add payment processing with Stripe"
395
+ # Select schema: default
396
+
397
+ # 2. Generate all planning docs
398
+ /opsx:ff
399
+ # Creates: proposal.md, design.md, tasks.md, specs/
400
+
401
+ # 3. Implement
402
+ /opsx:apply
403
+ # AI writes code following tasks.md
404
+
405
+ # 4. Verify
406
+ /opsx:verify
407
+ # Confirms implementation matches specs
408
+
409
+ # 5. Finalize
410
+ /opsx:sync # Merge deltas into main specs
411
+ /opsx:archive # Move to archive
412
+ ```
413
+
414
+ ---
415
+
416
+ ## MCP Servers
417
+
418
+ ### Context7 - Library Documentation
419
+
420
+ **Package**: `@upstash/context7-mcp@2` (pin to major version, not `@latest`)
421
+ **Purpose**: Up-to-date documentation and code examples for any programming library
422
+ **Used in**: `/plan` stage (Phase 2 research); any library lookup
423
+
424
+ Context7 provides current documentation that may be more recent than the AI's training data.
425
+
426
+ **Installation**:
427
+
428
+ **Claude Code**: Add to `.mcp.json` in your project root:
429
+
430
+
431
+ ```json
432
+ {
433
+ "mcpServers": {
434
+ "context7": {
435
+ "command": "bunx",
436
+ "args": ["--bun", "@upstash/context7-mcp@latest"]
437
+ }
438
+ }
439
+ }
440
+ ```
441
+
442
+ **Cline (VSCode)**:
443
+ 1. Open VSCode Settings
444
+ 2. Search for "Cline MCP"
445
+ 3. Add Context7 server configuration
446
+
447
+ **Cursor**: Check Cursor Settings → MCP Servers for configuration options
448
+
449
+ **Other agents**: If your agent supports MCP, configure using the JSON format above
450
+
451
+ **Usage**:
452
+ ```
453
+ # The AI will automatically use Context7 when you ask about libraries
454
+ "How do I use React Query's useMutation hook?"
455
+ "What's the latest Next.js App Router API?"
456
+ "Show me Supabase RLS policy examples"
457
+ ```
458
+
459
+ **When to use Context7**:
460
+ - Before implementing a library feature
461
+ - When official docs may have changed since AI training
462
+ - To verify API signatures and patterns
463
+ - For current best practices
464
+
465
+ ### grep.app - Code Search
466
+
467
+ **Package**: `@ai-tools-all/grep_app_mcp` (recommended) or `@galprz/grep-mcp`
468
+ **Website**: [grep.app](https://grep.app)
469
+ **Purpose**: Search across 1M+ public GitHub repositories for real-world code examples
470
+ **Used in**: `/plan` stage (Phase 2 research); finding implementation patterns
471
+
472
+ grep.app provides code search across public GitHub repositories to find real-world examples and patterns.
473
+
474
+ **Installation (Claude Code)**:
475
+
476
+ Add to `.mcp.json` in your project root:
477
+
478
+ ```json
479
+ {
480
+ "mcpServers": {
481
+ "context7": {
482
+ "command": "bunx",
483
+ "args": ["--bun", "@upstash/context7-mcp@latest"]
484
+ },
485
+ "grep-app": {
486
+ "command": "bunx",
487
+ "args": ["--bun", "@ai-tools-all/grep_app_mcp"]
488
+ }
489
+ }
490
+ }
491
+ ```
492
+
493
+ **Usage**:
494
+ ```
495
+ # The AI will use grep.app when you need real-world examples
496
+ "Find examples of React useEffect cleanup patterns"
497
+ "Show me how others implement JWT authentication in Express"
498
+ "Search for rate limiting implementations in Node.js"
499
+ ```
500
+
501
+ **When to use grep.app**:
502
+
503
+ - Finding real-world implementation examples
504
+ - Discovering coding patterns in production code
505
+ - Validating implementation approaches
506
+ - Learning from open source projects
507
+
508
+ **Context7 vs grep.app**:
509
+
510
+ | Tool | Purpose | Use When |
511
+ |----------------|--------------------------------|-------------------------------------------|
512
+ | **Context7** | Official library documentation | You need API reference, official patterns |
513
+ | **grep.app** | Real code in the wild | You want to see how others solve problems |
514
+
515
+ ---
516
+
517
+ ## External Services
518
+
519
+ ### Parallel AI - Web Research
520
+
521
+ **Website**: [platform.parallel.ai](https://platform.parallel.ai)
522
+ **Used in**: `/plan` stage (Phase 2 research)
523
+
524
+ 4 APIs for research:
525
+ - **Search** - Web search with AI analysis
526
+ - **Extract** - Scrape specific URLs
527
+ - **Task** - Structured data enrichment
528
+ - **Deep Research** - Multi-source analysis
529
+
530
+ ```bash
531
+ # Setup
532
+ # 1. Get key from https://platform.parallel.ai
533
+ # 2. Add to .env.local
534
+ PARALLEL_API_KEY=your-key
535
+
536
+ # Test
537
+ API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
538
+ curl -s -X POST "https://api.parallel.ai/v1beta/search" \
539
+ -H "x-api-key: $API_KEY" \
540
+ -H "Content-Type: application/json" \
541
+ -H "parallel-beta: search-extract-2025-10-10" \
542
+ -d '{"objective": "Next.js authentication best practices 2026"}'
543
+ ```
544
+
545
+ ---
546
+
547
+ ## Code Review Tools
548
+
549
+ Choose ONE code review tool based on your needs:
550
+
551
+ | Tool | Pricing | Best For | Setup |
552
+ |------|---------|----------|-------|
553
+ | **GitHub Code Quality** | FREE | All GitHub repos | Built-in, zero setup |
554
+ | **CodeRabbit** | FREE (OSS) | Open source projects | GitHub App |
555
+ | **Greptile** | $99+/mo | Enterprise | API key |
556
+
557
+ ### Option 1: GitHub Code Quality (FREE, Recommended)
558
+
559
+ **Status**: Built-in to GitHub
560
+ **Used in**: `/review` stage
561
+
562
+ Zero setup required - GitHub's code quality features are enabled by default.
563
+
564
+ Features:
565
+ - Automatic code scanning
566
+ - Dependency vulnerability alerts
567
+ - Secret scanning
568
+ - Code navigation
569
+
570
+ ### Option 2: CodeRabbit (FREE for Open Source)
571
+
572
+ **Website**: [coderabbit.ai](https://coderabbit.ai)
573
+ **Used in**: `/review` stage
574
+
575
+ AI-powered code review with deep context understanding.
576
+
577
+ ```bash
578
+ # Setup
579
+ # 1. Go to https://coderabbit.ai
580
+ # 2. Install the GitHub App
581
+ # 3. Enable for your repositories
582
+
583
+ # Configuration (optional)
584
+ # Create .coderabbit.yaml in repo root
585
+ ```
586
+
587
+ ### Option 3: Greptile (Paid - Enterprise)
588
+
589
+ **Website**: [greptile.com](https://greptile.com)
590
+ **Used in**: `/review` stage
591
+
592
+ Enterprise-grade AI code review that understands your codebase.
593
+
594
+ ```bash
595
+ # Setup
596
+ # 1. Get key from https://app.greptile.com
597
+ # 2. Add to .env.local
598
+ GREPTILE_API_KEY=your-key
599
+
600
+ # 3. Index repository (one-time)
601
+ curl -X POST "https://api.greptile.com/v2/repositories" \
602
+ -H "Authorization: Bearer $GREPTILE_API_KEY" \
603
+ -H "Content-Type: application/json" \
604
+ -d '{"remote": "github", "repository": "owner/repo"}'
605
+ ```
606
+
607
+ ---
608
+
609
+ ## Code Quality Tools
610
+
611
+ Choose ONE code quality scanner based on your needs:
612
+
613
+ | Tool | Pricing | Best For | Requirement |
614
+ |------|---------|----------|-------------|
615
+ | **ESLint** | FREE | All projects | Built-in |
616
+ | **SonarCloud** | 50k LoC free | Cloud-first teams | API key |
617
+ | **SonarQube Community** | FREE | Self-hosted, unlimited | Docker |
618
+
619
+ ### Option 1: ESLint Only (FREE, Recommended)
620
+
621
+ **Status**: Built-in
622
+ **Used in**: `/validate` stage
623
+
624
+ No external server required - uses your project's linting configuration.
625
+
626
+ ```bash
627
+ # Already configured via package.json or eslint.config.js
628
+ bun run lint
629
+ ```
630
+
631
+ ### Option 2: SonarCloud (Cloud-Hosted)
632
+
633
+ **Website**: [sonarcloud.io](https://sonarcloud.io)
634
+ **Used in**: `/validate` stage
635
+ **Free Tier**: 50,000 lines of code
636
+
637
+ Static analysis for bugs, vulnerabilities, code smells.
638
+
639
+ ```bash
640
+ # Setup
641
+ # 1. Create project at https://sonarcloud.io
642
+ # 2. Get token from Security settings
643
+ # 3. Add to .env.local
644
+ SONAR_TOKEN=your-token
645
+ SONAR_ORGANIZATION=your-org
646
+ SONAR_PROJECT_KEY=your-project
647
+
648
+ # 4. Create sonar-project.properties
649
+ echo "sonar.organization=$SONAR_ORGANIZATION
650
+ sonar.projectKey=$SONAR_PROJECT_KEY
651
+ sonar.sources=src" > sonar-project.properties
652
+
653
+ # 5. Run analysis
654
+ bunx sonarqube-scanner
655
+ ```
656
+
657
+ ### Option 3: SonarQube Community (Self-Hosted, FREE)
658
+
659
+ **Website**: [sonarqube.org](https://www.sonarsource.com/products/sonarqube/)
660
+ **Used in**: `/validate` stage
661
+ **Pricing**: FREE, unlimited lines of code
662
+
663
+ Self-hosted code quality analysis - no cloud dependency.
664
+
665
+ ```bash
666
+ # Setup with Docker
667
+ docker run -d --name sonarqube \
668
+ -p 9000:9000 \
669
+ sonarqube:community
670
+
671
+ # Access at http://localhost:9000
672
+ # Default credentials: admin/admin
673
+
674
+ # Add to .env.local
675
+ SONARQUBE_URL=http://localhost:9000
676
+ SONARQUBE_TOKEN=your-token # Generate in SonarQube UI
677
+
678
+ # Create sonar-project.properties
679
+ echo "sonar.host.url=$SONARQUBE_URL
680
+ sonar.login=$SONARQUBE_TOKEN
681
+ sonar.projectKey=your-project
682
+ sonar.sources=src" > sonar-project.properties
683
+
684
+ # Run analysis
685
+ bunx sonarqube-scanner
686
+ ```
687
+
688
+ **Docker Compose (Production)**:
689
+ ```yaml
690
+ # docker-compose.yml
691
+ version: '3'
692
+ services:
693
+ sonarqube:
694
+ image: sonarqube:community
695
+ ports:
696
+ - "9000:9000"
697
+ environment:
698
+ - SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
699
+ volumes:
700
+ - sonarqube_data:/opt/sonarqube/data
701
+ - sonarqube_logs:/opt/sonarqube/logs
702
+
703
+ volumes:
704
+ sonarqube_data:
705
+ sonarqube_logs:
706
+ ```
707
+
708
+ ---
709
+
710
+ ### GitHub CLI - PR Workflow
711
+
712
+ **Installation**: [cli.github.com](https://cli.github.com)
713
+ **Used in**: `/ship`, `/review`, `/merge` stages
714
+
715
+ ```bash
716
+ # Install
717
+ # macOS: brew install gh
718
+ # Windows: winget install GitHub.cli
719
+ # Linux: sudo apt install gh
720
+
721
+ # Authenticate
722
+ gh auth login
723
+
724
+ # Common commands
725
+ gh pr create --title "..." --body "..."
726
+ gh pr view <number>
727
+ gh pr checks <number>
728
+ gh pr merge <number> --squash --delete-branch
729
+ gh issue create --title "..." --body "..."
730
+ ```
731
+
732
+ ---
733
+
734
+ ## Integration with Forge Stages
735
+
736
+ | Stage | Tools Used |
737
+ |-------|------------|
738
+ | `/status` | `bd ready`, `bd list`, `git status`, `openspec list` |
739
+ | `/plan` (Phase 2) | Parallel AI, Context7, grep.app, codebase exploration |
740
+ | `/plan` | `bd create`, `openspec` (if strategic), `git checkout -b` |
741
+ | `/dev` | Tests, code, `bd update`, `/tasks save` |
742
+ | `/validate` | Type check, lint, tests, SonarCloud |
743
+ | `/ship` | `bd update --status done`, `gh pr create` |
744
+ | `/review` | `gh pr view`, Greptile, SonarCloud |
745
+ | `/merge` | `gh pr merge`, `openspec archive`, `bd sync` |
746
+ | `/verify` | Documentation cross-check |
747
+
748
+ ---
749
+
750
+ ## Quick Reference Card
751
+
752
+ ### Beads (Issue Tracking)
753
+
754
+ ```bash
755
+ bd init # Initialize
756
+ bd ready # Find unblocked work
757
+ bd create "Title" # Create issue
758
+ bd show <id> # View details
759
+ bd update <id> --status X # Update status
760
+ bd dep add <a> <b> # a depends on b
761
+ bd close <id> # Complete
762
+ bd sync # Git sync
763
+ ```
764
+
765
+ ### OpenSpec (Specifications)
766
+
767
+ ```bash
768
+ openspec init # Initialize
769
+ /opsx:new # Start change (AI)
770
+ /opsx:ff # Generate all docs (AI)
771
+ /opsx:apply # Implement (AI)
772
+ openspec validate <name> # Validate
773
+ openspec archive <name> # Complete
774
+ ```
775
+
776
+ ### GitHub CLI
777
+
778
+ ```bash
779
+ gh auth login # Authenticate
780
+ gh pr create # Create PR
781
+ gh pr view <n> # View PR
782
+ gh pr checks <n> # Check status
783
+ gh pr merge <n> --squash # Merge
784
+ ```
785
+
786
+ ---
787
+
788
+ ## Troubleshooting
789
+
790
+ ### Beads
791
+
792
+ **"bd: command not found"**
793
+ ```bash
794
+ # macOS / Linux
795
+ bun add -g @beads/bd
796
+ # Or use bunx @beads/bd <command>
797
+
798
+ # Windows — use PowerShell installer
799
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
800
+ ```
801
+
802
+ **Windows EPERM error during `npm install -g @beads/bd`**
803
+ ```bash
804
+ # npm @beads/bd has a known EPERM bug on Windows (Issue #1031)
805
+ # Use the PowerShell installer instead:
806
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
807
+ ```
808
+
809
+ **"database locked"**
810
+ ```bash
811
+ bd sync --force
812
+ ```
813
+
814
+ **Issues not showing after git pull**
815
+ ```bash
816
+ bd sync # Re-imports from JSONL
817
+ ```
818
+
819
+ ### OpenSpec
820
+
821
+ **"openspec: command not found"**
822
+ ```bash
823
+ bun add -g @fission-ai/openspec
824
+ # Or use bunx @fission-ai/openspec <command>
825
+ ```
826
+
827
+ **Validation errors**
828
+ ```bash
829
+ openspec validate <name> --verbose
830
+ ```
831
+
832
+ ### GitHub CLI
833
+
834
+ **"gh: not authenticated"**
835
+ ```bash
836
+ gh auth login
837
+ gh auth status
838
+ ```
839
+
840
+ ---
841
+
842
+ ## Resources
843
+
844
+ - **Beads**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
845
+ - **OpenSpec**: [openspec.dev](https://openspec.dev) | [github.com/Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec)
846
+ - **Parallel AI**: [platform.parallel.ai](https://platform.parallel.ai)
847
+ - **Greptile**: [greptile.com](https://greptile.com)
848
+ - **SonarCloud**: [sonarcloud.io](https://sonarcloud.io)
849
+ - **GitHub CLI**: [cli.github.com](https://cli.github.com)