forgedock 1.0.0
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/LICENSE +244 -0
- package/README.md +251 -0
- package/bin/forgedock.mjs +232 -0
- package/commands/analytics.md +777 -0
- package/commands/audit-agents.md +410 -0
- package/commands/audit.md +410 -0
- package/commands/autopilot.md +432 -0
- package/commands/cleanup.md +264 -0
- package/commands/deploy-info.md +292 -0
- package/commands/failure-recon.md +375 -0
- package/commands/forge-stats.md +183 -0
- package/commands/geo-audit.md +343 -0
- package/commands/incident-response.md +384 -0
- package/commands/issue.md +506 -0
- package/commands/milestone.md +599 -0
- package/commands/orchestrate.md +1044 -0
- package/commands/pipeline-health.md +2343 -0
- package/commands/qa-sweep.md +237 -0
- package/commands/quality-gate.md +777 -0
- package/commands/review-pr-agents.md +1711 -0
- package/commands/review-pr-staging.md +325 -0
- package/commands/review-pr.md +888 -0
- package/commands/rollback.md +253 -0
- package/commands/security-audit.md +529 -0
- package/commands/sync-ecosystem.md +527 -0
- package/commands/validate.md +131 -0
- package/commands/work-on/build/architect.md +291 -0
- package/commands/work-on/build/context.md +349 -0
- package/commands/work-on/build/implement.md +280 -0
- package/commands/work-on/build/validate.md +292 -0
- package/commands/work-on/build.md +262 -0
- package/commands/work-on/close.md +350 -0
- package/commands/work-on/decompose.md +254 -0
- package/commands/work-on/investigate.md +437 -0
- package/commands/work-on/review.md +245 -0
- package/commands/work-on-monolithic.md +298 -0
- package/commands/work-on.md +1089 -0
- package/docs/CODEX.md +92 -0
- package/docs/WORKFLOW.md +104 -0
- package/package.json +45 -0
- package/scripts/verify-env-vars.sh +201 -0
- package/scripts/verify-host-headers.sh +117 -0
- package/scripts/verify-route-registration.sh +118 -0
- package/scripts/verify-sops-chain.sh +163 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Detect API changes, sync satellite repos, and publish releases (SDKs, MCP server, n8n node)
|
|
3
|
+
argument-hint: [check | auto | status | publish | PR-number]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /sync-ecosystem — Cross-Project Sync & Publish
|
|
7
|
+
|
|
8
|
+
**Input**: $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
When the AlterLab API surface changes (new parameters, endpoints, modes, pricing), satellite projects (SDKs, MCP server, n8n node) need updates. This command detects what changed, creates tracking issues, checks publication status, and publishes releases.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Ecosystem Registry
|
|
15
|
+
|
|
16
|
+
### Satellite Projects
|
|
17
|
+
|
|
18
|
+
| Component | Repo | Local Path | Package | Publish Trigger |
|
|
19
|
+
|-----------|------|------------|---------|-----------------|
|
|
20
|
+
| MCP Server | `RapierCraft/alterlab-mcp-server` | `/home/mrdubey/projects/ScraperAPI/alterlab-mcp-server` | `alterlab-mcp-server` (npm) | GitHub Release → `publish-npm.yml` + `publish-mcp-registry.yml` |
|
|
21
|
+
| n8n Node | `RapierCraft/n8n-nodes-alterlab` | `/home/mrdubey/projects/ScraperAPI/n8n-nodes-alterlab` | `n8n-nodes-alterlab` (npm) | GitHub Release → `publish.yml` |
|
|
22
|
+
| Python SDK | monorepo `sdk/python/` | `/home/mrdubey/projects/ScraperAPI/alterlab/sdk/python` | `alterlab` (PyPI) | Manual `workflow_dispatch` → `publish-sdks.yml` (input: `python` or `both`) |
|
|
23
|
+
| Node SDK | monorepo `sdk/node/` | `/home/mrdubey/projects/ScraperAPI/alterlab/sdk/node` | `@alterlab/sdk` (npm) | Manual `workflow_dispatch` → `publish-sdks.yml` (input: `node` or `both`) |
|
|
24
|
+
|
|
25
|
+
### Version Bump Rules
|
|
26
|
+
|
|
27
|
+
- **Satellite repos** (MCP, n8n): Version lives in `package.json`. Must be bumped, committed, and pushed to `main` BEFORE creating the GitHub Release tag. The release tag must match the version (`v{VERSION}`).
|
|
28
|
+
- **SDKs** (Python, Node): Version lives in `pyproject.toml` / `package.json` in the monorepo. Must be bumped, committed, and pushed to `main` BEFORE triggering `publish-sdks.yml`.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Command Router
|
|
33
|
+
|
|
34
|
+
| Input | Action |
|
|
35
|
+
|-------|--------|
|
|
36
|
+
| `check` or empty | Scan recent PRs for API changes, report what needs syncing |
|
|
37
|
+
| `auto` | Same as check, but auto-create issues in satellite repos |
|
|
38
|
+
| `status` | Check publication status of ALL ecosystem components (code vs published versions) |
|
|
39
|
+
| `publish` | Bump versions, cut releases, and trigger publishes for all components with unpublished changes |
|
|
40
|
+
| `publish mcp` / `publish n8n` / `publish sdks` | Publish a specific component |
|
|
41
|
+
| `PR-number` (e.g., `#1500`) | Analyze a specific PR for ecosystem impact |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Phase 1: Detect API Surface Changes
|
|
46
|
+
|
|
47
|
+
**Skip this phase if input is `status` or `publish`.**
|
|
48
|
+
|
|
49
|
+
### If input is a PR number:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Get the PR diff
|
|
53
|
+
gh pr diff {PR_NUMBER} --name-only
|
|
54
|
+
gh pr view {PR_NUMBER} --json title,body,files
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### If input is `check` or `auto`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Find recent merged PRs to staging or main (last 7 days)
|
|
61
|
+
gh pr list --state merged --base staging --limit 20 --json number,title,mergedAt,files
|
|
62
|
+
gh pr list --state merged --base main --limit 10 --json number,title,mergedAt,files
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Analyze changes for sync triggers
|
|
66
|
+
|
|
67
|
+
Scan the changed files for API surface modifications:
|
|
68
|
+
|
|
69
|
+
| File Pattern | Trigger Type | Satellite Impact |
|
|
70
|
+
|-------------|--------------|------------------|
|
|
71
|
+
| `services/api/app/routers/scrape*.py` | New/changed scrape parameters | SDKs, MCP, n8n |
|
|
72
|
+
| `services/api/app/schemas/scrape*.py` | Schema changes | SDKs, MCP, n8n |
|
|
73
|
+
| `services/api/app/routers/extract*.py` | Extraction changes | MCP, n8n |
|
|
74
|
+
| `services/api/app/core/pricing.py` | Pricing/credit changes | MCP (estimate tool), SDK docs |
|
|
75
|
+
| `services/api/app/routers/*.py` (new file) | New endpoint | SDKs, MCP |
|
|
76
|
+
| `services/api/app/auth/` | Auth changes | n8n credentials, SDK auth, MCP config |
|
|
77
|
+
| `sdk/python/` | SDK already updated | Check if n8n/MCP need matching update |
|
|
78
|
+
| `sdk/node/` | SDK already updated | Check if n8n/MCP need matching update |
|
|
79
|
+
|
|
80
|
+
**Read the actual diff** for each matched file to understand what specifically changed (new parameter, renamed field, new endpoint, etc.).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Phase 2: Map Impact to Satellite Projects
|
|
85
|
+
|
|
86
|
+
For each detected change, determine which satellite projects need updates:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
# Example impact map
|
|
90
|
+
changes:
|
|
91
|
+
- description: "Added `cookies` parameter to /api/v1/scrape"
|
|
92
|
+
source_pr: "#1800"
|
|
93
|
+
impacts:
|
|
94
|
+
- repo: "RapierCraft/alterlab-mcp-server"
|
|
95
|
+
what: "Add `cookies` param to scrape tool schema"
|
|
96
|
+
files: ["src/tools/scrape.ts"]
|
|
97
|
+
- repo: "RapierCraft/n8n-nodes-alterlab"
|
|
98
|
+
what: "Add `cookies` field to Scrape operation"
|
|
99
|
+
files: ["nodes/AlterLab/AlterLab.node.ts"]
|
|
100
|
+
- repo: "sdk/python" (monorepo)
|
|
101
|
+
what: "Add `cookies` kwarg to client.scrape()"
|
|
102
|
+
files: ["sdk/python/alterlab/client.py"]
|
|
103
|
+
- repo: "sdk/node" (monorepo)
|
|
104
|
+
what: "Add `cookies` option to scrape()"
|
|
105
|
+
files: ["sdk/node/src/index.ts"]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Check if sync is already done**: Before creating issues, check if the satellite repo already has the change:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# For MCP server (check git main, not local disk — local may be stale):
|
|
112
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab-mcp-server && git fetch origin main && git show origin/main:src/tools/scrape.ts | grep -n "cookies"
|
|
113
|
+
|
|
114
|
+
# For n8n node:
|
|
115
|
+
cd /home/mrdubey/projects/ScraperAPI/n8n-nodes-alterlab && git fetch origin main && git show origin/main:nodes/AlterLab/AlterLab.node.ts | grep -n "cookies"
|
|
116
|
+
|
|
117
|
+
# For SDKs (check origin/main in monorepo):
|
|
118
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab && git show origin/main:sdk/python/alterlab/client.py | grep -n "cookies"
|
|
119
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab && git show origin/main:sdk/node/src/index.ts | grep -n "cookies"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
If the change already exists in a satellite's `origin/main` → skip it (code synced). Then check if it's also **published** (see Phase 5).
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Phase 3: Report or Create Issues
|
|
127
|
+
|
|
128
|
+
### If `check` mode:
|
|
129
|
+
|
|
130
|
+
Report what needs syncing without creating issues:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
## Ecosystem Sync Report
|
|
134
|
+
|
|
135
|
+
### API Changes Detected
|
|
136
|
+
{list of changes from recent PRs}
|
|
137
|
+
|
|
138
|
+
### Sync Needed
|
|
139
|
+
|
|
140
|
+
| Repo | Change Needed | Source PR | Status |
|
|
141
|
+
|------|--------------|-----------|--------|
|
|
142
|
+
| MCP Server | Add `cookies` to scrape tool | #1800 | Needs sync |
|
|
143
|
+
| n8n Node | Add `cookies` to Scrape op | #1800 | Needs sync |
|
|
144
|
+
| Python SDK | Already has `cookies` | #1800 | In sync |
|
|
145
|
+
| Node SDK | Add `cookies` option | #1800 | Needs sync |
|
|
146
|
+
|
|
147
|
+
Run `/sync-ecosystem auto` to create issues automatically.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Always append the Phase 5 publication status table** to `check` output — code sync is not enough, users need to know if changes are published.
|
|
151
|
+
|
|
152
|
+
### If `auto` mode:
|
|
153
|
+
|
|
154
|
+
Create issues in the affected repos:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# For satellite repos (separate GitHub repos):
|
|
158
|
+
gh issue create -R {TARGET_REPO} \
|
|
159
|
+
--title "feat(sync): {description of what API change needs to be reflected}" \
|
|
160
|
+
--label "feature,P2" \
|
|
161
|
+
--body "$(cat <<'BODY_EOF'
|
|
162
|
+
## Problem
|
|
163
|
+
|
|
164
|
+
{1-3 sentences: what API or schema change in the upstream repo needs to be reflected in this satellite repo. What will break or be missing if this sync is not done.}
|
|
165
|
+
|
|
166
|
+
## Root Cause (if known)
|
|
167
|
+
|
|
168
|
+
The upstream AlterLab API changed in PR #{SOURCE_PR}: {brief description of the change}. This satellite repo must be updated to stay in sync.
|
|
169
|
+
|
|
170
|
+
## Affected Files
|
|
171
|
+
|
|
172
|
+
Files that need changes:
|
|
173
|
+
1. `{filepath}` — {what needs to change}
|
|
174
|
+
2. `{filepath}` — {what needs to change}
|
|
175
|
+
|
|
176
|
+
## Acceptance Criteria
|
|
177
|
+
|
|
178
|
+
- [ ] {Specific sync criterion — e.g., new parameter available in tool schema}
|
|
179
|
+
- [ ] Changes passed through to AlterLab API correctly
|
|
180
|
+
- [ ] TypeScript types / validation schemas updated
|
|
181
|
+
|
|
182
|
+
## Context
|
|
183
|
+
|
|
184
|
+
**Source**: {SOURCE_REPO} PR #{SOURCE_PR}
|
|
185
|
+
**Change**: {description of upstream API change}
|
|
186
|
+
**Detected by**: \`/sync-ecosystem\`
|
|
187
|
+
|
|
188
|
+
## API Reference
|
|
189
|
+
|
|
190
|
+
{If applicable: describe the new API shape with an example}
|
|
191
|
+
BODY_EOF
|
|
192
|
+
)"
|
|
193
|
+
|
|
194
|
+
# For monorepo issues (SDKs, chrome extension):
|
|
195
|
+
gh issue create \
|
|
196
|
+
--title "feat(sync): {description of what API change needs to be reflected}" \
|
|
197
|
+
--label "feature,P2" \
|
|
198
|
+
--body "$(cat <<'BODY_EOF'
|
|
199
|
+
## Problem
|
|
200
|
+
|
|
201
|
+
{1-3 sentences: what API or schema change needs to be reflected in this SDK or extension. What will be out of sync if not updated.}
|
|
202
|
+
|
|
203
|
+
## Root Cause (if known)
|
|
204
|
+
|
|
205
|
+
The upstream AlterLab API changed in PR #{SOURCE_PR}: {brief description of the change}. This SDK must be updated to expose the new capability.
|
|
206
|
+
|
|
207
|
+
## Affected Files
|
|
208
|
+
|
|
209
|
+
Files that need changes:
|
|
210
|
+
1. `{filepath}` — {what needs to change}
|
|
211
|
+
2. `{filepath}` — {what needs to change}
|
|
212
|
+
|
|
213
|
+
## Acceptance Criteria
|
|
214
|
+
|
|
215
|
+
- [ ] {Specific sync criterion}
|
|
216
|
+
- [ ] Types and documentation updated to match new API
|
|
217
|
+
- [ ] No regression in existing SDK functionality
|
|
218
|
+
|
|
219
|
+
## Context
|
|
220
|
+
|
|
221
|
+
**Source**: {SOURCE_REPO} PR #{SOURCE_PR}
|
|
222
|
+
**Change**: {description of upstream API change}
|
|
223
|
+
**Detected by**: \`/sync-ecosystem\`
|
|
224
|
+
BODY_EOF
|
|
225
|
+
)"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Add sync issues to Project board
|
|
229
|
+
|
|
230
|
+
For each created issue, add it to the GitHub Project with `Lane=Sync` and the correct `Component`. Reference `~/projects/forge/docs/WORKFLOW.md` → "Project Board Integration" for field IDs.
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# For each created issue:
|
|
234
|
+
ISSUE_URL="https://github.com/{TARGET_REPO}/issues/${ISSUE_NUM}"
|
|
235
|
+
ITEM_ID=$(gh project item-add 1 --owner RapierCraft --url "$ISSUE_URL" --format json --jq '.id' 2>/dev/null)
|
|
236
|
+
if [ -n "$ITEM_ID" ]; then
|
|
237
|
+
gh project item-edit --project-id PVT_kwHOCx3gR84BSK2L --id "$ITEM_ID" --field-id PVTSSF_lAHOCx3gR84BSK2Lzg_yF6E --single-select-option-id f75ad846 2>/dev/null || true # Status=Todo
|
|
238
|
+
gh project item-edit --project-id PVT_kwHOCx3gR84BSK2L --id "$ITEM_ID" --field-id PVTSSF_lAHOCx3gR84BSK2Lzg_yF98 --single-select-option-id c0c37d33 2>/dev/null || true # Lane=Sync
|
|
239
|
+
gh project item-edit --project-id PVT_kwHOCx3gR84BSK2L --id "$ITEM_ID" --field-id PVTSSF_lAHOCx3gR84BSK2Lzg_yF-o --single-select-option-id {COMPONENT_OPTION_ID} 2>/dev/null || true # Component (MCP Server/n8n Node/Python SDK/Node SDK)
|
|
240
|
+
gh project item-edit --project-id PVT_kwHOCx3gR84BSK2L --id "$ITEM_ID" --field-id PVTSSF_lAHOCx3gR84BSK2Lzg_yF8o --single-select-option-id 4d95eef3 2>/dev/null || true # Priority=P2
|
|
241
|
+
fi
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Report created issues:
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
## Ecosystem Sync: {N} issues created
|
|
248
|
+
|
|
249
|
+
| # | Repo | Issue | Priority |
|
|
250
|
+
|---|------|-------|----------|
|
|
251
|
+
| mcp:#5 | alterlab-mcp-server | Add cookies to scrape tool | P2 |
|
|
252
|
+
| n8n:#12 | n8n-nodes-alterlab | Add cookies to Scrape op | P2 |
|
|
253
|
+
| #2100 | AlterLab (SDK) | Add cookies to Node SDK | P2 |
|
|
254
|
+
|
|
255
|
+
Run `/orchestrate mcp:5 n8n:12 #2100` to implement all sync issues in parallel.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Phase 4: Version Bump Tracking
|
|
261
|
+
|
|
262
|
+
If the API change warrants a version bump in satellite packages:
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
### Version Bumps Needed
|
|
266
|
+
|
|
267
|
+
| Package | Current | Suggested | Reason |
|
|
268
|
+
|---------|---------|-----------|--------|
|
|
269
|
+
| alterlab (PyPI) | 2.0.1 | 2.1.0 | New `cookies` parameter |
|
|
270
|
+
| @alterlab/sdk (npm) | 2.0.1 | 2.1.0 | New `cookies` parameter |
|
|
271
|
+
| alterlab-mcp-server (npm) | 1.0.0 | 1.1.0 | New scrape tool param |
|
|
272
|
+
| n8n-nodes-alterlab (npm) | 0.5.0 | 0.6.0 | New Scrape field |
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Include version bump instructions in the created issues.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Phase 5: Publication Status Check
|
|
280
|
+
|
|
281
|
+
**Run this phase for ALL inputs** (`check`, `auto`, `status`, `publish`). This is the critical gap — code being merged to `main` is NOT the same as being published to npm/PyPI.
|
|
282
|
+
|
|
283
|
+
### 5A: Collect current versions (code vs published)
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
echo "=== MCP Server ==="
|
|
287
|
+
# Version in code (on main):
|
|
288
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab-mcp-server && git fetch origin main 2>/dev/null
|
|
289
|
+
MCP_CODE_VERSION=$(git show origin/main:package.json | grep '"version"' | head -1 | grep -oP '\d+\.\d+\.\d+')
|
|
290
|
+
echo "Code version: $MCP_CODE_VERSION"
|
|
291
|
+
# Latest GitHub release:
|
|
292
|
+
MCP_RELEASE=$(gh release list -R RapierCraft/alterlab-mcp-server --limit 1 --json tagName,publishedAt --jq '.[0] | "\(.tagName) (\(.publishedAt))"' 2>/dev/null)
|
|
293
|
+
echo "Latest release: $MCP_RELEASE"
|
|
294
|
+
# Commits since last release tag:
|
|
295
|
+
MCP_RELEASE_TAG=$(gh release list -R RapierCraft/alterlab-mcp-server --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null)
|
|
296
|
+
MCP_COMMITS_SINCE=$(git rev-list ${MCP_RELEASE_TAG}..origin/main --count 2>/dev/null || echo "unknown")
|
|
297
|
+
echo "Commits since release: $MCP_COMMITS_SINCE"
|
|
298
|
+
|
|
299
|
+
echo "=== n8n Node ==="
|
|
300
|
+
cd /home/mrdubey/projects/ScraperAPI/n8n-nodes-alterlab && git fetch origin main 2>/dev/null
|
|
301
|
+
N8N_CODE_VERSION=$(git show origin/main:package.json | grep '"version"' | head -1 | grep -oP '\d+\.\d+\.\d+')
|
|
302
|
+
echo "Code version: $N8N_CODE_VERSION"
|
|
303
|
+
N8N_RELEASE=$(gh release list -R RapierCraft/n8n-nodes-alterlab --limit 1 --json tagName,publishedAt --jq '.[0] | "\(.tagName) (\(.publishedAt))"' 2>/dev/null)
|
|
304
|
+
echo "Latest release: $N8N_RELEASE"
|
|
305
|
+
N8N_RELEASE_TAG=$(gh release list -R RapierCraft/n8n-nodes-alterlab --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null)
|
|
306
|
+
N8N_COMMITS_SINCE=$(git rev-list ${N8N_RELEASE_TAG}..origin/main --count 2>/dev/null || echo "unknown")
|
|
307
|
+
echo "Commits since release: $N8N_COMMITS_SINCE"
|
|
308
|
+
|
|
309
|
+
echo "=== Python SDK ==="
|
|
310
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab && git fetch origin main 2>/dev/null
|
|
311
|
+
PY_CODE_VERSION=$(git show origin/main:sdk/python/pyproject.toml | grep '^version' | grep -oP '\d+\.\d+\.\d+')
|
|
312
|
+
echo "Code version: $PY_CODE_VERSION"
|
|
313
|
+
# Last publish-sdks workflow run:
|
|
314
|
+
PY_LAST_PUBLISH=$(gh run list --workflow=publish-sdks.yml --status=success --limit 1 --json createdAt,headBranch --jq '.[0] | "\(.headBranch) (\(.createdAt))"' 2>/dev/null)
|
|
315
|
+
echo "Last SDK publish: $PY_LAST_PUBLISH"
|
|
316
|
+
|
|
317
|
+
echo "=== Node SDK ==="
|
|
318
|
+
NODE_CODE_VERSION=$(git show origin/main:sdk/node/package.json | grep '"version"' | head -1 | grep -oP '\d+\.\d+\.\d+')
|
|
319
|
+
echo "Code version: $NODE_CODE_VERSION"
|
|
320
|
+
echo "Last SDK publish: $PY_LAST_PUBLISH" # Same workflow handles both
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### 5B: Determine what needs publishing
|
|
324
|
+
|
|
325
|
+
A component needs publishing when ANY of these are true:
|
|
326
|
+
- Commits exist on `main` after the last release tag (for satellite repos)
|
|
327
|
+
- The version in code is newer than the last published version
|
|
328
|
+
- The last `publish-sdks.yml` run predates commits that changed `sdk/python/` or `sdk/node/`
|
|
329
|
+
|
|
330
|
+
### 5C: Report publication status
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
## Publication Status
|
|
334
|
+
|
|
335
|
+
| Component | Code Version | Published Version | Commits Behind | Status |
|
|
336
|
+
|-----------|-------------|-------------------|----------------|--------|
|
|
337
|
+
| MCP Server (npm) | {MCP_CODE_VERSION} | {MCP_RELEASE_TAG} | {N} commits | {PUBLISHED / STALE} |
|
|
338
|
+
| n8n Node (npm) | {N8N_CODE_VERSION} | {N8N_RELEASE_TAG} | {N} commits | {PUBLISHED / STALE} |
|
|
339
|
+
| Python SDK (PyPI) | {PY_CODE_VERSION} | last publish: {date} | — | {PUBLISHED / STALE} |
|
|
340
|
+
| Node SDK (npm) | {NODE_CODE_VERSION} | last publish: {date} | — | {PUBLISHED / STALE} |
|
|
341
|
+
|
|
342
|
+
{If any STALE:}
|
|
343
|
+
Run `/sync-ecosystem publish` to bump versions and publish all stale components.
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Phase 6: Publish Releases
|
|
349
|
+
|
|
350
|
+
**Only run when input is `publish` (or `publish <component>`).** This phase bumps versions, creates releases, and triggers publish workflows.
|
|
351
|
+
|
|
352
|
+
**IMPORTANT**: Always confirm with the user before publishing. Show the Phase 5 status table and ask: "These components will be published. Proceed?"
|
|
353
|
+
|
|
354
|
+
### 6A: Determine version bumps
|
|
355
|
+
|
|
356
|
+
For each stale component, determine the appropriate semver bump:
|
|
357
|
+
|
|
358
|
+
| Change Type | Bump | Example |
|
|
359
|
+
|------------|------|---------|
|
|
360
|
+
| New parameter/field (additive) | MINOR | 1.2.0 → 1.3.0 |
|
|
361
|
+
| Bug fix, formatting, internal | PATCH | 1.2.0 → 1.2.1 |
|
|
362
|
+
| Breaking change (removed/renamed field) | MAJOR | 1.2.0 → 2.0.0 |
|
|
363
|
+
|
|
364
|
+
Read the commit log since the last release to determine the bump type:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
# For MCP server:
|
|
368
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab-mcp-server
|
|
369
|
+
git log ${MCP_RELEASE_TAG}..origin/main --oneline --no-merges
|
|
370
|
+
# Look for feat: (MINOR), fix: (PATCH), or BREAKING CHANGE (MAJOR)
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### 6B: Publish satellite repos (MCP Server, n8n Node)
|
|
374
|
+
|
|
375
|
+
For each satellite repo that needs publishing:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
cd {REPO_PATH}
|
|
379
|
+
|
|
380
|
+
# 1. Pull latest main
|
|
381
|
+
git checkout main && git pull origin main
|
|
382
|
+
|
|
383
|
+
# 2. Bump version in package.json
|
|
384
|
+
# Use npm version which updates package.json AND creates a git tag
|
|
385
|
+
npm version {minor|patch|major} --no-git-tag-version
|
|
386
|
+
|
|
387
|
+
# 3. Commit the version bump
|
|
388
|
+
NEW_VERSION=$(grep '"version"' package.json | grep -oP '\d+\.\d+\.\d+')
|
|
389
|
+
git add package.json package-lock.json
|
|
390
|
+
git commit -m "chore: bump version to ${NEW_VERSION}"
|
|
391
|
+
git push origin main
|
|
392
|
+
|
|
393
|
+
# 4. Create GitHub Release (triggers publish-npm.yml automatically)
|
|
394
|
+
gh release create "v${NEW_VERSION}" \
|
|
395
|
+
--repo {GH_REPO} \
|
|
396
|
+
--title "v${NEW_VERSION}" \
|
|
397
|
+
--generate-notes \
|
|
398
|
+
--target main
|
|
399
|
+
|
|
400
|
+
# 5. Verify publish workflow started
|
|
401
|
+
sleep 5
|
|
402
|
+
gh run list --repo {GH_REPO} --workflow={PUBLISH_WORKFLOW} --limit 1 --json status,conclusion
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**MCP Server specific**: The `publish-mcp-registry.yml` also fires on release — it publishes to the MCP Registry alongside npm. No extra action needed.
|
|
406
|
+
|
|
407
|
+
### 6C: Publish SDKs (Python + Node)
|
|
408
|
+
|
|
409
|
+
SDKs live in the AlterLab monorepo and use a `workflow_dispatch` workflow:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab
|
|
413
|
+
|
|
414
|
+
# 1. Check if SDK versions need bumping (compare code version to last publish)
|
|
415
|
+
PY_VERSION=$(git show origin/main:sdk/python/pyproject.toml | grep '^version' | grep -oP '\d+\.\d+\.\d+')
|
|
416
|
+
NODE_VERSION=$(git show origin/main:sdk/node/package.json | grep '"version"' | head -1 | grep -oP '\d+\.\d+\.\d+')
|
|
417
|
+
|
|
418
|
+
# 2. If versions already bumped in code, just trigger the publish
|
|
419
|
+
# If versions need bumping, create a worktree, bump, commit, push, then trigger
|
|
420
|
+
|
|
421
|
+
# 3. Trigger publish workflow
|
|
422
|
+
gh workflow run publish-sdks.yml --ref main -f sdk=both
|
|
423
|
+
|
|
424
|
+
# 4. Verify workflow started
|
|
425
|
+
sleep 5
|
|
426
|
+
gh run list --workflow=publish-sdks.yml --limit 1 --json status,conclusion,createdAt
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**If SDK versions need bumping** (code version matches last published version but code has changed):
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
# Create worktree for version bump
|
|
433
|
+
cd /home/mrdubey/projects/ScraperAPI/alterlab
|
|
434
|
+
git worktree add ../alterlab-sdk-bump -b fix/sdk-version-bump origin/main
|
|
435
|
+
cd ../alterlab-sdk-bump
|
|
436
|
+
|
|
437
|
+
# Bump Python SDK version
|
|
438
|
+
# Edit sdk/python/pyproject.toml: version = "{NEW_VERSION}"
|
|
439
|
+
|
|
440
|
+
# Bump Node SDK version
|
|
441
|
+
cd sdk/node && npm version {minor|patch} --no-git-tag-version && cd ../..
|
|
442
|
+
|
|
443
|
+
# Commit and push
|
|
444
|
+
git add sdk/python/pyproject.toml sdk/node/package.json sdk/node/package-lock.json
|
|
445
|
+
git commit -m "chore(sdk): bump Python SDK to {PY_NEW} and Node SDK to {NODE_NEW}"
|
|
446
|
+
git push origin fix/sdk-version-bump
|
|
447
|
+
|
|
448
|
+
# Create PR to staging (fast-lane), merge, then trigger publish from main after deploy
|
|
449
|
+
gh pr create --base staging --title "chore: bump SDK versions" --body "Version bump for SDK publish"
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### 6D: Monitor publish workflows
|
|
453
|
+
|
|
454
|
+
After triggering publishes, monitor completion:
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
echo "=== Publish Status ==="
|
|
458
|
+
|
|
459
|
+
# MCP Server
|
|
460
|
+
echo "MCP Server:"
|
|
461
|
+
gh run list --repo RapierCraft/alterlab-mcp-server --workflow=publish-npm.yml --limit 1 --json status,conclusion,createdAt --jq '.[0]'
|
|
462
|
+
gh run list --repo RapierCraft/alterlab-mcp-server --workflow=publish-mcp-registry.yml --limit 1 --json status,conclusion,createdAt --jq '.[0]'
|
|
463
|
+
|
|
464
|
+
# n8n Node
|
|
465
|
+
echo "n8n Node:"
|
|
466
|
+
gh run list --repo RapierCraft/n8n-nodes-alterlab --workflow=publish.yml --limit 1 --json status,conclusion,createdAt --jq '.[0]'
|
|
467
|
+
|
|
468
|
+
# SDKs
|
|
469
|
+
echo "SDKs:"
|
|
470
|
+
gh run list --workflow=publish-sdks.yml --limit 1 --json status,conclusion,createdAt --jq '.[0]'
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### 6E: Generate changelog for releases
|
|
474
|
+
|
|
475
|
+
When creating GitHub releases, generate notes from commits since the last tag:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
# Collect commit messages since last release
|
|
479
|
+
cd {REPO_PATH}
|
|
480
|
+
CHANGES=$(git log ${LAST_TAG}..origin/main --oneline --no-merges | sed 's/^/- /')
|
|
481
|
+
|
|
482
|
+
# Create release body
|
|
483
|
+
cat <<EOF
|
|
484
|
+
## Changes
|
|
485
|
+
|
|
486
|
+
$CHANGES
|
|
487
|
+
|
|
488
|
+
## Ecosystem Sync
|
|
489
|
+
|
|
490
|
+
This release brings parity with AlterLab API changes from the following PRs:
|
|
491
|
+
{list of source AlterLab PRs that drove these changes}
|
|
492
|
+
EOF
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### 6F: Report publish results
|
|
496
|
+
|
|
497
|
+
```
|
|
498
|
+
## Publish Results
|
|
499
|
+
|
|
500
|
+
| Component | Old Version | New Version | Status | Registry |
|
|
501
|
+
|-----------|------------|-------------|--------|----------|
|
|
502
|
+
| MCP Server | v1.2.0 | v1.3.0 | Published | npm + MCP Registry |
|
|
503
|
+
| n8n Node | v0.8.0 | v0.9.0 | Published | npm |
|
|
504
|
+
| Python SDK | 2.1.0 | 2.1.1 | Published | PyPI |
|
|
505
|
+
| Node SDK | 2.1.0 | 2.1.1 | Published | npm |
|
|
506
|
+
|
|
507
|
+
### Verification
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# Verify packages are live on registries:
|
|
511
|
+
npm view alterlab-mcp-server version
|
|
512
|
+
npm view n8n-nodes-alterlab version
|
|
513
|
+
npm view @alterlab/sdk version
|
|
514
|
+
pip index versions alterlab 2>/dev/null || pip install alterlab== 2>&1 | grep -oP '\d+\.\d+\.\d+'
|
|
515
|
+
```
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## Error Handling
|
|
521
|
+
|
|
522
|
+
- **No API changes detected**: Report "No API surface changes found in recent PRs. Ecosystem is in sync." — but STILL run Phase 5 to check publication status.
|
|
523
|
+
- **Repo not accessible**: Skip and warn (e.g., "Could not access RapierCraft/n8n-nodes-alterlab — check gh auth")
|
|
524
|
+
- **Duplicate issues**: Check for existing open issues with "Sync:" prefix before creating new ones
|
|
525
|
+
- **Publish workflow fails**: Report the failure, link to the workflow run, suggest manual investigation. Do NOT retry automatically.
|
|
526
|
+
- **Version conflict on npm/PyPI**: The version already exists on the registry. Bump to the next version and retry.
|
|
527
|
+
- **OIDC publish fails**: Check that the repo has npm/PyPI trusted publishing configured. See workflow files for required permissions.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Independently verify if a reported issue is actually a problem before making code changes
|
|
3
|
+
argument-hint: [issue description or #number]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /validate — Independent Issue Verification
|
|
7
|
+
|
|
8
|
+
**Input**: $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
Verify whether a reported issue is real before anyone writes code. This command exists for reports that come from outside the pipeline — user complaints, DevOps alerts, monitoring triggers, gut feelings. It is the checkpoint before creating a GitHub issue.
|
|
11
|
+
|
|
12
|
+
**Agent model policy**: Default `model: "sonnet"`. If Sonnet is rate-limited, fall back to `model: "opus"`.
|
|
13
|
+
|
|
14
|
+
**Output**: A verdict (CONFIRMED / NOT A PROBLEM / NEEDS MORE DATA) with evidence.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step 1: Parse the claim
|
|
19
|
+
|
|
20
|
+
Restate in one sentence: what exactly is being claimed?
|
|
21
|
+
What would prove it? What would disprove it?
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Step 2: Gather evidence (parallel)
|
|
26
|
+
|
|
27
|
+
Launch 2-3 agents based on what's relevant. Not every issue needs all of these.
|
|
28
|
+
|
|
29
|
+
**Agent A — Code Analysis** (always):
|
|
30
|
+
```
|
|
31
|
+
Search the codebase for all code related to [CLAIM].
|
|
32
|
+
- Find the exact file:line where the alleged issue would exist
|
|
33
|
+
- Read the full function/module, not just the line
|
|
34
|
+
- Trace the code path end-to-end
|
|
35
|
+
- Check: does the code actually do what the report claims?
|
|
36
|
+
- Check git log: was this area recently changed?
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Agent B — Production Evidence** (if production issue):
|
|
40
|
+
```
|
|
41
|
+
Use MCP tools to check production:
|
|
42
|
+
- get_production_logs(service="[service]", lines=200)
|
|
43
|
+
- get_production_status()
|
|
44
|
+
- run_production_health_check()
|
|
45
|
+
Look for: actual error messages, frequency, affected users, timestamps.
|
|
46
|
+
Quantify: how often, how many users, since when.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Agent C — Reproduction** (if reproducible locally):
|
|
50
|
+
```
|
|
51
|
+
Try to reproduce the issue locally:
|
|
52
|
+
- Set up the scenario described in the report
|
|
53
|
+
- Execute the failing path
|
|
54
|
+
- Document: did it fail? How? What error?
|
|
55
|
+
If it doesn't reproduce: that's important data.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Step 3: Synthesize
|
|
61
|
+
|
|
62
|
+
Cross-reference all findings:
|
|
63
|
+
1. Does the code actually have the reported problem?
|
|
64
|
+
2. Does production data confirm it's happening?
|
|
65
|
+
3. Could it be reproduced?
|
|
66
|
+
4. Are there contradictions?
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Step 4: Verdict
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
VALIDATION VERDICT: [CONFIRMED | NOT A PROBLEM | NEEDS MORE DATA]
|
|
74
|
+
Confidence: [High 90%+ | Medium 70-89% | Low <70%]
|
|
75
|
+
|
|
76
|
+
What was claimed: [one sentence]
|
|
77
|
+
What we found: [one sentence — may differ from claim]
|
|
78
|
+
|
|
79
|
+
Evidence:
|
|
80
|
+
- [source]: [finding]
|
|
81
|
+
- [source]: [finding]
|
|
82
|
+
|
|
83
|
+
Impact: [quantified — N users, X% of requests, $Y revenue]
|
|
84
|
+
Priority: [P0-P3 or NO ACTION]
|
|
85
|
+
|
|
86
|
+
If CONFIRMED — recommended next step:
|
|
87
|
+
File: [path:line]
|
|
88
|
+
Root cause: [one sentence]
|
|
89
|
+
Fix approach: [one sentence]
|
|
90
|
+
Create issue:
|
|
91
|
+
```bash
|
|
92
|
+
gh issue create --title "fix: [concise description of the confirmed bug]" \
|
|
93
|
+
--label "[priority],[bug|enhancement]" \
|
|
94
|
+
--body "$(cat <<'BODY_EOF'
|
|
95
|
+
## Problem
|
|
96
|
+
|
|
97
|
+
[1-3 sentences: what the validation confirmed is wrong. Specific and concrete.]
|
|
98
|
+
|
|
99
|
+
## Root Cause (if known)
|
|
100
|
+
|
|
101
|
+
[path:line] — [one sentence: why the bug occurs mechanically]
|
|
102
|
+
|
|
103
|
+
## Affected Files
|
|
104
|
+
|
|
105
|
+
Files that need changes:
|
|
106
|
+
1. `[filepath]` — [what needs to change]
|
|
107
|
+
2. `[filepath]` — [what needs to change]
|
|
108
|
+
|
|
109
|
+
## Acceptance Criteria
|
|
110
|
+
|
|
111
|
+
- [ ] [Specific, testable criterion]
|
|
112
|
+
- [ ] No regression in [related feature]
|
|
113
|
+
|
|
114
|
+
## Context
|
|
115
|
+
|
|
116
|
+
Validated by \`/validate\` on [DATE]. Confidence: [High|Medium|Low].
|
|
117
|
+
|
|
118
|
+
## Evidence
|
|
119
|
+
|
|
120
|
+
- [source]: [finding]
|
|
121
|
+
- [source]: [finding]
|
|
122
|
+
BODY_EOF
|
|
123
|
+
)"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If NOT A PROBLEM — why the report was wrong:
|
|
127
|
+
[explanation]
|
|
128
|
+
|
|
129
|
+
If NEEDS MORE DATA — what's missing:
|
|
130
|
+
[specific questions to answer]
|
|
131
|
+
```
|