forge-workflow 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/.claude/commands/dev.md +340 -340
  2. package/.claude/commands/plan.md +521 -521
  3. package/.claude/commands/premerge.md +176 -176
  4. package/.claude/commands/research.md +42 -42
  5. package/.claude/commands/review.md +442 -442
  6. package/.claude/commands/rollback.md +721 -721
  7. package/.claude/commands/ship.md +164 -164
  8. package/.claude/commands/sonarcloud.md +152 -152
  9. package/.claude/commands/status.md +48 -48
  10. package/.claude/commands/validate.md +282 -282
  11. package/.claude/commands/verify.md +221 -221
  12. package/.claude/rules/greptile-review-process.md +285 -285
  13. package/.claude/rules/workflow.md +105 -105
  14. package/.claude/scripts/greptile-resolve.sh +526 -526
  15. package/.claude/scripts/load-env.sh +32 -32
  16. package/.cline/workflows/dev.md +337 -337
  17. package/.cline/workflows/plan.md +518 -518
  18. package/.cline/workflows/premerge.md +173 -173
  19. package/.cline/workflows/research.md +39 -39
  20. package/.cline/workflows/review.md +439 -439
  21. package/.cline/workflows/rollback.md +718 -718
  22. package/.cline/workflows/ship.md +161 -161
  23. package/.cline/workflows/sonarcloud.md +146 -146
  24. package/.cline/workflows/status.md +45 -45
  25. package/.cline/workflows/validate.md +279 -279
  26. package/.cline/workflows/verify.md +218 -218
  27. package/.codex/config.toml +11 -11
  28. package/.codex/skills/dev/SKILL.md +340 -340
  29. package/.codex/skills/plan/SKILL.md +521 -521
  30. package/.codex/skills/premerge/SKILL.md +176 -176
  31. package/.codex/skills/research/SKILL.md +42 -42
  32. package/.codex/skills/review/SKILL.md +442 -442
  33. package/.codex/skills/rollback/SKILL.md +721 -721
  34. package/.codex/skills/ship/SKILL.md +164 -164
  35. package/.codex/skills/sonarcloud/SKILL.md +149 -149
  36. package/.codex/skills/status/SKILL.md +48 -48
  37. package/.codex/skills/validate/SKILL.md +282 -282
  38. package/.codex/skills/verify/SKILL.md +221 -221
  39. package/.cursor/commands/dev.md +337 -337
  40. package/.cursor/commands/plan.md +518 -518
  41. package/.cursor/commands/premerge.md +173 -173
  42. package/.cursor/commands/research.md +39 -39
  43. package/.cursor/commands/review.md +439 -439
  44. package/.cursor/commands/rollback.md +718 -718
  45. package/.cursor/commands/ship.md +161 -161
  46. package/.cursor/commands/sonarcloud.md +146 -146
  47. package/.cursor/commands/status.md +45 -45
  48. package/.cursor/commands/validate.md +279 -279
  49. package/.cursor/commands/verify.md +218 -218
  50. package/.cursor/rules/permissions-guidance.mdc +37 -37
  51. package/.forge/hooks/check-tdd.js +240 -240
  52. package/.github/PLUGIN_TEMPLATE.json +32 -32
  53. package/.github/prompts/dev.prompt.md +342 -342
  54. package/.github/prompts/plan.prompt.md +523 -523
  55. package/.github/prompts/premerge.prompt.md +178 -178
  56. package/.github/prompts/research.prompt.md +44 -44
  57. package/.github/prompts/review.prompt.md +444 -444
  58. package/.github/prompts/rollback.prompt.md +723 -723
  59. package/.github/prompts/ship.prompt.md +166 -166
  60. package/.github/prompts/sonarcloud.prompt.md +151 -151
  61. package/.github/prompts/status.prompt.md +50 -50
  62. package/.github/prompts/validate.prompt.md +284 -284
  63. package/.github/prompts/verify.prompt.md +223 -223
  64. package/.github/workflows/beads-to-github.yml +56 -0
  65. package/.github/workflows/github-to-beads.yml +97 -0
  66. package/.kilocode/workflows/dev.md +341 -341
  67. package/.kilocode/workflows/plan.md +522 -522
  68. package/.kilocode/workflows/premerge.md +177 -177
  69. package/.kilocode/workflows/research.md +43 -43
  70. package/.kilocode/workflows/review.md +443 -443
  71. package/.kilocode/workflows/rollback.md +722 -722
  72. package/.kilocode/workflows/ship.md +165 -165
  73. package/.kilocode/workflows/sonarcloud.md +150 -150
  74. package/.kilocode/workflows/status.md +49 -49
  75. package/.kilocode/workflows/validate.md +283 -283
  76. package/.kilocode/workflows/verify.md +222 -222
  77. package/.mcp.json.example +12 -12
  78. package/.opencode/commands/dev.md +340 -340
  79. package/.opencode/commands/plan.md +521 -521
  80. package/.opencode/commands/premerge.md +176 -176
  81. package/.opencode/commands/research.md +42 -42
  82. package/.opencode/commands/review.md +442 -442
  83. package/.opencode/commands/rollback.md +721 -721
  84. package/.opencode/commands/ship.md +164 -164
  85. package/.opencode/commands/sonarcloud.md +149 -149
  86. package/.opencode/commands/status.md +48 -48
  87. package/.opencode/commands/validate.md +282 -282
  88. package/.opencode/commands/verify.md +221 -221
  89. package/.roo/commands/dev.md +341 -341
  90. package/.roo/commands/plan.md +522 -522
  91. package/.roo/commands/premerge.md +177 -177
  92. package/.roo/commands/research.md +43 -43
  93. package/.roo/commands/review.md +443 -443
  94. package/.roo/commands/rollback.md +722 -722
  95. package/.roo/commands/ship.md +165 -165
  96. package/.roo/commands/sonarcloud.md +150 -150
  97. package/.roo/commands/status.md +49 -49
  98. package/.roo/commands/validate.md +283 -283
  99. package/.roo/commands/verify.md +222 -222
  100. package/AGENTS.md +175 -175
  101. package/CLAUDE.md +100 -100
  102. package/README.md +429 -416
  103. package/bin/forge-cmd.js +313 -313
  104. package/bin/forge-preflight.js +309 -309
  105. package/bin/forge.js +4596 -4303
  106. package/docs/AGENT_INSTALL_PROMPT.md +342 -342
  107. package/docs/BEADS_GITHUB_SYNC.md +251 -251
  108. package/docs/ENHANCED_ONBOARDING.md +602 -602
  109. package/docs/EXAMPLES.md +482 -482
  110. package/docs/GREPTILE_SETUP.md +400 -400
  111. package/docs/MANUAL_REVIEW_GUIDE.md +106 -106
  112. package/docs/ROADMAP.md +359 -359
  113. package/docs/SETUP.md +663 -631
  114. package/docs/TOOLCHAIN.md +630 -630
  115. package/docs/VALIDATION.md +363 -363
  116. package/install.sh +40 -1056
  117. package/lefthook.yml +39 -39
  118. package/lib/agents/README.md +198 -198
  119. package/lib/agents/claude.plugin.json +28 -28
  120. package/lib/agents/cline.plugin.json +22 -22
  121. package/lib/agents/codex.plugin.json +19 -19
  122. package/lib/agents/copilot.plugin.json +24 -24
  123. package/lib/agents/cursor.plugin.json +25 -25
  124. package/lib/agents/kilocode.plugin.json +22 -22
  125. package/lib/agents/opencode.plugin.json +20 -20
  126. package/lib/agents/roo.plugin.json +23 -23
  127. package/lib/agents-config.js +2112 -2112
  128. package/lib/beads-health-check.js +143 -0
  129. package/lib/beads-setup.js +341 -0
  130. package/lib/beads-sync-scaffold.js +260 -0
  131. package/lib/commands/dev.js +513 -513
  132. package/lib/commands/plan.js +692 -692
  133. package/lib/commands/recommend.js +119 -119
  134. package/lib/commands/ship.js +377 -377
  135. package/lib/commands/status.js +378 -378
  136. package/lib/commands/validate.js +602 -602
  137. package/lib/context-merge.js +359 -359
  138. package/lib/dep-guard/analyzer.js +294 -294
  139. package/lib/dep-guard/behavior-detector.js +98 -98
  140. package/lib/dep-guard/contract-detector.js +162 -162
  141. package/lib/dep-guard/import-detector.js +498 -498
  142. package/lib/dep-guard/path-utils.js +13 -13
  143. package/lib/dep-guard/rubric.js +120 -120
  144. package/lib/dep-guard/task-parser.js +318 -318
  145. package/lib/detect-agent.js +191 -191
  146. package/lib/detect-worktree.js +47 -47
  147. package/lib/file-hash.js +26 -26
  148. package/lib/husky-migration.js +450 -0
  149. package/lib/lefthook-check.js +65 -0
  150. package/lib/pat-setup.js +207 -0
  151. package/lib/plugin-catalog.js +350 -350
  152. package/lib/plugin-manager.js +166 -166
  153. package/lib/plugin-recommender.js +141 -141
  154. package/lib/project-discovery.js +491 -491
  155. package/lib/setup-action-log.js +139 -139
  156. package/lib/setup-summary-renderer.js +106 -106
  157. package/lib/setup-utils.js +96 -0
  158. package/lib/setup.js +192 -192
  159. package/lib/smart-merge.js +64 -0
  160. package/lib/symlink-utils.js +81 -0
  161. package/lib/workflow-profiles.js +197 -197
  162. package/package.json +131 -128
  163. package/scripts/beads-context.sh +291 -0
  164. package/scripts/beads-context.test.js +563 -0
  165. package/scripts/behavioral-judge.sh +378 -0
  166. package/scripts/benchmark.js +85 -0
  167. package/scripts/branch-protection.js +183 -0
  168. package/scripts/check-agents.js +172 -0
  169. package/scripts/commitlint.js +42 -0
  170. package/scripts/conflict-detect.sh +323 -0
  171. package/scripts/dep-guard-analyze.js +71 -0
  172. package/scripts/dep-guard.sh +811 -0
  173. package/scripts/eval_win.py +249 -0
  174. package/scripts/file-index.sh +399 -0
  175. package/scripts/github-beads-sync/comment.mjs +64 -0
  176. package/scripts/github-beads-sync/config.mjs +148 -0
  177. package/scripts/github-beads-sync/github-api.mjs +131 -0
  178. package/scripts/github-beads-sync/index.mjs +332 -0
  179. package/scripts/github-beads-sync/label-mapper.mjs +54 -0
  180. package/scripts/github-beads-sync/mapping.mjs +78 -0
  181. package/scripts/github-beads-sync/reverse-sync-cli.mjs +31 -0
  182. package/scripts/github-beads-sync/reverse-sync.mjs +138 -0
  183. package/scripts/github-beads-sync/run-bd.mjs +159 -0
  184. package/scripts/github-beads-sync/sanitize.mjs +121 -0
  185. package/scripts/github-beads-sync.config.json +26 -0
  186. package/scripts/improve-command.js +375 -0
  187. package/scripts/lib/eval-runner.js +229 -0
  188. package/scripts/lib/eval-schema.js +135 -0
  189. package/scripts/lib/eval-storage.js +78 -0
  190. package/scripts/lib/grading.js +203 -0
  191. package/scripts/lib/transcript-parser.js +63 -0
  192. package/scripts/lint.js +47 -0
  193. package/scripts/migrate-to-bun-test.js +412 -0
  194. package/scripts/run-command-eval.js +236 -0
  195. package/scripts/smart-status.sh +782 -0
  196. package/scripts/sync-commands.js +571 -0
  197. package/scripts/sync-utils.sh +460 -0
  198. package/scripts/test-dashboard.js +123 -0
  199. package/scripts/test.js +44 -0
  200. package/scripts/validate.sh +94 -0
  201. package/skills/parallel-deep-research/SKILL.md +108 -108
  202. package/skills/parallel-deep-research/evals/README.md +27 -27
  203. package/skills/parallel-deep-research/evals/evals.json +62 -62
  204. package/skills/sonarcloud-analysis/SKILL.md +171 -171
  205. package/skills/sonarcloud-analysis/evals/README.md +27 -27
  206. package/skills/sonarcloud-analysis/evals/evals.json +50 -50
  207. package/skills/sonarcloud-analysis/references/api-reference.md +466 -466
  208. package/.cursor/hooks/state/continual-learning-index.json +0 -19
  209. package/.cursor/hooks/state/continual-learning.json +0 -8
