forge-workflow 1.4.0 → 1.4.2

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/README.md CHANGED
@@ -1,860 +1,316 @@
1
1
  # Forge
2
2
 
3
- A 9-stage TDD-first workflow for **ALL AI coding agents**. Ship features with confidence using test-driven development, research-first planning, and comprehensive documentation.
3
+ Ship features with confidence using a 9-stage TDD-first workflow for AI coding agents.
4
4
 
5
5
  ```
6
- /status -> /research -> /plan -> /dev -> /check -> /ship -> /review -> /merge -> /verify
6
+ /status /research /plan /dev /check /ship /review /merge /verify
7
7
  ```
8
8
 
9
- ## Why Forge?
10
-
11
- - **TDD-First**: Write tests before code (RED-GREEN-REFACTOR)
12
- - **Research-First**: Understand before building, document decisions
13
- - **Security Built-In**: OWASP Top 10 analysis for every feature
14
- - **Multi-Session**: Track work across sessions with Beads
15
- - **Strategic Planning**: Use OpenSpec for architecture changes
16
- - **Universal**: Works with 11+ AI coding agents
17
-
18
- ## Supported AI Coding Agents
19
-
20
- Forge works with **all major AI coding agents** using the universal AGENTS.md standard:
21
-
22
- | Agent | Status | Primary Config | Commands Location |
23
- |-------|--------|----------------|-------------------|
24
- | **Claude Code** | Full | `CLAUDE.md` | `.claude/commands/` |
25
- | **Google Antigravity** | Full | `GEMINI.md` | `.agent/workflows/` |
26
- | **Cursor** | Full | `.cursorrules` | `.cursor/rules/` |
27
- | **Windsurf** | Full | `.windsurfrules` | `.windsurf/workflows/` |
28
- | **Kilo Code** | Full | `AGENTS.md` | `.kilocode/workflows/` |
29
- | **OpenCode** | Full | `AGENTS.md` | `.opencode/commands/` |
30
- | **Continue** | Full | `.continuerules` | `.continue/prompts/` |
31
- | **GitHub Copilot** | Full | `.github/copilot-instructions.md` | `.github/prompts/` |
32
- | **Cline** | Full | `.clinerules` | Via instructions |
33
- | **Roo Code** | Full | `.clinerules` | `.roo/commands/` |
34
- | **Aider** | Full | `AGENTS.md` | Via instructions |
9
+ **TDD-First**: Write tests before code
10
+ ✅ **Research-First**: Understand before building
11
+ **Universal**: Works with 11+ AI agents
35
12
 
36
- ## Installation
37
-
38
- ### Option 1: npm (Recommended)
39
-
40
- ```bash
41
- # Step 1: Install the package (minimal: AGENTS.md + docs)
42
- npm install forge-workflow
43
-
44
- # Step 2: Configure for your agents (interactive)
45
- npx forge setup
46
- ```
47
-
48
- Or specify agents directly:
49
-
50
- ```bash
51
- # Install for specific agents
52
- npx forge setup --agents claude,cursor,windsurf
13
+ ---
53
14
 
54
- # Install for all agents
55
- npx forge setup --all
56
- ```
15
+ ## Quick Example
57
16
 
58
- ### Option 2: curl (Interactive)
17
+ **Adding a login button with Forge:**
59
18
 
60
19
  ```bash
61
- curl -fsSL https://raw.githubusercontent.com/harshanandak/forge/main/install.sh | bash
20
+ /research login-button # AI researches best practices + security
21
+ /plan login-button # Creates plan, branch, tracking issue
22
+ /dev # TDD: RED → GREEN → REFACTOR cycles
23
+ /check # Type check + lint + tests + security scan
24
+ /ship # Create PR with full documentation
62
25
  ```
63
26
 
64
- ### Option 3: bun
27
+ **Result**: Feature shipped with tests, security validated, fully documented.
65
28
 
66
- ```bash
67
- bun add forge-workflow
68
- bunx forge setup
69
- ```
70
-
71
- ## The Toolchain
29
+ **Without Forge** (chaotic):
30
+ - Code first, tests later (or never)
31
+ - No research or planning
32
+ - Security issues found in production
33
+ - Documentation forgotten
72
34
 
73
- Forge integrates with three powerful tools for complete workflow management:
35
+ **With Forge** (systematic):
36
+ - Tests written BEFORE code (TDD)
37
+ - Research-backed decisions
38
+ - OWASP Top 10 analysis built-in
39
+ - Documentation at every stage
74
40
 
75
- ```
76
- ┌─────────────────────────────────────────────────────────────────┐
77
- │ FORGE TOOLCHAIN │
78
- ├─────────────────────────────────────────────────────────────────┤
79
- │ │
80
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
81
- │ │ BEADS │ │ OPENSPEC │ │ CLAUDE TASKS │ │
82
- │ │ │ │ │ │ │ │
83
- │ │ Issue │ │ Proposal │ │ Save/Resume │ │
84
- │ │ Tracking │ │ System │ │ Task State │ │
85
- │ │ │ │ │ │ │ │
86
- │ │ bd create │ │ openspec │ │ /tasks save │ │
87
- │ │ bd ready │ │ proposal │ │ /tasks resume │ │
88
- │ │ bd close │ │ create │ │ /tasks list │ │
89
- │ └─────────────┘ └─────────────┘ └─────────────────────┘ │
90
- │ │ │ │ │
91
- │ └─────────────────┴─────────────────────┘ │
92
- │ │ │
93
- │ ┌─────▼─────┐ │
94
- │ │ FORGE │ │
95
- │ │ 9-Stage │ │
96
- │ │ Workflow │ │
97
- │ └───────────┘ │
98
- │ │
99
- └─────────────────────────────────────────────────────────────────┘
100
- ```
41
+ → [See complete walkthrough in QUICKSTART.md](QUICKSTART.md)
101
42
 
