forge-workflow 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.claude/commands/dev.md +314 -0
  2. package/.claude/commands/plan.md +389 -0
  3. package/.claude/commands/premerge.md +179 -0
  4. package/.claude/commands/research.md +42 -0
  5. package/.claude/commands/review.md +442 -0
  6. package/.claude/commands/rollback.md +721 -0
  7. package/.claude/commands/ship.md +134 -0
  8. package/.claude/commands/sonarcloud.md +152 -0
  9. package/.claude/commands/status.md +77 -0
  10. package/.claude/commands/validate.md +237 -0
  11. package/.claude/commands/verify.md +221 -0
  12. package/.claude/rules/greptile-review-process.md +285 -0
  13. package/.claude/rules/workflow.md +105 -0
  14. package/.claude/scripts/greptile-resolve.sh +526 -0
  15. package/.claude/scripts/load-env.sh +32 -0
  16. package/.forge/hooks/check-tdd.js +240 -0
  17. package/.github/PLUGIN_TEMPLATE.json +32 -0
  18. package/.mcp.json.example +12 -0
  19. package/AGENTS.md +169 -0
  20. package/CLAUDE.md +99 -0
  21. package/LICENSE +21 -0
  22. package/README.md +414 -0
  23. package/bin/forge-cmd.js +313 -0
  24. package/bin/forge-validate.js +303 -0
  25. package/bin/forge.js +4228 -0
  26. package/docs/AGENT_INSTALL_PROMPT.md +342 -0
  27. package/docs/ENHANCED_ONBOARDING.md +602 -0
  28. package/docs/EXAMPLES.md +482 -0
  29. package/docs/GREPTILE_SETUP.md +400 -0
  30. package/docs/MANUAL_REVIEW_GUIDE.md +106 -0
  31. package/docs/ROADMAP.md +359 -0
  32. package/docs/SETUP.md +632 -0
  33. package/docs/TOOLCHAIN.md +849 -0
  34. package/docs/VALIDATION.md +363 -0
  35. package/docs/WORKFLOW.md +400 -0
  36. package/docs/planning/PROGRESS.md +396 -0
  37. package/docs/plans/.gitkeep +0 -0
  38. package/docs/plans/2026-02-27-forge-test-suite-v2-decisions.md +21 -0
  39. package/docs/plans/2026-02-27-forge-test-suite-v2-design.md +362 -0
  40. package/docs/plans/2026-02-27-forge-test-suite-v2-tasks.md +343 -0
  41. package/docs/plans/2026-03-02-superpowers-gaps-decisions.md +26 -0
  42. package/docs/plans/2026-03-02-superpowers-gaps-design.md +239 -0
  43. package/docs/plans/2026-03-02-superpowers-gaps-tasks.md +260 -0
  44. package/docs/plans/2026-03-04-agent-command-parity-design.md +163 -0
  45. package/docs/plans/2026-03-04-verify-worktree-cleanup-decisions.md +7 -0
  46. package/docs/plans/2026-03-04-verify-worktree-cleanup-design.md +165 -0
  47. package/docs/plans/2026-03-05-forge-uto-decisions.md +6 -0
  48. package/docs/plans/2026-03-05-forge-uto-design.md +116 -0
  49. package/docs/plans/2026-03-05-forge-uto-tasks.md +244 -0
  50. package/docs/plans/2026-03-10-command-creator-and-eval-decisions.md +52 -0
  51. package/docs/plans/2026-03-10-command-creator-and-eval-design.md +350 -0
  52. package/docs/plans/2026-03-10-command-creator-and-eval-tasks.md +426 -0
  53. package/docs/plans/2026-03-10-stale-workflow-refs-decisions.md +8 -0
  54. package/docs/plans/2026-03-10-stale-workflow-refs-design.md +80 -0
  55. package/docs/plans/2026-03-10-stale-workflow-refs-tasks.md +90 -0
  56. package/docs/plans/2026-03-14-beads-plan-context-decisions.md +9 -0
  57. package/docs/plans/2026-03-14-beads-plan-context-design.md +171 -0
  58. package/docs/plans/2026-03-14-beads-plan-context-tasks.md +160 -0
  59. package/docs/plans/2026-03-14-skill-eval-loop-decisions.md +33 -0
  60. package/docs/plans/2026-03-14-skill-eval-loop-design.md +118 -0
  61. package/docs/plans/2026-03-14-skill-eval-loop-results.md +78 -0
  62. package/docs/plans/2026-03-14-skill-eval-loop-tasks.md +160 -0
  63. package/docs/plans/2026-03-15-agent-command-parity-v2-decisions.md +11 -0
  64. package/docs/plans/2026-03-15-agent-command-parity-v2-design.md +145 -0
  65. package/docs/plans/2026-03-15-agent-command-parity-v2-tasks.md +211 -0
  66. package/docs/research/TEMPLATE.md +292 -0
  67. package/docs/research/advanced-testing.md +297 -0
  68. package/docs/research/agent-permissions.md +167 -0
  69. package/docs/research/dependency-chain.md +328 -0
  70. package/docs/research/forge-workflow-v2.md +550 -0
  71. package/docs/research/plugin-architecture.md +772 -0
  72. package/docs/research/pr4-cli-automation.md +326 -0
  73. package/docs/research/premerge-verify-restructure.md +205 -0
  74. package/docs/research/skills-restructure.md +508 -0
  75. package/docs/research/sonarcloud-perfection-plan.md +166 -0
  76. package/docs/research/sonarcloud-quality-gate.md +184 -0
  77. package/docs/research/superpowers-integration.md +403 -0
  78. package/docs/research/superpowers.md +319 -0
  79. package/docs/research/test-environment.md +519 -0
  80. package/install.sh +1062 -0
  81. package/lefthook.yml +39 -0
  82. package/lib/agents/README.md +198 -0
  83. package/lib/agents/claude.plugin.json +28 -0
  84. package/lib/agents/cline.plugin.json +22 -0
  85. package/lib/agents/codex.plugin.json +19 -0
  86. package/lib/agents/copilot.plugin.json +24 -0
  87. package/lib/agents/cursor.plugin.json +25 -0
  88. package/lib/agents/kilocode.plugin.json +22 -0
  89. package/lib/agents/opencode.plugin.json +20 -0
  90. package/lib/agents/roo.plugin.json +23 -0
  91. package/lib/agents-config.js +2112 -0
  92. package/lib/commands/dev.js +513 -0
  93. package/lib/commands/plan.js +696 -0
  94. package/lib/commands/recommend.js +119 -0
  95. package/lib/commands/ship.js +377 -0
  96. package/lib/commands/status.js +378 -0
  97. package/lib/commands/validate.js +602 -0
  98. package/lib/context-merge.js +359 -0
  99. package/lib/plugin-catalog.js +360 -0
  100. package/lib/plugin-manager.js +166 -0
  101. package/lib/plugin-recommender.js +141 -0
  102. package/lib/project-discovery.js +491 -0
  103. package/lib/setup.js +118 -0
  104. package/lib/workflow-profiles.js +203 -0
  105. package/package.json +115 -0