package/README.md CHANGED
@@ -1,416 +1,429 @@
1
- # Forge
2
-
3
- [![npm version](https://img.shields.io/npm/v/forge-workflow.svg)](https://www.npmjs.com/package/forge-workflow)
4
- [![npm downloads](https://img.shields.io/npm/dw/forge-workflow.svg)](https://www.npmjs.com/package/forge-workflow)
5
- [![license](https://img.shields.io/npm/l/forge-workflow.svg)](https://github.com/harshanandak/forge/blob/master/LICENSE)
6
- [![Tests](https://github.com/harshanandak/forge/actions/workflows/test.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/test.yml)
7
- [![ESLint](https://github.com/harshanandak/forge/actions/workflows/eslint.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/eslint.yml)
8
- [![Greptile Quality Gate](https://github.com/harshanandak/forge/actions/workflows/greptile-quality-gate.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/greptile-quality-gate.yml)
9
- [![Package Size](https://github.com/harshanandak/forge/actions/workflows/size-check.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/size-check.yml)
10
- [![Coverage](https://img.shields.io/badge/coverage-80%25-brightgreen.svg)](https://github.com/harshanandak/forge)
11
- [![CodeQL](https://github.com/harshanandak/forge/actions/workflows/codeql.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/codeql.yml)
12
- [![Security Policy](https://img.shields.io/badge/security-policy-blue.svg)](https://github.com/harshanandak/forge/blob/master/SECURITY.md)
13
-
14
- Ship features with confidence using a 7-stage TDD-first workflow for AI coding agents.
15
-
16
- ```
17
- /plan → /dev → /validate → /ship → /review → /premerge → /verify
18
- ```
19
-
20
- ✅ **TDD-First**: Write tests before code
21
- ✅ **Design-First**: One-question-at-a-time Q&A captures intent upfront
22
- ✅ **Multi-Agent**: Universal AGENTS.md works with 8 agents
23
-
24
- ---
25
-
26
- ## Quick Example
27
-
28
- **Adding a login button with Forge:**
29
-
30
- ```bash
31
- /plan login-button # Design Q&A → research → branch + task list
32
- /dev # TDD: RED → GREEN → REFACTOR cycles
33
- /validate # Type check + lint + tests + security scan
34
- /ship # Create PR with full documentation
35
- ```
36
-
37
- **Result**: Feature shipped with tests, security validated, fully documented.
38
-
39
- **Without Forge** (chaotic):
40
- - Code first, tests later (or never)
41
- - No research or planning
42
- - Security issues found in production
43
- - Documentation forgotten
44
-
45
- **With Forge** (systematic):
46
- - Tests written BEFORE code (TDD)
47
- - Research-backed decisions
48
- - OWASP Top 10 analysis in every /plan
49
- - Documentation at every stage
50
-
51
- → [See complete walkthrough in QUICKSTART.md](QUICKSTART.md)
52
-
53
- ---
54
-
55
- ## Installation
56
-
57
- ```bash
58
- # Step 1: Install the package
59
- bun install forge-workflow
60
-
61
- # Step 2: Setup for your AI agent
62
- bunx forge setup
63
- ```
64
-
65
- **That's it!** Forge will:
66
- - Create AGENTS.md (universal instructions)
67
- - Setup agent-specific files (Claude, Cursor, etc.)
68
- - Create docs/ folder with guides
69
-
70
- **Prerequisites**: Node.js, Git, GitHub account
71
- **Optional tools**: Beads (issue tracking)
72
-
73
- [Detailed setup guide for all agents](docs/SETUP.md)
74
-
75
- ---
76
-
77
- ## The 7 Stages
78
-
79
- | Stage | Command | Purpose |
80
- |-------|---------|---------|
81
- | **utility** | `/status` | Ranked issue dashboard with conflict detection |
82
- | **1. Plan** | `/plan` | Design Q&A research branch + task list |
83
- | **2. Dev** | `/dev` | Subagent TDD per task (spec + quality review) |
84
- | **3. Validate** | `/validate` | Validate: types, lint, tests, security |
85
- | **4. Ship** | `/ship` | Create PR with documentation |
86
- | **5. Review** | `/review` | Address ALL PR feedback (Greptile, reviewers, CI/CD) |
87
- | **6. Premerge** | `/premerge` | Complete docs on feature branch, hand off PR |
88
- | **7. Verify** | `/verify` | Post-merge health check (CI on main) |
89
-
90
- **Full workflow guide**: [AGENTS.md](AGENTS.md)
91
-
92
- ---
93
-
94
- ## Supported AI Agents
95
-
96
- Works with **8 AI coding agents** via universal AGENTS.md:
97
-
98
- ### Tier 1 (Primary Support)
99
-
100
- | Agent | Features | Setup Time |
101
- |-------|----------|------------|
102
- | **Claude Code** | Custom slash commands, .claude/ directory | 30 seconds |
103
- | **GitHub Copilot** | Enterprise support, .github/copilot-instructions.md | 30 seconds |
104
- | **Kilo Code** | Auto failure recovery, .kilo.md | 30 seconds |
105
- | **Cursor** | Native modes (Plan/Ask/Debug), .cursor/rules/ | 30 seconds |
106
- | **Codex CLI** | OpenAI terminal agent, AGENTS.md | 30 seconds |
107
-
108
- ### Tier 2 (Optional Support)
109
-
110
- | Agent | Features | Setup Time |
111
- |-------|----------|------------|
112
- | **OpenCode** | Flexible, opencode.json | 30 seconds |
113
- | **Goose** | Model flexibility, open-source | 30 seconds |
114
-
115
- **Quick setup** (auto-detects agents):
116
- ```bash
117
- bunx forge setup
118
- ```
119
-
120
- **Setup for specific agent**:
121
- ```bash
122
- bunx forge setup --agent=copilot # GitHub Copilot
123
- bunx forge setup --agent=cursor # Cursor IDE
124
- bunx forge setup --agent=kilo # Kilo Code
125
- bunx forge setup --agent=codex # Codex CLI
126
- ```
127
-
128
- **Setup for all Tier 1 agents**:
129
- ```bash
130
- bunx forge setup --all
131
- ```
132
-
133
- [Agent-specific setup instructions](docs/SETUP.md)
134
-
135
- ---
136
-
137
- ## What Makes Forge Different
138
-
139
- ### 1. TDD-First Development
140
- Tests are written **BEFORE** code, every single time:
141
- - **RED**: Write a failing test
142
- - **GREEN**: Write minimal code to pass
143
- - **REFACTOR**: Clean up and commit
144
- - **REPEAT**: Next feature
145
-
146
- No feature ships without tests. Period.
147
-
148
- ### 2. Research-First Planning
149
- AI researches best practices before you write a line of code:
150
- - Web search for latest patterns
151
- - OWASP Top 10 security analysis
152
- - Codebase pattern analysis
153
- - Decisions documented with evidence
154
-
155
- Saves hours of debugging and refactoring later.
156
-
157
- ### 3. Universal Compatibility
158
- One workflow, works with ALL major AI agents:
159
- - Single `AGENTS.md` file (universal standard)
160
- - Agent-specific enhancements (slash commands, skills)
161
- - Git-backed persistence (Beads)
162
- - No vendor lock-in
163
-
164
- Switch agents anytime without changing your workflow.
165
-
166
- ### 4. Built-in TDD Enforcement
167
- Git hooks automatically enforce TDD practices:
168
- - **Pre-commit**: Blocks source commits without tests
169
- - **Pre-push**: Runs full test suite before push
170
- - **Interactive**: Guided recovery when violations occur
171
- - **CI/CD aware**: Auto-aborts in non-interactive environments
172
-
173
- ```bash
174
- # Validation CLI
175
- forge-preflight status # Check project prerequisites
176
- forge-preflight dev # Validate before /dev stage
177
- forge-preflight ship # Validate before /ship stage
178
- ```
179
-
180
- ### 5. Smart Tool Recommendations
181
- Curated plugin catalog across 7 workflow stages — plan, dev, validate, ship, review, and more:
182
- - **Auto-detection**: Scans your project for frameworks, databases, auth, payments, and more
183
- - **Budget modes**: free, open-source, startup, professional, custom
184
- - **Portability-first**: MCPs included only when they add clear value over CLI alternatives
185
- - **Free alternatives**: Every paid tool shows free alternatives
186
-
187
- ```bash
188
- bunx forge recommend # Recommendations for your project
189
- bunx forge recommend --budget free # Only free tools
190
- ```
191
-
192
- → [Validation docs](docs/VALIDATION.md) | [Plugin docs](docs/TOOLCHAIN.md)
193
-
194
- ### 6. Enhanced Onboarding
195
- Smart setup that adapts to your project:
196
-
197
- **Intelligent File Merging**
198
- - Preserves your existing AGENTS.md content
199
- - Adds Forge workflow without overwriting
200
- - Three options: smart merge, keep, or replace
201
- ```bash
202
- bunx forge setup --merge=smart # Intelligent merge
203
- ```
204
-
205
- **Auto-Detection**
206
- - Detects framework (Next.js, React, Vue, Express)
207
- - Detects language (TypeScript, JavaScript)
208
- - Analyzes git stats and CI/CD setup
209
- - Infers project stage (new, active, stable)
210
- - Saves to `.forge/context.json`
211
-
212
- **Workflow Profiles**
213
- - Adapts workflow based on work type (3-8 stages):
214
- - `critical`: Full 8-stage workflow (auth, payments, security-sensitive)
215
- - `standard`: 7-stage workflow (typical features)
216
- - `refactor`: Behavior-preserving 5-stage workflow
217
- - `simple`: Streamlined 4-stage workflow
218
- - `hotfix`: Minimal 3-stage workflow (production fixes)
219
- - `docs`: Minimal 3-stage workflow (documentation/config)
220
- ```bash
221
- bunx forge setup --type=critical # Set workflow manually
222
- ```
223
-
224
- **Context Interview** (optional)
225
- ```bash
226
- bunx forge setup --interview # Gather project context
227
- ```
228
-
229
- [Enhanced onboarding guide](docs/ENHANCED_ONBOARDING.md)
230
-
231
- ### 7. Automated Quality Gates 🆕
232
- Multi-layer quality enforcement before merge:
233
-
234
- **Greptile AI Code Review**
235
- - AI-powered review on every PR
236
- - Catches bugs, security issues, performance problems
237
- - Detailed inline feedback with fix suggestions
238
- - Automatic re-review after changes
239
- ```bash
240
- # Branch protection requires Greptile review to pass
241
- # Typically completes in 1-2 minutes
242
- ```
243
-
244
- **GitHub Actions Workflows**
245
- - Greptile Quality Gate: Enforces minimum score (≥4/5)
246
- - ESLint checks: Code quality validation
247
- - Test suite: All tests must pass
248
-
249
- **Git Hooks (Lefthook)**
250
- - Pre-commit: TDD enforcement (tests required)
251
- - Pre-push: Full test suite + lint checks
252
- - Branch protection: Blocks direct push to main/master
253
-
254
- [Greptile setup guide](docs/GREPTILE_SETUP.md)
255
-
256
- ---
257
-
258
- ## The Toolchain
259
-
260
- Forge integrates with powerful tools:
261
-
262
- ```
263
- ┌──────────────────────────────────────────────┐
264
- │ FORGE TOOLCHAIN │
265
- ├──────────────────────────────────────────────┤
266
- │ │
267
- │ ┌──────────┐ ┌──────────┐ │
268
- │ │ BEADS │ │ GITHUB │ │
269
- │ │ Issue │ │ PR │ │
270
- │ │ Tracking │ │ Workflow │ │
271
- │ └──────────┘ └──────────┘ │
272
- │ │ │ │
273
- │ └──────────────────────────────┘ │
274
- │ │ │
275
- │ ┌─────▼─────┐ │
276
- │ │ FORGE │ │
277
- 7-Stage │
278
- │ │ Workflow │ │
279
- └───────────┘
280
-
281
- └──────────────────────────────────────────────┘
282
- ```
283
-
284
- **All tools are optional** - Forge works standalone.
285
-
286
- **Beads** (optional): Git-backed issue tracking that survives context clearing
287
- ```bash
288
- bun add -g @beads/bd && bd init
289
- ```
290
-
291
- **GitHub CLI** (recommended): Required for PR workflow
292
- ```bash
293
- gh auth login
294
- ```
295
-
296
- → [Complete toolchain guide](docs/TOOLCHAIN.md)
297
-
298
- ---
299
-
300
- ## Real-World Examples
301
-
302
- ### Example 1: Simple Feature (20 minutes)
303
- **Task**: Add a health check endpoint
304
-
305
- ```bash
306
- /plan health-check-endpoint # Design Q&A → research → branch + task list
307
- /dev # 8 min: TDD implementation
308
- /validate # 2 min: All validations pass
309
- /ship # 2 min: PR created
310
- # → Greptile AI review completes (~2 min)
311
- /review # 3 min: Address Greptile feedback
312
- /premerge # 2 min: Complete docs, hand off PR
313
- ```
314
-
315
- ### Example 2: Bug Fix with Security (30 minutes)
316
- **Task**: Fix SQL injection vulnerability
317
-
318
- ```bash
319
- /plan sql-injection-fix # Design Q&A → OWASP research → branch
320
- /dev # 8 min: Fix + tests
321
- /validate # 3 min: Security scan
322
- /ship # 2 min: PR with security notes
323
- # → Greptile validates security fix (~2 min)
324
- /review # 5 min: Address security feedback
325
- /premerge # 3 min: Complete docs, hand off PR
326
- ```
327
-
328
- ### Example 3: Architecture Change (2-3 days)
329
- **Task**: Add authentication system
330
-
331
- ```bash
332
- /plan user-authentication # Design Q&A → deep research → branch
333
- /dev # 1-2 days: TDD implementation
334
- /validate # 30 min: Full validation
335
- /ship # 15 min: PR with docs
336
- /review # Varies: Address feedback
337
- /premerge # 15 min: Complete docs, hand off PR
338
- /verify # 15 min: Post-merge health check
339
- ```
340
-
341
- [More examples in docs/EXAMPLES.md](docs/EXAMPLES.md)
342
-
343
- ---
344
-
345
- ## Core Principles
346
-
347
- **TDD-First**: Tests before code, always
348
- **Design-First**: One-question-at-a-time Q&A captures intent before research
349
- **Security Built-In**: OWASP Top 10 for every feature
350
- **Documentation Progressive**: Update at each stage
351
- **Multi-Session**: Work persists across sessions
352
-
353
- → [Read the philosophy in AGENTS.md](AGENTS.md)
354
-
355
- ---
356
-
357
- ## Next Steps
358
-
359
- 📚 **New to Forge?**
360
- → [QUICKSTART.md](QUICKSTART.md) - Your first feature in 5 minutes
361
-
362
- 📖 **Learn the workflow**
363
- [AGENTS.md](AGENTS.md) - Complete guide with examples
364
-
365
- 🛠️ **Setup the toolchain**
366
- → [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) - Beads, GitHub CLI
367
-
368
- 🎯 **See real examples**
369
- → [docs/EXAMPLES.md](docs/EXAMPLES.md) - Real-world use cases
370
-
371
- 💬 **Have questions?**
372
- [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
373
-
374
- 🐛 **Found a bug?**
375
- [GitHub Issues](https://github.com/harshanandak/forge/issues)
376
-
377
- ---
378
-
379
- ## Quick Reference
380
-
381
- ```bash
382
- # Forge commands
383
- /status # Check current context
384
- /plan <feature> # Design Q&A → research → branch + task list
385
- /dev # TDD development
386
- /validate # Validate everything
387
- /ship # Create PR
388
- /review <pr> # Address feedback
389
- /premerge <pr> # Complete docs, hand off PR
390
- /verify # Post-merge health check
391
-
392
- # Beads commands (optional)
393
- bd init # Initialize tracking
394
- bd ready # Find ready work
395
- bd create "title" # Create issue
396
- bd update <id> --status X # Update status
397
- bd sync # Sync with git
398
- ```
399
-
400
- ---
401
-
402
- ## License
403
-
404
- MIT © Harsha Nandak
405
-
406
- ---
407
-
408
- **Ready to start?**
409
-
410
- ```bash
411
- bun install forge-workflow
412
- bunx forge setup
413
- /status
414
- ```
415
-
416
- Then open [QUICKSTART.md](QUICKSTART.md) and ship your first feature! 🚀
1
+ # Forge
2
+
3
+ [![npm version](https://img.shields.io/npm/v/forge-workflow.svg)](https://www.npmjs.com/package/forge-workflow)
4
+ [![npm downloads](https://img.shields.io/npm/dw/forge-workflow.svg)](https://www.npmjs.com/package/forge-workflow)
5
+ [![license](https://img.shields.io/npm/l/forge-workflow.svg)](https://github.com/harshanandak/forge/blob/master/LICENSE)
6
+ [![Tests](https://github.com/harshanandak/forge/actions/workflows/test.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/test.yml)
7
+ [![ESLint](https://github.com/harshanandak/forge/actions/workflows/eslint.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/eslint.yml)
8
+ [![Greptile Quality Gate](https://github.com/harshanandak/forge/actions/workflows/greptile-quality-gate.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/greptile-quality-gate.yml)
9
+ [![Package Size](https://github.com/harshanandak/forge/actions/workflows/size-check.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/size-check.yml)
10
+ [![Coverage](https://img.shields.io/badge/coverage-80%25-brightgreen.svg)](https://github.com/harshanandak/forge)
11
+ [![CodeQL](https://github.com/harshanandak/forge/actions/workflows/codeql.yml/badge.svg)](https://github.com/harshanandak/forge/actions/workflows/codeql.yml)
12
+ [![Security Policy](https://img.shields.io/badge/security-policy-blue.svg)](https://github.com/harshanandak/forge/blob/master/SECURITY.md)
13
+
14
+ Ship features with confidence using a 7-stage TDD-first workflow for AI coding agents.
15
+
16
+ ```
17
+ /plan → /dev → /validate → /ship → /review → /premerge → /verify
18
+ ```
19
+
20
+ ✅ **TDD-First**: Write tests before code
21
+ ✅ **Design-First**: One-question-at-a-time Q&A captures intent upfront
22
+ ✅ **Multi-Agent**: Universal AGENTS.md works with 8 agents
23
+
24
+ ---
25
+
26
+ ## Quick Example
27
+
28
+ **Adding a login button with Forge:**
29
+
30
+ ```bash
31
+ /plan login-button # Design Q&A → research → branch + task list
32
+ /dev # TDD: RED → GREEN → REFACTOR cycles
33
+ /validate # Type check + lint + tests + security scan
34
+ /ship # Create PR with full documentation
35
+ ```
36
+
37
+ **Result**: Feature shipped with tests, security validated, fully documented.
38
+
39
+ **Without Forge** (chaotic):
40
+ - Code first, tests later (or never)
41
+ - No research or planning
42
+ - Security issues found in production
43
+ - Documentation forgotten
44
+
45
+ **With Forge** (systematic):
46
+ - Tests written BEFORE code (TDD)
47
+ - Research-backed decisions
48
+ - OWASP Top 10 analysis in every /plan
49
+ - Documentation at every stage
50
+
51
+ → [See complete walkthrough in QUICKSTART.md](QUICKSTART.md)
52
+
53
+ ---
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ # Step 1: Install the package (as dev dependency)
59
+ bun add -D forge-workflow
60
+
61
+ # Step 2: Setup for your AI agent
62
+ bunx forge setup
63
+ ```
64
+
65
+ **That's it!** Forge will:
66
+ - Create AGENTS.md (universal instructions)
67
+ - Setup agent-specific files (Claude, Cursor, etc.)
68
+ - Create docs/ folder with guides
69
+
70
+ **Prerequisites**: Node.js, Git, GitHub account
71
+ **Optional tools**: Beads (issue tracking)
72
+
73
+ ### Setup Flags
74
+
75
+ | Flag | Description |
76
+ |------|-------------|
77
+ | `--agents=<list>` | Comma-separated agents to set up (e.g., `--agents=claude,cursor`) |
78
+ | `--all` | Set up all supported agents |
79
+ | `--dry-run` | Preview what setup would do without writing files |
80
+ | `--non-interactive` | Skip all prompts (use defaults). Auto-enabled when `CI=true` |
81
+ | `--symlink` | Create CLAUDE.md as a symlink to AGENTS.md instead of a copy |
82
+ | `--sync` | Enable Beads GitHub sync (scaffolds workflow + PAT) |
83
+ | `--verbose` | Show file-by-file detail instead of summary |
84
+ | `--force` | Overwrite existing files even if content matches |
85
+
86
+ [Detailed setup guide for all agents](docs/SETUP.md)
87
+
88
+ ---
89
+
90
+ ## The 7 Stages
91
+
92
+ | Stage | Command | Purpose |
93
+ |-------|---------|---------|
94
+ | **utility** | `/status` | Ranked issue dashboard with conflict detection |
95
+ | **1. Plan** | `/plan` | Design Q&A → research → branch + task list |
96
+ | **2. Dev** | `/dev` | Subagent TDD per task (spec + quality review) |
97
+ | **3. Validate** | `/validate` | Validate: types, lint, tests, security |
98
+ | **4. Ship** | `/ship` | Create PR with documentation |
99
+ | **5. Review** | `/review` | Address ALL PR feedback (Greptile, reviewers, CI/CD) |
100
+ | **6. Premerge** | `/premerge` | Complete docs on feature branch, hand off PR |
101
+ | **7. Verify** | `/verify` | Post-merge health check (CI on main) |
102
+
103
+ **Full workflow guide**: [AGENTS.md](AGENTS.md)
104
+
105
+ ---
106
+
107
+ ## Supported AI Agents
108
+
109
+ Works with **8 AI coding agents** via universal AGENTS.md:
110
+
111
+ ### Tier 1 (Primary Support)
112
+
113
+ | Agent | Features | Setup Time |
114
+ |-------|----------|------------|
115
+ | **Claude Code** | Custom slash commands, .claude/ directory | 30 seconds |
116
+ | **GitHub Copilot** | Enterprise support, .github/copilot-instructions.md | 30 seconds |
117
+ | **Kilo Code** | Auto failure recovery, .kilo.md | 30 seconds |
118
+ | **Cursor** | Native modes (Plan/Ask/Debug), .cursor/rules/ | 30 seconds |
119
+ | **Codex CLI** | OpenAI terminal agent, AGENTS.md | 30 seconds |
120
+
121
+ ### Tier 2 (Optional Support)
122
+
123
+ | Agent | Features | Setup Time |
124
+ |-------|----------|------------|
125
+ | **OpenCode** | Flexible, opencode.json | 30 seconds |
126
+ | **Goose** | Model flexibility, open-source | 30 seconds |
127
+
128
+ **Quick setup** (auto-detects agents):
129
+ ```bash
130
+ bunx forge setup
131
+ ```
132
+
133
+ **Setup for specific agent**:
134
+ ```bash
135
+ bunx forge setup --agent=copilot # GitHub Copilot
136
+ bunx forge setup --agent=cursor # Cursor IDE
137
+ bunx forge setup --agent=kilo # Kilo Code
138
+ bunx forge setup --agent=codex # Codex CLI
139
+ ```
140
+
141
+ **Setup for all Tier 1 agents**:
142
+ ```bash
143
+ bunx forge setup --all
144
+ ```
145
+
146
+ [Agent-specific setup instructions](docs/SETUP.md)
147
+
148
+ ---
149
+
150
+ ## What Makes Forge Different
151
+
152
+ ### 1. TDD-First Development
153
+ Tests are written **BEFORE** code, every single time:
154
+ - **RED**: Write a failing test
155
+ - **GREEN**: Write minimal code to pass
156
+ - **REFACTOR**: Clean up and commit
157
+ - **REPEAT**: Next feature
158
+
159
+ No feature ships without tests. Period.
160
+
161
+ ### 2. Research-First Planning
162
+ AI researches best practices before you write a line of code:
163
+ - Web search for latest patterns
164
+ - OWASP Top 10 security analysis
165
+ - Codebase pattern analysis
166
+ - Decisions documented with evidence
167
+
168
+ Saves hours of debugging and refactoring later.
169
+
170
+ ### 3. Universal Compatibility
171
+ One workflow, works with ALL major AI agents:
172
+ - Single `AGENTS.md` file (universal standard)
173
+ - Agent-specific enhancements (slash commands, skills)
174
+ - Git-backed persistence (Beads)
175
+ - No vendor lock-in
176
+
177
+ Switch agents anytime without changing your workflow.
178
+
179
+ ### 4. Built-in TDD Enforcement
180
+ Git hooks automatically enforce TDD practices:
181
+ - **Pre-commit**: Blocks source commits without tests
182
+ - **Pre-push**: Runs full test suite before push
183
+ - **Interactive**: Guided recovery when violations occur
184
+ - **CI/CD aware**: Auto-aborts in non-interactive environments
185
+
186
+ ```bash
187
+ # Validation CLI
188
+ forge-preflight status # Check project prerequisites
189
+ forge-preflight dev # Validate before /dev stage
190
+ forge-preflight ship # Validate before /ship stage
191
+ ```
192
+
193
+ ### 5. Smart Tool Recommendations
194
+ Curated plugin catalog across 7 workflow stages — plan, dev, validate, ship, review, and more:
195
+ - **Auto-detection**: Scans your project for frameworks, databases, auth, payments, and more
196
+ - **Budget modes**: free, open-source, startup, professional, custom
197
+ - **Portability-first**: MCPs included only when they add clear value over CLI alternatives
198
+ - **Free alternatives**: Every paid tool shows free alternatives
199
+
200
+ ```bash
201
+ bunx forge recommend # Recommendations for your project
202
+ bunx forge recommend --budget free # Only free tools
203
+ ```
204
+
205
+ → [Validation docs](docs/VALIDATION.md) | [Plugin docs](docs/TOOLCHAIN.md)
206
+
207
+ ### 6. Enhanced Onboarding
208
+ Smart setup that adapts to your project:
209
+
210
+ **Intelligent File Merging**
211
+ - Preserves your existing AGENTS.md content
212
+ - Adds Forge workflow without overwriting
213
+ - Three options: smart merge, keep, or replace
214
+ ```bash
215
+ bunx forge setup --merge=smart # Intelligent merge
216
+ ```
217
+
218
+ **Auto-Detection**
219
+ - Detects framework (Next.js, React, Vue, Express)
220
+ - Detects language (TypeScript, JavaScript)
221
+ - Analyzes git stats and CI/CD setup
222
+ - Infers project stage (new, active, stable)
223
+ - Saves to `.forge/context.json`
224
+
225
+ **Workflow Profiles**
226
+ - Adapts workflow based on work type (3-8 stages):
227
+ - `critical`: Full 8-stage workflow (auth, payments, security-sensitive)
228
+ - `standard`: 7-stage workflow (typical features)
229
+ - `refactor`: Behavior-preserving 5-stage workflow
230
+ - `simple`: Streamlined 4-stage workflow
231
+ - `hotfix`: Minimal 3-stage workflow (production fixes)
232
+ - `docs`: Minimal 3-stage workflow (documentation/config)
233
+ ```bash
234
+ bunx forge setup --type=critical # Set workflow manually
235
+ ```
236
+
237
+ **Context Interview** (optional)
238
+ ```bash
239
+ bunx forge setup --interview # Gather project context
240
+ ```
241
+
242
+ → [Enhanced onboarding guide](docs/ENHANCED_ONBOARDING.md)
243
+
244
+ ### 7. Automated Quality Gates 🆕
245
+ Multi-layer quality enforcement before merge:
246
+
247
+ **Greptile AI Code Review**
248
+ - AI-powered review on every PR
249
+ - Catches bugs, security issues, performance problems
250
+ - Detailed inline feedback with fix suggestions
251
+ - Automatic re-review after changes
252
+ ```bash
253
+ # Branch protection requires Greptile review to pass
254
+ # Typically completes in 1-2 minutes
255
+ ```
256
+
257
+ **GitHub Actions Workflows**
258
+ - Greptile Quality Gate: Enforces minimum score (≥4/5)
259
+ - ESLint checks: Code quality validation
260
+ - Test suite: All tests must pass
261
+
262
+ **Git Hooks (Lefthook)**
263
+ - Pre-commit: TDD enforcement (tests required)
264
+ - Pre-push: Full test suite + lint checks
265
+ - Branch protection: Blocks direct push to main/master
266
+
267
+ → [Greptile setup guide](docs/GREPTILE_SETUP.md)
268
+
269
+ ---
270
+
271
+ ## The Toolchain
272
+
273
+ Forge integrates with powerful tools:
274
+
275
+ ```
276
+ ┌──────────────────────────────────────────────┐
277
+ FORGE TOOLCHAIN
278
+ ├──────────────────────────────────────────────┤
279
+
280
+ ┌──────────┐ ┌──────────┐
281
+ │ │ BEADS │ │ GITHUB │ │
282
+ │ │ Issue │ │ PR │ │
283
+ │ │ Tracking │ │ Workflow │ │
284
+ │ └──────────┘ └──────────┘ │
285
+ │ │ │ │
286
+ │ └──────────────────────────────┘ │
287
+ │ │ │
288
+ │ ┌─────▼─────┐ │
289
+ │ │ FORGE │ │
290
+ │ │ 7-Stage │ │
291
+ │ │ Workflow │ │
292
+ │ └───────────┘ │
293
+ │ │
294
+ └──────────────────────────────────────────────┘
295
+ ```
296
+
297
+ **All tools are optional** - Forge works standalone.
298
+
299
+ **Beads** (optional): Git-backed issue tracking that survives context clearing
300
+ ```bash
301
+ bun add -g @beads/bd && bd init
302
+ ```
303
+
304
+ **GitHub CLI** (recommended): Required for PR workflow
305
+ ```bash
306
+ gh auth login
307
+ ```
308
+
309
+ [Complete toolchain guide](docs/TOOLCHAIN.md)
310
+
311
+ ---
312
+
313
+ ## Real-World Examples
314
+
315
+ ### Example 1: Simple Feature (20 minutes)
316
+ **Task**: Add a health check endpoint
317
+
318
+ ```bash
319
+ /plan health-check-endpoint # Design Q&A → research → branch + task list
320
+ /dev # 8 min: TDD implementation
321
+ /validate # 2 min: All validations pass
322
+ /ship # 2 min: PR created
323
+ # → Greptile AI review completes (~2 min)
324
+ /review # 3 min: Address Greptile feedback
325
+ /premerge # 2 min: Complete docs, hand off PR
326
+ ```
327
+
328
+ ### Example 2: Bug Fix with Security (30 minutes)
329
+ **Task**: Fix SQL injection vulnerability
330
+
331
+ ```bash
332
+ /plan sql-injection-fix # Design Q&A → OWASP research → branch
333
+ /dev # 8 min: Fix + tests
334
+ /validate # 3 min: Security scan
335
+ /ship # 2 min: PR with security notes
336
+ # Greptile validates security fix (~2 min)
337
+ /review # 5 min: Address security feedback
338
+ /premerge # 3 min: Complete docs, hand off PR
339
+ ```
340
+
341
+ ### Example 3: Architecture Change (2-3 days)
342
+ **Task**: Add authentication system
343
+
344
+ ```bash
345
+ /plan user-authentication # Design Q&A → deep research → branch
346
+ /dev # 1-2 days: TDD implementation
347
+ /validate # 30 min: Full validation
348
+ /ship # 15 min: PR with docs
349
+ /review # Varies: Address feedback
350
+ /premerge # 15 min: Complete docs, hand off PR
351
+ /verify # 15 min: Post-merge health check
352
+ ```
353
+
354
+ → [More examples in docs/EXAMPLES.md](docs/EXAMPLES.md)
355
+
356
+ ---
357
+
358
+ ## Core Principles
359
+
360
+ **TDD-First**: Tests before code, always
361
+ **Design-First**: One-question-at-a-time Q&A captures intent before research
362
+ **Security Built-In**: OWASP Top 10 for every feature
363
+ **Documentation Progressive**: Update at each stage
364
+ **Multi-Session**: Work persists across sessions
365
+
366
+ → [Read the philosophy in AGENTS.md](AGENTS.md)
367
+
368
+ ---
369
+
370
+ ## Next Steps
371
+
372
+ 📚 **New to Forge?**
373
+ → [QUICKSTART.md](QUICKSTART.md) - Your first feature in 5 minutes
374
+
375
+ 📖 **Learn the workflow**
376
+ → [AGENTS.md](AGENTS.md) - Complete guide with examples
377
+
378
+ 🛠️ **Setup the toolchain**
379
+ [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) - Beads, GitHub CLI
380
+
381
+ 🎯 **See real examples**
382
+ [docs/EXAMPLES.md](docs/EXAMPLES.md) - Real-world use cases
383
+
384
+ 💬 **Have questions?**
385
+ [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
386
+
387
+ 🐛 **Found a bug?**
388
+ [GitHub Issues](https://github.com/harshanandak/forge/issues)
389
+
390
+ ---
391
+
392
+ ## Quick Reference
393
+
394
+ ```bash
395
+ # Forge commands
396
+ /status # Check current context
397
+ /plan <feature> # Design Q&A → research → branch + task list
398
+ /dev # TDD development
399
+ /validate # Validate everything
400
+ /ship # Create PR
401
+ /review <pr> # Address feedback
402
+ /premerge <pr> # Complete docs, hand off PR
403
+ /verify # Post-merge health check
404
+
405
+ # Beads commands (optional)
406
+ bd init # Initialize tracking
407
+ bd ready # Find ready work
408
+ bd create "title" # Create issue
409
+ bd update <id> --status X # Update status
410
+ bd sync # Sync with git
411
+ ```
412
+
413
+ ---
414
+
415
+ ## License
416
+
417
+ MIT © Harsha Nandak
418
+
419
+ ---
420
+
421
+ **Ready to start?**
422
+
423
+ ```bash
424
+ bun add -D forge-workflow
425
+ bunx forge setup
426
+ /status
427
+ ```
428
+
429
+ Then open [QUICKSTART.md](QUICKSTART.md) and ship your first feature! 🚀