@lifeaitools/rdc-skills 0.9.31 → 0.9.33

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 (59) hide show
  1. package/.claude-plugin/plugin.json +24 -2
  2. package/.github/workflows/self-test.yml +34 -34
  3. package/MANIFEST.md +4 -0
  4. package/commands/build.md +183 -183
  5. package/commands/collab.md +180 -180
  6. package/commands/deploy.md +152 -138
  7. package/commands/fixit.md +116 -104
  8. package/commands/handoff.md +173 -173
  9. package/commands/overnight.md +220 -220
  10. package/commands/plan.md +158 -158
  11. package/commands/preplan.md +131 -131
  12. package/commands/prototype.md +145 -145
  13. package/commands/report.md +99 -99
  14. package/commands/review.md +120 -120
  15. package/commands/status.md +86 -86
  16. package/commands/workitems.md +132 -127
  17. package/guides/agent-bootstrap.md +265 -206
  18. package/guides/agents/backend.md +104 -104
  19. package/guides/agents/content.md +94 -94
  20. package/guides/agents/cs2.md +56 -56
  21. package/guides/agents/data.md +87 -87
  22. package/guides/agents/design.md +77 -77
  23. package/guides/agents/frontend.md +92 -92
  24. package/guides/agents/infrastructure.md +81 -81
  25. package/guides/agents/setup.md +279 -279
  26. package/guides/agents/verify.md +119 -119
  27. package/guides/agents/viz.md +106 -106
  28. package/hooks/foreground-process-gate.js +109 -0
  29. package/hooks/hook-logger.js +25 -0
  30. package/hooks/run-hidden-hook.ps1 +47 -0
  31. package/hooks/work-item-exit-gate.js +297 -0
  32. package/package.json +3 -3
  33. package/rules/work-items-rpc.md +56 -7
  34. package/scripts/fixtures/guides/bad-guide.md +15 -0
  35. package/scripts/fixtures/guides-clean/good-guide.md +16 -0
  36. package/scripts/install-rdc-skills.js +53 -9
  37. package/scripts/install.ps1 +17 -11
  38. package/scripts/self-test.mjs +1323 -1113
  39. package/scripts/test-guide-validator.mjs +194 -0
  40. package/skills/build/SKILL.md +355 -355
  41. package/skills/co-develop/SKILL.md +182 -0
  42. package/skills/collab/SKILL.md +217 -217
  43. package/skills/deploy/SKILL.md +198 -152
  44. package/skills/design/SKILL.md +211 -211
  45. package/skills/fixit/SKILL.md +132 -122
  46. package/skills/handoff/SKILL.md +200 -200
  47. package/skills/help/SKILL.md +104 -102
  48. package/skills/overnight/SKILL.md +224 -224
  49. package/skills/plan/SKILL.md +252 -251
  50. package/skills/preplan/SKILL.md +86 -86
  51. package/skills/prototype/SKILL.md +150 -150
  52. package/skills/release/SKILL.md +342 -342
  53. package/skills/report/SKILL.md +100 -100
  54. package/skills/review/SKILL.md +121 -120
  55. package/skills/self-test/SKILL.md +126 -126
  56. package/skills/status/SKILL.md +99 -97
  57. package/skills/terminal-config/SKILL.md +18 -18
  58. package/skills/watch/SKILL.md +91 -91
  59. package/skills/workitems/SKILL.md +151 -146
