forge-workflow 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/dev.md +26 -0
- package/.claude/commands/plan.md +141 -9
- package/.claude/commands/premerge.md +0 -3
- package/.claude/commands/rollback.md +4 -4
- package/.claude/commands/ship.md +71 -41
- package/.claude/commands/status.md +9 -38
- package/.claude/commands/validate.md +47 -2
- package/.cline/workflows/dev.md +337 -0
- package/.cline/workflows/plan.md +518 -0
- package/.cline/workflows/premerge.md +173 -0
- package/.cline/workflows/research.md +39 -0
- package/.cline/workflows/review.md +439 -0
- package/.cline/workflows/rollback.md +718 -0
- package/.cline/workflows/ship.md +161 -0
- package/.cline/workflows/sonarcloud.md +146 -0
- package/.cline/workflows/status.md +45 -0
- package/.cline/workflows/validate.md +279 -0
- package/.cline/workflows/verify.md +218 -0
- package/.codex/config.toml +11 -0
- package/.codex/skills/dev/SKILL.md +340 -0
- package/.codex/skills/plan/SKILL.md +521 -0
- package/.codex/skills/premerge/SKILL.md +176 -0
- package/.codex/skills/research/SKILL.md +42 -0
- package/.codex/skills/review/SKILL.md +442 -0
- package/.codex/skills/rollback/SKILL.md +721 -0
- package/.codex/skills/ship/SKILL.md +164 -0
- package/.codex/skills/sonarcloud/SKILL.md +149 -0
- package/.codex/skills/status/SKILL.md +48 -0
- package/.codex/skills/validate/SKILL.md +282 -0
- package/.codex/skills/verify/SKILL.md +221 -0
- package/.cursor/commands/dev.md +337 -0
- package/.cursor/commands/plan.md +518 -0
- package/.cursor/commands/premerge.md +173 -0
- package/.cursor/commands/research.md +39 -0
- package/.cursor/commands/review.md +439 -0
- package/.cursor/commands/rollback.md +718 -0
- package/.cursor/commands/ship.md +161 -0
- package/.cursor/commands/sonarcloud.md +146 -0
- package/.cursor/commands/status.md +45 -0
- package/.cursor/commands/validate.md +279 -0
- package/.cursor/commands/verify.md +218 -0
- package/.cursor/hooks/state/continual-learning-index.json +19 -0
- package/.cursor/hooks/state/continual-learning.json +8 -0
- package/.cursor/rules/permissions-guidance.mdc +37 -0
- package/.github/prompts/dev.prompt.md +342 -0
- package/.github/prompts/plan.prompt.md +523 -0
- package/.github/prompts/premerge.prompt.md +178 -0
- package/.github/prompts/research.prompt.md +44 -0
- package/.github/prompts/review.prompt.md +444 -0
- package/.github/prompts/rollback.prompt.md +723 -0
- package/.github/prompts/ship.prompt.md +166 -0
- package/.github/prompts/sonarcloud.prompt.md +151 -0
- package/.github/prompts/status.prompt.md +50 -0
- package/.github/prompts/validate.prompt.md +284 -0
- package/.github/prompts/verify.prompt.md +223 -0
- package/.kilocode/workflows/dev.md +341 -0
- package/.kilocode/workflows/plan.md +522 -0
- package/.kilocode/workflows/premerge.md +177 -0
- package/.kilocode/workflows/research.md +43 -0
- package/.kilocode/workflows/review.md +443 -0
- package/.kilocode/workflows/rollback.md +722 -0
- package/.kilocode/workflows/ship.md +165 -0
- package/.kilocode/workflows/sonarcloud.md +150 -0
- package/.kilocode/workflows/status.md +49 -0
- package/.kilocode/workflows/validate.md +283 -0
- package/.kilocode/workflows/verify.md +222 -0
- package/.opencode/commands/dev.md +340 -0
- package/.opencode/commands/plan.md +521 -0
- package/.opencode/commands/premerge.md +176 -0
- package/.opencode/commands/research.md +42 -0
- package/.opencode/commands/review.md +442 -0
- package/.opencode/commands/rollback.md +721 -0
- package/.opencode/commands/ship.md +164 -0
- package/.opencode/commands/sonarcloud.md +149 -0
- package/.opencode/commands/status.md +48 -0
- package/.opencode/commands/validate.md +282 -0
- package/.opencode/commands/verify.md +221 -0
- package/.roo/commands/dev.md +341 -0
- package/.roo/commands/plan.md +522 -0
- package/.roo/commands/premerge.md +177 -0
- package/.roo/commands/research.md +43 -0
- package/.roo/commands/review.md +443 -0
- package/.roo/commands/rollback.md +722 -0
- package/.roo/commands/ship.md +165 -0
- package/.roo/commands/sonarcloud.md +150 -0
- package/.roo/commands/status.md +49 -0
- package/.roo/commands/validate.md +283 -0
- package/.roo/commands/verify.md +222 -0
- package/AGENTS.md +7 -1
- package/CLAUDE.md +5 -4
- package/README.md +21 -19
- package/bin/{forge-validate.js → forge-preflight.js} +21 -15
- package/bin/forge.js +209 -138
- package/docs/AGENT_INSTALL_PROMPT.md +1 -1
- package/docs/BEADS_GITHUB_SYNC.md +251 -0
- package/docs/ENHANCED_ONBOARDING.md +8 -8
- package/docs/EXAMPLES.md +4 -4
- package/docs/GREPTILE_SETUP.md +1 -1
- package/docs/MANUAL_REVIEW_GUIDE.md +1 -1
- package/docs/ROADMAP.md +6 -6
- package/docs/SETUP.md +1 -2
- package/docs/TOOLCHAIN.md +15 -234
- package/docs/VALIDATION.md +11 -11
- package/install.sh +33 -39
- package/lib/agents-config.js +3 -3
- package/lib/commands/plan.js +11 -15
- package/lib/commands/recommend.js +2 -2
- package/lib/dep-guard/analyzer.js +294 -0
- package/lib/dep-guard/behavior-detector.js +98 -0
- package/lib/dep-guard/contract-detector.js +162 -0
- package/lib/dep-guard/import-detector.js +498 -0
- package/lib/dep-guard/path-utils.js +13 -0
- package/lib/dep-guard/rubric.js +120 -0
- package/lib/dep-guard/task-parser.js +318 -0
- package/lib/detect-agent.js +191 -0
- package/lib/detect-worktree.js +47 -0
- package/lib/file-hash.js +26 -0
- package/lib/plugin-catalog.js +18 -28
- package/lib/setup-action-log.js +139 -0
- package/lib/setup-summary-renderer.js +106 -0
- package/lib/setup.js +75 -1
- package/lib/workflow-profiles.js +5 -11
- package/package.json +17 -7
- package/skills/parallel-deep-research/SKILL.md +108 -0
- package/skills/parallel-deep-research/evals/README.md +27 -0
- package/skills/parallel-deep-research/evals/evals.json +62 -0
- package/skills/sonarcloud-analysis/SKILL.md +171 -0
- package/skills/sonarcloud-analysis/evals/README.md +27 -0
- package/skills/sonarcloud-analysis/evals/evals.json +50 -0
- package/skills/sonarcloud-analysis/references/api-reference.md +466 -0
- package/docs/WORKFLOW.md +0 -400
- package/docs/planning/PROGRESS.md +0 -396
- package/docs/plans/.gitkeep +0 -0
- package/docs/plans/2026-02-27-forge-test-suite-v2-decisions.md +0 -21
- package/docs/plans/2026-02-27-forge-test-suite-v2-design.md +0 -362
- package/docs/plans/2026-02-27-forge-test-suite-v2-tasks.md +0 -343
- package/docs/plans/2026-03-02-superpowers-gaps-decisions.md +0 -26
- package/docs/plans/2026-03-02-superpowers-gaps-design.md +0 -239
- package/docs/plans/2026-03-02-superpowers-gaps-tasks.md +0 -260
- package/docs/plans/2026-03-04-agent-command-parity-design.md +0 -163
- package/docs/plans/2026-03-04-verify-worktree-cleanup-decisions.md +0 -7
- package/docs/plans/2026-03-04-verify-worktree-cleanup-design.md +0 -165
- package/docs/plans/2026-03-05-forge-uto-decisions.md +0 -6
- package/docs/plans/2026-03-05-forge-uto-design.md +0 -116
- package/docs/plans/2026-03-05-forge-uto-tasks.md +0 -244
- package/docs/plans/2026-03-10-command-creator-and-eval-decisions.md +0 -52
- package/docs/plans/2026-03-10-command-creator-and-eval-design.md +0 -350
- package/docs/plans/2026-03-10-command-creator-and-eval-tasks.md +0 -426
- package/docs/plans/2026-03-10-stale-workflow-refs-decisions.md +0 -8
- package/docs/plans/2026-03-10-stale-workflow-refs-design.md +0 -80
- package/docs/plans/2026-03-10-stale-workflow-refs-tasks.md +0 -90
- package/docs/plans/2026-03-14-beads-plan-context-decisions.md +0 -9
- package/docs/plans/2026-03-14-beads-plan-context-design.md +0 -171
- package/docs/plans/2026-03-14-beads-plan-context-tasks.md +0 -160
- package/docs/plans/2026-03-14-skill-eval-loop-decisions.md +0 -33
- package/docs/plans/2026-03-14-skill-eval-loop-design.md +0 -118
- package/docs/plans/2026-03-14-skill-eval-loop-results.md +0 -78
- package/docs/plans/2026-03-14-skill-eval-loop-tasks.md +0 -160
- package/docs/plans/2026-03-15-agent-command-parity-v2-decisions.md +0 -11
- package/docs/plans/2026-03-15-agent-command-parity-v2-design.md +0 -145
- package/docs/plans/2026-03-15-agent-command-parity-v2-tasks.md +0 -211
- package/docs/research/TEMPLATE.md +0 -292
- package/docs/research/advanced-testing.md +0 -297
- package/docs/research/agent-permissions.md +0 -167
- package/docs/research/dependency-chain.md +0 -328
- package/docs/research/forge-workflow-v2.md +0 -550
- package/docs/research/plugin-architecture.md +0 -772
- package/docs/research/pr4-cli-automation.md +0 -326
- package/docs/research/premerge-verify-restructure.md +0 -205
- package/docs/research/skills-restructure.md +0 -508
- package/docs/research/sonarcloud-perfection-plan.md +0 -166
- package/docs/research/sonarcloud-quality-gate.md +0 -184
- package/docs/research/superpowers-integration.md +0 -403
- package/docs/research/superpowers.md +0 -319
- package/docs/research/test-environment.md +0 -519
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Post-merge health check — confirm merge landed, CI is clean, deployments are up
|
|
3
|
+
mode: code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Verify that the merge landed correctly and everything is running properly after merge.
|
|
7
|
+
|
|
8
|
+
# Verify
|
|
9
|
+
|
|
10
|
+
This command runs AFTER the user has merged the PR. It checks system health — not documentation (that was handled in `/premerge`).
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/verify
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What This Command Does
|
|
19
|
+
|
|
20
|
+
### Step 1: Switch to Main and Pull
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git checkout master
|
|
24
|
+
git pull
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Confirm the merge actually landed on main. If the PR isn't merged yet, stop and tell the user to merge first.
|
|
28
|
+
|
|
29
|
+
### Step 2: Confirm PR Is Merged
|
|
30
|
+
|
|
31
|
+
Detect the most recently merged PR from the current HEAD commit:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gh pr list --state merged --base master --limit 1 --json number,state,mergedAt,mergedBy
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- `state` should be `MERGED`
|
|
38
|
+
- If no PR found: the merge may not have landed yet — stop and tell the user to merge first
|
|
39
|
+
- If the wrong PR appears: user can specify the number directly with `gh pr view <number> --json state,mergedAt,mergedBy`
|
|
40
|
+
|
|
41
|
+
### Step 3: Check CI on Main After Merge
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gh run list --branch master --limit 5
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Check the most recent workflow runs on `master`:
|
|
48
|
+
- All should be passing or in progress
|
|
49
|
+
- If any failed: identify which workflow and what failed
|
|
50
|
+
- Failed CI on main after merge may need a hotfix PR
|
|
51
|
+
|
|
52
|
+
### Step 4: Check Deployments (if applicable)
|
|
53
|
+
|
|
54
|
+
Check if the project has a deployment target:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Check deployment status from latest run
|
|
58
|
+
gh run list --branch master --limit 1
|
|
59
|
+
|
|
60
|
+
# Check Vercel deployments for the merged PR (use number from Step 2)
|
|
61
|
+
gh pr view <number> --json deployments
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If deployments exist:
|
|
65
|
+
- Are they showing as successful?
|
|
66
|
+
- Is the production/preview URL responding?
|
|
67
|
+
|
|
68
|
+
### Step 5: Report Status
|
|
69
|
+
|
|
70
|
+
**If everything is clean**:
|
|
71
|
+
```
|
|
72
|
+
✅ Merge verified — everything is healthy
|
|
73
|
+
|
|
74
|
+
PR: #<number> merged by <user> at <time>
|
|
75
|
+
CI on master: ✓ All passing
|
|
76
|
+
Deployments: ✓ Up (if applicable)
|
|
77
|
+
|
|
78
|
+
Ready for next feature → run /status
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**If issues found**:
|
|
82
|
+
```
|
|
83
|
+
⚠️ Post-merge issues detected
|
|
84
|
+
|
|
85
|
+
PR: #<number> merged ✓
|
|
86
|
+
CI on master: ✗ <workflow-name> failing
|
|
87
|
+
- Error: <description>
|
|
88
|
+
- Action needed: <hotfix or investigation>
|
|
89
|
+
|
|
90
|
+
Deployments: ✗ <deployment> not responding
|
|
91
|
+
|
|
92
|
+
Next: Create hotfix branch or investigate root cause
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Step 6: Clean Up Worktree and Branch
|
|
96
|
+
|
|
97
|
+
Only run this step after CI is confirmed healthy (Step 3 passed).
|
|
98
|
+
|
|
99
|
+
Get the merged branch name:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
gh pr view <number> --json headRefName --jq '.headRefName'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If the branch name cannot be determined (empty output or error), skip cleanup and tell the user to run `git worktree list` and clean up manually.
|
|
106
|
+
|
|
107
|
+
Find and remove the matching worktree (if it exists):
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Get the worktree path for this exact branch
|
|
111
|
+
WORKTREE_PATH=$(git worktree list --porcelain \
|
|
112
|
+
| awk -v branch="refs/heads/<branch>" '
|
|
113
|
+
/^worktree / { path=substr($0, 10) }
|
|
114
|
+
$0 == "branch " branch { print path }
|
|
115
|
+
')
|
|
116
|
+
|
|
117
|
+
if [ -n "$WORKTREE_PATH" ]; then
|
|
118
|
+
git worktree remove "$WORKTREE_PATH" --force
|
|
119
|
+
echo "Worktree: removed ✓ ($WORKTREE_PATH)"
|
|
120
|
+
else
|
|
121
|
+
echo "Worktree: not found (already removed or never created) — skipping"
|
|
122
|
+
fi
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
If no worktree is found for that branch, skip gracefully with a note: "Worktree: not found (already removed or never created)".
|
|
126
|
+
|
|
127
|
+
Delete the local branch (safe delete only):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
git branch -d <branch> 2>/dev/null || echo "Branch: already deleted — skipping"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The `|| echo` fallback handles the case where the branch is already gone (e.g., deleted by a previous run or the remote), so the command never fails the verify step.
|
|
134
|
+
|
|
135
|
+
Report cleanup in output:
|
|
136
|
+
```
|
|
137
|
+
Worktree: removed ✓
|
|
138
|
+
Branch: <branch-name> deleted ✓
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 7: If Issues Found — Create Beads Issue
|
|
142
|
+
|
|
143
|
+
**Never commit inline.** If something is wrong, create a tracking issue:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
bd create --title="Post-merge: <description of issue>" --type=bug --priority=1
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Step 8: Close Beads Issue (if healthy)
|
|
150
|
+
|
|
151
|
+
If everything is clean, close the Beads issue:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
bd close <id> --reason="Merged and verified on master"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
<HARD-GATE: /verify exit>
|
|
159
|
+
Do NOT declare /verify complete until:
|
|
160
|
+
1. gh run list --branch master --limit 3 shows actual CI output (not "should be fine")
|
|
161
|
+
2. If healthy: Beads issue is closed (bd close <id> run and confirmed)
|
|
162
|
+
3. If issues found: Beads tracking issue created for every problem
|
|
163
|
+
4. Worktree removed (or confirmed already gone) — OR Step 6 was intentionally skipped because CI was unhealthy; if skipped, state explicitly: "cleanup deferred, CI was not healthy"
|
|
164
|
+
"It should be fine" is not evidence. Run the command. Show the output.
|
|
165
|
+
</HARD-GATE>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Rules
|
|
169
|
+
|
|
170
|
+
- **Never commits** — this command is read-only
|
|
171
|
+
- **Never creates PRs** — if fixes are needed, that's a new /dev cycle
|
|
172
|
+
- **Runs after user confirms merge** — not before
|
|
173
|
+
- **Reports honestly** — if CI is broken on main, say so clearly
|
|
174
|
+
|
|
175
|
+
## Example Output (Healthy)
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
✅ Merge verified — everything is healthy
|
|
179
|
+
|
|
180
|
+
PR: #89 merged by harshanandak at 2026-02-24T14:30:00Z
|
|
181
|
+
Branch: feat/auth-refresh deleted ✓
|
|
182
|
+
CI on master:
|
|
183
|
+
✓ Test Suite (ubuntu, node 20): passing
|
|
184
|
+
✓ Test Suite (windows, node 22): passing
|
|
185
|
+
✓ ESLint: passing
|
|
186
|
+
✓ SonarCloud: passing
|
|
187
|
+
✓ CodeQL: passing
|
|
188
|
+
Deployments: N/A (no deployment configured)
|
|
189
|
+
|
|
190
|
+
Ready for next feature → run /status
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Example Output (Issues Found)
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
⚠️ Post-merge issues detected
|
|
197
|
+
|
|
198
|
+
PR: #89 merged ✓
|
|
199
|
+
CI on master:
|
|
200
|
+
✓ Test Suite: passing
|
|
201
|
+
✗ SonarCloud: quality gate failing
|
|
202
|
+
- 2 new code smells introduced
|
|
203
|
+
- Action: investigate or create hotfix
|
|
204
|
+
|
|
205
|
+
Created Beads issue: forge-xyz
|
|
206
|
+
"Post-merge: SonarCloud quality gate failing on master after PR #89"
|
|
207
|
+
|
|
208
|
+
Run /status to assess next steps
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Integration with Workflow
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
Utility: /status → Understand current context before starting
|
|
215
|
+
Stage 1: /plan → Design intent → research → branch + worktree + task list
|
|
216
|
+
Stage 2: /dev → Implement each task with subagent-driven TDD
|
|
217
|
+
Stage 3: /validate → Type check, lint, tests, security — all fresh output
|
|
218
|
+
Stage 4: /ship → Push + create PR
|
|
219
|
+
Stage 5: /review → Address GitHub Actions, Greptile, SonarCloud
|
|
220
|
+
Stage 6: /premerge → Update docs, hand off PR to user
|
|
221
|
+
Stage 7: /verify → Post-merge CI check on main (you are here) ✓
|
|
222
|
+
```
|
package/AGENTS.md
CHANGED
|
@@ -71,6 +71,10 @@ When the user requests work, **you MUST automatically classify** the change type
|
|
|
71
71
|
|
|
72
72
|
Proceed?"
|
|
73
73
|
|
|
74
|
+
**Dynamic commands — no hardcoded examples:**
|
|
75
|
+
|
|
76
|
+
Command files (`.claude/commands/*.md` and agent equivalents) must never hardcode example output when a script generates that output dynamically. Reference the script and describe what it does — don't duplicate its output with fake data that becomes stale.
|
|
77
|
+
|
|
74
78
|
## TDD Development (Stage 2: /dev)
|
|
75
79
|
|
|
76
80
|
**Subagent-driven per-task implementation loop:**
|
|
@@ -108,6 +112,8 @@ Task 2: Validation logic
|
|
|
108
112
|
|
|
109
113
|
## State Management (Single Source of Truth)
|
|
110
114
|
|
|
115
|
+
> GitHub issue lifecycle may sync to Beads via CI -- see [docs/BEADS_GITHUB_SYNC.md](docs/BEADS_GITHUB_SYNC.md).
|
|
116
|
+
|
|
111
117
|
**All workflow state stored in Beads metadata** (survives compaction):
|
|
112
118
|
|
|
113
119
|
```json
|
|
@@ -162,7 +168,7 @@ Task 2: Validation logic
|
|
|
162
168
|
- `docs/plans/YYYY-MM-DD-<slug>-decisions.md` - Decisions log from /dev
|
|
163
169
|
|
|
164
170
|
**Comprehensive workflow guide:**
|
|
165
|
-
-
|
|
171
|
+
- This file (AGENTS.md) is the single source of truth for the complete workflow
|
|
166
172
|
- [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) - Tool setup and configuration
|
|
167
173
|
- [docs/VALIDATION.md](docs/VALIDATION.md) - Enforcement and validation details
|
|
168
174
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project Instructions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Forge is a 7-stage TDD-first development workflow harness for AI coding agents (9 commands total, including utility stages).
|
|
4
4
|
|
|
5
5
|
**Package manager**: Bun (preferred for performance)
|
|
6
6
|
|
|
@@ -72,13 +72,13 @@ This project uses the **Professional Git Workflow** with Lefthook for automated
|
|
|
72
72
|
- **All review comments must be resolved** before merge
|
|
73
73
|
- Squash-only merging: Clean, linear git history
|
|
74
74
|
|
|
75
|
-
**Emergency bypass
|
|
75
|
+
**Emergency bypass** (human-only, NEVER for AI agents):
|
|
76
76
|
```bash
|
|
77
77
|
LEFTHOOK=0 git push # Skip all pre-push hooks
|
|
78
78
|
git commit --no-verify # Skip pre-commit hooks
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
**⚠️
|
|
81
|
+
**⚠️ AI agents must NEVER use `LEFTHOOK=0`, `--no-verify`, or any hook bypass.** If a hook fails, fix the underlying issue. Only humans may bypass hooks in emergencies, documented in the PR description.
|
|
82
82
|
|
|
83
83
|
See [.github/pull_request_template.md](.github/pull_request_template.md) for PR guidelines.
|
|
84
84
|
|
|
@@ -93,7 +93,8 @@ As you work, when you give the same instruction twice, add it here:
|
|
|
93
93
|
- **Scope discipline**: Do ONLY what was explicitly asked. Answer a question → stop. Check something → stop. Never auto-continue to next steps or pending work unless told to.
|
|
94
94
|
- **Stage names**: The validation stage is `/validate` (not `/check`) — renamed in PR #50.
|
|
95
95
|
- **Unused params**: Prefix with `_` (e.g., `_searchTerm`) — ESLint `no-unused-vars` enforced with `--max-warnings 0`.
|
|
96
|
-
- **Pre-push test env**: `test-env/` fixture tests can fail during actual `git push` due to git mid-push state
|
|
96
|
+
- **Pre-push test env**: `test-env/` fixture tests can fail during actual `git push` due to git mid-push state. Fix the root cause — never use `LEFTHOOK=0`.
|
|
97
97
|
- **Command sync**: After editing `.claude/commands/*.md`, run `node scripts/sync-commands.js` to update all 7 agent directories. Use `--check` in CI to detect drift. Use `--dry-run` to preview.
|
|
98
|
+
- **Dynamic commands**: Never hardcode example output in command files (`.claude/commands/*.md`) when a script generates that output dynamically. Command files should reference the script and describe what it does — not duplicate its output with fake data that becomes stale.
|
|
98
99
|
|
|
99
100
|
<!-- USER:END -->
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Ship features with confidence using a 7-stage TDD-first workflow for AI coding a
|
|
|
45
45
|
**With Forge** (systematic):
|
|
46
46
|
- Tests written BEFORE code (TDD)
|
|
47
47
|
- Research-backed decisions
|
|
48
|
-
- OWASP Top 10 analysis
|
|
48
|
+
- OWASP Top 10 analysis in every /plan
|
|
49
49
|
- Documentation at every stage
|
|
50
50
|
|
|
51
51
|
→ [See complete walkthrough in QUICKSTART.md](QUICKSTART.md)
|
|
@@ -78,7 +78,7 @@ bunx forge setup
|
|
|
78
78
|
|
|
79
79
|
| Stage | Command | Purpose |
|
|
80
80
|
|-------|---------|---------|
|
|
81
|
-
| **utility** | `/status` |
|
|
81
|
+
| **utility** | `/status` | Ranked issue dashboard with conflict detection |
|
|
82
82
|
| **1. Plan** | `/plan` | Design Q&A → research → branch + task list |
|
|
83
83
|
| **2. Dev** | `/dev` | Subagent TDD per task (spec + quality review) |
|
|
84
84
|
| **3. Validate** | `/validate` | Validate: types, lint, tests, security |
|
|
@@ -87,13 +87,13 @@ bunx forge setup
|
|
|
87
87
|
| **6. Premerge** | `/premerge` | Complete docs on feature branch, hand off PR |
|
|
88
88
|
| **7. Verify** | `/verify` | Post-merge health check (CI on main) |
|
|
89
89
|
|
|
90
|
-
**Full workflow guide**: [
|
|
90
|
+
**Full workflow guide**: [AGENTS.md](AGENTS.md)
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
94
94
|
## Supported AI Agents
|
|
95
95
|
|
|
96
|
-
Works with **
|
|
96
|
+
Works with **8 AI coding agents** via universal AGENTS.md:
|
|
97
97
|
|
|
98
98
|
### Tier 1 (Primary Support)
|
|
99
99
|
|
|
@@ -163,7 +163,7 @@ One workflow, works with ALL major AI agents:
|
|
|
163
163
|
|
|
164
164
|
Switch agents anytime without changing your workflow.
|
|
165
165
|
|
|
166
|
-
### 4. Built-in TDD Enforcement
|
|
166
|
+
### 4. Built-in TDD Enforcement
|
|
167
167
|
Git hooks automatically enforce TDD practices:
|
|
168
168
|
- **Pre-commit**: Blocks source commits without tests
|
|
169
169
|
- **Pre-push**: Runs full test suite before push
|
|
@@ -172,16 +172,16 @@ Git hooks automatically enforce TDD practices:
|
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
174
|
# Validation CLI
|
|
175
|
-
forge-
|
|
176
|
-
forge-
|
|
177
|
-
forge-
|
|
175
|
+
forge-preflight status # Check project prerequisites
|
|
176
|
+
forge-preflight dev # Validate before /dev stage
|
|
177
|
+
forge-preflight ship # Validate before /ship stage
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
### 5. Smart Tool Recommendations
|
|
181
|
-
|
|
180
|
+
### 5. Smart Tool Recommendations
|
|
181
|
+
Curated plugin catalog across 7 workflow stages — plan, dev, validate, ship, review, and more:
|
|
182
182
|
- **Auto-detection**: Scans your project for frameworks, databases, auth, payments, and more
|
|
183
183
|
- **Budget modes**: free, open-source, startup, professional, custom
|
|
184
|
-
- **
|
|
184
|
+
- **Portability-first**: MCPs included only when they add clear value over CLI alternatives
|
|
185
185
|
- **Free alternatives**: Every paid tool shows free alternatives
|
|
186
186
|
|
|
187
187
|
```bash
|
|
@@ -189,9 +189,9 @@ bunx forge recommend # Recommendations for your project
|
|
|
189
189
|
bunx forge recommend --budget free # Only free tools
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
→ [Validation docs](docs/VALIDATION.md) | [Plugin docs](
|
|
192
|
+
→ [Validation docs](docs/VALIDATION.md) | [Plugin docs](docs/TOOLCHAIN.md)
|
|
193
193
|
|
|
194
|
-
### 6. Enhanced Onboarding
|
|
194
|
+
### 6. Enhanced Onboarding
|
|
195
195
|
Smart setup that adapts to your project:
|
|
196
196
|
|
|
197
197
|
**Intelligent File Merging**
|
|
@@ -210,11 +210,13 @@ bunx forge setup --merge=smart # Intelligent merge
|
|
|
210
210
|
- Saves to `.forge/context.json`
|
|
211
211
|
|
|
212
212
|
**Workflow Profiles**
|
|
213
|
-
- Adapts workflow based on work type:
|
|
214
|
-
- `
|
|
215
|
-
- `
|
|
213
|
+
- Adapts workflow based on work type (3-8 stages):
|
|
214
|
+
- `critical`: Full 8-stage workflow (auth, payments, security-sensitive)
|
|
215
|
+
- `standard`: 7-stage workflow (typical features)
|
|
216
216
|
- `refactor`: Behavior-preserving 5-stage workflow
|
|
217
|
-
- `
|
|
217
|
+
- `simple`: Streamlined 4-stage workflow
|
|
218
|
+
- `hotfix`: Minimal 3-stage workflow (production fixes)
|
|
219
|
+
- `docs`: Minimal 3-stage workflow (documentation/config)
|
|
218
220
|
```bash
|
|
219
221
|
bunx forge setup --type=critical # Set workflow manually
|
|
220
222
|
```
|
|
@@ -348,7 +350,7 @@ gh auth login
|
|
|
348
350
|
**Documentation Progressive**: Update at each stage
|
|
349
351
|
**Multi-Session**: Work persists across sessions
|
|
350
352
|
|
|
351
|
-
→ [Read the philosophy in
|
|
353
|
+
→ [Read the philosophy in AGENTS.md](AGENTS.md)
|
|
352
354
|
|
|
353
355
|
---
|
|
354
356
|
|
|
@@ -358,7 +360,7 @@ gh auth login
|
|
|
358
360
|
→ [QUICKSTART.md](QUICKSTART.md) - Your first feature in 5 minutes
|
|
359
361
|
|
|
360
362
|
📖 **Learn the workflow**
|
|
361
|
-
→ [
|
|
363
|
+
→ [AGENTS.md](AGENTS.md) - Complete guide with examples
|
|
362
364
|
|
|
363
365
|
🛠️ **Setup the toolchain**
|
|
364
366
|
→ [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md) - Beads, GitHub CLI
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Forge
|
|
4
|
+
* Forge Preflight CLI
|
|
5
5
|
*
|
|
6
6
|
* Prerequisite validation for workflow stages.
|
|
7
7
|
* Helps ensure developers have required tools and files before proceeding.
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
|
-
* forge-
|
|
11
|
-
* forge-
|
|
12
|
-
* forge-
|
|
10
|
+
* forge-preflight status - Check project prerequisites
|
|
11
|
+
* forge-preflight dev - Validate before /dev stage
|
|
12
|
+
* forge-preflight ship - Validate before /ship stage
|
|
13
13
|
*
|
|
14
14
|
* Security: Uses execFileSync to prevent command injection.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const { execFileSync } = require("node:child_process");
|
|
18
18
|
const fs = require("node:fs");
|
|
19
|
-
// const path = require("node:path"); // Currently unused
|
|
20
19
|
|
|
21
20
|
// Validation results
|
|
22
21
|
let checks = [];
|
|
@@ -52,6 +51,7 @@ function printResults() {
|
|
|
52
51
|
// Validation functions
|
|
53
52
|
|
|
54
53
|
function validateStatus() {
|
|
54
|
+
checks = [];
|
|
55
55
|
console.log("Checking project prerequisites...\n");
|
|
56
56
|
|
|
57
57
|
check(
|
|
@@ -100,6 +100,7 @@ function validateStatus() {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function validateDev() {
|
|
103
|
+
checks = [];
|
|
103
104
|
console.log("Validating prerequisites for /dev stage...\n");
|
|
104
105
|
|
|
105
106
|
check(
|
|
@@ -129,15 +130,15 @@ function validateDev() {
|
|
|
129
130
|
"Plan file exists",
|
|
130
131
|
() => {
|
|
131
132
|
try {
|
|
132
|
-
const plansDir = "
|
|
133
|
+
const plansDir = "docs/plans";
|
|
133
134
|
if (!fs.existsSync(plansDir)) return false;
|
|
134
|
-
const plans = fs.readdirSync(plansDir).filter((f) => f.endsWith(".md"));
|
|
135
|
+
const plans = fs.readdirSync(plansDir).filter((f) => f.endsWith("-design.md"));
|
|
135
136
|
return plans.length > 0;
|
|
136
137
|
} catch {
|
|
137
138
|
return false;
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
|
-
"No plan file found in
|
|
141
|
+
"No plan file found in docs/plans/. Run: /plan",
|
|
141
142
|
);
|
|
142
143
|
|
|
143
144
|
check(
|
|
@@ -173,6 +174,7 @@ function validateDev() {
|
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
function validateShip() {
|
|
177
|
+
checks = [];
|
|
176
178
|
console.log("Validating prerequisites for /ship stage...\n");
|
|
177
179
|
|
|
178
180
|
check(
|
|
@@ -182,7 +184,7 @@ function validateShip() {
|
|
|
182
184
|
return testDirs.some((dir) => {
|
|
183
185
|
if (!fs.existsSync(dir)) return false;
|
|
184
186
|
try {
|
|
185
|
-
const files = fs.readdirSync(dir
|
|
187
|
+
const files = fs.readdirSync(dir);
|
|
186
188
|
return files.some(
|
|
187
189
|
(f) => f.includes(".test.") || f.includes(".spec."),
|
|
188
190
|
);
|
|
@@ -200,7 +202,11 @@ function validateShip() {
|
|
|
200
202
|
try {
|
|
201
203
|
execFileSync("npm", ["test"], { stdio: "pipe" });
|
|
202
204
|
return true;
|
|
203
|
-
} catch {
|
|
205
|
+
} catch (err) {
|
|
206
|
+
const output = ((err.stdout || "") + "\n" + (err.stderr || "")).trim();
|
|
207
|
+
if (output) {
|
|
208
|
+
console.error("\nTest output:\n" + output.slice(0, 2000));
|
|
209
|
+
}
|
|
204
210
|
return false;
|
|
205
211
|
}
|
|
206
212
|
},
|
|
@@ -235,10 +241,10 @@ function validateShip() {
|
|
|
235
241
|
|
|
236
242
|
function showHelp() {
|
|
237
243
|
console.log(`
|
|
238
|
-
Forge
|
|
244
|
+
Forge Preflight - Prerequisite validation for workflow stages
|
|
239
245
|
|
|
240
246
|
Usage:
|
|
241
|
-
forge-
|
|
247
|
+
forge-preflight <command>
|
|
242
248
|
|
|
243
249
|
Commands:
|
|
244
250
|
status Check project prerequisites (git, npm, tests)
|
|
@@ -247,9 +253,9 @@ Commands:
|
|
|
247
253
|
help Show this help message
|
|
248
254
|
|
|
249
255
|
Examples:
|
|
250
|
-
forge-
|
|
251
|
-
forge-
|
|
252
|
-
forge-
|
|
256
|
+
forge-preflight status
|
|
257
|
+
forge-preflight dev
|
|
258
|
+
forge-preflight ship
|
|
253
259
|
`);
|
|
254
260
|
}
|
|
255
261
|
|