102
- ### Beads - Issue Tracking Across Sessions
43
+ ---
103
44
 
104
- [Beads](https://github.com/steveyegge/beads) provides git-backed, distributed issue tracking designed for AI coding agents.
45
+ ## Installation
105
46
 
106
47
  ```bash
107
- # Install
108
- npm install -g @beads/bd
109
-
110
- # Initialize in your project
111
- bd init
112
-
113
- # Find work ready to start (no blockers!)
114
- bd ready
115
-
116
- # Create an issue
117
- bd create "Add user authentication" --type feature --priority 2
118
-
119
- # View issue details
120
- bd show <id>
121
-
122
- # Update status
123
- bd update <id> --status in_progress
124
-
125
- # Add dependencies (child depends on parent)
126
- bd dep add <child> <parent>
127
-
128
- # Add comments during work
129
- bd comments <id> "Progress: login working, starting signup"
130
-
131
- # Complete work
132
- bd close <id> --reason "Implemented with JWT"
48
+ # Step 1: Install the package
49
+ npm install forge-workflow
133
50
 
134
- # Sync with git (ALWAYS at session end!)
135
- bd sync
51
+ # Step 2: Setup for your AI agent
52
+ npx forge setup
136
53
  ```
137
54
 
138
- **Why Beads?**
139
- - **Persists across sessions** - Issues survive context clearing, compaction, new chats
140
- - **Git-backed** - Version controlled like code, mergeable, team-shareable
141
- - **Dependency tracking** - Know what blocks what with `bd blocked`
142
- - **Ready detection** - `bd ready` finds unblocked work automatically
143
- - **AI-optimized** - JSON output, semantic compaction, audit trails
144
-
145
- See [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) for complete Beads command reference.
55
+ **That's it!** Forge will:
56
+ - Create AGENTS.md (universal instructions)
57
+ - Setup agent-specific files (Claude, Cursor, etc.)
58
+ - Create docs/ folder with guides
146
59
 
147
- ### OpenSpec - Spec-Driven Development
148
-
149
- [OpenSpec](https://github.com/Fission-AI/OpenSpec) provides spec-driven development for AI-assisted workflows.
150
-
151
- ```bash
152
- # Install (requires Node.js 20.19+)
153
- npm install -g @fission-ai/openspec
154
-
155
- # Initialize
156
- openspec init
157
-
158
- # In AI assistant (Claude Code, Cursor, Windsurf):
159
- /opsx:new # Start a new change
160
- /opsx:ff # Fast-forward: generate all planning docs
161
- /opsx:apply # Implement tasks
162
- /opsx:verify # Validate implementation
163
- /opsx:archive # Complete and archive
164
-
165
- # Creates:
166
- # openspec/changes/[name]/
167
- # ├── proposal.md # Intent, scope, rationale
168
- # ├── design.md # Technical approach
169
- # ├── tasks.md # Implementation checklist
170
- # └── specs/ # Delta specifications (ADDED/MODIFIED/REMOVED)
171
- ```
60
+ **Prerequisites**: Node.js, Git, GitHub account
61
+ **Optional tools**: Beads (issue tracking), OpenSpec (architecture proposals)
172
62
 
173
- **When to use OpenSpec:**
63
+ [Detailed setup guide for all agents](docs/SETUP.md)
174
64
 
175
- | Scope | Use OpenSpec? | Example |
176
- |-------|---------------|---------|
177
- | **Tactical** (< 1 day) | No | Bug fix, small feature |
178
- | **Strategic** (architecture) | Yes | New service, major refactor |
179
- | **Breaking changes** | Yes | API changes, schema migrations |
180
- | **Multi-session work** | Yes | Large features |
65
+ ---
181
66
 
182
- **Workflow:**
183
- ```bash
184
- # 1. Start change (in AI assistant)
185
- /opsx:new
186
- # Describe: "Add payment processing with Stripe"
187
-
188
- # 2. Generate all planning docs
189
- /opsx:ff
190
- # Creates proposal.md, design.md, tasks.md, specs/
191
-
192
- # 3. Implement
193
- /opsx:apply
194
- # AI writes code following tasks.md
195
-
196
- # 4. Validate and finalize
197
- /opsx:verify # Confirm implementation matches specs
198
- openspec sync # Merge deltas into main specs
199
- openspec archive name # Move to archive
200
- ```
67
+ ## The 9 Stages
201
68
 
202
- See [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) for complete OpenSpec reference.
69
+ | Stage | Command | Purpose |
70
+ |-------|---------|---------|
71
+ | **1. Status** | `/status` | Check current context, active work |
72
+ | **2. Research** | `/research` | Deep research with AI, document findings |
73
+ | **3. Plan** | `/plan` | Create plan + branch + tracking |
74
+ | **4. Dev** | `/dev` | TDD development (RED-GREEN-REFACTOR) |
75
+ | **5. Check** | `/check` | Validate: types, lint, tests, security |
76
+ | **6. Ship** | `/ship` | Create PR with documentation |
77
+ | **7. Review** | `/review` | Address ALL PR feedback |
78
+ | **8. Merge** | `/merge` | Update docs, merge, cleanup |
79
+ | **9. Verify** | `/verify` | Final documentation check |
203
80
 
204
- ### Claude Tasks - Save and Resume Work
81
+ **Full workflow guide**: [docs/WORKFLOW.md](docs/WORKFLOW.md)
205
82
 
206
- Claude Code's built-in task system lets you save work state and resume later.
83
+ ---
207
84
 
85
+ ## Supported AI Agents
86
+
87
+ Works with **11+ AI coding agents**:
88
+
89
+ | Agent | Status | Setup Time |
90
+ |-------|--------|------------|
91
+ | **Claude Code** | ✅ Full support | 30 seconds |
92
+ | **Cursor** | ✅ Full support | 30 seconds |
93
+ | **Windsurf** | ✅ Full support | 30 seconds |
94
+ | **GitHub Copilot** | ✅ Full support | 30 seconds |
95
+ | **Google Antigravity** | ✅ Full support | 30 seconds |
96
+ | **Kilo Code** | ✅ Full support | 30 seconds |
97
+ | **OpenCode** | ✅ Full support | 30 seconds |
98
+ | **Continue** | ✅ Full support | 30 seconds |
99
+ | **Cline** | ✅ Full support | 30 seconds |
100
+ | **Roo Code** | ✅ Full support | 30 seconds |
101
+ | **Aider** | ✅ Full support | 30 seconds |
102
+
103
+ **Setup for specific agents**:
208
104
  ```bash
209
- # Save current task state
210
- /tasks save "implementing auth flow"
211
-
212
- # List saved tasks
213
- /tasks list
214
-
215
- # Resume a saved task
216
- /tasks resume <task-id>
217
-
218
- # Delete a task
219
- /tasks delete <task-id>
105
+ npx forge setup --agents claude,cursor,windsurf
220
106
  ```
221
107
 
222
- **When to use Claude Tasks:**
223
- - Taking a break mid-implementation
224
- - Switching between features
225
- - Preserving context before `/clear`
226
- - Handoff to another session
227
-
228
- ## The 9 Stages
229
-
230
- | Stage | Command | What It Does | Tools Used |
231
- |-------|---------|--------------|------------|
232
- | 1 | `/status` | Check current context | Beads, Git |
233
- | 2 | `/research` | Deep research, document findings | Web search, Codebase |
234
- | 3 | `/plan` | Create plan, branch, tracking | Beads, OpenSpec |
235
- | 4 | `/dev` | TDD development (RED-GREEN-REFACTOR) | Tests, Code |
236
- | 5 | `/check` | Validation (type/lint/security/tests) | CI tools |
237
- | 6 | `/ship` | Create PR with documentation | GitHub CLI |
238
- | 7 | `/review` | Address ALL PR feedback | GitHub, Greptile |
239
- | 8 | `/merge` | Update docs, merge, cleanup | Git |
240
- | 9 | `/verify` | Final documentation check | Docs |
241
-
242
- ## Complete Workflow Example
243
-
108
+ **Setup for all agents**:
244
109
  ```bash
245
- # ═══════════════════════════════════════════════════════════
246
- # STAGE 1: STATUS - Where are we?
247
- # ═══════════════════════════════════════════════════════════
248
- /status
249
-
250
- # Checks:
251
- # - bd ready (Beads issues ready to work)
252
- # - bd list --status in_progress (active work)
253
- # - git status (branch state)
254
- # - openspec list --active (pending proposals)
255
-
256
- # ═══════════════════════════════════════════════════════════
257
- # STAGE 2: RESEARCH - Understand before building
258
- # ═══════════════════════════════════════════════════════════
259
- /research user-authentication
260
-
261
- # Creates: docs/research/user-authentication.md
262
- # Contains:
263
- # - Codebase analysis (existing patterns)
264
- # - Web research (best practices, security)
265
- # - OWASP Top 10 analysis
266
- # - Key decisions with reasoning
267
- # - TDD test scenarios (identified UPFRONT)
268
-
269
- # ═══════════════════════════════════════════════════════════
270
- # STAGE 3: PLAN - Create formal plan
271
- # ═══════════════════════════════════════════════════════════
272
- /plan user-authentication
273
-
274
- # If TACTICAL (< 1 day):
275
- bd create "Add user authentication"
276
- git checkout -b feat/user-authentication
277
-
278
- # If STRATEGIC (architecture change):
279
- openspec proposal create user-authentication
280
- # Write proposal.md, tasks.md, design.md
281
- openspec validate user-authentication --strict
282
- bd create "User auth (see openspec/changes/user-authentication)"
283
- git checkout -b feat/user-authentication
284
- # Create PR for proposal approval first!
285
-
286
- # ═══════════════════════════════════════════════════════════
287
- # STAGE 4: DEV - TDD Implementation
288
- # ═══════════════════════════════════════════════════════════
289
- /dev
290
-
291
- # TDD Cycle (repeat for each feature):
292
- # RED: Write failing test
293
- # GREEN: Make it pass (minimal code)
294
- # REFACTOR: Clean up
295
- # COMMIT: git commit after each GREEN
296
-
297
- bd update <id> --status in_progress
298
-
299
- # If taking a break:
300
- /tasks save "auth flow - completed login, starting signup"
301
-
302
- # ═══════════════════════════════════════════════════════════
303
- # STAGE 5: CHECK - Validate everything
304
- # ═══════════════════════════════════════════════════════════
305
- /check
306
-
307
- # Runs:
308
- # - Type checking (tsc/typecheck)
309
- # - Linting (eslint)
310
- # - Unit tests
311
- # - Integration tests
312
- # - E2E tests
313
- # - Security scan
314
-
315
- # If fails:
316
- bd update <id> --status blocked --comment "Type errors in auth.ts"
317
-
318
- # ═══════════════════════════════════════════════════════════
319
- # STAGE 6: SHIP - Create PR
320
- # ═══════════════════════════════════════════════════════════
321
- /ship
322
-
323
- bd update <id> --status done
324
- git push -u origin feat/user-authentication
325
-
326
- gh pr create --title "feat: user authentication" --body "
327
- ## Summary
328
- - JWT-based auth with refresh tokens
329
- - Login/signup/logout flows
330
- - Password reset via email
331
-
332
- ## Research
333
- See: docs/research/user-authentication.md
334
-
335
- ## Beads Issue
336
- Closes: beads-abc123
337
-
338
- ## Test Coverage
339
- - 45 unit tests
340
- - 12 integration tests
341
- - 8 E2E tests
342
- "
343
-
344
- # ═══════════════════════════════════════════════════════════
345
- # STAGE 7: REVIEW - Address ALL feedback
346
- # ═══════════════════════════════════════════════════════════
347
- /review 123
348
-
349
- # Address:
350
- # - GitHub Actions failures
351
- # - Greptile comments
352
- # - SonarCloud issues
353
- # - Human reviewer comments
354
-
355
- # Fix, commit, push
356
- git commit -m "fix: address PR review feedback"
357
- git push
358
-
359
- # ═══════════════════════════════════════════════════════════
360
- # STAGE 8: MERGE - Complete the work
361
- # ═══════════════════════════════════════════════════════════
362
- /merge 123
363
-
364
- # Update docs BEFORE merge:
365
- # - docs/planning/PROGRESS.md
366
- # - API documentation
367
- # - README if user-facing
368
-
369
- gh pr merge 123 --squash --delete-branch
370
-
371
- # If OpenSpec was used:
372
- openspec archive user-authentication
373
-
374
- bd sync
375
- git checkout main && git pull
376
-
377
- # ═══════════════════════════════════════════════════════════
378
- # STAGE 9: VERIFY - Final documentation check
379
- # ═══════════════════════════════════════════════════════════
380
- /verify
381
-
382
- # Verify:
383
- # - PROGRESS.md updated
384
- # - API docs current
385
- # - README examples work
386
- # - Cross-references valid
387
-
388
- # Done! Back to /status for next task
110
+ npx forge setup --all
389
111
  ```
390
112
 
391
- ## Directory Structure
113
+ [Agent-specific setup instructions](docs/SETUP.md)
392
114
 
393
- After running `npx forge setup`, only selected agents are configured:
394
-
395
- ```
396
- your-project/
397
- ├── AGENTS.md # Universal standard (always created)
398
- ├── CLAUDE.md # -> linked to AGENTS.md (if Claude selected)
399
- ├── GEMINI.md # -> linked (if Antigravity selected)
400
- ├── .cursorrules # -> linked (if Cursor selected)
401
- ├── .windsurfrules # -> linked (if Windsurf selected)
402
- ├── .clinerules # -> linked (if Cline/Roo selected)
403
-
404
- ├── .beads/ # Beads issue tracking (if bd init)
405
- │ └── issues/
406
-
407
- ├── openspec/ # OpenSpec proposals (if openspec init)
408
- │ ├── specs/
409
- │ └── changes/
410
-
411
- ├── .claude/ # Claude Code (if selected)
412
- │ ├── commands/ # 9 workflow commands
413
- │ ├── rules/
414
- │ └── skills/forge-workflow/
415
-
416
- ├── .cursor/ # Cursor (if selected)
417
- │ ├── rules/forge-workflow.mdc
418
- │ └── skills/forge-workflow/
419
-
420
- ├── .windsurf/ # Windsurf (if selected)
421
- │ ├── workflows/
422
- │ └── skills/forge-workflow/
423
-
424
- └── docs/
425
- ├── planning/PROGRESS.md # Project progress
426
- ├── research/ # Research documents
427
- │ └── TEMPLATE.md
428
- └── WORKFLOW.md # Complete guide
429
- ```
115
+ ---
430
116
 
431
- ## External Services & API Tokens
117
+ ## What Makes Forge Different
432
118
 
433
- Forge integrates with external services for enhanced capabilities. **Most tools have FREE alternatives!**
119
+ ### 1. TDD-First Development
120
+ Tests are written **BEFORE** code, every single time:
121
+ - **RED**: Write a failing test
122
+ - **GREEN**: Write minimal code to pass
123
+ - **REFACTOR**: Clean up and commit
124
+ - **REPEAT**: Next feature
434
125
 
435
- ### Code Review Options (Choose One)
126
+ No feature ships without tests. Period.
436
127
 
437
- | Tool | Pricing | Best For | Setup |
438
- |------|---------|----------|-------|
439
- | **GitHub Code Quality** | FREE | All GitHub repos | Built-in, zero setup ✓ |
440
- | **CodeRabbit** | FREE (OSS) | Open source | GitHub App |
441
- | **Greptile** | $99+/mo | Enterprise | API key |
128
+ ### 2. Research-First Planning
129
+ AI researches best practices before you write a line of code:
130
+ - Web search for latest patterns
131
+ - OWASP Top 10 security analysis
132
+ - Codebase pattern analysis
133
+ - Decisions documented with evidence
442
134
 
443
- **Recommended**: Start with GitHub Code Quality (free, already enabled).
135
+ Saves hours of debugging and refactoring later.
444
136
 
445
- ### Code Quality Options (Choose One)
137
+ ### 3. Universal Compatibility
138
+ One workflow, works with ALL major AI agents:
139
+ - Single `AGENTS.md` file (universal standard)
140
+ - Agent-specific enhancements (slash commands, skills)
141
+ - Git-backed persistence (Beads)
142
+ - No vendor lock-in
446
143
 
447
- | Tool | Pricing | Best For | Setup |
448
- |------|---------|----------|-------|
449
- | **ESLint** | FREE | All projects | Built-in ✓ |
450
- | **SonarCloud** | 50k LoC free | Cloud-first | API key |
451
- | **SonarQube Community** | FREE | Self-hosted | Docker |
144
+ Switch agents anytime without changing your workflow.
452
145
 
453
- **Recommended**: Start with ESLint (free, already in your project).
146
+ ---
454
147
 
455
- Store API tokens in `.env.local`:
148
+ ## The Toolchain
456
149
 
150
+ Forge integrates with powerful tools:
151
+
152
+ ```
153
+ ┌──────────────────────────────────────────────┐
154
+ │ FORGE TOOLCHAIN │
155
+ ├──────────────────────────────────────────────┤
156
+ │ │
157
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
158
+ │ │ BEADS │ │ OPENSPEC │ │ GITHUB │ │
159
+ │ │ Issue │ │ Proposal │ │ PR │ │
160
+ │ │ Tracking │ │ System │ │ Workflow │ │
161
+ │ └──────────┘ └──────────┘ └──────────┘ │
162
+ │ │ │ │ │
163
+ │ └──────────────┴──────────────┘ │
164
+ │ │ │
165
+ │ ┌─────▼─────┐ │
166
+ │ │ FORGE │ │
167
+ │ │ 9-Stage │ │
168
+ │ │ Workflow │ │
169
+ │ └───────────┘ │
170
+ │ │
171
+ └──────────────────────────────────────────────┘
172
+ ```
173
+
174
+ **All tools are optional** - Forge works standalone.
175
+
176
+ **Beads** (optional): Git-backed issue tracking that survives context clearing
457
177
  ```bash
458
- # .env.local (add to .gitignore!)
459
-
460
- # Code Review Tool Selection
461
- CODE_REVIEW_TOOL=github-code-quality # or: coderabbit, greptile, none
462
-
463
- # Code Quality Tool Selection
464
- CODE_QUALITY_TOOL=eslint # or: sonarcloud, sonarqube, none
465
-
466
- # Required for PR workflow
467
- GITHUB_TOKEN=ghp_xxxxxxxxxxxx
468
-
469
- # Parallel AI - Deep web research (/research stage, optional)
470
- PARALLEL_API_KEY=your-parallel-ai-key
471
-
472
- # Greptile - AI code review (only if CODE_REVIEW_TOOL=greptile)
473
- GREPTILE_API_KEY=your-greptile-key
474
-
475
- # SonarCloud (only if CODE_QUALITY_TOOL=sonarcloud)
476
- SONAR_TOKEN=your-sonarcloud-token
477
- SONAR_ORGANIZATION=your-org
478
- SONAR_PROJECT_KEY=your-project-key
479
-
480
- # SonarQube Self-Hosted (only if CODE_QUALITY_TOOL=sonarqube)
481
- SONARQUBE_URL=http://localhost:9000
482
- SONARQUBE_TOKEN=your-token
483
-
178
+ npm install -g @beads/bd && bd init
484
179
  ```
485
180
 
486
- ### Service Setup
487
-
488
- | Service | Pricing | Purpose | Get Token | Used In |
489
- |---------|---------|---------|-----------|---------|
490
- | **GitHub CLI** | FREE | PR workflow | `gh auth login` | `/ship`, `/review`, `/merge` |
491
- | **GitHub Code Quality** | FREE | Code review | Built-in | `/review` |
492
- | **CodeRabbit** | FREE (OSS) | AI code review | [coderabbit.ai](https://coderabbit.ai) | `/review` |
493
- | **Greptile** | $99+/mo | Enterprise review | [greptile.com](https://greptile.com) | `/review` |
494
- | **ESLint** | FREE | Linting | Built-in | `/check` |
495
- | **SonarCloud** | 50k LoC free | Cloud quality | [sonarcloud.io](https://sonarcloud.io) | `/check` |
496
- | **SonarQube** | FREE | Self-hosted quality | Docker | `/check` |
497
- | **Parallel AI** | Paid | Web research | [platform.parallel.ai](https://platform.parallel.ai) | `/research` |
498
-
499
- ### Code Review Setup
500
-
501
- **Option 1: GitHub Code Quality (FREE, Recommended)**
502
-
503
- Zero setup required - GitHub's built-in code quality features are already enabled.
504
-
505
- **Option 2: CodeRabbit (FREE for Open Source)**
506
-
181
+ **OpenSpec** (optional): Spec-driven development for architecture changes
507
182
  ```bash
508
- # 1. Go to https://coderabbit.ai
509
- # 2. Install the GitHub App
510
- # 3. Enable for your repositories
511
- # That's it! CodeRabbit will review PRs automatically.
183
+ npm install -g @fission-ai/openspec && openspec init
512
184
  ```
513
185
 
514
- **Option 3: Greptile (Paid - Enterprise)**
515
-
186
+ **GitHub CLI** (recommended): Required for PR workflow
516
187
  ```bash
517
- # 1. Get API key from https://app.greptile.com
518
- # 2. Add to .env.local
519
- GREPTILE_API_KEY=your-key
520
-
521
- # 3. Index your repository (one-time)
522
- curl -X POST "https://api.greptile.com/v2/repositories" \
523
- -H "Authorization: Bearer $GREPTILE_API_KEY" \
524
- -H "Content-Type: application/json" \
525
- -d '{"remote": "github", "repository": "owner/repo"}'
188
+ gh auth login
526
189
  ```
527
190
 
528
- ### Code Quality Setup
191
+ [Complete toolchain guide](docs/TOOLCHAIN.md)
529
192
 
530
- **Option 1: ESLint Only (FREE, Recommended)**
193
+ ---
531
194
 
532
- Already configured in your project - no additional setup needed.
195
+ ## Real-World Examples
533
196
 
534
- ```bash
535
- npm run lint # or bun run lint
536
- ```
537
-
538
- **Option 2: SonarCloud (Cloud-Hosted)**
197
+ ### Example 1: Simple Feature (15 minutes)
198
+ **Task**: Add a health check endpoint
539
199
 
540
200
  ```bash
541
- # 1. Create project at https://sonarcloud.io
542
- # 2. Get token from Security settings
543
- # 3. Add to .env.local
544
- SONAR_TOKEN=your-token
545
- SONAR_ORGANIZATION=your-org
546
- SONAR_PROJECT_KEY=your-project
547
-
548
- # 4. Add sonar-project.properties
549
- echo "sonar.organization=$SONAR_ORGANIZATION
550
- sonar.projectKey=$SONAR_PROJECT_KEY
551
- sonar.sources=src" > sonar-project.properties
552
-
553
- # 5. Run analysis (in CI or locally)
554
- npx sonarqube-scanner
201
+ /research health-check-endpoint # 2 min: Research patterns
202
+ /plan health-check-endpoint # 1 min: Create plan + branch
203
+ /dev # 8 min: TDD implementation
204
+ /check # 2 min: All validations pass
205
+ /ship # 2 min: PR created
555
206
  ```
556
207
 
557
- **Option 3: SonarQube Community (FREE, Self-Hosted)**
208
+ ### Example 2: Bug Fix with Security (20 minutes)
209
+ **Task**: Fix SQL injection vulnerability
558
210
 
559
211
  ```bash
560
- # 1. Start SonarQube with Docker
561
- docker run -d --name sonarqube -p 9000:9000 sonarqube:community
562
-
563
- # 2. Access at http://localhost:9000 (admin/admin)
564
- # 3. Generate token in SonarQube UI
565
- # 4. Add to .env.local
566
- SONARQUBE_URL=http://localhost:9000
567
- SONARQUBE_TOKEN=your-token
568
-
569
- # 5. Add sonar-project.properties
570
- echo "sonar.host.url=http://localhost:9000
571
- sonar.login=your-token
572
- sonar.projectKey=your-project
573
- sonar.sources=src" > sonar-project.properties
574
-
575
- # 6. Run analysis
576
- npx sonarqube-scanner
212
+ /research sql-injection-fix # 5 min: OWASP research
213
+ /plan sql-injection-fix # 2 min: Plan + branch
214
+ /dev # 8 min: Fix + tests
215
+ /check # 3 min: Security scan
216
+ /ship # 2 min: PR with security notes
577
217
  ```
578
218
 
579
- ### Research Tool Setup
580
-
581
- **Parallel AI (Optional - Paid)**
219
+ ### Example 3: Architecture Change (2-3 days)
220
+ **Task**: Add authentication system
582
221
 
583
222
  ```bash
584
- # 1. Get API key from https://platform.parallel.ai
585
- # 2. Add to .env.local
586
- PARALLEL_API_KEY=your-key
587
-
588
- # 3. Test with curl
589
- API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
590
- curl -s -X POST "https://api.parallel.ai/v1beta/search" \
591
- -H "x-api-key: $API_KEY" \
592
- -H "Content-Type: application/json" \
593
- -H "parallel-beta: search-extract-2025-10-10" \
594
- -d '{"objective": "test query"}'
223
+ /research user-authentication # 30 min: Deep research
224
+ /plan user-authentication # 60 min: OpenSpec proposal
225
+ # → Create PR for proposal approval first
226
+ /dev # 1-2 days: TDD implementation
227
+ /check # 30 min: Full validation
228
+ /ship # 15 min: PR with docs
229
+ /review # Varies: Address feedback
230
+ /merge # 15 min: Merge + cleanup
231
+ /verify # 15 min: Final check
595
232
  ```
596
233
 
597
- ### Loading Tokens
234
+ [More examples in docs/EXAMPLES.md](docs/EXAMPLES.md)
598
235
 
599
- Forge includes a helper script:
600
-
601
- ```bash
602
- # .claude/scripts/load-env.sh
603
- source .claude/scripts/load-env.sh
236
+ ---
604
237
 
605
- # Or manually
606
- export $(grep -v '^#' .env.local | xargs)
607
- ```
238
+ ## Core Principles
608
239
 
609
- ### Security Notes
240
+ **TDD-First**: Tests before code, always
241
+ **Research-First**: Understand before building
242
+ **Security Built-In**: OWASP Top 10 for every feature
243
+ **Documentation Progressive**: Update at each stage
244
+ **Multi-Session**: Work persists across sessions
610
245
 
611
- - **NEVER commit `.env.local`** - add to `.gitignore`
612
- - Use GitHub Secrets for CI/CD
613
- - Rotate tokens periodically
614
- - Use least-privilege tokens where possible
246
+ [Read the philosophy in docs/WORKFLOW.md](docs/WORKFLOW.md)
615
247
 
616
- ## Prerequisites
248
+ ---
617
249
 
618
- ### Required
250
+ ## Next Steps
619
251
 
620
- - **Git** - Version control
621
- - **GitHub CLI** - For PR workflow
622
- ```bash
623
- # macOS
624
- brew install gh && gh auth login
252
+ 📚 **New to Forge?**
253
+ → [QUICKSTART.md](QUICKSTART.md) - Your first feature in 5 minutes
625
254
 
626
- # Windows
627
- winget install GitHub.cli && gh auth login
255
+ 📖 **Learn the workflow**
256
+ [docs/WORKFLOW.md](docs/WORKFLOW.md) - Complete guide with examples
628
257
 
629
- # Linux
630
- sudo apt install gh && gh auth login
631
- ```
258
+ 🛠️ **Setup the toolchain**
259
+ [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) - Beads, OpenSpec, GitHub CLI
632
260
 
633
- ### Recommended
261
+ 🎯 **See real examples**
262
+ → [docs/EXAMPLES.md](docs/EXAMPLES.md) - Real-world use cases
634
263
 
635
- - **Beads** - Issue tracking across sessions
636
- ```bash
637
- npm install -g @beads/bd
638
- bd init
639
- ```
264
+ 💬 **Have questions?**
265
+ → [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
640
266
 
641
- ### Optional
267
+ 🐛 **Found a bug?**
268
+ → [GitHub Issues](https://github.com/harshanandak/forge/issues)
642
269
 
643
- - **OpenSpec** - Spec-driven development (requires Node.js 20.19+)
644
- ```bash
645
- npm install -g @fission-ai/openspec
646
- openspec init
647
- ```
270
+ ---
648
271
 
649
272
  ## Quick Reference
650
273
 
651
- ### Beads Commands
652
-
653
- ```bash
654
- bd init # Initialize in project
655
- bd ready # Show work with no blockers (start here!)
656
- bd create "title" -p 2 # Create issue with priority
657
- bd show <id> # View issue details + audit trail
658
- bd list --status open # List open issues
659
- bd update <id> --status X # Update status
660
- bd dep add <child> <parent> # child depends on parent
661
- bd comments <id> "note" # Add comment
662
- bd close <id> # Complete issue
663
- bd blocked # Show blocked issues
664
- bd sync # Sync with git (always at session end!)
665
- ```
666
-
667
- ### OpenSpec Commands (AI Slash Commands)
668
-
669
- ```bash
670
- /opsx:new # Start new change
671
- /opsx:ff # Fast-forward: generate all docs
672
- /opsx:apply # Implement tasks
673
- /opsx:verify # Validate implementation
674
- /opsx:sync # Merge delta specs
675
- /opsx:archive # Complete and archive
676
- ```
677
-
678
- ### OpenSpec Commands (CLI)
679
-
680
- ```bash
681
- openspec init # Initialize
682
- openspec list # List changes/specs
683
- openspec validate <name> # Validate change
684
- openspec status # Show progress
685
- openspec archive <name> # Archive completed
686
- ```
687
-
688
- ### Claude Tasks Commands
689
-
690
- ```bash
691
- /tasks save "description" # Save current state
692
- /tasks list # List saved tasks
693
- /tasks resume <id> # Resume a task
694
- /tasks delete <id> # Delete a task
695
- ```
696
-
697
- ### Forge Commands
698
-
699
274
  ```bash
700
- /status # Check current state
701
- /research <feature> # Research a feature
702
- /plan <feature> # Create implementation plan
703
- /dev # TDD development
704
- /check # Run all validations
705
- /ship # Create PR
706
- /review <pr> # Address PR feedback
707
- /merge <pr> # Merge PR
708
- /verify # Final doc check
275
+ # Forge commands
276
+ /status # Check current context
277
+ /research <feature> # Research + document
278
+ /plan <feature> # Create plan + branch
279
+ /dev # TDD development
280
+ /check # Validate everything
281
+ /ship # Create PR
282
+ /review <pr> # Address feedback
283
+ /merge <pr> # Merge + cleanup
284
+ /verify # Final docs check
285
+
286
+ # Beads commands (optional)
287
+ bd init # Initialize tracking
288
+ bd ready # Find ready work
289
+ bd create "title" # Create issue
290
+ bd update <id> --status X # Update status
291
+ bd sync # Sync with git
292
+
293
+ # OpenSpec commands (optional)
294
+ /opsx:new # Start change
295
+ /opsx:ff # Generate all docs
296
+ /opsx:apply # Implement tasks
297
+ /opsx:archive # Complete change
709
298
  ```
710
299
 
711
- ## Core Principles
712
-
713
- ### TDD-First
714
-
715
- Every feature starts with tests:
716
-
717
- ```
718
- RED -> Write a failing test
719
- GREEN -> Write minimal code to pass
720
- REFACTOR -> Clean up, commit
721
- REPEAT -> Next test case
722
- ```
723
-
724
- ### Research-First
725
-
726
- Before building, understand:
727
-
728
- 1. **Codebase** - Existing patterns, affected modules
729
- 2. **Best practices** - Web research, official docs
730
- 3. **Security** - OWASP Top 10 analysis
731
- 4. **Decisions** - Document WHY, not just WHAT
732
-
733
- ### Security Built-In
734
-
735
- Every feature includes:
736
-
737
- - OWASP Top 10 analysis in research
738
- - Security test scenarios in TDD
739
- - Automated scans in `/check`
740
- - Security review in PR
741
-
742
- ### Documentation Progressive
743
-
744
- Update docs at each stage:
745
-
746
- - `/research` -> Research document
747
- - `/plan` -> Beads issue, OpenSpec (if strategic)
748
- - `/ship` -> PR description
749
- - `/merge` -> PROGRESS.md, API docs
750
- - `/verify` -> Cross-check everything
751
-
752
- ## Agent Compatibility
753
-
754
- Forge is designed for Claude Code's extensive features but adapts to all agents:
300
+ ---
755
301
 
756
- ### Feature Availability by Agent
302
+ ## License
757
303
 
758
- | Feature | Claude Code | Cursor | Windsurf | Kilo | Others |
759
- |---------|-------------|--------|----------|------|--------|
760
- | **Slash Commands** | `/status` etc. | Via rules | `/status` etc. | `/status.md` | AGENTS.md |
761
- | **Skills (SKILL.md)** | Full | Full | Full | Full | Partial |
762
- | **Rules** | `.claude/rules/` | `.mdc` | `.windsurf/rules/` | `.kilocode/rules/` | AGENTS.md |
763
- | **Tasks Save/Resume** | `/tasks` | Memory | Memories | Memory Bank | Manual |
764
- | **Issue Tracking** | Beads | Beads | Beads | Memory Bank | Beads |
765
- | **Proposals** | OpenSpec | OpenSpec | OpenSpec | OpenSpec | OpenSpec |
304
+ MIT © Harsha Nandak
766
305
 
767
- ### How Forge Adapts
306
+ ---
768
307
 
769
- **Claude Code** (Full Support):
770
- ```bash
771
- /status # Native slash command
772
- /tasks save # Built-in task persistence
773
- bd ready # Beads integration
774
- ```
308
+ **Ready to start?**
775
309
 
776
- **Cursor/Windsurf** (Near-Full Support):
777
310
  ```bash
778
- # Read AGENTS.md instructions
779
- # Use Memories/Memory for persistence
780
- # Same Beads/OpenSpec workflow
781
- ```
782
-
783
- **Other Agents** (AGENTS.md Fallback):
784
- ```
785
- The agent reads AGENTS.md and follows the 9-stage workflow.
786
- Users describe what stage they're at: "I'm at the /dev stage"
787
- Agent follows the documented process.
788
- ```
789
-
790
- ### The Universal Principle
791
-
792
- Even without slash commands, the **workflow principles** work everywhere:
793
-
794
- 1. **Check status before starting** - Review active work, git state
795
- 2. **Research before building** - Document decisions
796
- 3. **Plan formally** - Create tracking issue, branch
797
- 4. **TDD development** - RED-GREEN-REFACTOR
798
- 5. **Validate thoroughly** - Type/lint/test/security
799
- 6. **Document in PR** - Link research, list tests
800
- 7. **Address ALL feedback** - CI failures, reviews
801
- 8. **Update docs before merge** - PROGRESS.md, API docs
802
- 9. **Verify completeness** - Cross-check everything
803
-
804
- ### Persistence Across Agents
805
-
806
- | Agent | How to Persist Context |
807
- |-------|------------------------|
808
- | **Claude Code** | `/tasks save`, Beads issues |
809
- | **Cursor** | Composer memory, Beads |
810
- | **Windsurf** | Cascade Memories, Beads |
811
- | **Kilo Code** | Memory Bank, Beads |
812
- | **Cline** | Memory Bank, Beads |
813
- | **Others** | Beads (git-backed, universal) |
814
-
815
- **Beads is the universal solution** - it works with ANY agent because it's git-backed.
816
-
817
- ### Why This Architecture?
818
-
819
- ```
820
- ┌─────────────────────────────────────────────────────────────┐
821
- │ FORGE ARCHITECTURE │
822
- ├─────────────────────────────────────────────────────────────┤
823
- │ │
824
- │ AGENTS.md (Universal) │
825
- │ ├── Works with EVERY agent │
826
- │ ├── Plain markdown, no special features needed │
827
- │ └── Contains full workflow documentation │
828
- │ │
829
- │ Agent-Specific Enhancements (Optional) │
830
- │ ├── .claude/commands/ -> Native slash commands │
831
- │ ├── .cursor/rules/ -> Cursor MDC rules │
832
- │ ├── .windsurf/workflows/ -> Windsurf workflows │
833
- │ └── etc. │
834
- │ │
835
- │ External Tools (Universal) │
836
- │ ├── Beads -> Issue tracking (git-backed) │
837
- │ ├── OpenSpec -> Architectural proposals │
838
- │ └── GitHub CLI -> PR workflow │
839
- │ │
840
- └─────────────────────────────────────────────────────────────┘
311
+ npm install forge-workflow
312
+ npx forge setup
313
+ /status
841
314
  ```
842
315
 
843
- The workflow **degrades gracefully**:
844
- - Full features in Claude Code
845
- - Most features in Cursor/Windsurf/Kilo
846
- - Core workflow in ANY agent via AGENTS.md
847
-
848
- ## License
849
-
850
- MIT
851
-
852
- ## Contributing
853
-
854
- Contributions welcome! Please read `docs/WORKFLOW.md` before submitting PRs.
855
-
856
- ---
857
-
858
- **Start with:** `npm install forge-workflow && npx forge setup`
859
-
860
- **Then:** `/status` to see where to begin!
316
+ Then open [QUICKSTART.md](QUICKSTART.md) and ship your first feature! 🚀