@@ -1,342 +1,342 @@
1
- ---
2
- name: rdc:release
3
- description: "Promote develop→main and deploy to production for any LIFEAI repo (clauth, rdc-skills, regen-root, etc.), or promote a staged app with rdc:release promote <slug>. Requires dev verification first."
4
- ---
5
-
6
- > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
7
- > Checklist-only output. No tool-call narration. No raw git/npm/CI dumps.
8
- > One checklist upfront, updated in place, shown again at end with 1-line verdict.
9
-
10
- > **Sandbox contract:** This skill honors `RDC_TEST=1` per `guides/agent-bootstrap.md` § RDC_TEST Sandbox Contract. Destructive external calls short-circuit under the flag — checklist runs, each destructive step echoes `[RDC_TEST] skipping <step>` instead of mutating state.
11
-
12
- # rdc:release — Atomic LIFEAI Release
13
-
14
- ## Purpose
15
-
16
- One skill. All repos. No confusion about which release path to use.
17
-
18
- When user says **"release"**, **"publish"**, **"promote"**, **"deploy to main"**, **"ship"**, or **"bump the version"** — this is the skill. Always. No exceptions.
19
-
20
- Dave has Bash access. He should never be asked to run commands. This skill runs the complete loop and shows one checklist + one verdict.
21
-
22
- ## When to Use
23
- - User says "release", "publish", "promote", "deploy to main", "ship", or "bump the version"
24
- - A package, plugin, or app needs to be versioned and pushed to its distribution channel
25
- - After landing significant changes that must be published (clauth, rdc-skills, regen-media, gws)
26
- - After develop is verified and staging passes — promoting to main
27
- - User says "promote studio", "release studio to production", "ship the app" — use `promote <slug>` mode
28
-
29
- **Never release autonomously.** This skill ONLY runs when the user explicitly invokes it. Never push to main on your own initiative.
30
-
31
- ## Arguments
32
-
33
- - `rdc:release <repo>` — patch bump (default), full loop
34
- - `rdc:release <repo> <version>` — explicit version (e.g. `1.6.0`)
35
- - `rdc:release <repo> --minor` | `--major` | `--patch` — semver bump
36
- - `rdc:release <repo> --dry-run` — show checklist and planned version, do nothing
37
- - `rdc:release promote <slug>` — promote a specific deployed app from staging → production
38
- - `rdc:release promote <slug> --dry-run` — show what would happen, do nothing
39
- - `rdc:release` (no args) — list known repos, ask which
40
-
41
- ## Known Repos — The Single Lookup Table
42
-
43
- Resolve `<repo>` here. If not in this table, ask Dave for source path + deploy mechanism before proceeding.
44
-
45
- | Repo | Type | Source path | Release mechanism | Post-release |
46
- |------|------|-------------|-------------------|--------------|
47
- | `clauth` | npm package | `C:/Dev/clauth` | bump + tag → GitHub Actions → npm publish | `npm install -g @lifeaitools/clauth@latest` → daemon restart |
48
- | `rdc-skills` | local install | `C:/Dev/rdc-skills` | bump + tag → `install.sh` | copy to `~/.claude/skills/user/` + project |
49
- | `regen-root` | monorepo | `C:/Dev/regen-root` | merge develop→main via GitHub PR → Coolify auto-deploys | run `rdc:deploy <affected-slug>` gate checks |
50
- | `regen-media` | MCP server (in monorepo) | `C:/Dev/regen-root/mcp-servers/regen-media` | part of regen-root release — use `rdc:release regen-root` | Coolify redeploys `regen-media-mcp` from main |
51
- | `gws` | MCP server (in monorepo) | `C:/Dev/regen-root/mcp-servers/gws` | part of regen-root release — use `rdc:release regen-root` | Coolify redeploys from main |
52
-
53
- > **MCP servers inside the monorepo** (`regen-media`, `gws`) are released as part of `regen-root`. Coolify watches main and auto-deploys each app by its `watch_paths`. Don't release them separately.
54
-
55
- ---
56
-
57
- ## Checklists
58
-
59
- ### Package release checklist (clauth, rdc-skills)
60
-
61
- ```
62
- rdc:release: <repo> vX.Y.Z → vA.B.C
63
- [ ] Source path resolved
64
- [ ] Working tree clean (git status)
65
- [ ] Current version detected (package.json)
66
- [ ] New version computed
67
- [ ] Dry-run gate (if --dry-run, stop here and print planned commands)
68
- [ ] package.json bumped
69
- [ ] Commit created
70
- [ ] Tag vA.B.C created + pushed
71
- [ ] CI completion event received via clauth channel (mcp__claude_ai_clauth__channel_list)
72
- [ ] CI concluded successfully (failure → pull logs via gh run view --log-failed)
73
- [ ] npm registry shows vA.B.C (npm view @lifeaitools/<repo> version)
74
- [ ] Local install executed
75
- [ ] Installed version verified
76
- [ ] Post-install action (daemon restart if clauth)
77
- [ ] Smoke test passed
78
- ✅ rdc:release <repo>: vA.B.C live
79
- ```
80
-
81
- ### App promote checklist (promote <slug>)
82
-
83
- This mode promotes a single deployed app. It does NOT push `git push origin main` directly — it uses the GitHub PR merge API, which bypasses the `block-main-push` hook by design. The hook blocks autonomous pushes; explicit promotion via this skill is authorized by the user invoking it.
84
-
85
- ```
86
- rdc:release promote: <slug> → <domain>
87
- [ ] Registry lookup (slug, coolify_uuid, domain, staging_slug, staging_domain, app_version)
88
- [ ] Staging health gate (HTTP 200 on staging_domain)
89
- [ ] Staging TLS valid
90
- [ ] develop branch clean and pushed
91
- [ ] Commits ahead of main: <N> commits
92
- [ ] Dry-run gate (if --dry-run, stop here and print planned commands)
93
- [ ] app package.json version bumped on develop
94
- [ ] Version bump committed + pushed to develop
95
- [ ] GitHub PR develop→main: created or located
96
- [ ] PR merged via GitHub API (merge method: merge)
97
- [ ] Coolify auto-deploy confirmed started (polling <slug> deployments)
98
- [ ] Deployment reached "finished" state
99
- [ ] Gate: HTTP 200 on <domain>
100
- [ ] Gate: TLS valid on <domain>
101
- [ ] deployment_registry updated (last_deploy_at, status='active')
102
- ✅ rdc:release promote <slug>: <domain> live
103
- ```
104
-
105
- ### Monorepo release checklist (regen-root)
106
-
107
- ```
108
- rdc:release: regen-root — develop → main
109
- [ ] Source path: C:/Dev/regen-root
110
- [ ] develop branch clean and pushed (git status + git push)
111
- [ ] Commits ahead of main summarised (git log main..develop --oneline)
112
- [ ] Dry-run gate (if --dry-run, stop here)
113
- [ ] Root package.json version bumped on develop
114
- [ ] Version bump committed + pushed to develop
115
- [ ] GitHub PR: develop → main created (or existing PR located)
116
- [ ] PR merged via GitHub API (merge method: merge)
117
- [ ] main pulled locally (git fetch origin main)
118
- [ ] Coolify auto-deploy confirmed in progress (poll deployment status)
119
- [ ] Affected apps gate-checked via rdc:deploy health probes
120
- [ ] deployment_registry updated (last_deploy_at)
121
- ✅ rdc:release regen-root: main promoted, Coolify deployed
122
- ```
123
-
124
- ---
125
-
126
- ## Execution Details
127
-
128
- > **Notification paths by repo type:**
129
- > - **Public repos** (rdc-skills, clauth): GitHub Actions POSTs to clauth channel on publish — wait for `mcp__claude_ai_clauth__channel_list` event, not a polling loop
130
- > - **Private repos** (regen-root): Coolify webhook is wired to Supabase — check `deployment_registry` for deploy completion, not the clauth channel
131
-
132
- ### Package repos (clauth, rdc-skills)
133
-
134
- #### 1. Version bump
135
- - Read `package.json`, parse `version`
136
- - Apply: patch (default), minor, major, or explicit
137
- - Rewrite all `version` fields (some packages have `claude.version` too)
138
-
139
- #### 2. Commit + tag + push
140
- ```bash
141
- cd <source_path>
142
- git add package.json
143
- git commit -m "chore(release): vA.B.C"
144
- git tag vA.B.C
145
- git push && git push --tags
146
- ```
147
- Never `--no-verify`. Never `--force`. Fix pre-commit hook failures at root cause.
148
-
149
- #### 3. Wait for CI via clauth channel (rdc-skills and clauth)
150
-
151
- Both repos have a GitHub Actions workflow that POSTs to `https://clauth.prtrust.fund/channel` on publish completion. **Do not poll `gh run list` in a loop.** Use the Monitor tool or check the channel:
152
-
153
- ```
154
- # Check clauth channel for the completion event:
155
- mcp__claude_ai_clauth__channel_list (since: <tag-push-timestamp>)
156
- # Wait for event with text containing "vA.B.C" and status "success" or "failure"
157
- # If no event after 10 min → fallback: gh run list --repo LIFEAI/<repo> --limit 3
158
- ```
159
-
160
- If the channel event shows failure, pull the run logs before proceeding:
161
- ```bash
162
- gh run view <databaseId> --repo LIFEAI/<repo> --log-failed
163
- ```
164
-
165
- #### 4. Verify npm registry
166
-
167
- ```bash
168
- npm view @lifeaitools/<repo> version # must equal vA.B.C
169
- ```
170
-
171
- Only run this after the channel event confirms success — don't poll npm independently.
172
-
173
- #### 5. Install
174
- - **clauth:** `npm install -g @lifeaitools/clauth@latest`
175
- - **rdc-skills:** `node C:/Dev/rdc-skills/scripts/install-rdc-skills.js`
176
- - If install script fails, fall back:
177
- `cp -r C:/Dev/rdc-skills/skills/* ~/.claude/plugins/cache/rdc-skills/rdc-skills/latest/skills/`
178
-
179
- #### 6. Verify
180
- - **clauth:** `curl -s http://127.0.0.1:52437/ping | python3 -c "import sys,json; print(json.load(sys.stdin)['app_version'])"` — must match vA.B.C
181
- - **rdc-skills:** `ls ~/.claude/skills/user/rdc-release/SKILL.md` — must exist
182
- - **npm:** `npm list -g --depth=0 @lifeaitools/clauth` — version matches
183
-
184
- #### 7. Post-install
185
- - **clauth:** `curl -s -X POST http://127.0.0.1:52437/restart` → wait 3s → ping again
186
- - **rdc-skills:** none
187
-
188
- #### 8. Smoke test
189
- - **clauth:** `curl -s http://127.0.0.1:52437/get/supabase-anon | python3 -c "import sys,json; print('ok' if json.load(sys.stdin).get('value') else 'fail')"` — expect `ok`
190
- - **rdc-skills:** read frontmatter of one new/updated SKILL.md — parse succeeds
191
-
192
- ---
193
-
194
- ### App promote (promote <slug>)
195
-
196
- #### 1. Registry lookup
197
- ```sql
198
- SELECT slug, display_name, domain, staging_slug, staging_domain, coolify_uuid, monorepo_path, environment
199
- FROM deployment_registry
200
- WHERE slug = '<slug>';
201
- ```
202
- If no `staging_slug` or `staging_domain`, ask Dave before proceeding — don't assume.
203
-
204
- #### 2. Staging health gate
205
- ```bash
206
- curl -s -o /dev/null -w "%{http_code}" https://<staging_domain>/
207
- # Must return 200. TLS must be valid (no -k flag).
208
- ```
209
- If staging is not healthy, STOP with `[!]` — don't promote a broken staging.
210
-
211
- #### 3. Git state check
212
- ```bash
213
- cd C:/Dev/regen-root
214
- git status # must be clean on develop
215
- git push origin develop
216
- git log origin/main..develop --oneline # show what's going to main
217
- ```
218
-
219
- #### 4. Version bump
220
- - Read `apps/<app>/package.json` (use `monorepo_path` from registry), parse `version`
221
- - Apply patch bump (default) or use explicit version if provided
222
- - Commit: `chore(release): <slug> vA.B.C`
223
- - Push to develop
224
-
225
- #### 5. GitHub PR merge
226
- ```
227
- # Check for existing open PR develop→main
228
- mcp__claude_ai_Github_Proxy_MCP__list_pull_requests (base: main, head: develop)
229
-
230
- # If none: create one
231
- mcp__claude_ai_Github_Proxy_MCP__create_pull_request (base: main, head: develop, title: "chore(release): <slug> vA.B.C")
232
-
233
- # Merge it
234
- mcp__claude_ai_Github_Proxy_MCP__merge_pull_request (merge_method: merge)
235
- ```
236
- **Note:** This uses the GitHub API — it does NOT run `git push origin main`. The `block-main-push` hook only blocks direct git push, not API merges.
237
-
238
- #### 6. Coolify deploy poll
239
- ```bash
240
- # Use clauth to get Coolify token, then poll the app's deployments
241
- # Wait for status = "finished" — poll every 15s, 15min timeout
242
- curl -s -H "Authorization: Bearer $COOLIFY_TOKEN" \
243
- "https://deploy.regendevcorp.com/api/v1/applications/<coolify_uuid>/deployments?per_page=1"
244
- ```
245
-
246
- #### 7. Gate checks
247
- ```bash
248
- curl -s -o /dev/null -w "%{http_code}" https://<domain>/ # must return 200
249
- curl -s -I https://<domain>/ | grep -i "strict-transport" # TLS
250
- ```
251
-
252
- #### 8. Update registry
253
- ```sql
254
- UPDATE deployment_registry SET last_deploy_at = now(), status = 'active' WHERE slug = '<slug>';
255
- ```
256
-
257
- ---
258
-
259
- ### Monorepo release (regen-root)
260
-
261
- #### 1. Git state check
262
- ```bash
263
- cd C:/Dev/regen-root
264
- git status # must be clean on develop
265
- git push origin develop # ensure latest is pushed
266
- git log origin/main..develop --oneline # summarise what's going to main
267
- ```
268
-
269
- #### 2. Bump root version on develop
270
- ```bash
271
- # Read current version from package.json, apply patch bump
272
- # Commit: "chore(release): vA.B.C — promote develop → main"
273
- git add package.json && git commit -m "chore(release): vA.B.C"
274
- git push origin develop
275
- ```
276
-
277
- #### 3. GitHub PR: develop → main
278
- - Check for open PR from develop→main: `gh pr list --repo LIFEAI/regen-root --base main --head develop`
279
- - If exists: use it. If not: create it via `mcp__claude_ai_Github_Proxy_MCP__create_pull_request`
280
- - Merge via `mcp__claude_ai_Github_Proxy_MCP__merge_pull_request` with `merge_method: merge`
281
-
282
- #### 4. Confirm Coolify auto-deploy
283
-
284
- regen-root is a **private repo**. Coolify's webhook is wired to Supabase — deployment events land there automatically. Do NOT poll the Coolify REST API in a loop. Check Supabase:
285
-
286
- ```sql
287
- -- Wait for the affected app's deployment to show status = 'finished'
288
- SELECT slug, last_deploy_at, status, notes
289
- FROM deployment_registry
290
- WHERE slug IN (<affected slugs>)
291
- ORDER BY last_deploy_at DESC;
292
- ```
293
-
294
- If the registry hasn't updated within 2 minutes of the PR merge, check Coolify directly:
295
- ```bash
296
- curl -s -H "Authorization: Bearer $(curl -s http://127.0.0.1:52437/v/coolify-api)" \
297
- "https://deploy.regendevcorp.com/api/v1/applications/<uuid>/deployments?per_page=1"
298
- ```
299
-
300
- #### 5. Gate checks
301
- For each affected app, verify: HTTP 200, TLS valid, container running.
302
- Use `rdc:deploy diagnose <slug>` for any that fail.
303
-
304
- #### 6. Update registry
305
- ```sql
306
- UPDATE deployment_registry SET last_deploy_at = now() WHERE slug IN (<affected slugs>);
307
- ```
308
-
309
- ---
310
-
311
- ## Failure Modes
312
-
313
- | Failure | Marker | Action |
314
- |---------|--------|--------|
315
- | Dirty working tree | `[!]` | Abort — show one-line diff summary, ask to commit or stash |
316
- | Pre-commit hook fails | `[!]` | Fix root cause, re-stage, retry — NEVER `--no-verify` |
317
- | CI fails | `[!]` | Print run URL + last 20 log lines |
318
- | npm not registered | `[!]` | Check CI actually published — not a silent skip |
319
- | PR merge blocked | `[!]` | Show blocker (branch protection, conflict) — resolve and retry |
320
- | Coolify deploy failed | `[!]` | Run `rdc:deploy diagnose <slug>` — fix before declaring done |
321
- | Gate non-200 | `[!]` | Don't update registry until fixed |
322
-
323
- Show full checklist with `[!]` markers even on failure.
324
-
325
- ---
326
-
327
- ## Hard Rules
328
-
329
- - **Never push directly to `main`** — always via GitHub PR merge (`mcp__claude_ai_Github_Proxy_MCP__merge_pull_request`)
330
- - **Never `--force`, never `--no-verify`, never `--no-gpg-sign`**
331
- - **Never declare success** without verified install or verified Coolify gate
332
- - **Never release without an explicit `rdc:release` invocation** from the user
333
- - **Monorepo MCP servers** (`regen-media`, `gws`) are released via `rdc:release regen-root` — not separately
334
-
335
- ---
336
-
337
- ## Related
338
-
339
- - `.claude/context/clauth.md` — clauth release source of truth
340
- - `.claude/context/coolify-deployment.md` — Coolify watch_paths, deploy rules
341
- - `memory/feedback_version_bump_must_tag.md` — never bump without tagging
342
- - `memory/feedback_use_rdc_release.md` — "promote/deploy to main" always triggers this skill
1
+ ---
2
+ name: rdc:release
3
+ description: "Usage `rdc:release [promote <slug>|rdc-skills|clauth]` — Promote develop→main and deploy to production for any LIFEAI repo (clauth, rdc-skills, regen-root, etc.), or promote a staged app with rdc:release promote <slug>. Requires dev verification first."
4
+ ---
5
+
6
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
7
+ > Checklist-only output. No tool-call narration. No raw git/npm/CI dumps.
8
+ > One checklist upfront, updated in place, shown again at end with 1-line verdict.
9
+
10
+ > **Sandbox contract:** This skill honors `RDC_TEST=1` per `guides/agent-bootstrap.md` § RDC_TEST Sandbox Contract. Destructive external calls short-circuit under the flag — checklist runs, each destructive step echoes `[RDC_TEST] skipping <step>` instead of mutating state.
11
+
12
+ # rdc:release — Atomic LIFEAI Release
13
+
14
+ ## Purpose
15
+
16
+ One skill. All repos. No confusion about which release path to use.
17
+
18
+ When user says **"release"**, **"publish"**, **"promote"**, **"deploy to main"**, **"ship"**, or **"bump the version"** — this is the skill. Always. No exceptions.
19
+
20
+ Dave has Bash access. He should never be asked to run commands. This skill runs the complete loop and shows one checklist + one verdict.
21
+
22
+ ## When to Use
23
+ - User says "release", "publish", "promote", "deploy to main", "ship", or "bump the version"
24
+ - A package, plugin, or app needs to be versioned and pushed to its distribution channel
25
+ - After landing significant changes that must be published (clauth, rdc-skills, regen-media, gws)
26
+ - After develop is verified and staging passes — promoting to main
27
+ - User says "promote studio", "release studio to production", "ship the app" — use `promote <slug>` mode
28
+
29
+ **Never release autonomously.** This skill ONLY runs when the user explicitly invokes it. Never push to main on your own initiative.
30
+
31
+ ## Arguments
32
+
33
+ - `rdc:release <repo>` — patch bump (default), full loop
34
+ - `rdc:release <repo> <version>` — explicit version (e.g. `1.6.0`)
35
+ - `rdc:release <repo> --minor` | `--major` | `--patch` — semver bump
36
+ - `rdc:release <repo> --dry-run` — show checklist and planned version, do nothing
37
+ - `rdc:release promote <slug>` — promote a specific deployed app from staging → production
38
+ - `rdc:release promote <slug> --dry-run` — show what would happen, do nothing
39
+ - `rdc:release` (no args) — list known repos, ask which
40
+
41
+ ## Known Repos — The Single Lookup Table
42
+
43
+ Resolve `<repo>` here. If not in this table, ask Dave for source path + deploy mechanism before proceeding.
44
+
45
+ | Repo | Type | Source path | Release mechanism | Post-release |
46
+ |------|------|-------------|-------------------|--------------|
47
+ | `clauth` | npm package | `C:/Dev/clauth` | bump + tag → GitHub Actions → npm publish | `npm install -g @lifeaitools/clauth@latest` → daemon restart |
48
+ | `rdc-skills` | local install | `C:/Dev/rdc-skills` | bump + tag → `install.sh` | copy to `~/.claude/skills/user/` + project |
49
+ | `regen-root` | monorepo | `C:/Dev/regen-root` | merge develop→main via GitHub PR → Coolify auto-deploys | run `rdc:deploy <affected-slug>` gate checks |
50
+ | `regen-media` | MCP server (in monorepo) | `C:/Dev/regen-root/mcp-servers/regen-media` | part of regen-root release — use `rdc:release regen-root` | Coolify redeploys `regen-media-mcp` from main |
51
+ | `gws` | MCP server (in monorepo) | `C:/Dev/regen-root/mcp-servers/gws` | part of regen-root release — use `rdc:release regen-root` | Coolify redeploys from main |
52
+
53
+ > **MCP servers inside the monorepo** (`regen-media`, `gws`) are released as part of `regen-root`. Coolify watches main and auto-deploys each app by its `watch_paths`. Don't release them separately.
54
+
55
+ ---
56
+
57
+ ## Checklists
58
+
59
+ ### Package release checklist (clauth, rdc-skills)
60
+
61
+ ```
62
+ rdc:release: <repo> vX.Y.Z → vA.B.C
63
+ [ ] Source path resolved
64
+ [ ] Working tree clean (git status)
65
+ [ ] Current version detected (package.json)
66
+ [ ] New version computed
67
+ [ ] Dry-run gate (if --dry-run, stop here and print planned commands)
68
+ [ ] package.json bumped
69
+ [ ] Commit created
70
+ [ ] Tag vA.B.C created + pushed
71
+ [ ] CI completion event received via clauth channel (mcp__claude_ai_clauth__channel_list)
72
+ [ ] CI concluded successfully (failure → pull logs via gh run view --log-failed)
73
+ [ ] npm registry shows vA.B.C (npm view @lifeaitools/<repo> version)
74
+ [ ] Local install executed
75
+ [ ] Installed version verified
76
+ [ ] Post-install action (daemon restart if clauth)
77
+ [ ] Smoke test passed
78
+ ✅ rdc:release <repo>: vA.B.C live
79
+ ```
80
+
81
+ ### App promote checklist (promote <slug>)
82
+
83
+ This mode promotes a single deployed app. It does NOT push `git push origin main` directly — it uses the GitHub PR merge API, which bypasses the `block-main-push` hook by design. The hook blocks autonomous pushes; explicit promotion via this skill is authorized by the user invoking it.
84
+
85
+ ```
86
+ rdc:release promote: <slug> → <domain>
87
+ [ ] Registry lookup (slug, coolify_uuid, domain, staging_slug, staging_domain, app_version)
88
+ [ ] Staging health gate (HTTP 200 on staging_domain)
89
+ [ ] Staging TLS valid
90
+ [ ] develop branch clean and pushed
91
+ [ ] Commits ahead of main: <N> commits
92
+ [ ] Dry-run gate (if --dry-run, stop here and print planned commands)
93
+ [ ] app package.json version bumped on develop
94
+ [ ] Version bump committed + pushed to develop
95
+ [ ] GitHub PR develop→main: created or located
96
+ [ ] PR merged via GitHub API (merge method: merge)
97
+ [ ] Coolify auto-deploy confirmed started (polling <slug> deployments)
98
+ [ ] Deployment reached "finished" state
99
+ [ ] Gate: HTTP 200 on <domain>
100
+ [ ] Gate: TLS valid on <domain>
101
+ [ ] deployment_registry updated (last_deploy_at, status='active')
102
+ ✅ rdc:release promote <slug>: <domain> live
103
+ ```
104
+
105
+ ### Monorepo release checklist (regen-root)
106
+
107
+ ```
108
+ rdc:release: regen-root — develop → main
109
+ [ ] Source path: C:/Dev/regen-root
110
+ [ ] develop branch clean and pushed (git status + git push)
111
+ [ ] Commits ahead of main summarised (git log main..develop --oneline)
112
+ [ ] Dry-run gate (if --dry-run, stop here)
113
+ [ ] Root package.json version bumped on develop
114
+ [ ] Version bump committed + pushed to develop
115
+ [ ] GitHub PR: develop → main created (or existing PR located)
116
+ [ ] PR merged via GitHub API (merge method: merge)
117
+ [ ] main pulled locally (git fetch origin main)
118
+ [ ] Coolify auto-deploy confirmed in progress (poll deployment status)
119
+ [ ] Affected apps gate-checked via rdc:deploy health probes
120
+ [ ] deployment_registry updated (last_deploy_at)
121
+ ✅ rdc:release regen-root: main promoted, Coolify deployed
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Execution Details
127
+
128
+ > **Notification paths by repo type:**
129
+ > - **Public repos** (rdc-skills, clauth): GitHub Actions POSTs to clauth channel on publish — wait for `mcp__claude_ai_clauth__channel_list` event, not a polling loop
130
+ > - **Private repos** (regen-root): Coolify webhook is wired to Supabase — check `deployment_registry` for deploy completion, not the clauth channel
131
+
132
+ ### Package repos (clauth, rdc-skills)
133
+
134
+ #### 1. Version bump
135
+ - Read `package.json`, parse `version`
136
+ - Apply: patch (default), minor, major, or explicit
137
+ - Rewrite all `version` fields (some packages have `claude.version` too)
138
+
139
+ #### 2. Commit + tag + push
140
+ ```bash
141
+ cd <source_path>
142
+ git add package.json
143
+ git commit -m "chore(release): vA.B.C"
144
+ git tag vA.B.C
145
+ git push && git push --tags
146
+ ```
147
+ Never `--no-verify`. Never `--force`. Fix pre-commit hook failures at root cause.
148
+
149
+ #### 3. Wait for CI via clauth channel (rdc-skills and clauth)
150
+
151
+ Both repos have a GitHub Actions workflow that POSTs to `https://clauth.prtrust.fund/channel` on publish completion. **Do not poll `gh run list` in a loop.** Use the Monitor tool or check the channel:
152
+
153
+ ```
154
+ # Check clauth channel for the completion event:
155
+ mcp__claude_ai_clauth__channel_list (since: <tag-push-timestamp>)
156
+ # Wait for event with text containing "vA.B.C" and status "success" or "failure"
157
+ # If no event after 10 min → fallback: gh run list --repo LIFEAI/<repo> --limit 3
158
+ ```
159
+
160
+ If the channel event shows failure, pull the run logs before proceeding:
161
+ ```bash
162
+ gh run view <databaseId> --repo LIFEAI/<repo> --log-failed
163
+ ```
164
+
165
+ #### 4. Verify npm registry
166
+
167
+ ```bash
168
+ npm view @lifeaitools/<repo> version # must equal vA.B.C
169
+ ```
170
+
171
+ Only run this after the channel event confirms success — don't poll npm independently.
172
+
173
+ #### 5. Install
174
+ - **clauth:** `npm install -g @lifeaitools/clauth@latest`
175
+ - **rdc-skills:** `node C:/Dev/rdc-skills/scripts/install-rdc-skills.js`
176
+ - If install script fails, fall back:
177
+ `cp -r C:/Dev/rdc-skills/skills/* ~/.claude/plugins/cache/rdc-skills/rdc-skills/latest/skills/`
178
+
179
+ #### 6. Verify
180
+ - **clauth:** `curl -s http://127.0.0.1:52437/ping | python3 -c "import sys,json; print(json.load(sys.stdin)['app_version'])"` — must match vA.B.C
181
+ - **rdc-skills:** `ls ~/.claude/skills/user/rdc-release/SKILL.md` — must exist
182
+ - **npm:** `npm list -g --depth=0 @lifeaitools/clauth` — version matches
183
+
184
+ #### 7. Post-install
185
+ - **clauth:** `curl -s -X POST http://127.0.0.1:52437/restart` → wait 3s → ping again
186
+ - **rdc-skills:** none
187
+
188
+ #### 8. Smoke test
189
+ - **clauth:** `curl -s http://127.0.0.1:52437/v/supabase-anon` expect a non-empty JWT string
190
+ - **rdc-skills:** read frontmatter of one new/updated SKILL.md — parse succeeds
191
+
192
+ ---
193
+
194
+ ### App promote (promote <slug>)
195
+
196
+ #### 1. Registry lookup
197
+ ```sql
198
+ SELECT slug, display_name, domain, staging_slug, staging_domain, coolify_uuid, monorepo_path, environment
199
+ FROM deployment_registry
200
+ WHERE slug = '<slug>';
201
+ ```
202
+ If no `staging_slug` or `staging_domain`, ask Dave before proceeding — don't assume.
203
+
204
+ #### 2. Staging health gate
205
+ ```bash
206
+ curl -s -o /dev/null -w "%{http_code}" https://<staging_domain>/
207
+ # Must return 200. TLS must be valid (no -k flag).
208
+ ```
209
+ If staging is not healthy, STOP with `[!]` — don't promote a broken staging.
210
+
211
+ #### 3. Git state check
212
+ ```bash
213
+ cd C:/Dev/regen-root
214
+ git status # must be clean on develop
215
+ git push origin develop
216
+ git log origin/main..develop --oneline # show what's going to main
217
+ ```
218
+
219
+ #### 4. Version bump
220
+ - Read `apps/<app>/package.json` (use `monorepo_path` from registry), parse `version`
221
+ - Apply patch bump (default) or use explicit version if provided
222
+ - Commit: `chore(release): <slug> vA.B.C`
223
+ - Push to develop
224
+
225
+ #### 5. GitHub PR merge
226
+ ```
227
+ # Check for existing open PR develop→main
228
+ mcp__claude_ai_Github_Proxy_MCP__list_pull_requests (base: main, head: develop)
229
+
230
+ # If none: create one
231
+ mcp__claude_ai_Github_Proxy_MCP__create_pull_request (base: main, head: develop, title: "chore(release): <slug> vA.B.C")
232
+
233
+ # Merge it
234
+ mcp__claude_ai_Github_Proxy_MCP__merge_pull_request (merge_method: merge)
235
+ ```
236
+ **Note:** This uses the GitHub API — it does NOT run `git push origin main`. The `block-main-push` hook only blocks direct git push, not API merges.
237
+
238
+ #### 6. Coolify deploy poll
239
+ ```bash
240
+ # Use clauth to get Coolify token, then poll the app's deployments
241
+ # Wait for status = "finished" — poll every 15s, 15min timeout
242
+ curl -s -H "Authorization: Bearer $COOLIFY_TOKEN" \
243
+ "https://deploy.regendevcorp.com/api/v1/applications/<coolify_uuid>/deployments?per_page=1"
244
+ ```
245
+
246
+ #### 7. Gate checks
247
+ ```bash
248
+ curl -s -o /dev/null -w "%{http_code}" https://<domain>/ # must return 200
249
+ curl -s -I https://<domain>/ | grep -i "strict-transport" # TLS
250
+ ```
251
+
252
+ #### 8. Update registry
253
+ ```sql
254
+ UPDATE deployment_registry SET last_deploy_at = now(), status = 'active' WHERE slug = '<slug>';
255
+ ```
256
+
257
+ ---
258
+
259
+ ### Monorepo release (regen-root)
260
+
261
+ #### 1. Git state check
262
+ ```bash
263
+ cd C:/Dev/regen-root
264
+ git status # must be clean on develop
265
+ git push origin develop # ensure latest is pushed
266
+ git log origin/main..develop --oneline # summarise what's going to main
267
+ ```
268
+
269
+ #### 2. Bump root version on develop
270
+ ```bash
271
+ # Read current version from package.json, apply patch bump
272
+ # Commit: "chore(release): vA.B.C — promote develop → main"
273
+ git add package.json && git commit -m "chore(release): vA.B.C"
274
+ git push origin develop
275
+ ```
276
+
277
+ #### 3. GitHub PR: develop → main
278
+ - Check for open PR from develop→main: `gh pr list --repo LIFEAI/regen-root --base main --head develop`
279
+ - If exists: use it. If not: create it via `mcp__claude_ai_Github_Proxy_MCP__create_pull_request`
280
+ - Merge via `mcp__claude_ai_Github_Proxy_MCP__merge_pull_request` with `merge_method: merge`
281
+
282
+ #### 4. Confirm Coolify auto-deploy
283
+
284
+ regen-root is a **private repo**. Coolify's webhook is wired to Supabase — deployment events land there automatically. Do NOT poll the Coolify REST API in a loop. Check Supabase:
285
+
286
+ ```sql
287
+ -- Wait for the affected app's deployment to show status = 'finished'
288
+ SELECT slug, last_deploy_at, status, notes
289
+ FROM deployment_registry
290
+ WHERE slug IN (<affected slugs>)
291
+ ORDER BY last_deploy_at DESC;
292
+ ```
293
+
294
+ If the registry hasn't updated within 2 minutes of the PR merge, check Coolify directly:
295
+ ```bash
296
+ curl -s -H "Authorization: Bearer $(curl -s http://127.0.0.1:52437/v/coolify-api)" \
297
+ "https://deploy.regendevcorp.com/api/v1/applications/<uuid>/deployments?per_page=1"
298
+ ```
299
+
300
+ #### 5. Gate checks
301
+ For each affected app, verify: HTTP 200, TLS valid, container running.
302
+ Use `rdc:deploy diagnose <slug>` for any that fail.
303
+
304
+ #### 6. Update registry
305
+ ```sql
306
+ UPDATE deployment_registry SET last_deploy_at = now() WHERE slug IN (<affected slugs>);
307
+ ```
308
+
309
+ ---
310
+
311
+ ## Failure Modes
312
+
313
+ | Failure | Marker | Action |
314
+ |---------|--------|--------|
315
+ | Dirty working tree | `[!]` | Abort — show one-line diff summary, ask to commit or stash |
316
+ | Pre-commit hook fails | `[!]` | Fix root cause, re-stage, retry — NEVER `--no-verify` |
317
+ | CI fails | `[!]` | Print run URL + last 20 log lines |
318
+ | npm not registered | `[!]` | Check CI actually published — not a silent skip |
319
+ | PR merge blocked | `[!]` | Show blocker (branch protection, conflict) — resolve and retry |
320
+ | Coolify deploy failed | `[!]` | Run `rdc:deploy diagnose <slug>` — fix before declaring done |
321
+ | Gate non-200 | `[!]` | Don't update registry until fixed |
322
+
323
+ Show full checklist with `[!]` markers even on failure.
324
+
325
+ ---
326
+
327
+ ## Hard Rules
328
+
329
+ - **Never push directly to `main`** — always via GitHub PR merge (`mcp__claude_ai_Github_Proxy_MCP__merge_pull_request`)
330
+ - **Never `--force`, never `--no-verify`, never `--no-gpg-sign`**
331
+ - **Never declare success** without verified install or verified Coolify gate
332
+ - **Never release without an explicit `rdc:release` invocation** from the user
333
+ - **Monorepo MCP servers** (`regen-media`, `gws`) are released via `rdc:release regen-root` — not separately
334
+
335
+ ---
336
+
337
+ ## Related
338
+
339
+ - `.claude/context/clauth.md` — clauth release source of truth
340
+ - `.claude/context/coolify-deployment.md` — Coolify watch_paths, deploy rules
341
+ - `memory/feedback_version_bump_must_tag.md` — never bump without tagging
342
+ - `memory/feedback_use_rdc_release.md` — "promote/deploy to main" always triggers this skill