forgedock 1.0.1 → 1.0.3
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/README.md +19 -2
- package/bin/forgedock.mjs +3084 -80
- package/bin/github-app-manifest.json +24 -0
- package/bin/tui.mjs +702 -0
- package/commands/analytics.md +129 -52
- package/commands/audit-agents.md +29 -5
- package/commands/audit.md +55 -17
- package/commands/autopilot.md +11 -6
- package/commands/cleanup.md +44 -24
- package/commands/deploy-info.md +7 -3
- package/commands/forge-stats.md +13 -4
- package/commands/forgedock-init.md +534 -0
- package/commands/geo-audit.md +114 -26
- package/commands/incident-response.md +4 -1
- package/commands/issue.md +26 -25
- package/commands/milestone.md +80 -59
- package/commands/orchestrate.md +38 -21
- package/commands/pipeline-health.md +26 -15
- package/commands/qa-sweep.md +68 -5
- package/commands/quality-gate.md +18 -0
- package/commands/review-pr-agents.md +58 -90
- package/commands/review-pr.md +58 -16
- package/commands/rollback.md +8 -5
- package/commands/security-audit.md +68 -12
- package/commands/sync-ecosystem.md +196 -156
- package/commands/work-on/build/architect.md +2 -2
- package/commands/work-on/build/context.md +2 -2
- package/commands/work-on/build/implement.md +3 -3
- package/commands/work-on/build/validate.md +3 -3
- package/commands/work-on/build.md +6 -6
- package/commands/work-on/close.md +59 -30
- package/commands/work-on/decompose.md +6 -6
- package/commands/work-on/investigate.md +16 -20
- package/commands/work-on/review.md +4 -4
- package/commands/work-on-monolithic.md +15 -16
- package/commands/work-on.md +45 -33
- package/docs/CODEX.md +1 -1
- package/docs/CONFIG.md +398 -0
- package/docs/WORKFLOW.md +115 -72
- package/package.json +1 -1
- package/scripts/verify-host-headers.sh +14 -9
- package/scripts/verify-route-registration.sh +10 -10
- package/commands/failure-recon.md +0 -375
package/commands/cleanup.md
CHANGED
|
@@ -13,6 +13,25 @@ Scan the entire development environment for rot and fix it. This is a maintenanc
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## Config Resolution
|
|
17
|
+
|
|
18
|
+
Read `forge.yaml` at the project root to resolve all project-specific variables before running any commands:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Parse forge.yaml for project context
|
|
22
|
+
GH_REPO=$(yq '.project.owner + "/" + .project.repo' forge.yaml)
|
|
23
|
+
GH_FLAG="-R $GH_REPO"
|
|
24
|
+
REPO_PATH=$(yq '.paths.root' forge.yaml)
|
|
25
|
+
STAGING_BRANCH=$(yq '.branches.staging' forge.yaml)
|
|
26
|
+
PROJECT_BOARD_OWNER=$(yq '.project_board.owner // .project.owner' forge.yaml)
|
|
27
|
+
PROJECT_NUMBER=$(yq '.project_board.project_number // "1"' forge.yaml)
|
|
28
|
+
PROJECT_ID=$(yq '.project_board.project_id' forge.yaml)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
All `{GH_REPO}`, `{GH_FLAG}`, `{REPO_PATH}`, `{STAGING_BRANCH}`, `{PROJECT_BOARD_OWNER}`, `{PROJECT_NUMBER}`, and `{PROJECT_ID}` references below are populated from `forge.yaml`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
16
35
|
## Command Router
|
|
17
36
|
|
|
18
37
|
| Input | Action |
|
|
@@ -34,16 +53,16 @@ These labels should only exist on OPEN issues. If a closed issue has them, the p
|
|
|
34
53
|
|
|
35
54
|
```bash
|
|
36
55
|
echo "=== Stale workflow:in-review ==="
|
|
37
|
-
gh issue list
|
|
56
|
+
gh issue list {GH_FLAG} --state closed --label "workflow:in-review" --limit 100 --json number,title --jq '.[] | "#\(.number) — \(.title)"'
|
|
38
57
|
|
|
39
58
|
echo "=== Stale workflow:building ==="
|
|
40
|
-
gh issue list
|
|
59
|
+
gh issue list {GH_FLAG} --state closed --label "workflow:building" --limit 100 --json number,title --jq '.[] | "#\(.number) — \(.title)"'
|
|
41
60
|
|
|
42
61
|
echo "=== Stale workflow:investigating ==="
|
|
43
|
-
gh issue list
|
|
62
|
+
gh issue list {GH_FLAG} --state closed --label "workflow:investigating" --limit 100 --json number,title --jq '.[] | "#\(.number) — \(.title)"'
|
|
44
63
|
|
|
45
64
|
echo "=== Stale needs-validation ==="
|
|
46
|
-
gh issue list
|
|
65
|
+
gh issue list {GH_FLAG} --state closed --label "needs-validation" --limit 100 --json number,title --jq '.[] | "#\(.number) — \(.title)"'
|
|
47
66
|
```
|
|
48
67
|
|
|
49
68
|
### 1B: Fix stale labels
|
|
@@ -53,8 +72,8 @@ For each closed issue with a stale intermediate label:
|
|
|
53
72
|
**Stale `workflow:in-review`, `workflow:building`** — these were merged but label wasn't updated:
|
|
54
73
|
```bash
|
|
55
74
|
for NUM in {stale_issue_numbers}; do
|
|
56
|
-
gh issue edit $NUM
|
|
57
|
-
gh issue edit $NUM
|
|
75
|
+
gh issue edit $NUM {GH_FLAG} --add-label "workflow:merged"
|
|
76
|
+
gh issue edit $NUM {GH_FLAG} --remove-label "workflow:in-review,workflow:building,needs-validation" 2>/dev/null || true
|
|
58
77
|
done
|
|
59
78
|
```
|
|
60
79
|
|
|
@@ -65,14 +84,14 @@ done
|
|
|
65
84
|
**Stale `needs-validation`** — remove from all closed issues:
|
|
66
85
|
```bash
|
|
67
86
|
for NUM in {needs_validation_numbers}; do
|
|
68
|
-
gh issue edit $NUM
|
|
87
|
+
gh issue edit $NUM {GH_FLAG} --remove-label "needs-validation" 2>/dev/null || true
|
|
69
88
|
done
|
|
70
89
|
```
|
|
71
90
|
|
|
72
91
|
### 1C: Report closed issues with NO workflow label
|
|
73
92
|
|
|
74
93
|
```bash
|
|
75
|
-
gh issue list
|
|
94
|
+
gh issue list {GH_FLAG} --state closed --limit 200 --json number,title,labels \
|
|
76
95
|
--jq '.[] | select([.labels[].name] | any(startswith("workflow:")) | not) | "#\(.number) — \(.title)"'
|
|
77
96
|
```
|
|
78
97
|
|
|
@@ -90,11 +109,11 @@ For each open issue with `workflow:in-review` label, check if it has a merged PR
|
|
|
90
109
|
|
|
91
110
|
```bash
|
|
92
111
|
# Get all open issues with workflow:in-review
|
|
93
|
-
OPEN_IN_REVIEW=$(gh issue list
|
|
112
|
+
OPEN_IN_REVIEW=$(gh issue list {GH_FLAG} --state open --label "workflow:in-review" --limit 100 --json number --jq '.[].number')
|
|
94
113
|
|
|
95
114
|
for NUM in $OPEN_IN_REVIEW; do
|
|
96
115
|
# Search for merged PRs that reference this issue
|
|
97
|
-
MERGED_PR=$(gh pr list
|
|
116
|
+
MERGED_PR=$(gh pr list {GH_FLAG} --search "Closes #$NUM" --state merged --json number --jq '.[0].number' 2>/dev/null)
|
|
98
117
|
if [ -n "$MERGED_PR" ]; then
|
|
99
118
|
echo "ORPHAN: #$NUM has merged PR #$MERGED_PR"
|
|
100
119
|
fi
|
|
@@ -105,9 +124,9 @@ done
|
|
|
105
124
|
|
|
106
125
|
For each orphaned issue found:
|
|
107
126
|
```bash
|
|
108
|
-
gh issue close $NUM
|
|
109
|
-
gh issue edit $NUM
|
|
110
|
-
gh issue edit $NUM
|
|
127
|
+
gh issue close $NUM {GH_FLAG} --comment "Closed by cleanup — PR #$MERGED_PR was already merged."
|
|
128
|
+
gh issue edit $NUM {GH_FLAG} --add-label "workflow:merged"
|
|
129
|
+
gh issue edit $NUM {GH_FLAG} --remove-label "workflow:in-review" 2>/dev/null || true
|
|
111
130
|
```
|
|
112
131
|
|
|
113
132
|
Also check open issues with `workflow:building` — same pattern (search for merged PRs referencing them).
|
|
@@ -119,10 +138,11 @@ Also check open issues with `workflow:building` — same pattern (search for mer
|
|
|
119
138
|
### 3A: Identify worktrees with merged PRs
|
|
120
139
|
|
|
121
140
|
```bash
|
|
122
|
-
cd
|
|
141
|
+
cd {REPO_PATH}
|
|
123
142
|
|
|
124
143
|
# For each worktree (excluding the main one), check if its branch has a merged PR
|
|
125
|
-
|
|
144
|
+
REPO_NAME=$(basename "{REPO_PATH}")
|
|
145
|
+
git worktree list --porcelain | grep "^worktree " | grep -v "/$REPO_NAME$" | sed 's/^worktree //' | while read wt; do
|
|
126
146
|
branch=$(git -C "$wt" branch --show-current 2>/dev/null)
|
|
127
147
|
if [ -n "$branch" ]; then
|
|
128
148
|
merged_pr=$(gh pr list --head "$branch" --state merged --json number --jq '.[0].number' 2>/dev/null)
|
|
@@ -144,19 +164,19 @@ echo "Removed: $WORKTREE_PATH ($BRANCH_NAME)"
|
|
|
144
164
|
|
|
145
165
|
### 3C: Prune merged remote branches
|
|
146
166
|
|
|
147
|
-
Delete remote `fix/` and `feat/` branches that are fully merged into `
|
|
167
|
+
Delete remote `fix/` and `feat/` branches that are fully merged into `{STAGING_BRANCH}`:
|
|
148
168
|
|
|
149
169
|
```bash
|
|
150
|
-
cd
|
|
170
|
+
cd {REPO_PATH}
|
|
151
171
|
git fetch --prune origin
|
|
152
172
|
|
|
153
173
|
# Count first
|
|
154
|
-
MERGED_COUNT=$(git branch -r --merged origin/
|
|
174
|
+
MERGED_COUNT=$(git branch -r --merged origin/{STAGING_BRANCH} | grep -E "origin/(fix|feat)/" | wc -l)
|
|
155
175
|
echo "Found $MERGED_COUNT merged remote branches to delete"
|
|
156
176
|
|
|
157
177
|
# Delete them
|
|
158
178
|
if [ "$MERGED_COUNT" -gt 0 ]; then
|
|
159
|
-
git branch -r --merged origin/
|
|
179
|
+
git branch -r --merged origin/{STAGING_BRANCH} | grep -E "origin/(fix|feat)/" | sed 's|origin/||' | xargs -I{} git push origin --delete {} 2>&1
|
|
160
180
|
fi
|
|
161
181
|
```
|
|
162
182
|
|
|
@@ -204,16 +224,16 @@ fi
|
|
|
204
224
|
For closed issues that are on the Project board but have stale fields:
|
|
205
225
|
|
|
206
226
|
```bash
|
|
207
|
-
gh project item-list
|
|
227
|
+
gh project item-list {PROJECT_NUMBER} --owner {PROJECT_BOARD_OWNER} --format json --limit 200
|
|
208
228
|
```
|
|
209
229
|
|
|
210
230
|
For each item where `content.state == "CLOSED"` but `status != "Done"` or `workflow` is not a terminal state:
|
|
211
231
|
|
|
212
232
|
```bash
|
|
213
|
-
gh project item-edit --project-id
|
|
214
|
-
--field-id
|
|
215
|
-
gh project item-edit --project-id
|
|
216
|
-
--field-id
|
|
233
|
+
gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" \
|
|
234
|
+
--field-id {PROJECT_BOARD_STATUS_FIELD_ID} --single-select-option-id {PROJECT_BOARD_STATUS_DONE_ID} 2>/dev/null || true # Status=Done
|
|
235
|
+
gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" \
|
|
236
|
+
--field-id {PROJECT_BOARD_WORKFLOW_FIELD_ID} --single-select-option-id {PROJECT_BOARD_WORKFLOW_MERGED_ID} 2>/dev/null || true # Workflow=Merged
|
|
217
237
|
```
|
|
218
238
|
|
|
219
239
|
---
|
package/commands/deploy-info.md
CHANGED
|
@@ -7,6 +7,10 @@ argument-hint: [staging | milestone/{slug} | compare {branch}]
|
|
|
7
7
|
|
|
8
8
|
**Input**: $ARGUMENTS (default: `staging`)
|
|
9
9
|
|
|
10
|
+
**Config variables used by this command** (set in `forge.yaml`):
|
|
11
|
+
- `{REPO_PATH}` ← `paths.root` — project repository root
|
|
12
|
+
- `{HEALTH_ENDPOINT}` ← `services.health_endpoint` (optional) — URL used in post-deploy health check
|
|
13
|
+
|
|
10
14
|
You are the pipeline's deploy awareness layer. Before the user merges staging → main (triggering CI/CD deployment), this command shows exactly what's going out: which PRs, which issues, what changed, and what risks exist.
|
|
11
15
|
|
|
12
16
|
**Agent model policy**: Default `model: "sonnet"`. If Sonnet is rate-limited, fall back to `model: "opus"`. User can override with `--model <name>`.
|
|
@@ -22,7 +26,7 @@ You are the pipeline's deploy awareness layer. Before the user merges staging
|
|
|
22
26
|
**Non-blocking**: This phase emits a warning but does NOT block. Deploy-info is an informational tool. The authoritative gate is Phase 0A of `/review-pr-staging`.
|
|
23
27
|
|
|
24
28
|
```bash
|
|
25
|
-
cd
|
|
29
|
+
cd {REPO_PATH}
|
|
26
30
|
git fetch origin main staging
|
|
27
31
|
|
|
28
32
|
SOURCE=${SOURCE_BRANCH:-staging}
|
|
@@ -90,7 +94,7 @@ fi
|
|
|
90
94
|
| `compare {branch}` | `{branch}` | `main` | Custom comparison |
|
|
91
95
|
|
|
92
96
|
```bash
|
|
93
|
-
cd
|
|
97
|
+
cd {REPO_PATH}
|
|
94
98
|
git fetch origin main staging
|
|
95
99
|
|
|
96
100
|
# Determine source and target
|
|
@@ -241,7 +245,7 @@ gh workflow run hotfix-deploy.yml --ref main -f services={affected_services} -f
|
|
|
241
245
|
```
|
|
242
246
|
|
|
243
247
|
### Post-Deploy
|
|
244
|
-
- [ ] Health check: `curl -s
|
|
248
|
+
- [ ] Health check: `curl -s {HEALTH_ENDPOINT} | jq .`
|
|
245
249
|
- [ ] {If migrations} Verify migration applied: check new tables/columns exist
|
|
246
250
|
- [ ] {If new features} Smoke test the new functionality
|
|
247
251
|
- [ ] Monitor error rates for 15 minutes
|
package/commands/forge-stats.md
CHANGED
|
@@ -9,7 +9,16 @@ argument-hint: [diff | baseline | full]
|
|
|
9
9
|
|
|
10
10
|
Tracks the size of every Forge command file over time. Detects bloat by comparing current sizes against the git-tracked baseline and per-command thresholds.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Config
|
|
13
|
+
|
|
14
|
+
Read project home from `forge.yaml` before running any mode:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
FORGE_HOME=$(yq e '.paths.root' forge.yaml)
|
|
18
|
+
echo "Forge home: $FORGE_HOME"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**FORGE_HOME**: `$FORGE_HOME` (set from `forge.yaml` → `paths.root`)
|
|
13
22
|
|
|
14
23
|
---
|
|
15
24
|
|
|
@@ -42,7 +51,7 @@ Commands are classified by role. Each role has a max line count — beyond this,
|
|
|
42
51
|
Compare current line counts against the last git commit. Shows what grew and what shrank.
|
|
43
52
|
|
|
44
53
|
```bash
|
|
45
|
-
cd
|
|
54
|
+
cd "$FORGE_HOME"
|
|
46
55
|
|
|
47
56
|
echo "=== Forge Command Sizes — $(date +%Y-%m-%d) ==="
|
|
48
57
|
echo ""
|
|
@@ -104,7 +113,7 @@ echo "Total: $(wc -l commands/*.md | tail -1 | awk '{print $1}') lines across $(
|
|
|
104
113
|
Record the current sizes as the new baseline. Run this after a deliberate refactor or rewrite.
|
|
105
114
|
|
|
106
115
|
```bash
|
|
107
|
-
cd
|
|
116
|
+
cd "$FORGE_HOME"
|
|
108
117
|
|
|
109
118
|
echo "# Forge Command Baselines — $(date +%Y-%m-%d)" > .baselines
|
|
110
119
|
echo "# Auto-generated by /forge-stats baseline" >> .baselines
|
|
@@ -127,7 +136,7 @@ git commit -m "stats: update command baselines — $(date +%Y-%m-%d)"
|
|
|
127
136
|
Full analysis with git history trend. Shows how each command has grown over time.
|
|
128
137
|
|
|
129
138
|
```bash
|
|
130
|
-
cd
|
|
139
|
+
cd "$FORGE_HOME"
|
|
131
140
|
|
|
132
141
|
echo "=== Forge Command Growth History ==="
|
|
133
142
|
echo ""
|