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.
- package/.claude/commands/dev.md +314 -0
- package/.claude/commands/plan.md +389 -0
- package/.claude/commands/premerge.md +179 -0
- package/.claude/commands/research.md +42 -0
- package/.claude/commands/review.md +442 -0
- package/.claude/commands/rollback.md +721 -0
- package/.claude/commands/ship.md +134 -0
- package/.claude/commands/sonarcloud.md +152 -0
- package/.claude/commands/status.md +77 -0
- package/.claude/commands/validate.md +237 -0
- package/.claude/commands/verify.md +221 -0
- package/.claude/rules/greptile-review-process.md +285 -0
- package/.claude/rules/workflow.md +105 -0
- package/.claude/scripts/greptile-resolve.sh +526 -0
- package/.claude/scripts/load-env.sh +32 -0
- package/.forge/hooks/check-tdd.js +240 -0
- package/.github/PLUGIN_TEMPLATE.json +32 -0
- package/.mcp.json.example +12 -0
- package/AGENTS.md +169 -0
- package/CLAUDE.md +99 -0
- package/LICENSE +21 -0
- package/README.md +414 -0
- package/bin/forge-cmd.js +313 -0
- package/bin/forge-validate.js +303 -0
- package/bin/forge.js +4228 -0
- package/docs/AGENT_INSTALL_PROMPT.md +342 -0
- package/docs/ENHANCED_ONBOARDING.md +602 -0
- package/docs/EXAMPLES.md +482 -0
- package/docs/GREPTILE_SETUP.md +400 -0
- package/docs/MANUAL_REVIEW_GUIDE.md +106 -0
- package/docs/ROADMAP.md +359 -0
- package/docs/SETUP.md +632 -0
- package/docs/TOOLCHAIN.md +849 -0
- package/docs/VALIDATION.md +363 -0
- package/docs/WORKFLOW.md +400 -0
- package/docs/planning/PROGRESS.md +396 -0
- package/docs/plans/.gitkeep +0 -0
- package/docs/plans/2026-02-27-forge-test-suite-v2-decisions.md +21 -0
- package/docs/plans/2026-02-27-forge-test-suite-v2-design.md +362 -0
- package/docs/plans/2026-02-27-forge-test-suite-v2-tasks.md +343 -0
- package/docs/plans/2026-03-02-superpowers-gaps-decisions.md +26 -0
- package/docs/plans/2026-03-02-superpowers-gaps-design.md +239 -0
- package/docs/plans/2026-03-02-superpowers-gaps-tasks.md +260 -0
- package/docs/plans/2026-03-04-agent-command-parity-design.md +163 -0
- package/docs/plans/2026-03-04-verify-worktree-cleanup-decisions.md +7 -0
- package/docs/plans/2026-03-04-verify-worktree-cleanup-design.md +165 -0
- package/docs/plans/2026-03-05-forge-uto-decisions.md +6 -0
- package/docs/plans/2026-03-05-forge-uto-design.md +116 -0
- package/docs/plans/2026-03-05-forge-uto-tasks.md +244 -0
- package/docs/plans/2026-03-10-command-creator-and-eval-decisions.md +52 -0
- package/docs/plans/2026-03-10-command-creator-and-eval-design.md +350 -0
- package/docs/plans/2026-03-10-command-creator-and-eval-tasks.md +426 -0
- package/docs/plans/2026-03-10-stale-workflow-refs-decisions.md +8 -0
- package/docs/plans/2026-03-10-stale-workflow-refs-design.md +80 -0
- package/docs/plans/2026-03-10-stale-workflow-refs-tasks.md +90 -0
- package/docs/plans/2026-03-14-beads-plan-context-decisions.md +9 -0
- package/docs/plans/2026-03-14-beads-plan-context-design.md +171 -0
- package/docs/plans/2026-03-14-beads-plan-context-tasks.md +160 -0
- package/docs/plans/2026-03-14-skill-eval-loop-decisions.md +33 -0
- package/docs/plans/2026-03-14-skill-eval-loop-design.md +118 -0
- package/docs/plans/2026-03-14-skill-eval-loop-results.md +78 -0
- package/docs/plans/2026-03-14-skill-eval-loop-tasks.md +160 -0
- package/docs/plans/2026-03-15-agent-command-parity-v2-decisions.md +11 -0
- package/docs/plans/2026-03-15-agent-command-parity-v2-design.md +145 -0
- package/docs/plans/2026-03-15-agent-command-parity-v2-tasks.md +211 -0
- package/docs/research/TEMPLATE.md +292 -0
- package/docs/research/advanced-testing.md +297 -0
- package/docs/research/agent-permissions.md +167 -0
- package/docs/research/dependency-chain.md +328 -0
- package/docs/research/forge-workflow-v2.md +550 -0
- package/docs/research/plugin-architecture.md +772 -0
- package/docs/research/pr4-cli-automation.md +326 -0
- package/docs/research/premerge-verify-restructure.md +205 -0
- package/docs/research/skills-restructure.md +508 -0
- package/docs/research/sonarcloud-perfection-plan.md +166 -0
- package/docs/research/sonarcloud-quality-gate.md +184 -0
- package/docs/research/superpowers-integration.md +403 -0
- package/docs/research/superpowers.md +319 -0
- package/docs/research/test-environment.md +519 -0
- package/install.sh +1062 -0
- package/lefthook.yml +39 -0
- package/lib/agents/README.md +198 -0
- package/lib/agents/claude.plugin.json +28 -0
- package/lib/agents/cline.plugin.json +22 -0
- package/lib/agents/codex.plugin.json +19 -0
- package/lib/agents/copilot.plugin.json +24 -0
- package/lib/agents/cursor.plugin.json +25 -0
- package/lib/agents/kilocode.plugin.json +22 -0
- package/lib/agents/opencode.plugin.json +20 -0
- package/lib/agents/roo.plugin.json +23 -0
- package/lib/agents-config.js +2112 -0
- package/lib/commands/dev.js +513 -0
- package/lib/commands/plan.js +696 -0
- package/lib/commands/recommend.js +119 -0
- package/lib/commands/ship.js +377 -0
- package/lib/commands/status.js +378 -0
- package/lib/commands/validate.js +602 -0
- package/lib/context-merge.js +359 -0
- package/lib/plugin-catalog.js +360 -0
- package/lib/plugin-manager.js +166 -0
- package/lib/plugin-recommender.js +141 -0
- package/lib/project-discovery.js +491 -0
- package/lib/setup.js +118 -0
- package/lib/workflow-profiles.js +203 -0
- package/package.json +115 -0
package/docs/SETUP.md
ADDED
|
@@ -0,0 +1,632 @@
|
|
|
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
|
+
│ ├── WORKFLOW.md # Complete guide
|
|
537
|
+
│ ├── TOOLCHAIN.md # Tool reference
|
|
538
|
+
│ ├── SETUP.md # This file
|
|
539
|
+
│ ├── EXAMPLES.md # Real examples
|
|
540
|
+
│ ├── planning/PROGRESS.md # Progress tracking
|
|
541
|
+
│ └── research/TEMPLATE.md # Research template
|
|
542
|
+
│
|
|
543
|
+
├── .beads/ # If Beads installed
|
|
544
|
+
│ ├── issues.jsonl
|
|
545
|
+
│ ├── config.yaml
|
|
546
|
+
│ └── .gitignore
|
|
547
|
+
│
|
|
548
|
+
└── .env.local # Your configuration (add to .gitignore!)
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
## Troubleshooting
|
|
554
|
+
|
|
555
|
+
### "Command not found: bunx forge"
|
|
556
|
+
|
|
557
|
+
```bash
|
|
558
|
+
# Ensure forge-workflow is installed
|
|
559
|
+
bun pm ls | grep forge-workflow
|
|
560
|
+
|
|
561
|
+
# If not, install
|
|
562
|
+
bun add forge-workflow
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### "Permission denied: gh"
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
# Authenticate GitHub CLI
|
|
569
|
+
gh auth login
|
|
570
|
+
|
|
571
|
+
# Or check status
|
|
572
|
+
gh auth status
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### "Beads: command not found"
|
|
576
|
+
|
|
577
|
+
```bash
|
|
578
|
+
# Install globally
|
|
579
|
+
bun install -g @beads/bd
|
|
580
|
+
|
|
581
|
+
# Verify
|
|
582
|
+
bd --version
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### "SonarQube connection refused"
|
|
586
|
+
|
|
587
|
+
```bash
|
|
588
|
+
# Check if SonarQube is running
|
|
589
|
+
docker ps | grep sonarqube
|
|
590
|
+
|
|
591
|
+
# If not, start it
|
|
592
|
+
docker start sonarqube
|
|
593
|
+
|
|
594
|
+
# Or run fresh
|
|
595
|
+
docker run -d --name sonarqube -p 9000:9000 sonarqube:community
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### "Greptile API rate limit"
|
|
599
|
+
|
|
600
|
+
**Wait** for rate limit to reset (usually 1 minute).
|
|
601
|
+
|
|
602
|
+
**Or upgrade** to higher tier at https://greptile.com/pricing
|
|
603
|
+
|
|
604
|
+
### "Parallel AI API key invalid"
|
|
605
|
+
|
|
606
|
+
```bash
|
|
607
|
+
# Verify key in .env.local
|
|
608
|
+
grep PARALLEL_API_KEY .env.local
|
|
609
|
+
|
|
610
|
+
# Test key
|
|
611
|
+
curl -s -X POST "https://api.parallel.ai/v1beta/search" \
|
|
612
|
+
-H "x-api-key: YOUR_KEY" \
|
|
613
|
+
-H "Content-Type: application/json" \
|
|
614
|
+
-H "parallel-beta: search-extract-2025-10-10" \
|
|
615
|
+
-d '{"objective": "test"}'
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
## Next Steps
|
|
621
|
+
|
|
622
|
+
✅ Setup complete? Try your [first feature](../QUICKSTART.md)
|
|
623
|
+
|
|
624
|
+
📖 Learn the workflow in [WORKFLOW.md](WORKFLOW.md)
|
|
625
|
+
|
|
626
|
+
🛠️ Explore toolchain in [TOOLCHAIN.md](TOOLCHAIN.md)
|
|
627
|
+
|
|
628
|
+
🎯 See examples in [EXAMPLES.md](EXAMPLES.md)
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
**Questions?** → [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
|