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,184 @@
1
+ # SonarCloud Quality Gate - Phase 2 Cognitive Complexity Fixes
2
+
3
+ ## Research Summary
4
+
5
+ **Date**: 2026-02-07
6
+ **Context**: PR #10 Enhanced Forge Onboarding
7
+ **Status**: Phase 1 complete (15/19 issues fixed), Phase 2 remaining
8
+
9
+ ### Current State
10
+
11
+ **Quality Gate Status**: FAILED
12
+ - ✅ Reliability: Fixed (bug resolved)
13
+ - ✅ Security Hotspots: 1/3 reviewed (ReDoS fixed)
14
+ - ✅ Minor Code Smells: 15/15 fixed (Phase 1)
15
+ - ❌ **Cognitive Complexity**: 4 functions over limit (CRITICAL)
16
+ - ❌ **Code Duplication**: 15.0% (required ≤ 3%)
17
+
18
+ ### Remaining Issues (4 CRITICAL)
19
+
20
+ #### 1. bin/forge.js:105 - parseFlagsFromArgs()
21
+ - **Current Complexity**: 25
22
+ - **Target**: ≤ 15
23
+ - **Reduction Needed**: 10 points
24
+ - **Effort**: 15 minutes
25
+ - **Strategy**: Extract flag parsing by category
26
+ - `parsePathFlag(args, i)`
27
+ - `parseAgentsFlag(args, i)`
28
+ - `parseMergeFlag(args, i)`
29
+ - `parseTypeFlag(args, i)`
30
+
31
+ #### 2. bin/forge.js:2003 - runEnhancedOnboarding()
32
+ - **Current Complexity**: 23
33
+ - **Target**: ≤ 15
34
+ - **Reduction Needed**: 8 points
35
+ - **Effort**: 13 minutes
36
+ - **Strategy**: Extract validation and setup logic
37
+ - `validateEnhancedOnboardingState()`
38
+ - `checkFeatureFlags()`
39
+ - `setupEnhancedPrompts()`
40
+
41
+ #### 3. bin/forge.js:2160 - validateState()
42
+ - **Current Complexity**: 16
43
+ - **Target**: ≤ 15
44
+ - **Reduction Needed**: 1 point
45
+ - **Effort**: 6 minutes
46
+ - **Strategy**: Extract one validation check
47
+ - `validateProjectRoot(state)`
48
+
49
+ #### 4. lib/context-merge.js:131 - mergeContents()
50
+ - **Current Complexity**: 17
51
+ - **Target**: ≤ 15
52
+ - **Reduction Needed**: 2 points
53
+ - **Effort**: 7 minutes
54
+ - **Strategy**: Extract section matching
55
+ - `shouldPreserveSection(section, category)`
56
+
57
+ ### Code Duplication Challenge
58
+
59
+ **Root Cause**: 2,700+ lines of new code with structural patterns
60
+ - Setup flows with similar structure
61
+ - Test fixtures with repeated patterns
62
+ - Validation logic across multiple files
63
+
64
+ **Analysis**:
65
+ - Not specific duplicated blocks that can be easily refactored
66
+ - Structural duplication across large feature implementation
67
+ - Would require 4-6 hours of deep refactoring (high risk)
68
+
69
+ **Recommendation**:
70
+ 1. Complete Phase 2 (cognitive complexity) - may indirectly reduce duplication
71
+ 2. If still blocked: Request quality gate exception for initial feature
72
+ 3. Commit to duplication reduction in follow-up PRs
73
+
74
+ ### Technical Debt Impact
75
+
76
+ - **Before Phase 2**: 41 minutes (4 functions)
77
+ - **After Phase 2**: 0 minutes
78
+ - **Total PR effort**: 167 minutes → 0 minutes
79
+
80
+ ### Testing Strategy
81
+
82
+ Each refactoring:
83
+ 1. Extract helper function
84
+ 2. Run affected tests
85
+ 3. Verify complexity reduction
86
+ 4. Commit incrementally
87
+
88
+ ```bash
89
+ # After each function refactor
90
+ bun test test/integration/enhanced-onboarding.test.js
91
+ bun test test/context-merge.test.js
92
+
93
+ # Final validation
94
+ bun test
95
+ ```
96
+
97
+ ### Success Criteria
98
+
99
+ - ✅ All 4 functions ≤ 15 complexity
100
+ - ✅ All 127 tests passing
101
+ - ✅ No behavioral changes
102
+ - ✅ Incremental commits for safety
103
+ - ⚠️ Duplication may remain (separate effort)
104
+
105
+ ### Risk Assessment
106
+
107
+ **Low Risk** (validateState, mergeContents):
108
+ - Minimal changes (1-2 points reduction)
109
+ - Simple extractions
110
+ - Easy to test
111
+
112
+ **Medium Risk** (runEnhancedOnboarding, parseFlagsFromArgs):
113
+ - Moderate refactoring
114
+ - Multiple helper functions
115
+ - Need careful testing
116
+ - High complexity reduction impact
117
+
118
+ ### Decision Log
119
+
120
+ 1. **Skip OpenSpec**: Tactical code quality improvement, no architecture changes
121
+ 2. **Incremental commits**: Safer than one large refactoring commit
122
+ 3. **Accept duplication for now**: Focus on unblocking critical complexity issues first
123
+ 4. **Order**: Easy wins first (validateState, mergeContents) then complex (others)
124
+
125
+
126
+ ---
127
+
128
+ ## EXPANDED SCOPE - All SonarLint Issues
129
+
130
+ ### Additional Issues Discovered (44 new)
131
+
132
+ **Date**: 2026-02-07 (expansion)
133
+ **Source**: Local SonarLint analysis
134
+
135
+ #### Cognitive Complexity (8 additional functions)
136
+ 1. Line 249: function (27→15) - 12 point reduction
137
+ 2. Line 1394: function (37→15) - 22 point reduction
138
+ 3. Line 2452: parseFlags (61→15) - 46 point reduction ⚠️ MASSIVE
139
+ 4. Line 2849: function (60→15) - 45 point reduction ⚠️ MASSIVE
140
+ 5. Line 3022: function (18→15) - 3 point reduction
141
+ 6. Line 3171: interactiveSetupWithFlags (81→15) - 66 point reduction ⚠️ MASSIVE
142
+ 7. Line 3708: function (25→15) - 10 point reduction
143
+
144
+ #### Exception Handling (19 issues - S2486)
145
+ Empty or insufficient catch blocks at lines:
146
+ 241, 526, 550, 652, 2054, 2686, 2699, 2705, 2729, 2740, 2748, 2759, 2770, 2778, 2789, 2926, 3003, 3051
147
+
148
+ #### Code Quality (17 issues)
149
+ - S4624: Nested template (1)
150
+ - S3800: Return type (3)
151
+ - S3358: Nested ternary (3)
152
+ - S3516: Always same return (1)
153
+ - S6582: Optional chaining (2)
154
+ - S7718: Catch naming (1)
155
+ - S6509: Double negation (2)
156
+ - S7735: Negated condition (2)
157
+ - S7785: Top-level await (1)
158
+
159
+ **Total Issues**: 60+
160
+ **Estimated Effort**: 6-8 hours
161
+
162
+ ### Execution Strategy
163
+
164
+ **Phase 1: Quick Wins** (DONE - 30 min)
165
+ - ✅ Minor code quality issues
166
+ - ✅ 2 easy cognitive complexity fixes
167
+
168
+ **Phase 2: Exception Handling** (60 min)
169
+ - Add proper error logging to 19 catch blocks
170
+ - Low risk, high impact on code quality
171
+
172
+ **Phase 3: Medium Complexity** (90 min)
173
+ - Fix 4 functions with 15-30 point reductions
174
+ - Lines: 249, 3022, 3708, and remaining from Phase 1
175
+
176
+ **Phase 4: Code Quality Issues** (60 min)
177
+ - Fix nested ternaries, optional chaining, return types
178
+ - 17 issues total
179
+
180
+ **Phase 5: Massive Refactorings** (4 hours)
181
+ - Lines 2452 (61), 2849 (60), 3171 (81)
182
+ - Requires significant extraction and restructuring
183
+ - Highest risk, highest impact
184
+
@@ -0,0 +1,403 @@
1
+ # Research: Superpowers Integration Possibilities for Forge
2
+
3
+ **Feature slug**: `superpowers-integration`
4
+ **Date**: 2026-02-26
5
+ **Prerequisite**: Read `docs/research/superpowers.md` first for Superpowers overview.
6
+ **Sources**: All claims cite exact URLs.
7
+
8
+ ---
9
+
10
+ ## The Core Question
11
+
12
+ > Can we install Superpowers as a base layer and build Forge on top of it?
13
+ > Or should we cherry-pick specific ideas and add them to Forge's workflow?
14
+ > What are all the possibilities, and what are the real pros and cons?
15
+
16
+ ---
17
+
18
+ ## How Claude Code Plugin Stacking Works
19
+
20
+ Multiple plugins can coexist simultaneously. Claude Code installs plugins to `~/.claude/plugins/` and loads all of them. As of 2026-02-14, there are 50+ official plugins available and people routinely run several at once.
21
+
22
+ **Source**: https://www.reddit.com/r/ClaudeAI/comments/1r4tk3u/there_are_28_official_claude_code_plugins_most/
23
+
24
+ Official docs confirm two deployment modes:
25
+ - **Standalone**: `.claude/` directory, slash commands like `/hello` — project/personal-specific
26
+ - **Plugin**: Named prefix, shareable, installed via marketplace — cross-project
27
+
28
+ **Source**: https://code.claude.com/docs/en/plugins
29
+
30
+ **No built-in conflict resolution mechanism exists.** Conflicts arise only from:
31
+ 1. Identical slash command names
32
+ 2. Overlapping auto-trigger logic (the more dangerous one)
33
+
34
+ Superpowers uses `/command` prefix namespacing (e.g., `/superpowers:brainstorm`) in some usage patterns, but its skills also auto-trigger without commands via the `using-superpowers` skill.
35
+
36
+ ---
37
+
38
+ ## The Auto-Trigger Problem (Critical to Understand)
39
+
40
+ The `using-superpowers` skill contains a non-negotiable rule:
41
+
42
+ > "Invoke relevant skills before any response — even with only a 1% chance of applicability."
43
+ > "Red flags to avoid: treating questions as simple, seeking context before skill verification, characterizing tasks as not needing formal skills."
44
+
45
+ **Source**: `skills/using-superpowers/SKILL.md` — https://github.com/obra/superpowers/blob/main/skills/using-superpowers/SKILL.md
46
+
47
+ This means: if Superpowers is installed, **it will auto-trigger `brainstorming` every time a user requests a new feature** — before Forge's `/research` stage runs. The Superpowers `brainstorming` skill then hands off to `writing-plans`, creating its own planning artifact at `docs/plans/YYYY-MM-DD-<topic>-design.md`. This runs in parallel to Forge's `docs/research/<slug>.md`.
48
+
49
+ The result of installing both without coordination:
50
+
51
+ ```
52
+ User: "Let's build feature X"
53
+ → Superpowers brainstorming auto-triggers (HARD-GATE: no code until approved)
54
+ → Superpowers writing-plans creates docs/plans/2026-02-26-feature-x.md
55
+ → User runs /research
56
+ → Forge creates docs/research/feature-x.md ← duplicate effort
57
+ → User runs /plan
58
+ → Forge creates Beads issue + branch
59
+ → User runs /dev
60
+ → Superpowers subagent-driven-development might auto-trigger ← possible collision
61
+ ```
62
+
63
+ Two independent planning artifacts, two review flows, ambiguity about which governs. This is the core compatibility risk.
64
+
65
+ ---
66
+
67
+ ## The 5 Integration Options: Full Analysis
68
+
69
+ ---
70
+
71
+ ### Option 1: Install Superpowers as Base + Run Forge Commands on Top
72
+
73
+ **What it means**: Install Superpowers plugin via marketplace. Forge commands remain in `.claude/commands/`. Both active simultaneously.
74
+
75
+ **How technically**:
76
+ ```bash
77
+ /plugin marketplace add obra/superpowers-marketplace
78
+ /plugin install superpowers@superpowers-marketplace
79
+ # Forge commands already in .claude/commands/ — stay as-is
80
+ ```
81
+
82
+ **What you get**: All 14 Superpowers skills auto-available + all Forge commands available.
83
+
84
+ **Pros**:
85
+ - Zero changes to Forge — install and go
86
+ - Immediately gets brainstorming HARD-GATE, systematic-debugging, git worktrees, two-stage code review
87
+ - Superpowers auto-updates via `/plugin update superpowers`
88
+ - Superpowers handles gaps Forge doesn't cover (debugging, verification, worktrees)
89
+ - Jesse Vincent actively maintains it (v4.3.1, last push 2026-02-21)
90
+
91
+ **Cons**:
92
+ - **Workflow collision**: Superpowers brainstorming auto-triggers before Forge's `/research`. Two parallel workflows compete for the same stages.
93
+ - **Duplicate artifacts**: `docs/plans/` (Superpowers) + `docs/research/` (Forge) created for every feature
94
+ - **Stage confusion**: User runs `/plan`, Forge creates Beads issue. But Superpowers has already created a plan via `writing-plans`. Which is authoritative?
95
+ - **No cross-system awareness**: Superpowers doesn't know about Beads. Forge doesn't know about Superpowers design docs.
96
+ - **Suppression difficulty**: Telling Claude "don't auto-trigger Superpowers for stages Forge handles" requires adding explicit suppression rules to AGENTS.md/CLAUDE.md — fragile, relies on soft instructions.
97
+
98
+ **Verdict**: Works for exploratory use. Not production-ready without explicit coordination layer in AGENTS.md that defines which system governs each stage. Medium friction in practice.
99
+
100
+ **Source on workflow collision pattern**: https://www.reddit.com/r/ClaudeCode/comments/1q9nx3d/workflow_questions_superpowers_speckit_custom/ (people already hitting this with Superpowers + SpecKit stacking)
101
+
102
+ ---
103
+
104
+ ### Option 2: Superpowers as Base + Forge Overrides (Coordinated Stack)
105
+
106
+ **What it means**: Install Superpowers AND add explicit coordination rules in AGENTS.md that suppress Superpowers auto-triggers for stages Forge owns, and delegate to Superpowers only for stages Forge doesn't cover.
107
+
108
+ **Division of labor**:
109
+ | Stage | Owner | Why |
110
+ |-------|-------|-----|
111
+ | Pre-feature brainstorming | Forge `/research` | Forge's research is deeper (web search, OWASP) |
112
+ | Planning | Forge `/plan` | Beads + OpenSpec integration |
113
+ | TDD development | Forge `/dev` | Parallel Task agents |
114
+ | Validation | Forge `/check` | OWASP security scan included |
115
+ | Shipping | Forge `/ship` `/review` `/premerge` `/verify` | Full PR lifecycle |
116
+ | Debugging | **Superpowers** `systematic-debugging` | Forge has no equivalent |
117
+ | Git worktrees | **Superpowers** `using-git-worktrees` | Forge has no equivalent |
118
+ | Verification before done | **Superpowers** `verification-before-completion` | Forge has no equivalent |
119
+
120
+ **AGENTS.md coordination block needed**:
121
+ ```markdown
122
+ ## Workflow Coordination: Forge + Superpowers
123
+
124
+ Superpowers is installed but Forge commands govern the primary development workflow.
125
+ **DO NOT auto-trigger Superpowers brainstorming or writing-plans** — use Forge's
126
+ /research and /plan commands instead.
127
+
128
+ Invoke Superpowers skills ONLY for:
129
+ - Debugging → systematic-debugging skill
130
+ - Git isolation → using-git-worktrees skill
131
+ - Pre-completion verification → verification-before-completion skill
132
+ ```
133
+
134
+ **Pros**:
135
+ - Gets the best of both: Forge's research + Beads + OpenSpec + PR lifecycle + Superpowers' debugging + worktrees + verification
136
+ - Clear role definition eliminates most collision
137
+ - Superpowers auto-updates for the skills Forge uses
138
+
139
+ **Cons**:
140
+ - Coordination rules are soft instructions in AGENTS.md — not guaranteed to be followed (same failure mode as Option A in agent-instructions-sync research)
141
+ - Still two systems to maintain/understand
142
+ - New contributors must learn both systems
143
+
144
+ **Verdict**: Best "install both" option, but requires explicit AGENTS.md governance. Medium-high complexity.
145
+
146
+ ---
147
+
148
+ ### Option 3: Cherry-Pick Specific Ideas Into Forge (No Superpowers Installation)
149
+
150
+ **What it means**: Don't install Superpowers. Instead, port the best ideas directly into Forge's existing commands and add new commands.
151
+
152
+ **What to cherry-pick**:
153
+
154
+ **A. HARD-GATE pattern** → Add to `/research`, `/plan`, `/dev` commands
155
+ ```
156
+ <HARD-GATE>
157
+ Do NOT proceed to implementation until research document exists at
158
+ docs/research/<slug>.md with OWASP analysis completed.
159
+ </HARD-GATE>
160
+ ```
161
+
162
+ **B. `brainstorming` stage** → New `/brainstorm` command or integrate into `/research`:
163
+ - Before /research runs web search, run one-question-at-a-time design clarification
164
+ - Save design doc to `docs/plans/YYYY-MM-DD-<slug>-design.md`
165
+ - HARD-GATE: no research until design intent is captured
166
+
167
+ **C. `systematic-debugging`** → New `/debug` command with 4-phase methodology:
168
+ - root-cause-tracing, defense-in-depth, condition-based-waiting techniques
169
+
170
+ **D. `verification-before-completion`** → Integrate into `/check`:
171
+ - Before declaring check done, run verification that the fix actually works end-to-end
172
+
173
+ **E. `writing-skills` methodology** → Use to build new Forge commands properly:
174
+ - Apply TDD to skill creation: write failing test first, minimal skill, close loopholes
175
+ - Add Claude Search Optimization to command descriptions
176
+
177
+ **F. Two-stage code review** → Upgrade `/review` command:
178
+ - Stage 1: spec compliance (does implementation match the research/plan?)
179
+ - Stage 2: code quality (is the code well-written?)
180
+
181
+ **Pros**:
182
+ - Single coherent system — no workflow collision
183
+ - Full control over every behavior
184
+ - No external dependency — Forge is self-contained
185
+ - Can adopt exact pieces without the parts that don't fit
186
+
187
+ **Cons**:
188
+ - Development effort to port/adapt each idea
189
+ - Maintenance burden — won't benefit from Jesse Vincent's updates automatically
190
+ - HARD-GATE pattern requires rewriting all 9 commands
191
+
192
+ **Verdict**: Best long-term path for Forge as a standalone, opinionated workflow. Highest initial effort, lowest ongoing complexity.
193
+
194
+ ---
195
+
196
+ ### Option 4: Forge as a Superpowers Plugin (Distribute Forge Through Superpowers)
197
+
198
+ **What it means**: Rewrite Forge's commands AS Superpowers-compatible skills. Package Forge as a plugin that extends Superpowers rather than sitting alongside it.
199
+
200
+ **Structure**:
201
+ ```
202
+ forge-plugin/
203
+ ├── .claude-plugin/
204
+ │ └── plugin.json
205
+ ├── skills/
206
+ │ ├── forge-research/ # Replaces /research command
207
+ │ ├── forge-plan/ # Replaces /plan command
208
+ │ ├── forge-dev/ # Replaces /dev command
209
+ │ ├── forge-check/ # Replaces /check command
210
+ │ ├── forge-ship/ # Replaces /ship command
211
+ │ ├── forge-review/ # Replaces /review command
212
+ │ ├── forge-premerge/ # Replaces /premerge command
213
+ │ └── forge-verify/ # Replaces /verify command
214
+ └── agents/
215
+ └── code-reviewer.md # (already in Superpowers)
216
+ ```
217
+
218
+ Install flow:
219
+ ```bash
220
+ /plugin install superpowers # Base layer: TDD, debugging, worktrees
221
+ /plugin install forge # Forge layer: research, OpenSpec, Beads, PR lifecycle
222
+ ```
223
+
224
+ **Pros**:
225
+ - Forge gets plugin distribution (single install command)
226
+ - Forge and Superpowers have defined separation — no collision
227
+ - Users get a curated stack that works together by design
228
+ - Superpowers handles debugging/worktrees, Forge handles research/OpenSpec/Beads/PRs
229
+ - Jesse Vincent has a `obra/superpowers-developing-for-claude-code` tutorial repo for exactly this
230
+
231
+ **Source**: https://lobehub.com/skills/obra-superpowers-developing-for-claude-code-workflow — confirms `superpowers-developing-for-claude-code` repo exists with `full-featured-plugin/skills/workflow` example.
232
+
233
+ **Cons**:
234
+ - Complete rewrite of Forge commands as skills (high effort)
235
+ - Forge then has a runtime dependency on Superpowers
236
+ - Users must install two plugins instead of one
237
+ - Forge's value proposition (beads + OpenSpec + 9-stage) must be re-expressed as skills
238
+
239
+ **Verdict**: Best long-term distribution model IF Forge wants to be a Claude Code plugin available in a marketplace. High effort, high payoff for adoption.
240
+
241
+ ---
242
+
243
+ ### Option 5: HARD-GATE Pattern Only — Minimum Viable Change (Quickest Win)
244
+
245
+ **What it means**: Don't install Superpowers. Don't rewrite commands. Just add HARD-GATE blocks to existing Forge commands where stage-skipping is the problem.
246
+
247
+ **Changes needed** (6 edits, ~15 minutes):
248
+
249
+ `/research` command — add:
250
+ ```
251
+ <HARD-GATE>
252
+ Do NOT proceed to /plan without a completed research document at
253
+ docs/research/<slug>.md that includes OWASP analysis and TDD test scenarios.
254
+ </HARD-GATE>
255
+ ```
256
+
257
+ `/plan` command — add:
258
+ ```
259
+ <HARD-GATE>
260
+ Do NOT proceed to /dev without:
261
+ 1. Beads issue created and status=in_progress
262
+ 2. Branch created at feat/<slug>
263
+ 3. Research doc confirmed at docs/research/<slug>.md
264
+ </HARD-GATE>
265
+ ```
266
+
267
+ `/dev` command — add:
268
+ ```
269
+ <HARD-GATE>
270
+ Do NOT write any production code until a FAILING TEST exists for that code.
271
+ Delete any code written before its test. There are no exceptions.
272
+ </HARD-GATE>
273
+ ```
274
+
275
+ **Pros**:
276
+ - Done in one session, zero new features
277
+ - Directly addresses the scope discipline problem
278
+ - Can be implemented TODAY before anything else
279
+ - Proven pattern (introduced in Superpowers v4.3.0 after Jesse Vincent found soft instructions insufficient)
280
+
281
+ **Cons**:
282
+ - Doesn't add debugging, worktrees, verification, brainstorming
283
+ - Only fixes enforcement, not capability gaps
284
+
285
+ **Source on why hard gates work**: https://blog.fsck.com/releases/2026/02/12/superpowers-v4-3-0/ — Jesse Vincent's own writeup: "What I was actually doing: skip all of that and start scaffolding a Vite project."
286
+
287
+ **Verdict**: Do this first regardless of which option is chosen for the larger integration. Zero risk, immediate value.
288
+
289
+ ---
290
+
291
+ ## Decision Matrix
292
+
293
+ | Option | Effort | Collision Risk | Capability Gain | Maintenance | Distribution |
294
+ |--------|--------|---------------|-----------------|-------------|--------------|
295
+ | 1: Install both (no coordination) | Low | HIGH | High | Low | No |
296
+ | 2: Install both (coordinated) | Medium | Medium | High | Medium | No |
297
+ | 3: Cherry-pick into Forge | High | None | High | High | No |
298
+ | 4: Forge as Superpowers plugin | Very High | None | High | Medium | Yes |
299
+ | 5: HARD-GATE only | Very Low | None | Low | Low | No |
300
+
301
+ ---
302
+
303
+ ## Recommended Path (Three Phases)
304
+
305
+ ### Phase 1: Immediate (This Session)
306
+ **Do Option 5** — Add HARD-GATE blocks to `/research`, `/plan`, `/dev` commands.
307
+ - Zero risk, zero new dependencies
308
+ - Directly fixes the scope discipline problem surfaced in this session
309
+ - Takes ~15 minutes
310
+
311
+ ### Phase 2: Short-Term (Next 1-2 Sessions)
312
+ **Do Option 3 partially** — Cherry-pick these specific ideas into Forge:
313
+ 1. Add a `/brainstorm` command (port Superpowers brainstorming skill, adapted for Forge's research-first approach)
314
+ 2. Add a `/debug` command (port `systematic-debugging`)
315
+ 3. Integrate `verification-before-completion` logic into `/check`
316
+ 4. Upgrade `/review` to two-stage (spec compliance → code quality)
317
+
318
+ ### Phase 3: Long-Term (Strategic Decision Needed)
319
+ **Decide between Option 2 and Option 4**:
320
+ - If Forge stays project-specific → Option 2 (install both, coordinated)
321
+ - If Forge should be a distributable plugin → Option 4 (rewrite as Superpowers plugin)
322
+
323
+ The `obra/superpowers-developing-for-claude-code` tutorial repo is the resource for Option 4.
324
+ **Source**: https://lobehub.com/skills/obra-superpowers-developing-for-claude-code-workflow
325
+
326
+ ---
327
+
328
+ ## HARD-GATE Implementation Detail
329
+
330
+ The exact pattern from Superpowers v4.3.0 brainstorming skill:
331
+
332
+ ```markdown
333
+ <HARD-GATE>
334
+ Do NOT invoke any implementation skill, write any code, scaffold any project,
335
+ or take any implementation action until you have presented a design and the
336
+ user has approved it. This applies to EVERY project regardless of perceived simplicity.
337
+ </HARD-GATE>
338
+ ```
339
+
340
+ **Key structural elements** that make it work:
341
+ 1. Explicit `<HARD-GATE>` tag — signals to the model this is non-negotiable
342
+ 2. Lists EXACTLY what is forbidden (not just "think first")
343
+ 3. Provides the approval condition (what unlocks the gate)
344
+ 4. States universal applicability ("EVERY project")
345
+ 5. Names the anti-rationalization ("regardless of perceived simplicity")
346
+
347
+ This is more effective than soft instructions because it eliminates the model's ability to rationalize skipping.
348
+
349
+ **Source**: https://ddewhurst.com/blog/superpowers-claude-code-plugin-enforces-what-you-should-do/ (2026-02-17 article specifically about v4.3.0 hard gates)
350
+
351
+ ---
352
+
353
+ ## What Forge Has That Superpowers Cannot Replace
354
+
355
+ These are Forge's unique strengths — not present in Superpowers and not cherry-pickable:
356
+
357
+ 1. **Multi-agent file support** (AGENTS.md/CLAUDE.md/GEMINI.md) — serves 9+ agent types, not just Claude Code
358
+ 2. **OpenSpec** — formal architecture proposals with PR approval workflows
359
+ 3. **Beads** — persistent cross-session issue tracking with dependencies
360
+ 4. **Research-first mandate** — web search + OWASP analysis before any planning
361
+ 5. **Full PR lifecycle** — `/ship`, `/review`, `/premerge`, `/verify` as an integrated sequence
362
+ 6. **SonarCloud + Greptile** integrations
363
+
364
+ Superpowers is Claude Code-only. Forge is multi-agent by design. This is a fundamental architectural difference that makes Forge irreplaceable for multi-agent teams.
365
+
366
+ ---
367
+
368
+ ## Key Signals From Community
369
+
370
+ "Would SpecKit be helpful to add into my workflow before brainstorming? I currently use the Superpowers skill/plugin quite a bit for brainstorming, planning, etc."
371
+ — https://www.reddit.com/r/ClaudeCode/comments/1q9nx3d/
372
+ (People ARE stacking multiple workflow systems. The compatibility concern is real and actively discussed.)
373
+
374
+ "GSD vs Superpowers vs Speckit — what are you using for BE work?"
375
+ — https://www.reddit.com/r/ClaudeCode/comments/1qxfprh/
376
+ (The market is fragmented. No single workflow tool dominates. Users mix and match.)
377
+
378
+ "Claude Code's Superpowers plugin actually delivers — sub-agents that verify implementation against the plan document. Catches what you'd normally miss."
379
+ — https://www.reddit.com/r/ClaudeCode/comments/1r9y2ka/
380
+
381
+ ---
382
+
383
+ ## Sources Index
384
+
385
+ | # | URL | Used For |
386
+ |---|-----|---------|
387
+ | 1 | https://github.com/obra/superpowers | Full repo structure, skill files |
388
+ | 2 | https://github.com/obra/superpowers/blob/main/skills/using-superpowers/SKILL.md | Auto-trigger rule — core collision concern |
389
+ | 3 | https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md | HARD-GATE pattern, 6-step process |
390
+ | 4 | https://github.com/obra/superpowers/blob/main/skills/writing-plans/SKILL.md | 2-5 min tasks, docs/plans/ artifacts |
391
+ | 5 | https://github.com/obra/superpowers/blob/main/skills/subagent-driven-development/SKILL.md | Two-stage code review mechanics |
392
+ | 6 | https://github.com/obra/superpowers/blob/main/skills/writing-skills/SKILL.md | TDD for skill creation, Claude Search Optimization |
393
+ | 7 | https://github.com/obra/superpowers/blob/main/skills/test-driven-development/SKILL.md | Iron Law, watch test fail mandate |
394
+ | 8 | https://code.claude.com/docs/en/plugins | Official plugin stacking docs |
395
+ | 9 | https://www.reddit.com/r/ClaudeAI/comments/1r4tk3u/ | 50+ official plugins confirmed, stacking confirmed |
396
+ | 10 | https://blog.fsck.com/releases/2026/02/12/superpowers-v4-3-0/ | Hard gate introduction — why soft instructions failed |
397
+ | 11 | https://ddewhurst.com/blog/superpowers-claude-code-plugin-enforces-what-you-should-do/ | Hard gate mechanics, v4.3.0 specifics |
398
+ | 12 | https://www.reddit.com/r/ClaudeCode/comments/1q9nx3d/ | Real user experience stacking Superpowers + SpecKit |
399
+ | 13 | https://www.reddit.com/r/ClaudeCode/comments/1qxfprh/ | GSD vs Superpowers vs SpecKit comparison |
400
+ | 14 | https://lobehub.com/skills/obra-superpowers-developing-for-claude-code-workflow | obra/superpowers-developing-for-claude-code tutorial repo |
401
+ | 15 | https://github.com/obra/superpowers/blob/main/RELEASE-NOTES.md | v4.1.0 breaking change (OpenCode native skills), v4.0.1 skill access fix |
402
+ | 16 | https://github.com/anthropics/claude-plugins-official/pull/148 | Superpowers accepted into official Anthropic marketplace |
403
+ | 17 | https://www.reddit.com/r/ClaudeCode/comments/1r9y2ka/ | User report on sub-agent spec compliance verification |