forge-workflow 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/.claude/commands/dev.md +340 -314
  2. package/.claude/commands/plan.md +521 -478
  3. package/.claude/commands/premerge.md +176 -179
  4. package/.claude/commands/research.md +42 -42
  5. package/.claude/commands/review.md +442 -442
  6. package/.claude/commands/rollback.md +721 -721
  7. package/.claude/commands/ship.md +164 -134
  8. package/.claude/commands/sonarcloud.md +152 -152
  9. package/.claude/commands/status.md +48 -77
  10. package/.claude/commands/validate.md +282 -237
  11. package/.claude/commands/verify.md +221 -221
  12. package/.claude/rules/greptile-review-process.md +285 -285
  13. package/.claude/rules/workflow.md +105 -105
  14. package/.claude/scripts/greptile-resolve.sh +526 -526
  15. package/.claude/scripts/load-env.sh +32 -32
  16. package/.cline/workflows/dev.md +337 -311
  17. package/.cline/workflows/plan.md +518 -475
  18. package/.cline/workflows/premerge.md +173 -176
  19. package/.cline/workflows/research.md +39 -39
  20. package/.cline/workflows/review.md +439 -439
  21. package/.cline/workflows/rollback.md +718 -718
  22. package/.cline/workflows/ship.md +161 -131
  23. package/.cline/workflows/sonarcloud.md +146 -146
  24. package/.cline/workflows/status.md +45 -74
  25. package/.cline/workflows/validate.md +279 -234
  26. package/.cline/workflows/verify.md +218 -218
  27. package/.codex/config.toml +11 -11
  28. package/.codex/skills/dev/SKILL.md +340 -314
  29. package/.codex/skills/plan/SKILL.md +521 -478
  30. package/.codex/skills/premerge/SKILL.md +176 -179
  31. package/.codex/skills/research/SKILL.md +42 -42
  32. package/.codex/skills/review/SKILL.md +442 -442
  33. package/.codex/skills/rollback/SKILL.md +721 -721
  34. package/.codex/skills/ship/SKILL.md +164 -134
  35. package/.codex/skills/sonarcloud/SKILL.md +149 -149
  36. package/.codex/skills/status/SKILL.md +48 -77
  37. package/.codex/skills/validate/SKILL.md +282 -237
  38. package/.codex/skills/verify/SKILL.md +221 -221
  39. package/.cursor/commands/dev.md +337 -311
  40. package/.cursor/commands/plan.md +518 -475
  41. package/.cursor/commands/premerge.md +173 -176
  42. package/.cursor/commands/research.md +39 -39
  43. package/.cursor/commands/review.md +439 -439
  44. package/.cursor/commands/rollback.md +718 -718
  45. package/.cursor/commands/ship.md +161 -131
  46. package/.cursor/commands/sonarcloud.md +146 -146
  47. package/.cursor/commands/status.md +45 -74
  48. package/.cursor/commands/validate.md +279 -234
  49. package/.cursor/commands/verify.md +218 -218
  50. package/.cursor/rules/permissions-guidance.mdc +37 -37
  51. package/.forge/hooks/check-tdd.js +240 -240
  52. package/.github/PLUGIN_TEMPLATE.json +32 -32
  53. package/.github/prompts/dev.prompt.md +342 -316
  54. package/.github/prompts/plan.prompt.md +523 -480
  55. package/.github/prompts/premerge.prompt.md +178 -181
  56. package/.github/prompts/research.prompt.md +44 -44
  57. package/.github/prompts/review.prompt.md +444 -444
  58. package/.github/prompts/rollback.prompt.md +723 -723
  59. package/.github/prompts/ship.prompt.md +166 -136
  60. package/.github/prompts/sonarcloud.prompt.md +151 -151
  61. package/.github/prompts/status.prompt.md +50 -79
  62. package/.github/prompts/validate.prompt.md +284 -239
  63. package/.github/prompts/verify.prompt.md +223 -223
  64. package/.github/workflows/beads-to-github.yml +56 -0
  65. package/.github/workflows/github-to-beads.yml +97 -0
  66. package/.kilocode/workflows/dev.md +341 -315
  67. package/.kilocode/workflows/plan.md +522 -479
  68. package/.kilocode/workflows/premerge.md +177 -180
  69. package/.kilocode/workflows/research.md +43 -43
  70. package/.kilocode/workflows/review.md +443 -443
  71. package/.kilocode/workflows/rollback.md +722 -722
  72. package/.kilocode/workflows/ship.md +165 -135
  73. package/.kilocode/workflows/sonarcloud.md +150 -150
  74. package/.kilocode/workflows/status.md +49 -78
  75. package/.kilocode/workflows/validate.md +283 -238
  76. package/.kilocode/workflows/verify.md +222 -222
  77. package/.mcp.json.example +12 -12
  78. package/.opencode/commands/dev.md +340 -314
  79. package/.opencode/commands/plan.md +521 -478
  80. package/.opencode/commands/premerge.md +176 -179
  81. package/.opencode/commands/research.md +42 -42
  82. package/.opencode/commands/review.md +442 -442
  83. package/.opencode/commands/rollback.md +721 -721
  84. package/.opencode/commands/ship.md +164 -134
  85. package/.opencode/commands/sonarcloud.md +149 -149
  86. package/.opencode/commands/status.md +48 -77
  87. package/.opencode/commands/validate.md +282 -237
  88. package/.opencode/commands/verify.md +221 -221
  89. package/.roo/commands/dev.md +341 -315
  90. package/.roo/commands/plan.md +522 -479
  91. package/.roo/commands/premerge.md +177 -180
  92. package/.roo/commands/research.md +43 -43
  93. package/.roo/commands/review.md +443 -443
  94. package/.roo/commands/rollback.md +722 -722
  95. package/.roo/commands/ship.md +165 -135
  96. package/.roo/commands/sonarcloud.md +150 -150
  97. package/.roo/commands/status.md +49 -78
  98. package/.roo/commands/validate.md +283 -238
  99. package/.roo/commands/verify.md +222 -222
  100. package/AGENTS.md +175 -169
  101. package/CLAUDE.md +100 -99
  102. package/LICENSE +21 -21
  103. package/README.md +429 -414
  104. package/bin/forge-cmd.js +313 -313
  105. package/bin/{forge-validate.js → forge-preflight.js} +309 -303
  106. package/bin/forge.js +4596 -4232
  107. package/docs/AGENT_INSTALL_PROMPT.md +342 -342
  108. package/docs/BEADS_GITHUB_SYNC.md +251 -0
  109. package/docs/ENHANCED_ONBOARDING.md +602 -602
  110. package/docs/EXAMPLES.md +482 -482
  111. package/docs/GREPTILE_SETUP.md +400 -400
  112. package/docs/MANUAL_REVIEW_GUIDE.md +106 -106
  113. package/docs/ROADMAP.md +359 -359
  114. package/docs/SETUP.md +663 -632
  115. package/docs/TOOLCHAIN.md +630 -630
  116. package/docs/VALIDATION.md +363 -363
  117. package/install.sh +40 -1058
  118. package/lefthook.yml +39 -39
  119. package/lib/agents/README.md +198 -198
  120. package/lib/agents/claude.plugin.json +28 -28
  121. package/lib/agents/cline.plugin.json +22 -22
  122. package/lib/agents/codex.plugin.json +19 -19
  123. package/lib/agents/copilot.plugin.json +24 -24
  124. package/lib/agents/cursor.plugin.json +25 -25
  125. package/lib/agents/kilocode.plugin.json +22 -22
  126. package/lib/agents/opencode.plugin.json +20 -20
  127. package/lib/agents/roo.plugin.json +23 -23
  128. package/lib/agents-config.js +2112 -2112
  129. package/lib/beads-health-check.js +143 -0
  130. package/lib/beads-setup.js +341 -0
  131. package/lib/beads-sync-scaffold.js +260 -0
  132. package/lib/commands/dev.js +513 -513
  133. package/lib/commands/plan.js +692 -692
  134. package/lib/commands/recommend.js +119 -119
  135. package/lib/commands/ship.js +377 -377
  136. package/lib/commands/status.js +378 -378
  137. package/lib/commands/validate.js +602 -602
  138. package/lib/context-merge.js +359 -359
  139. package/lib/dep-guard/analyzer.js +294 -294
  140. package/lib/dep-guard/behavior-detector.js +98 -98
  141. package/lib/dep-guard/contract-detector.js +162 -162
  142. package/lib/dep-guard/import-detector.js +498 -498
  143. package/lib/dep-guard/path-utils.js +13 -13
  144. package/lib/dep-guard/rubric.js +120 -120
  145. package/lib/dep-guard/task-parser.js +318 -318
  146. package/lib/detect-agent.js +191 -0
  147. package/lib/detect-worktree.js +47 -0
  148. package/lib/file-hash.js +26 -0
  149. package/lib/husky-migration.js +450 -0
  150. package/lib/lefthook-check.js +65 -0
  151. package/lib/pat-setup.js +207 -0
  152. package/lib/plugin-catalog.js +350 -350
  153. package/lib/plugin-manager.js +166 -166
  154. package/lib/plugin-recommender.js +141 -141
  155. package/lib/project-discovery.js +491 -491
  156. package/lib/setup-action-log.js +139 -0
  157. package/lib/setup-summary-renderer.js +106 -0
  158. package/lib/setup-utils.js +96 -0
  159. package/lib/setup.js +192 -118
  160. package/lib/smart-merge.js +64 -0
  161. package/lib/symlink-utils.js +81 -0
  162. package/lib/workflow-profiles.js +197 -197
  163. package/package.json +131 -129
  164. package/scripts/beads-context.sh +291 -0
  165. package/scripts/beads-context.test.js +563 -0
  166. package/scripts/behavioral-judge.sh +378 -0
  167. package/scripts/benchmark.js +85 -0
  168. package/scripts/branch-protection.js +183 -0
  169. package/scripts/check-agents.js +172 -0
  170. package/scripts/commitlint.js +42 -0
  171. package/scripts/conflict-detect.sh +323 -0
  172. package/scripts/dep-guard-analyze.js +71 -0
  173. package/scripts/dep-guard.sh +811 -0
  174. package/scripts/eval_win.py +249 -0
  175. package/scripts/file-index.sh +399 -0
  176. package/scripts/github-beads-sync/comment.mjs +64 -0
  177. package/scripts/github-beads-sync/config.mjs +148 -0
  178. package/scripts/github-beads-sync/github-api.mjs +131 -0
  179. package/scripts/github-beads-sync/index.mjs +332 -0
  180. package/scripts/github-beads-sync/label-mapper.mjs +54 -0
  181. package/scripts/github-beads-sync/mapping.mjs +78 -0
  182. package/scripts/github-beads-sync/reverse-sync-cli.mjs +31 -0
  183. package/scripts/github-beads-sync/reverse-sync.mjs +138 -0
  184. package/scripts/github-beads-sync/run-bd.mjs +159 -0
  185. package/scripts/github-beads-sync/sanitize.mjs +121 -0
  186. package/scripts/github-beads-sync.config.json +26 -0
  187. package/scripts/improve-command.js +375 -0
  188. package/scripts/lib/eval-runner.js +229 -0
  189. package/scripts/lib/eval-schema.js +135 -0
  190. package/scripts/lib/eval-storage.js +78 -0
  191. package/scripts/lib/grading.js +203 -0
  192. package/scripts/lib/transcript-parser.js +63 -0
  193. package/scripts/lint.js +47 -0
  194. package/scripts/migrate-to-bun-test.js +412 -0
  195. package/scripts/run-command-eval.js +236 -0
  196. package/scripts/smart-status.sh +782 -0
  197. package/scripts/sync-commands.js +571 -0
  198. package/scripts/sync-utils.sh +460 -0
  199. package/scripts/test-dashboard.js +123 -0
  200. package/scripts/test.js +44 -0
  201. package/scripts/validate.sh +94 -0
  202. package/skills/parallel-deep-research/SKILL.md +108 -108
  203. package/skills/parallel-deep-research/evals/README.md +27 -27
  204. package/skills/parallel-deep-research/evals/evals.json +62 -62
  205. package/skills/sonarcloud-analysis/SKILL.md +171 -171
  206. package/skills/sonarcloud-analysis/evals/README.md +27 -27
  207. package/skills/sonarcloud-analysis/evals/evals.json +50 -50
  208. package/skills/sonarcloud-analysis/references/api-reference.md +466 -466
  209. package/docs/WORKFLOW.md +0 -400