@@ -0,0 +1,167 @@
1
+ # Research: Per-Agent Permissions Configuration
2
+
3
+ **Feature slug**: `agent-permissions`
4
+ **Beads issue**: forge-bo2
5
+ **Date**: 2026-02-24
6
+
7
+ ---
8
+
9
+ ## Objective
10
+
11
+ Every AI agent supported by Forge has its own permission/auto-approval system for terminal commands and file operations. Currently Forge ships no default permission config for any agent, meaning developers hit approval prompts constantly for safe, routine commands (git status, ls, bun run, bd list, etc.).
12
+
13
+ **Goal**: Ship project-level permission config files for all supported agents so that safe commands auto-run out of the box, while destructive commands still require explicit approval.
14
+
15
+ ---
16
+
17
+ ## Codebase Analysis
18
+
19
+ ### What already exists
20
+
21
+ | File | Agent | Status |
22
+ | ---- | ----- | ------ |
23
+ | `AGENTS.md` | Universal | ✅ Exists — workflow instructions only |
24
+ | `docs/SETUP.md` | All agents | ✅ Exists (635 lines) — no permissions section |
25
+ | `lib/agents/*.plugin.json` | 11 agents | ✅ All 11 plugin definitions exist |
26
+ | `.claude/settings.json` | Claude Code | ✅ Exists — project-level permissions present |
27
+ | `opencode.json` | Kilo/OpenCode | ❌ Missing |
28
+ | `.codex/config.toml` | Codex CLI | ❌ Missing |
29
+ | `.cursor/rules/permissions-guidance.mdc` | Cursor | ❌ Missing |
30
+
31
+ ### Affected files
32
+
33
+ - `docs/SETUP.md` — add permissions section
34
+ - `opencode.json` — new file at project root
35
+ - `.codex/config.toml` — new file (directory must be created)
36
+ - `.cursor/rules/permissions-guidance.mdc` — new file (directory must be created)
37
+
38
+ ### Integration points
39
+
40
+ - `docs/SETUP.md` has per-agent sections — permissions guidance slots naturally into each agent's section
41
+ - `.cursor/rules/` is referenced in `cursor.plugin.json` — adding a `.mdc` file there fits the existing pattern
42
+ - The `forge setup` command will need to be updated separately to copy these files to new projects (separate issue)
43
+
44
+ ---
45
+
46
+ ## Research Findings
47
+
48
+ ### Agent Permission System Comparison
49
+
50
+ #### Claude Code — `.claude/settings.json`
51
+ - **Format**: JSON, `permissions.allow` array
52
+ - **Syntax**: `"Bash(git status:*)"` — command prefix with wildcard
53
+ - **Scope**: Project-level (committed) + global (`~/.claude/settings.json`) + local (gitignored)
54
+ - **Granularity**: Per-tool (Bash, Read, Edit, WebFetch, Skill, Task, MCP)
55
+ - **Evaluation**: First match in allow/deny wins
56
+ - **Status**: Already configured in this project's `.claude/settings.json`
57
+
58
+ #### Kilo Code + OpenCode — `opencode.json` (shared format)
59
+ - **Format**: JSON, `permission` object with nested patterns
60
+ - **Syntax**: `"git status *": "allow"` inside `bash` block
61
+ - **Scope**: Project root (project-level) OR `~/.config/kilo/opencode.json` (global)
62
+ - **Granularity**: bash, edit, external_directory, MCP, browser
63
+ - **Evaluation**: **Last matching rule wins** — put deny rules at the bottom
64
+ - **States**: `"allow"`, `"ask"`, `"deny"`
65
+ - **Sources**: [Kilo Code docs](https://kilo.ai/docs/features/auto-approving-actions), [OpenCode docs](https://opencode.ai/docs/permissions/)
66
+
67
+ #### OpenAI Codex CLI — `.codex/config.toml`
68
+ - **Format**: TOML
69
+ - **Syntax**: `approval_policy = "on-request"` + `sandbox_mode = "workspace-write"`
70
+ - **Scope**: `.codex/config.toml` (project) OR `~/.codex/config.toml` (global)
71
+ - **Granularity**: Policy-level (untrusted/on-request/never) + sandbox restrictions
72
+ - **States**: `untrusted` (approve all), `on-request` (agent decides), `never` (no prompts)
73
+ - **Best default**: `on-request` — agent uses built-in risk model, only asks when uncertain
74
+ - **Also supports**: `--full-auto` flag and `--yolo` (dangerous bypass)
75
+ - **Sources**: [Codex CLI config reference](https://developers.openai.com/codex/config-reference/)
76
+
77
+ #### Cursor — IDE Settings (YOLO Mode)
78
+ - **Format**: UI-only — configured in Cursor Settings > Features > Chat & Composer
79
+ - **Syntax**: `Bash(git status *)` in allow/deny lists (same format as Claude Code)
80
+ - **Scope**: IDE-level, not version-controlled — cannot be shipped as project file
81
+ - **Granularity**: Fine-grained per-command allow/deny lists
82
+ - **Approach for Forge**: Document recommended settings in `.cursor/rules/permissions-guidance.mdc`
83
+ - **Sources**: Cursor Settings UI
84
+
85
+ ### Risk-Based Command Classification
86
+
87
+ | Risk Level | Commands | Default action |
88
+ | ---------- | -------- | -------------- |
89
+ | **Safe (read-only)** | git status/log/diff/branch, ls, cat, grep, find, pwd, which, bd list/show/stats | `allow` |
90
+ | **Safe (local write, reversible)** | git add, git commit, git stash, git checkout, bun/npm run, mkdir, touch, cp, mv | `allow` |
91
+ | **Medium (remote-affecting)** | git push, gh pr create, gh issue create | `allow` (intentional dev action) |
92
+ | **Careful (needs attention)** | git reset --hard, git rebase | `ask` |
93
+ | **Dangerous (destructive)** | rm -rf, git push --force, drop database | `deny` |
94
+
95
+ ### Key Design Decisions
96
+
97
+ **Decision 1: Include `git push:*` in allow list**
98
+ - Reasoning: Developers push intentionally, constant prompting breaks flow
99
+ - Evidence: Volleyball project already allows it in settings.local.json
100
+ - Alternative: Keep as `ask` (rejected — too much friction for normal PRs)
101
+
102
+ **Decision 2: `on-request` not `never` for Codex CLI**
103
+ - Reasoning: `never` skips ALL prompts including network access and external edits; `on-request` lets the agent's risk model handle edge cases
104
+ - Evidence: Codex docs recommend `on-request` for interactive development
105
+ - Alternative: `never` for power users (can be documented as option)
106
+
107
+ **Decision 3: Documentation-only for Cursor**
108
+ - Reasoning: Cursor permissions are IDE-level settings, not project files — nothing to commit
109
+ - Evidence: No `settings.json`-like project file exists for Cursor
110
+ - Alternative: None — this is a platform limitation
111
+
112
+ ---
113
+
114
+ ## TDD Test Scenarios
115
+
116
+ Since these are config files (not code), traditional unit tests don't apply. Verification is manual:
117
+
118
+ 1. **opencode.json validity** — JSON parses without errors; `git status` and `bd list` run without prompt in Kilo Code or OpenCode
119
+ 2. **.codex/config.toml validity** — TOML parses correctly; Codex CLI reads file at startup
120
+ 3. **.cursor/rules/ presence** — File appears in Cursor's Rules panel; content is accurate
121
+ 4. **docs/SETUP.md section** — Section is readable, links work, global config snippet is copy-pasteable and correct
122
+
123
+ ---
124
+
125
+ ## Security Analysis
126
+
127
+ ### OWASP Top 10 Relevance
128
+
129
+ | Risk | Relevance | Mitigation |
130
+ | ---- | --------- | ---------- |
131
+ | **A01 Broken Access Control** | Medium — overly broad allow lists could let agents run unintended commands | Explicit deny rules for `rm -rf`, `git push --force`, `git reset --hard` |
132
+ | **A05 Security Misconfiguration** | Medium — shipping overly permissive defaults would be misconfigured | Conservative defaults: `approval_policy = "on-request"` |
133
+ | **A09 Security Logging** | Low — agent commands aren't logged by these configs | Mitigated by git history and Beads tracking |
134
+
135
+ ### Agent-Specific Security Notes
136
+
137
+ - **opencode.json**: Deny rules must be at the bottom (last match wins) — putting them first would be ineffective
138
+ - **Codex CLI**: `sandbox_mode = "workspace-write"` prevents file access outside project root — keep this
139
+ - **Never ship**: `--dangerously-bypass-approvals-and-sandbox` (Codex) or global `"*": "allow"` (opencode.json)
140
+
141
+ ---
142
+
143
+ ## Scope Assessment
144
+
145
+ **Type**: Tactical (config files + docs update, no business logic)
146
+ **Complexity**: Low — all config formats researched, no code changes needed
147
+ **Parallelization**: All 3 config files can be created simultaneously; docs/SETUP.md update is sequential after
148
+ **Estimated files**: 4 new files, 1 modified
149
+
150
+ **Branch**: `feat/agent-permissions`
151
+
152
+ ---
153
+
154
+ ## Sources
155
+
156
+ - [Kilo Code - Auto-Approving Actions](https://kilo.ai/docs/features/auto-approving-actions)
157
+ - [OpenCode - Permissions](https://opencode.ai/docs/permissions/)
158
+ - [Codex CLI - Config Reference](https://developers.openai.com/codex/config-reference/)
159
+ - Forge project codebase analysis (2026-02-24)
160
+
161
+ ---
162
+
163
+ ## Next Step
164
+
165
+ ```bash
166
+ /plan agent-permissions
167
+ ```
@@ -0,0 +1,328 @@
1
+ # Forge Workflow: Dependency Chain Research
2
+
3
+ **Date**: 2026-02-23
4
+ **Branch**: feat/skills-restructure
5
+ **Objective**: Map every dependency the Forge workflow installs, how it installs them, what their own prerequisites are, and how the user is informed throughout.
6
+
7
+ ---
8
+
9
+ ## 1. What Forge Installs — Complete Map
10
+
11
+ ### Quick Setup Flow (`bunx forge setup --quick`)
12
+
13
+ ```
14
+ quickSetup()
15
+ ├── checkPrerequisites()
16
+ ├── Copy AGENTS.md
17
+ ├── setupCoreDocs()
18
+ ├── autoInstallLefthook()
19
+ ├── autoSetupToolsInQuickMode()
20
+ │ ├── autoSetupBeadsInQuickMode()
21
+ │ ├── initializeOpenSpec() (only if already installed)
22
+ │ └── initializeSkills() (only if already installed)
23
+ ├── loadAndSetupClaudeCommands()
24
+ ├── setupSelectedAgents()
25
+ ├── installGitHooks()
26
+ └── configureDefaultExternalServices()
27
+ ```
28
+
29
+ ### Every Tool — Install Method and Command
30
+
31
+ | Tool | Install Method | Command Used | Platform Branch |
32
+ |------|---------------|--------------|-----------------|
33
+ | **Lefthook** | npm/bun devDep | `bun add -d lefthook` | No |
34
+ | **Beads** | npm global | `npm install -g @beads/bd` | ⚠️ No Windows branch |
35
+ | **OpenSpec** | Skip if missing | `openspec init` only if found | No |
36
+ | **Skills** | Skip if missing | `skills init` only if found | No |
37
+ | **Git hooks** | via lefthook | `lefthook install` → hooks from lefthook.yml | No |
38
+ | **Context7 MCP** | npx at runtime | `npx -y @upstash/context7-mcp@latest` | Auto for Claude Code, Continue |
39
+ | **Grep.app MCP** | npx at runtime | `npx -y @ai-tools-all/grep_app_mcp` | Auto for Claude Code, Continue |
40
+ | **Agent config files** | File copy | Copies .claude/, .cursor/, .github/, etc. | Yes (path handling) |
41
+ | **AGENTS.md** | File copy | from package | No |
42
+ | **docs/WORKFLOW.md** | File copy | from package | No |
43
+
44
+ ---
45
+
46
+ ## 2. Dependencies of Each Tool
47
+
48
+ ### Beads (`@beads/bd`)
49
+
50
+ - **Language**: Go binary (pre-compiled, ~114MB `.exe` on Windows)
51
+ - **Runtime deps**: None — self-contained binary
52
+ - **Install prerequisites**:
53
+
54
+ | Install Path | Prerequisites | Works on Windows? |
55
+ |-------------|--------------|-------------------|
56
+ | `npm install -g @beads/bd` | npm/bun | ⚠️ Broken — Issue #1031, closed "not planned" |
57
+ | `irm .../install.ps1 \| iex` | PowerShell 5+ | ✅ Recommended on Windows |
58
+ | `curl .../install.sh \| bash` | bash, curl | ❌ Needs Git Bash or WSL |
59
+ | `go install .../bd@latest` | Go 1.24+ | ✅ Works |
60
+ | `brew install beads` | Homebrew | macOS/Linux only |
61
+
62
+ - **Build-from-source deps** (only if no pre-compiled binary):
63
+ - macOS: `icu4c`, `zstd`
64
+ - Linux: `libicu-dev`, `libzstd-dev`
65
+ - Windows: Go 1.24+ (no ICU required — uses pure Go regex backend)
66
+
67
+ - **What `bd init` creates**: `.beads/` directory with `issues.jsonl`, `metadata.json`, `config.yaml`, `README.md`, `.gitignore`
68
+
69
+ - **Critical gap**: forge.js uses `npm install -g @beads/bd` on ALL platforms including Windows, where this is broken. The PowerShell installer (`install.ps1`) is never called.
70
+
71
+ ### OpenSpec (`@fission-ai/openspec`)
72
+
73
+ - **Language**: Node.js (pure JS/TS, not a compiled binary)
74
+ - **Runtime**: Node.js ≥ 20.19.0
75
+ - **Own dependencies** (transitive, pulled on install):
76
+ - `@inquirer/core`, `@inquirer/prompts` — CLI prompts
77
+ - `commander` — CLI argument parsing
78
+ - `chalk` — terminal colors
79
+ - `fast-glob` — file pattern matching
80
+ - `ora` — **spinner** (ironically OpenSpec has a spinner, Forge doesn't)
81
+ - `yaml` — YAML parsing
82
+ - `zod` — schema validation
83
+ - `posthog-node` — analytics (sends usage telemetry)
84
+ - **Install prerequisites**: Node.js 20+ only
85
+ - **Works on Windows**: ✅ Yes — pure Node.js
86
+ - **What `openspec init` creates**: `openspec/` directory with proposal templates
87
+ - **Forge behavior**: Only initialized if already installed. Never force-installed. If not on machine, silently skipped.
88
+
89
+ ### Lefthook
90
+
91
+ - **Language**: Go binary (same distribution model as Beads)
92
+ - **Runtime deps**: None — zero dependencies
93
+ - **Own npm dependencies**: Uses `optionalDependencies` for platform-specific binaries:
94
+ - `lefthook-darwin-arm64`, `lefthook-darwin-x64`
95
+ - `lefthook-linux-arm64`, `lefthook-linux-x64`
96
+ - `lefthook-win32-x64`, `lefthook-win32-arm64`
97
+ - **Install prerequisites**: npm/bun only (binary bundled in npm package)
98
+ - **Works on Windows**: ✅ Yes — ships Windows binary via npm optionalDependencies
99
+ - **What lefthook installs** (via lefthook.yml): 3 git hooks:
100
+ - `commit-msg`: `bunx commitlint --edit {1}` — enforces conventional commits
101
+ - `pre-commit`: `node .forge/hooks/check-tdd.js` — TDD enforcement
102
+ - `pre-push`: branch protection + ESLint + test suite
103
+ - **Pre-push hooks use bash syntax** (`if [ $? -ne 0 ]`) — ⚠️ breaks on Windows without Git Bash
104
+ - **Transitive from hooks**: `commitlint` pulled via bunx at runtime (not pre-installed)
105
+
106
+ ### GitHub CLI (`gh`)
107
+
108
+ - **Not installed by Forge** — must be pre-installed by user
109
+ - **Checked in**: `checkPrerequisites()` — fatal error if missing
110
+ - **Auth status**: checked as warning (not fatal)
111
+ - **Download**: https://cli.github.com
112
+ - **No version requirement specified** in forge.js
113
+
114
+ ### MCP Servers (Context7, Grep.app)
115
+
116
+ - **Not pre-installed** — downloaded at runtime when agent first uses them
117
+ - **Mechanism**: `npx -y @upstash/context7-mcp@latest` — npx downloads and runs on demand
118
+ - **Prerequisites**: npx (comes with npm) or bunx
119
+ - **Context7 own deps**: Unknown — uses `@latest`, no version pinned
120
+ - **Grep.app own deps**: Unknown — no version pinned
121
+ - **Version pinning gap**: Both use `@latest` — breaking changes can silently break research workflow
122
+ - **Auto-configured for**: Claude Code (`.mcp.json`)
123
+ - **Manual setup required for**: Cursor, Cline
124
+
125
+ ---
126
+
127
+ ## 3. Transitive Dependencies (What Each Tool Pulls In)
128
+
129
+ ```
130
+ Forge setup triggers:
131
+
132
+ ├── npm install -g @beads/bd
133
+ │ └── Pre-compiled Go binary (no transitive npm deps)
134
+
135
+ ├── bun add -d lefthook
136
+ │ └── lefthook-win32-x64 (or platform binary) via optionalDeps
137
+ │ └── No further deps
138
+
139
+ ├── lefthook install (from lefthook.yml)
140
+ │ ├── commit-msg hook → bunx commitlint (runtime, not pre-installed)
141
+ │ │ └── @commitlint/cli + @commitlint/config-conventional (in devDeps ✓)
142
+ │ ├── pre-commit hook → node .forge/hooks/check-tdd.js (local file)
143
+ │ └── pre-push hook → bunx eslint (runtime)
144
+ │ └── eslint (in devDeps ✓)
145
+
146
+ ├── npx @upstash/context7-mcp@latest (at agent runtime)
147
+ │ └── Unknown — @latest, not audited
148
+
149
+ └── npx @ai-tools-all/grep_app_mcp (at agent runtime)
150
+ └── Unknown — no version pinned
151
+ ```
152
+
153
+ **Key finding**: Beads and Lefthook have zero transitive npm dependencies (Go binaries). OpenSpec has ~8 transitive Node.js deps but all are benign utilities. The MCP servers are the unknown — they run as subprocesses with whatever deps they pull.
154
+
155
+ ---
156
+
157
+ ## 4. User-Facing Progress Reporting
158
+
159
+ ### What the user currently sees
160
+
161
+ ```
162
+ [ASCII Banner]
163
+ Forge v1.6.0
164
+ Quick Setup
165
+
166
+ Checking prerequisites...
167
+ ✓ git version 2.x
168
+ ✓ gh version 2.x
169
+ ✓ node v22.x
170
+ ✓ bun v1.x
171
+
172
+ Created: AGENTS.md (universal standard)
173
+
174
+ 📦 Installing lefthook for git hooks...
175
+ ✓ Lefthook installed
176
+
177
+ 📦 Installing Beads globally...
178
+ ✓ Beads installed globally
179
+ 📦 Initializing Beads...
180
+ ✓ Beads initialized
181
+
182
+ [1/1] Setting up Claude Code...
183
+ ✓ ...
184
+
185
+ Installing git hooks (TDD enforcement)...
186
+ ✓ Lefthook hooks installed (local)
187
+
188
+ ==============================================
189
+ Forge v1.6.0 Quick Setup Complete!
190
+ ==============================================
191
+
192
+ Next steps:
193
+ 1. Start with: /status
194
+ 2. Read the guide: docs/WORKFLOW.md
195
+ ```
196
+
197
+ ### What's MISSING from the UX
198
+
199
+ | Missing Element | Impact |
200
+ |----------------|--------|
201
+ | No spinner/progress bar | User can't tell if it's hung or working |
202
+ | No step counter in quick mode | "Step 3 of 6" would orient the user |
203
+ | No post-install verification | "Beads installed" ≠ `bd version` actually works |
204
+ | Silent skips for OpenSpec/Skills | User doesn't know they weren't installed |
205
+ | No total time estimate | Network-heavy steps (beads download) feel like hangs |
206
+ | No retry feedback | If npm fails, just says "run manually" with no context |
207
+ | No success summary with versions | Should show: `bd 0.49.1 ✓`, `lefthook 1.10.x ✓` |
208
+
209
+ ### Interactive mode step counter (exists but only in agent setup)
210
+
211
+ ```
212
+ [1/1] Setting up Claude Code... ← This exists for agent files
213
+ ```
214
+
215
+ But NOT for the tool installation steps (beads, openspec, lefthook).
216
+
217
+ ---
218
+
219
+ ## 5. Windows-Specific Gaps
220
+
221
+ ### What forge.js does detect on Windows
222
+ - `process.platform === 'win32'` → uses `where.exe` instead of `which`
223
+ - CRLF handling (line 85): `.split(/\r?\n/)` on path resolution
224
+ - chmod skipped with warning (line 2886)
225
+
226
+ ### What forge.js does NOT do on Windows
227
+ - Does NOT detect Windows and switch to `install.ps1` for beads
228
+ - Does NOT warn about bash-syntax lefthook hooks
229
+ - Does NOT check for Git Bash or WSL
230
+ - Does NOT offer PowerShell alternative for beads
231
+
232
+ ### Windows failure sequence (current behavior)
233
+ ```
234
+ 1. forge.js runs npm install -g @beads/bd
235
+ 2. npm postinstall runs PowerShell Expand-Archive
236
+ 3. File locking error (EPERM) — bd.exe never lands
237
+ 4. forge.js catches error, prints "Run manually: npm install -g @beads/bd && bd init"
238
+ 5. User retries npm install → same EPERM → stuck in loop
239
+ 6. pre-push hook runs bash syntax → fails on Windows CMD
240
+ 7. User has lefthook installed but hooks don't fire correctly
241
+ ```
242
+
243
+ ### Correct Windows flow (not yet implemented)
244
+ ```
245
+ 1. Detect win32
246
+ 2. Run: powershell -Command "irm https://.../install.ps1 | iex"
247
+ 3. Verify: bd version
248
+ 4. Run: bd init
249
+ 5. For lefthook hooks: verify Git Bash is available, or use Node.js equivalents
250
+ ```
251
+
252
+ ---
253
+
254
+ ## 6. Full Flow — Zero to Working
255
+
256
+ ### macOS / Linux
257
+ ```bash
258
+ # Prerequisites (manual)
259
+ # - git (https://git-scm.com)
260
+ # - gh (https://cli.github.com) + gh auth login
261
+ # - Node.js 20+ (https://nodejs.org)
262
+ # - bun (https://bun.sh)
263
+
264
+ # Install Forge (triggers postinstall → copies AGENTS.md baseline)
265
+ npx forge-workflow
266
+ # OR add to project:
267
+ bun add -d forge-workflow
268
+
269
+ # Full setup (single command)
270
+ bunx forge setup --quick
271
+
272
+ # Verify
273
+ bd version # should show 0.49.x
274
+ lefthook version # should show 1.10.x
275
+ bd ready # should show open issues
276
+ ```
277
+
278
+ ### Windows (correct flow — not what forge currently does)
279
+ ```powershell
280
+ # Prerequisites (manual)
281
+ # - Git for Windows (https://git-scm.com) — includes bash
282
+ # - gh CLI (https://cli.github.com) + gh auth login
283
+ # - Node.js 20+ (https://nodejs.org)
284
+ # - bun (https://bun.sh)
285
+
286
+ # Install beads FIRST (before forge setup) — npm is broken on Windows
287
+ irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
288
+
289
+ # Then install Forge
290
+ npx forge-workflow
291
+
292
+ # Full setup
293
+ bunx forge setup --quick
294
+
295
+ # Verify
296
+ bd version # should work now (was pre-installed)
297
+ lefthook version # should work (ships Windows binary via npm)
298
+ ```
299
+
300
+ ---
301
+
302
+ ## 7. Key Gaps — Priority Order
303
+
304
+ | Priority | Gap | Fix |
305
+ |----------|-----|-----|
306
+ | P0 | Beads npm install broken on Windows | Detect win32, use install.ps1 |
307
+ | P0 | No post-install verification | Run `bd version` after install, fail loudly if not working |
308
+ | P1 | OpenSpec/Skills silently skipped | Show clear message: "OpenSpec not found — install with: ..." |
309
+ | P1 | lefthook.yml pre-push uses bash syntax | Replace `if [ $? -ne 0 ]` with cross-platform Node.js scripts |
310
+ | P1 | MCP servers use @latest | Pin versions: `@upstash/context7-mcp@1.x.x` |
311
+ | P2 | No spinner during installs | Add ora (already a dep of OpenSpec — ironic) |
312
+ | P2 | No step counter in quick mode | "Step 3/6: Installing Beads..." |
313
+ | P2 | No versions in success summary | Show installed versions at end |
314
+ | P3 | Go not mentioned as Windows fallback | Document: if install.ps1 fails → go install |
315
+ | P3 | OpenSpec telemetry (posthog-node) | Document/allow opt-out |
316
+ | P3 | GitHub integration not set up post-install | Add `bd config set github.org/repo` prompt |
317
+
318
+ ---
319
+
320
+ ## Sources
321
+
322
+ - [Beads Installation Docs](https://steveyegge.github.io/beads/getting-started/installation)
323
+ - [npm install broken on Windows #1031](https://github.com/steveyegge/beads/issues/1031) — closed "not planned"
324
+ - [OpenSpec GitHub](https://github.com/Fission-AI/OpenSpec)
325
+ - [OpenSpec package.json](https://github.com/Fission-AI/OpenSpec/blob/main/package.json)
326
+ - [Lefthook npm](https://www.npmjs.com/package/lefthook) — 0 dependencies, platform binaries via optionalDeps
327
+ - [Lefthook Installation Docs](https://lefthook.dev/installation/node.html)
328
+ - [Beads install.ps1](https://github.com/steveyegge/beads/blob/main/install.ps1)