package/install.sh CHANGED
@@ -1,1058 +1,40 @@
1
- #!/bin/bash
2
- # Forge v1.1.0 - Universal AI Agent Workflow Installer
3
- # https://github.com/harshanandak/forge
4
- #
5
- # Interactive installer - select only the agents you use
6
- #
7
- # Usage:
8
- # ./install.sh # Interactive mode
9
- # ./install.sh --quick # Auto-select all agents, use defaults
10
- # ./install.sh --skip-external # Skip external services configuration
11
-
12
- set -e
13
-
14
- # ============================================
15
- # PARSE CLI FLAGS
16
- # ============================================
17
- QUICK_MODE=false
18
- SKIP_EXTERNAL=false
19
- for arg in "$@"; do
20
- case $arg in
21
- --quick) QUICK_MODE=true ;;
22
- --skip-external) SKIP_EXTERNAL=true ;;
23
- --help|-h)
24
- echo "Forge Installer"
25
- echo ""
26
- echo "Usage: ./install.sh [OPTIONS]"
27
- echo ""
28
- echo "Options:"
29
- echo " --quick Auto-select all agents, use defaults for services"
30
- echo " --skip-external Skip external services configuration"
31
- echo " --help, -h Show this help message"
32
- exit 0
33
- ;;
34
- esac
35
- done
36
-
37
- # Cleanup on error
38
- cleanup_on_error() {
39
- echo -e "\n${RED}Installation failed. Partial files may remain.${NC}"
40
- echo "Run 'rm -rf .claude .cursor .windsurf .kilocode .opencode .continue .github .agent .roo .env.local' to clean up."
41
- }
42
- trap cleanup_on_error ERR
43
-
44
- REPO="harshanandak/forge"
45
- BRANCH="main"
46
- BASE_URL="https://raw.githubusercontent.com/$REPO/$BRANCH"
47
-
48
- # Colors for output
49
- RED='\033[0;31m'
50
- GREEN='\033[0;32m'
51
- YELLOW='\033[1;33m'
52
- BLUE='\033[0;34m'
53
- CYAN='\033[0;36m'
54
- NC='\033[0m' # No Color
55
-
56
- echo ""
57
- echo -e "${CYAN} ███████╗ ██████╗ ██████╗ ██████╗ ███████╗${NC}"
58
- echo -e "${CYAN} ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝${NC}"
59
- echo -e "${CYAN} █████╗ ██║ ██║██████╔╝██║ ███╗█████╗ ${NC}"
60
- echo -e "${CYAN} ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ${NC}"
61
- echo -e "${CYAN} ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗${NC}"
62
- echo -e "${CYAN} ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝${NC}"
63
- echo -e "${GREEN} v1.1.0${NC}"
64
- echo ""
65
- echo -e "${GREEN} Universal AI Agent Workflow${NC}"
66
- echo ""
67
-
68
- # ============================================
69
- # PREREQUISITE VALIDATION
70
- # ============================================
71
- echo -e "${YELLOW}Checking prerequisites...${NC}"
72
-
73
- PREREQ_WARNINGS=()
74
- PREREQ_ERRORS=()
75
- PKG_MANAGER="npm"
76
-
77
- # Required: Git
78
- if ! command -v git &> /dev/null; then
79
- PREREQ_ERRORS+=("git - Install from https://git-scm.com")
80
- else
81
- echo -e " ${GREEN}✓${NC} git $(git --version | cut -d' ' -f3)"
82
- fi
83
-
84
- # Required: GitHub CLI
85
- if ! command -v gh &> /dev/null; then
86
- PREREQ_ERRORS+=("gh (GitHub CLI) - Install from https://cli.github.com")
87
- else
88
- echo -e " ${GREEN}✓${NC} gh $(gh --version | head -1 | cut -d' ' -f3)"
89
- # Check if authenticated
90
- if ! gh auth status &> /dev/null 2>&1; then
91
- PREREQ_WARNINGS+=("GitHub CLI not authenticated. Run: gh auth login")
92
- fi
93
- fi
94
-
95
- # Required: Node.js 20+
96
- if command -v node &> /dev/null; then
97
- node_version=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
98
- if [ "$node_version" -lt 20 ]; then
99
- PREREQ_ERRORS+=("Node.js 20+ required (current: $(node -v))")
100
- else
101
- echo -e " ${GREEN}✓${NC} node $(node -v)"
102
- fi
103
- else
104
- PREREQ_ERRORS+=("Node.js 20+ - Install from https://nodejs.org")
105
- fi
106
-
107
- # Required: curl (for downloading files)
108
- if ! command -v curl &> /dev/null; then
109
- PREREQ_ERRORS+=("curl - Install from your package manager (apt install curl, brew install curl)")
110
- else
111
- echo -e " ${GREEN}✓${NC} curl $(curl --version | head -1 | cut -d' ' -f2)"
112
- fi
113
-
114
- # Detect package manager
115
- if command -v bun &> /dev/null; then
116
- PKG_MANAGER="bun"
117
- echo -e " ${GREEN}✓${NC} bun $(bun --version) (detected as package manager)"
118
- elif command -v pnpm &> /dev/null; then
119
- PKG_MANAGER="pnpm"
120
- echo -e " ${GREEN}✓${NC} pnpm $(pnpm --version) (detected as package manager)"
121
- elif command -v yarn &> /dev/null; then
122
- PKG_MANAGER="yarn"
123
- echo -e " ${GREEN}✓${NC} yarn $(yarn --version) (detected as package manager)"
124
- elif command -v npm &> /dev/null; then
125
- PKG_MANAGER="npm"
126
- echo -e " ${GREEN}✓${NC} npm $(npm --version) (detected as package manager)"
127
- else
128
- PREREQ_ERRORS+=("npm, yarn, pnpm, or bun - Install a package manager")
129
- fi
130
-
131
- # Also detect from lock files if present
132
- if [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
133
- PKG_MANAGER="bun"
134
- elif [ -f "pnpm-lock.yaml" ]; then
135
- PKG_MANAGER="pnpm"
136
- elif [ -f "yarn.lock" ]; then
137
- PKG_MANAGER="yarn"
138
- fi
139
-
140
- # Show errors
141
- if [ ${#PREREQ_ERRORS[@]} -gt 0 ]; then
142
- echo ""
143
- echo -e "${RED}❌ Missing required tools:${NC}"
144
- for err in "${PREREQ_ERRORS[@]}"; do
145
- echo -e " ${RED}-${NC} $err"
146
- done
147
- echo ""
148
- echo "Please install missing tools and try again."
149
- exit 1
150
- fi
151
-
152
- # Show warnings
153
- if [ ${#PREREQ_WARNINGS[@]} -gt 0 ]; then
154
- echo ""
155
- echo -e "${YELLOW}⚠️ Warnings:${NC}"
156
- for warn in "${PREREQ_WARNINGS[@]}"; do
157
- echo -e " ${YELLOW}-${NC} $warn"
158
- done
159
- fi
160
-
161
- echo ""
162
- echo -e " ${GREEN}Package manager: $PKG_MANAGER${NC}"
163
- echo ""
164
-
165
- # ============================================
166
- # DETECT EXISTING INSTALLATION
167
- # ============================================
168
- EXISTING_INSTALL=false
169
- AGENTS_BACKUP_CREATED=false
170
- if [ -f "AGENTS.md" ] && [ -d ".claude/commands" ]; then
171
- EXISTING_INSTALL=true
172
- echo -e "${YELLOW}Found existing Forge installation.${NC}"
173
- echo ""
174
- fi
175
-
176
- # ============================================
177
- # AGENT SELECTION
178
- # ============================================
179
-
180
- # Parse selection
181
- INSTALL_CLAUDE=false
182
- INSTALL_CURSOR=false
183
- INSTALL_WINDSURF=false
184
- INSTALL_KILOCODE=false
185
- INSTALL_ANTIGRAVITY=false
186
- INSTALL_COPILOT=false
187
- INSTALL_CONTINUE=false
188
- INSTALL_OPENCODE=false
189
- INSTALL_CLINE=false
190
- INSTALL_ROO=false
191
- INSTALL_AIDER=false
192
-
193
- # Track Context7 MCP auto-installation
194
- CONTEXT7_INSTALLED_CLAUDE=false
195
- CONTEXT7_INSTALLED_CONTINUE=false
196
-
197
- if [ "$QUICK_MODE" = true ]; then
198
- # Quick mode: auto-select all agents
199
- echo -e "${YELLOW}Quick mode: Installing for all agents...${NC}"
200
- INSTALL_CLAUDE=true
201
- INSTALL_CURSOR=true
202
- INSTALL_WINDSURF=true
203
- INSTALL_KILOCODE=true
204
- INSTALL_ANTIGRAVITY=true
205
- INSTALL_COPILOT=true
206
- INSTALL_CONTINUE=true
207
- INSTALL_OPENCODE=true
208
- INSTALL_CLINE=true
209
- INSTALL_ROO=true
210
- INSTALL_AIDER=true
211
- else
212
- # Interactive mode: prompt user for selection
213
- echo -e "${YELLOW}Which AI coding agents do you use?${NC}"
214
- echo -e "${BLUE}(Enter numbers separated by spaces, or 'all' for everything)${NC}"
215
- echo ""
216
- echo " 1) Claude Code - Anthropic's CLI agent"
217
- echo " 2) Cursor - AI-first code editor"
218
- echo " 3) Windsurf - Codeium's agentic IDE"
219
- echo " 4) Kilo Code - VS Code extension"
220
- echo " 5) Google Antigravity - Google's agent IDE"
221
- echo " 6) GitHub Copilot - GitHub's AI assistant"
222
- echo " 7) Continue - Open-source AI assistant"
223
- echo " 8) OpenCode - Open-source agent"
224
- echo " 9) Cline - VS Code agent extension"
225
- echo " 10) Roo Code - Cline fork with modes"
226
- echo " 11) Aider - Terminal-based agent"
227
- echo ""
228
- echo -e " ${GREEN}all) Install for all agents${NC}"
229
- echo ""
230
-
231
- read -p "Your selection (e.g., '1 2 3' or 'all'): " selection
232
-
233
- if [[ "$selection" == "all" ]]; then
234
- INSTALL_CLAUDE=true
235
- INSTALL_CURSOR=true
236
- INSTALL_WINDSURF=true
237
- INSTALL_KILOCODE=true
238
- INSTALL_ANTIGRAVITY=true
239
- INSTALL_COPILOT=true
240
- INSTALL_CONTINUE=true
241
- INSTALL_OPENCODE=true
242
- INSTALL_CLINE=true
243
- INSTALL_ROO=true
244
- INSTALL_AIDER=true
245
- else
246
- for num in $selection; do
247
- case $num in
248
- 1) INSTALL_CLAUDE=true ;;
249
- 2) INSTALL_CURSOR=true ;;
250
- 3) INSTALL_WINDSURF=true ;;
251
- 4) INSTALL_KILOCODE=true ;;
252
- 5) INSTALL_ANTIGRAVITY=true ;;
253
- 6) INSTALL_COPILOT=true ;;
254
- 7) INSTALL_CONTINUE=true ;;
255
- 8) INSTALL_OPENCODE=true ;;
256
- 9) INSTALL_CLINE=true ;;
257
- 10) INSTALL_ROO=true ;;
258
- 11) INSTALL_AIDER=true ;;
259
- esac
260
- done
261
- fi
262
- fi
263
-
264
- echo ""
265
- echo -e "${BLUE}Installing Forge workflow...${NC}"
266
- echo ""
267
-
268
- # ============================================
269
- # ALWAYS CREATE: Core directories and AGENTS.md
270
- # ============================================
271
- echo "Creating core directories..."
272
- mkdir -p docs/planning docs/research
273
-
274
- # Backup existing AGENTS.md before overwriting
275
- if [ -f "AGENTS.md" ]; then
276
- cp AGENTS.md AGENTS.md.backup
277
- AGENTS_BACKUP_CREATED=true
278
- echo -e " ${YELLOW}Backed up: AGENTS.md -> AGENTS.md.backup${NC}"
279
- fi
280
-
281
- # Download universal AGENTS.md
282
- echo "Downloading AGENTS.md (universal standard)..."
283
- curl -fsSL "$BASE_URL/AGENTS.md" -o "AGENTS.md"
284
- echo -e " ${GREEN}Created: AGENTS.md${NC}"
285
-
286
- # Download documentation
287
- echo "Downloading documentation..."
288
- curl -fsSL "$BASE_URL/docs/WORKFLOW.md" -o "docs/WORKFLOW.md" 2>/dev/null || true
289
- curl -fsSL "$BASE_URL/docs/research/TEMPLATE.md" -o "docs/research/TEMPLATE.md" 2>/dev/null || true
290
-
291
- # Create PROGRESS.md if not exists
292
- if [ ! -f "docs/planning/PROGRESS.md" ]; then
293
- cat > docs/planning/PROGRESS.md << 'EOF'
294
- # Project Progress
295
-
296
- ## Current Focus
297
- <!-- What you're working on -->
298
-
299
- ## Completed
300
- <!-- Completed features -->
301
-
302
- ## Upcoming
303
- <!-- Next priorities -->
304
- EOF
305
- echo -e " ${GREEN}Created: docs/planning/PROGRESS.md${NC}"
306
- fi
307
-
308
- # ============================================
309
- # HELPER FUNCTIONS
310
- # ============================================
311
-
312
- # Function to strip YAML frontmatter
313
- strip_frontmatter() {
314
- sed '1{/^---$/!q};1,/^---$/d;1,/^---$/d' "$1"
315
- }
316
-
317
- # Function to create symlink or copy (with proper error handling)
318
- create_link() {
319
- local source="$1"
320
- local target="$2"
321
- local target_dir
322
- target_dir=$(dirname "$target")
323
-
324
- # Create target directory if needed
325
- if [ ! -d "$target_dir" ]; then
326
- mkdir -p "$target_dir" 2>/dev/null || true
327
- fi
328
-
329
- # Remove existing file/link
330
- rm -f "$target" 2>/dev/null || true
331
-
332
- # Try symlink first, fallback to copy
333
- if ln -s "$source" "$target" 2>/dev/null; then
334
- echo -e " ${GREEN}Linked: $target -> $source${NC}"
335
- elif cp "$source" "$target" 2>/dev/null; then
336
- echo -e " ${YELLOW}⚠ Copied (symlinks not supported): $target${NC}"
337
- else
338
- echo -e " ${RED}Failed: Could not link or copy $target${NC}"
339
- fi
340
- }
341
-
342
- # Universal SKILL.md content
343
- SKILL_CONTENT='---
344
- name: forge-workflow
345
- description: 7-stage TDD-first workflow for feature development. Use when building features, fixing bugs, or shipping PRs.
346
- category: Development Workflow
347
- tags: [tdd, workflow, pr, git, testing]
348
- tools: [Bash, Read, Write, Edit, Grep, Glob]
349
- ---
350
-
351
- # Forge Workflow Skill
352
-
353
- A TDD-first workflow for AI coding agents. Ship features with confidence.
354
-
355
- ## When to Use
356
-
357
- Automatically invoke this skill when the user wants to:
358
- - Build a new feature
359
- - Fix a bug
360
- - Create a pull request
361
- - Run the development workflow
362
-
363
- ## 7 Stages
364
-
365
- | Stage | Command | Description |
366
- |-------|---------|-------------|
367
- | utility | `/status` | Check current context, active work, recent completions |
368
- | 1 | `/plan` | Design intent -> research -> branch + worktree + task list |
369
- | 2 | `/dev` | TDD development (implementer -> spec review -> quality review) |
370
- | 3 | `/validate` | Type check, lint, security, tests - all fresh output |
371
- | 4 | `/ship` | Push branch and create PR with full documentation |
372
- | 5 | `/review` | Address ALL PR feedback (GitHub Actions, Greptile, SonarCloud) |
373
- | 6 | `/premerge` | Update docs, hand off PR to user |
374
- | 7 | `/verify` | Post-merge health check (CI on main, close Beads) |
375
-
376
- ## Workflow Flow
377
-
378
- ```
379
- /status -> /plan -> /dev -> /validate -> /ship -> /review -> /premerge -> /verify
380
- ```
381
-
382
- ## Core Principles
383
-
384
- - **TDD-First**: Write tests BEFORE implementation (RED-GREEN-REFACTOR)
385
- - **Research-First**: Understand before building, document decisions
386
- - **Security Built-In**: OWASP Top 10 analysis for every feature
387
- - **Documentation Progressive**: Update at each stage, verify at end
388
- '
389
-
390
- # ============================================
391
- # CLAUDE CODE
392
- # ============================================
393
- if [ "$INSTALL_CLAUDE" = true ]; then
394
- echo ""
395
- echo -e "${CYAN}Setting up Claude Code...${NC}"
396
-
397
- mkdir -p .claude/commands .claude/rules .claude/skills/forge-workflow .claude/scripts
398
-
399
- # Download commands
400
- for cmd in status plan dev validate ship review premerge verify research rollback sonarcloud; do
401
- curl -fsSL "$BASE_URL/.claude/commands/$cmd.md" -o ".claude/commands/$cmd.md" 2>/dev/null || true
402
- done
403
- echo -e " ${GREEN}Downloaded: 11 workflow commands${NC}"
404
-
405
- # Download rules
406
- curl -fsSL "$BASE_URL/.claude/rules/workflow.md" -o ".claude/rules/workflow.md" 2>/dev/null || true
407
- echo -e " ${GREEN}Downloaded: workflow rules${NC}"
408
-
409
- # Download scripts
410
- curl -fsSL "$BASE_URL/.claude/scripts/load-env.sh" -o ".claude/scripts/load-env.sh" 2>/dev/null || true
411
- chmod +x .claude/scripts/load-env.sh 2>/dev/null || true
412
-
413
- # Create SKILL.md
414
- echo "$SKILL_CONTENT" > .claude/skills/forge-workflow/SKILL.md
415
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
416
-
417
- # Create .mcp.json with Context7 MCP (auto-install for Claude Code)
418
- if [ ! -f ".mcp.json" ]; then
419
- cat > .mcp.json << 'MCP_EOF'
420
- {
421
- "mcpServers": {
422
- "context7": {
423
- "command": "npx",
424
- "args": ["-y", "@upstash/context7-mcp@latest"]
425
- }
426
- }
427
- }
428
- MCP_EOF
429
- echo -e " ${GREEN}Created: .mcp.json with Context7 MCP${NC}"
430
- CONTEXT7_INSTALLED_CLAUDE=true
431
- else
432
- echo -e " ${YELLOW}Skipped: .mcp.json already exists${NC}"
433
- fi
434
-
435
- # Link CLAUDE.md -> AGENTS.md
436
- create_link "AGENTS.md" "CLAUDE.md"
437
- fi
438
-
439
- # ============================================
440
- # CURSOR
441
- # ============================================
442
- if [ "$INSTALL_CURSOR" = true ]; then
443
- echo ""
444
- echo -e "${CYAN}Setting up Cursor...${NC}"
445
-
446
- mkdir -p .cursor/rules .cursor/skills/forge-workflow
447
-
448
- # Create workflow.mdc rule
449
- cat > .cursor/rules/forge-workflow.mdc << 'MDC_EOF'
450
- ---
451
- description: Forge 9-Stage TDD Workflow
452
- alwaysApply: true
453
- ---
454
-
455
- # Forge Workflow Commands
456
-
457
- Use these commands via `/command-name`:
458
-
459
- 1. `/status` - Check current context, active work, recent completions
460
- 2. `/plan` - Design intent -> research -> branch + worktree + task list
461
- 3. `/dev` - TDD development (implementer -> spec review -> quality review)
462
- 4. `/validate` - Type check, lint, security, tests - all fresh output
463
- 5. `/ship` - Push branch and create PR with full documentation
464
- 6. `/review` - Address ALL PR feedback (GitHub Actions, Greptile, SonarCloud)
465
- 7. `/premerge` - Update docs, hand off PR to user
466
- 8. `/verify` - Post-merge health check (CI on main, close Beads)
467
-
468
- See AGENTS.md for full workflow details.
469
- MDC_EOF
470
- echo -e " ${GREEN}Created: .cursor/rules/forge-workflow.mdc${NC}"
471
-
472
- # Create SKILL.md
473
- echo "$SKILL_CONTENT" > .cursor/skills/forge-workflow/SKILL.md
474
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
475
-
476
- # Link .cursorrules -> AGENTS.md
477
- create_link "AGENTS.md" ".cursorrules"
478
- fi
479
-
480
- # ============================================
481
- # WINDSURF
482
- # ============================================
483
- if [ "$INSTALL_WINDSURF" = true ]; then
484
- echo ""
485
- echo -e "${CYAN}Setting up Windsurf...${NC}"
486
-
487
- mkdir -p .windsurf/workflows .windsurf/rules .windsurf/skills/forge-workflow
488
-
489
- # Convert commands (strip YAML frontmatter)
490
- if [ "$INSTALL_CLAUDE" = true ]; then
491
- for cmd in .claude/commands/*.md; do
492
- [ -f "$cmd" ] || continue
493
- filename=$(basename "$cmd")
494
- strip_frontmatter "$cmd" > ".windsurf/workflows/$filename" 2>/dev/null || cp "$cmd" ".windsurf/workflows/$filename"
495
- done
496
- echo -e " ${GREEN}Converted: 11 workflow commands${NC}"
497
-
498
- # Copy rules
499
- cp .claude/rules/workflow.md .windsurf/rules/workflow.md 2>/dev/null || true
500
- fi
501
-
502
- # Create SKILL.md
503
- echo "$SKILL_CONTENT" > .windsurf/skills/forge-workflow/SKILL.md
504
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
505
-
506
- # Link .windsurfrules -> AGENTS.md
507
- create_link "AGENTS.md" ".windsurfrules"
508
- fi
509
-
510
- # ============================================
511
- # KILO CODE
512
- # ============================================
513
- if [ "$INSTALL_KILOCODE" = true ]; then
514
- echo ""
515
- echo -e "${CYAN}Setting up Kilo Code...${NC}"
516
-
517
- mkdir -p .kilocode/workflows .kilocode/rules .kilocode/skills/forge-workflow
518
-
519
- # Convert commands (strip YAML frontmatter)
520
- if [ "$INSTALL_CLAUDE" = true ]; then
521
- for cmd in .claude/commands/*.md; do
522
- [ -f "$cmd" ] || continue
523
- filename=$(basename "$cmd")
524
- strip_frontmatter "$cmd" > ".kilocode/workflows/$filename" 2>/dev/null || cp "$cmd" ".kilocode/workflows/$filename"
525
- done
526
- echo -e " ${GREEN}Converted: 11 workflow commands${NC}"
527
-
528
- # Copy rules
529
- cp .claude/rules/workflow.md .kilocode/rules/workflow.md 2>/dev/null || true
530
- fi
531
-
532
- # Create SKILL.md
533
- echo "$SKILL_CONTENT" > .kilocode/skills/forge-workflow/SKILL.md
534
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
535
- fi
536
-
537
- # ============================================
538
- # GOOGLE ANTIGRAVITY
539
- # ============================================
540
- if [ "$INSTALL_ANTIGRAVITY" = true ]; then
541
- echo ""
542
- echo -e "${CYAN}Setting up Google Antigravity...${NC}"
543
-
544
- mkdir -p .agent/workflows .agent/rules .agent/skills/forge-workflow
545
-
546
- # Convert commands (strip YAML frontmatter)
547
- if [ "$INSTALL_CLAUDE" = true ]; then
548
- for cmd in .claude/commands/*.md; do
549
- [ -f "$cmd" ] || continue
550
- filename=$(basename "$cmd")
551
- strip_frontmatter "$cmd" > ".agent/workflows/$filename" 2>/dev/null || cp "$cmd" ".agent/workflows/$filename"
552
- done
553
- echo -e " ${GREEN}Converted: 11 workflow commands${NC}"
554
-
555
- # Copy rules
556
- cp .claude/rules/workflow.md .agent/rules/workflow.md 2>/dev/null || true
557
- fi
558
-
559
- # Create SKILL.md
560
- echo "$SKILL_CONTENT" > .agent/skills/forge-workflow/SKILL.md
561
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
562
-
563
- # Link GEMINI.md -> AGENTS.md
564
- create_link "AGENTS.md" "GEMINI.md"
565
- fi
566
-
567
- # ============================================
568
- # GITHUB COPILOT
569
- # ============================================
570
- if [ "$INSTALL_COPILOT" = true ]; then
571
- echo ""
572
- echo -e "${CYAN}Setting up GitHub Copilot...${NC}"
573
-
574
- mkdir -p .github/prompts .github/instructions
575
-
576
- # Convert commands to .prompt.md
577
- if [ "$INSTALL_CLAUDE" = true ]; then
578
- for cmd in .claude/commands/*.md; do
579
- [ -f "$cmd" ] || continue
580
- basename_noext=$(basename "$cmd" .md)
581
- filename="${basename_noext}.prompt.md"
582
- strip_frontmatter "$cmd" > ".github/prompts/$filename" 2>/dev/null || cp "$cmd" ".github/prompts/$filename"
583
- done
584
- echo -e " ${GREEN}Converted: 11 workflow prompts${NC}"
585
- fi
586
-
587
- # Link copilot-instructions.md -> AGENTS.md
588
- create_link "AGENTS.md" ".github/copilot-instructions.md"
589
- fi
590
-
591
- # ============================================
592
- # CONTINUE
593
- # ============================================
594
- if [ "$INSTALL_CONTINUE" = true ]; then
595
- echo ""
596
- echo -e "${CYAN}Setting up Continue...${NC}"
597
-
598
- mkdir -p .continue/prompts .continue/skills/forge-workflow
599
-
600
- # Convert commands to .prompt with invokable: true
601
- if [ "$INSTALL_CLAUDE" = true ]; then
602
- for cmd in .claude/commands/*.md; do
603
- [ -f "$cmd" ] || continue
604
- basename_noext=$(basename "$cmd" .md)
605
- filename="${basename_noext}.prompt"
606
- {
607
- echo "---"
608
- echo "name: $basename_noext"
609
- echo "description: Forge workflow command - $basename_noext"
610
- echo "invokable: true"
611
- echo "---"
612
- echo ""
613
- strip_frontmatter "$cmd" 2>/dev/null || cat "$cmd"
614
- } > ".continue/prompts/$filename"
615
- done
616
- echo -e " ${GREEN}Converted: 11 workflow prompts${NC}"
617
- fi
618
-
619
- # Create SKILL.md
620
- echo "$SKILL_CONTENT" > .continue/skills/forge-workflow/SKILL.md
621
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
622
-
623
- # Create config.yaml with Context7 MCP (auto-install for Continue)
624
- if [ ! -f ".continue/config.yaml" ]; then
625
- cat > .continue/config.yaml << 'CONTINUE_EOF'
626
- # Continue Configuration
627
- # https://docs.continue.dev/customize/deep-dives/configuration
628
-
629
- name: Forge Workflow
630
- version: "1.0"
631
-
632
- # MCP Servers for enhanced capabilities
633
- mcpServers:
634
- - name: context7
635
- command: npx
636
- args:
637
- - "-y"
638
- - "@upstash/context7-mcp@latest"
639
-
640
- # Rules loaded from .continuerules
641
- CONTINUE_EOF
642
- echo -e " ${GREEN}Created: config.yaml with Context7 MCP${NC}"
643
- CONTEXT7_INSTALLED_CONTINUE=true
644
- else
645
- echo -e " ${YELLOW}Skipped: config.yaml already exists${NC}"
646
- fi
647
- fi
648
-
649
- # ============================================
650
- # OPENCODE
651
- # ============================================
652
- if [ "$INSTALL_OPENCODE" = true ]; then
653
- echo ""
654
- echo -e "${CYAN}Setting up OpenCode...${NC}"
655
-
656
- mkdir -p .opencode/commands .opencode/skills/forge-workflow
657
-
658
- # Copy commands as-is (same YAML format)
659
- if [ "$INSTALL_CLAUDE" = true ]; then
660
- cp .claude/commands/*.md .opencode/commands/ 2>/dev/null || true
661
- echo -e " ${GREEN}Copied: 11 workflow commands${NC}"
662
- fi
663
-
664
- # Create SKILL.md
665
- echo "$SKILL_CONTENT" > .opencode/skills/forge-workflow/SKILL.md
666
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
667
- fi
668
-
669
- # ============================================
670
- # CLINE
671
- # ============================================
672
- if [ "$INSTALL_CLINE" = true ]; then
673
- echo ""
674
- echo -e "${CYAN}Setting up Cline...${NC}"
675
-
676
- mkdir -p .cline/skills/forge-workflow
677
-
678
- # Create SKILL.md
679
- echo "$SKILL_CONTENT" > .cline/skills/forge-workflow/SKILL.md
680
- echo -e " ${GREEN}Created: forge-workflow skill${NC}"
681
-
682
- # Link .clinerules -> AGENTS.md
683
- create_link "AGENTS.md" ".clinerules"
684
- fi
685
-
686
- # ============================================
687
- # ROO CODE
688
- # ============================================
689
- if [ "$INSTALL_ROO" = true ]; then
690
- echo ""
691
- echo -e "${CYAN}Setting up Roo Code...${NC}"
692
-
693
- mkdir -p .roo/commands
694
-
695
- # Convert commands (strip YAML frontmatter)
696
- if [ "$INSTALL_CLAUDE" = true ]; then
697
- for cmd in .claude/commands/*.md; do
698
- [ -f "$cmd" ] || continue
699
- filename=$(basename "$cmd")
700
- strip_frontmatter "$cmd" > ".roo/commands/$filename" 2>/dev/null || cp "$cmd" ".roo/commands/$filename"
701
- done
702
- echo -e " ${GREEN}Converted: 11 workflow commands${NC}"
703
- fi
704
-
705
- # Link .roorules -> AGENTS.md
706
- if [ ! -f ".roorules" ]; then
707
- create_link "AGENTS.md" ".roorules"
708
- fi
709
- fi
710
-
711
- # ============================================
712
- # AIDER
713
- # ============================================
714
- if [ "$INSTALL_AIDER" = true ]; then
715
- echo ""
716
- echo -e "${CYAN}Setting up Aider...${NC}"
717
-
718
- # Aider uses AGENTS.md via config
719
- # Create .aider.conf.yml if not exists
720
- if [ ! -f ".aider.conf.yml" ]; then
721
- cat > .aider.conf.yml << 'EOF'
722
- # Aider configuration
723
- # Read AGENTS.md for workflow instructions
724
- read:
725
- - AGENTS.md
726
- - docs/WORKFLOW.md
727
- EOF
728
- echo -e " ${GREEN}Created: .aider.conf.yml${NC}"
729
- else
730
- echo -e " ${YELLOW}Skipped: .aider.conf.yml already exists${NC}"
731
- echo -e " ${YELLOW}Add 'read: [AGENTS.md]' to your config manually${NC}"
732
- fi
733
- fi
734
-
735
- # ============================================
736
- # EXTERNAL SERVICES CONFIGURATION
737
- # ============================================
738
-
739
- # Skip external services if flag is set
740
- if [ "$SKIP_EXTERNAL" = true ]; then
741
- echo ""
742
- echo -e "${YELLOW}Skipping external services configuration (--skip-external)${NC}"
743
- echo "You can configure them later by editing .env.local"
744
- configure_services="n"
745
- elif [ "$QUICK_MODE" = true ]; then
746
- # Quick mode: use defaults without prompting
747
- echo ""
748
- echo -e "${YELLOW}Quick mode: Using default service configuration...${NC}"
749
- configure_services="y"
750
- else
751
- echo ""
752
- echo -e "${YELLOW}=============================================="
753
- echo -e " EXTERNAL SERVICES (Optional)"
754
- echo -e "==============================================${NC}"
755
- echo ""
756
- echo "Would you like to configure external services?"
757
- echo "(You can also add them later to .env.local)"
758
- echo ""
759
- read -p "Configure external services? (y/n): " configure_services
760
- fi
761
-
762
- if [[ "$configure_services" == "y" || "$configure_services" == "Y" || "$configure_services" == "yes" ]]; then
763
-
764
- # Initialize .env.local with header if new
765
- if [ ! -f ".env.local" ]; then
766
- cat > .env.local << 'ENV_HEADER'
767
- # Forge Workflow Configuration
768
- # Generated by install.sh
769
-
770
- ENV_HEADER
771
- fi
772
-
773
- # ============================================
774
- # CODE REVIEW TOOL SELECTION
775
- # ============================================
776
- if [ "$QUICK_MODE" = true ]; then
777
- # Quick mode: use default (option 1)
778
- code_review_choice=1
779
- else
780
- echo ""
781
- echo -e "${CYAN}Code Review Tool${NC}"
782
- echo "Select your code review integration:"
783
- echo ""
784
- echo -e " ${GREEN}1)${NC} GitHub Code Quality (FREE, built-in) ${GREEN}[RECOMMENDED]${NC}"
785
- echo " Zero setup - uses GitHub's built-in code quality features"
786
- echo ""
787
- echo -e " ${GREEN}2)${NC} CodeRabbit (FREE for open source)"
788
- echo " AI-powered reviews - install GitHub App at https://coderabbit.ai"
789
- echo ""
790
- echo " 3) Greptile (Paid - \$99+/mo)"
791
- echo " Enterprise code review - https://greptile.com"
792
- echo ""
793
- echo " 4) Skip code review integration"
794
- echo ""
795
- read -p "Select [1]: " code_review_choice
796
- code_review_choice=${code_review_choice:-1}
797
- fi
798
-
799
- case $code_review_choice in
800
- 1)
801
- echo "CODE_REVIEW_TOOL=github-code-quality" >> .env.local
802
- echo -e " ${GREEN}✓${NC} Using GitHub Code Quality (FREE)"
803
- ;;
804
- 2)
805
- echo "CODE_REVIEW_TOOL=coderabbit" >> .env.local
806
- echo "# CodeRabbit: Install GitHub App at https://coderabbit.ai" >> .env.local
807
- echo -e " ${GREEN}✓${NC} Using CodeRabbit - Install the GitHub App to activate"
808
- echo -e " ${BLUE}https://coderabbit.ai${NC}"
809
- ;;
810
- 3)
811
- echo ""
812
- read -s -p " Enter Greptile API key: " greptile_key
813
- echo ""
814
- if [ -n "$greptile_key" ]; then
815
- echo "CODE_REVIEW_TOOL=greptile" >> .env.local
816
- echo "GREPTILE_API_KEY=$greptile_key" >> .env.local
817
- echo -e " ${GREEN}✓${NC} Greptile configured"
818
- else
819
- echo "CODE_REVIEW_TOOL=none" >> .env.local
820
- echo -e " ${YELLOW}Skipped${NC} - No API key provided"
821
- fi
822
- ;;
823
- 4|*)
824
- echo "CODE_REVIEW_TOOL=none" >> .env.local
825
- echo -e " ${YELLOW}Skipped${NC} code review integration"
826
- ;;
827
- esac
828
-
829
- # ============================================
830
- # CODE QUALITY TOOL SELECTION
831
- # ============================================
832
- if [ "$QUICK_MODE" = true ]; then
833
- # Quick mode: use default (option 1)
834
- code_quality_choice=1
835
- else
836
- echo ""
837
- echo -e "${CYAN}Code Quality Tool${NC}"
838
- echo "Select your code quality/security scanner:"
839
- echo ""
840
- echo -e " ${GREEN}1)${NC} ESLint only (FREE, built-in) ${GREEN}[RECOMMENDED]${NC}"
841
- echo " No external server required - uses project's linting"
842
- echo ""
843
- echo " 2) SonarCloud (50k LoC free, cloud-hosted)"
844
- echo " Get token: https://sonarcloud.io/account/security"
845
- echo ""
846
- echo " 3) SonarQube Community (FREE, self-hosted, unlimited LoC)"
847
- echo " Run: docker run -d --name sonarqube -p 9000:9000 sonarqube:community"
848
- echo ""
849
- echo " 4) Skip code quality integration"
850
- echo ""
851
- read -p "Select [1]: " code_quality_choice
852
- code_quality_choice=${code_quality_choice:-1}
853
- fi
854
-
855
- case $code_quality_choice in
856
- 1)
857
- echo "CODE_QUALITY_TOOL=eslint" >> .env.local
858
- echo -e " ${GREEN}✓${NC} Using ESLint (built-in)"
859
- ;;
860
- 2)
861
- echo ""
862
- read -s -p " Enter SonarCloud token: " sonar_token
863
- echo ""
864
- read -p " Enter SonarCloud organization: " sonar_org
865
- read -p " Enter SonarCloud project key: " sonar_project
866
- if [ -n "$sonar_token" ]; then
867
- echo "CODE_QUALITY_TOOL=sonarcloud" >> .env.local
868
- echo "SONAR_TOKEN=$sonar_token" >> .env.local
869
- [ -n "$sonar_org" ] && echo "SONAR_ORGANIZATION=$sonar_org" >> .env.local
870
- [ -n "$sonar_project" ] && echo "SONAR_PROJECT_KEY=$sonar_project" >> .env.local
871
- echo -e " ${GREEN}✓${NC} SonarCloud configured"
872
- else
873
- echo "CODE_QUALITY_TOOL=eslint" >> .env.local
874
- echo -e " ${YELLOW}Falling back to ESLint${NC}"
875
- fi
876
- ;;
877
- 3)
878
- echo ""
879
- echo -e " ${BLUE}SonarQube Self-Hosted Setup:${NC}"
880
- echo " docker run -d --name sonarqube -p 9000:9000 sonarqube:community"
881
- echo " Access: http://localhost:9000 (admin/admin)"
882
- echo ""
883
- read -p " Enter SonarQube URL [http://localhost:9000]: " sonarqube_url
884
- sonarqube_url=${sonarqube_url:-http://localhost:9000}
885
- read -s -p " Enter SonarQube token (optional): " sonarqube_token
886
- echo ""
887
-
888
- echo "CODE_QUALITY_TOOL=sonarqube" >> .env.local
889
- echo "SONARQUBE_URL=$sonarqube_url" >> .env.local
890
- [ -n "$sonarqube_token" ] && echo "SONARQUBE_TOKEN=$sonarqube_token" >> .env.local
891
- echo "# SonarQube: docker run -d --name sonarqube -p 9000:9000 sonarqube:community" >> .env.local
892
- echo -e " ${GREEN}✓${NC} SonarQube self-hosted configured"
893
- ;;
894
- 4|*)
895
- echo "CODE_QUALITY_TOOL=none" >> .env.local
896
- echo -e " ${YELLOW}Skipped${NC} code quality integration"
897
- ;;
898
- esac
899
-
900
- # ============================================
901
- # RESEARCH TOOL SELECTION
902
- # ============================================
903
- if [ "$QUICK_MODE" = true ]; then
904
- # Quick mode: use default (option 1)
905
- research_choice=1
906
- else
907
- echo ""
908
- echo -e "${CYAN}Research Tool${NC}"
909
- echo "Select your research tool for /research stage:"
910
- echo ""
911
- echo -e " ${GREEN}1)${NC} Manual research only ${GREEN}[DEFAULT]${NC}"
912
- echo " Use web browser and codebase exploration"
913
- echo ""
914
- echo " 2) Parallel AI (comprehensive web research)"
915
- echo " Get key: https://platform.parallel.ai"
916
- echo ""
917
- read -p "Select [1]: " research_choice
918
- research_choice=${research_choice:-1}
919
- fi
920
-
921
- case $research_choice in
922
- 2)
923
- echo ""
924
- read -s -p " Enter Parallel AI API key: " parallel_key
925
- echo ""
926
- if [ -n "$parallel_key" ]; then
927
- echo "PARALLEL_API_KEY=$parallel_key" >> .env.local
928
- echo -e " ${GREEN}✓${NC} Parallel AI configured"
929
- else
930
- echo -e " ${YELLOW}Skipped${NC} - No API key provided"
931
- fi
932
- ;;
933
- 1|*)
934
- echo -e " ${GREEN}✓${NC} Using manual research"
935
- ;;
936
- esac
937
-
938
- # ============================================
939
- # CONTEXT7 MCP - Library Documentation
940
- # ============================================
941
- echo ""
942
- echo -e "${CYAN}Context7 MCP - Library Documentation${NC}"
943
- echo "Provides up-to-date library docs for AI coding agents."
944
- echo ""
945
-
946
- # Show what was auto-installed
947
- if [ "$CONTEXT7_INSTALLED_CLAUDE" = true ]; then
948
- echo -e " ${GREEN}✓${NC} Auto-installed for Claude Code (.mcp.json)"
949
- fi
950
- if [ "$CONTEXT7_INSTALLED_CONTINUE" = true ]; then
951
- echo -e " ${GREEN}✓${NC} Auto-installed for Continue (.continue/config.yaml)"
952
- fi
953
-
954
- # Check for agents that need manual setup
955
- NEEDS_MANUAL_MCP=false
956
- if [ "$INSTALL_CURSOR" = true ]; then
957
- echo -e " ${YELLOW}!${NC} Cursor: Configure via Cursor Settings > MCP"
958
- NEEDS_MANUAL_MCP=true
959
- fi
960
- if [ "$INSTALL_WINDSURF" = true ]; then
961
- echo -e " ${YELLOW}!${NC} Windsurf: Install via Plugin Store"
962
- NEEDS_MANUAL_MCP=true
963
- fi
964
- if [ "$INSTALL_CLINE" = true ]; then
965
- echo -e " ${YELLOW}!${NC} Cline: Install via MCP Marketplace"
966
- NEEDS_MANUAL_MCP=true
967
- fi
968
-
969
- if [ "$NEEDS_MANUAL_MCP" = true ]; then
970
- echo ""
971
- echo " Package: @upstash/context7-mcp@latest"
972
- echo " Docs: https://github.com/upstash/context7-mcp"
973
- fi
974
-
975
- # ============================================
976
- # Save package manager preference
977
- # ============================================
978
- echo "" >> .env.local
979
- echo "# Package Manager (auto-detected)" >> .env.local
980
- echo "PKG_MANAGER=$PKG_MANAGER" >> .env.local
981
-
982
- # Add .env.local to .gitignore if not present
983
- if [ -f ".gitignore" ]; then
984
- if ! grep -q "\.env\.local" .gitignore; then
985
- echo "" >> .gitignore
986
- echo "# Local environment variables" >> .gitignore
987
- echo ".env.local" >> .gitignore
988
- fi
989
- else
990
- echo "# Local environment variables" > .gitignore
991
- echo ".env.local" >> .gitignore
992
- fi
993
-
994
- echo ""
995
- echo -e " ${GREEN}Configuration saved to .env.local${NC}"
996
- echo -e " ${GREEN}Added .env.local to .gitignore${NC}"
997
-
998
- else
999
- echo ""
1000
- echo "Skipping external services. You can configure them later by editing .env.local"
1001
- fi
1002
-
1003
- # ============================================
1004
- # SUCCESS MESSAGE
1005
- # ============================================
1006
- echo ""
1007
- echo -e "${GREEN}=============================================="
1008
- echo -e " Forge v1.1.0 Setup Complete!"
1009
- echo -e "==============================================${NC}"
1010
- echo ""
1011
-
1012
- # Show backup notification if created
1013
- if [ "$AGENTS_BACKUP_CREATED" = true ]; then
1014
- echo -e "${YELLOW}Note: Previous AGENTS.md backed up to AGENTS.md.backup${NC}"
1015
- echo ""
1016
- fi
1017
-
1018
- # Show existing installation upgrade notice
1019
- if [ "$EXISTING_INSTALL" = true ]; then
1020
- echo -e "${GREEN}Existing installation upgraded successfully.${NC}"
1021
- echo ""
1022
- fi
1023
-
1024
- # Show what was installed
1025
- echo "Installed for:"
1026
- [ "$INSTALL_CLAUDE" = true ] && echo -e " ${GREEN}*${NC} Claude Code (.claude/commands/)"
1027
- [ "$INSTALL_CURSOR" = true ] && echo -e " ${GREEN}*${NC} Cursor (.cursor/rules/)"
1028
- [ "$INSTALL_WINDSURF" = true ] && echo -e " ${GREEN}*${NC} Windsurf (.windsurf/workflows/)"
1029
- [ "$INSTALL_KILOCODE" = true ] && echo -e " ${GREEN}*${NC} Kilo Code (.kilocode/workflows/)"
1030
- [ "$INSTALL_ANTIGRAVITY" = true ] && echo -e " ${GREEN}*${NC} Google Antigravity (.agent/workflows/)"
1031
- [ "$INSTALL_COPILOT" = true ] && echo -e " ${GREEN}*${NC} GitHub Copilot (.github/prompts/)"
1032
- [ "$INSTALL_CONTINUE" = true ] && echo -e " ${GREEN}*${NC} Continue (.continue/prompts/)"
1033
- [ "$INSTALL_OPENCODE" = true ] && echo -e " ${GREEN}*${NC} OpenCode (.opencode/commands/)"
1034
- [ "$INSTALL_CLINE" = true ] && echo -e " ${GREEN}*${NC} Cline (.clinerules)"
1035
- [ "$INSTALL_ROO" = true ] && echo -e " ${GREEN}*${NC} Roo Code (.roo/commands/)"
1036
- [ "$INSTALL_AIDER" = true ] && echo -e " ${GREEN}*${NC} Aider (.aider.conf.yml)"
1037
-
1038
- echo ""
1039
- echo -e "${CYAN}=============================================="
1040
- echo -e " GET STARTED"
1041
- echo -e "==============================================${NC}"
1042
- echo ""
1043
- echo " /status - Check current context"
1044
- echo " /plan - Design intent, research, branch + task list"
1045
- echo " /dev - TDD development"
1046
- echo " /validate - Type check, lint, tests, security"
1047
- echo " /ship - Create pull request"
1048
- echo " /review - Address PR feedback"
1049
- echo " /premerge - Update docs, hand off PR"
1050
- echo " /verify - Post-merge health check"
1051
- echo ""
1052
- echo " Full guide: docs/WORKFLOW.md"
1053
- echo ""
1054
- echo "Optional tools:"
1055
- echo " - Beads: $PKG_MANAGER install -g @beads/bd && bd init"
1056
- echo ""
1057
- echo -e "${CYAN}Package manager detected: $PKG_MANAGER${NC}"
1058
- echo ""
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Forge — thin bootstrapper
5
+ # Installs the forge-workflow package and delegates to `bunx forge setup`.
6
+ # Note: This script is a bootstrapper. For full control, use: bunx forge setup
7
+
8
+ echo ""
9
+ echo "Note: This script is a bootstrapper. For full control, use: bunx forge setup"
10
+ echo ""
11
+
12
+ # Detect package manager (prefer bun)
13
+ if command -v bun >/dev/null 2>&1; then
14
+ PM="bun"
15
+ elif command -v npm >/dev/null 2>&1; then
16
+ PM="npm"
17
+ else
18
+ echo "Error: No supported package manager found (bun or npm)."
19
+ echo "Install bun (recommended): https://bun.sh"
20
+ echo " curl -fsSL https://bun.sh/install | bash"
21
+ echo "Or install Node.js/npm: https://nodejs.org"
22
+ exit 1
23
+ fi
24
+
25
+ # Install forge-workflow as a dev dependency
26
+ echo "Installing forge-workflow with $PM..."
27
+ if [ "$PM" = "bun" ]; then
28
+ bun add -D forge-workflow
29
+ else
30
+ npm install -D forge-workflow
31
+ fi
32
+
33
+ # Delegate to forge setup, passing through all CLI args
34
+ echo "Running forge setup..."
35
+ if [ "$PM" = "bun" ]; then
36
+ bunx forge setup "$@"
37
+ else
38
+ npx forge setup "$@"
39
+ fi
40
+ exit $?