@lifeaitools/rdc-skills 0.8.7

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 (97) hide show
  1. package/.claude/settings.json +15 -0
  2. package/.claude-plugin/marketplace.json +21 -0
  3. package/.claude-plugin/plugin.json +11 -0
  4. package/.github/workflows/publish.yml +25 -0
  5. package/.github/workflows/self-test.yml +53 -0
  6. package/CHANGELOG.md +246 -0
  7. package/LICENSE +21 -0
  8. package/MANIFEST.md +190 -0
  9. package/README.md +188 -0
  10. package/README.sandbox.md +3 -0
  11. package/assets/watcher/viewer.html +164 -0
  12. package/commands/build.md +183 -0
  13. package/commands/collab.md +180 -0
  14. package/commands/deploy.md +138 -0
  15. package/commands/fixit.md +112 -0
  16. package/commands/handoff.md +173 -0
  17. package/commands/help.md +88 -0
  18. package/commands/overnight.md +220 -0
  19. package/commands/plan.md +158 -0
  20. package/commands/preplan.md +131 -0
  21. package/commands/prototype.md +145 -0
  22. package/commands/release.md +159 -0
  23. package/commands/report.md +99 -0
  24. package/commands/review.md +120 -0
  25. package/commands/self-test.md +107 -0
  26. package/commands/status.md +86 -0
  27. package/commands/watch.md +92 -0
  28. package/commands/workitems.md +132 -0
  29. package/guides/.gitkeep +0 -0
  30. package/guides/agent-bootstrap.md +191 -0
  31. package/guides/agents/backend.md +104 -0
  32. package/guides/agents/content.md +94 -0
  33. package/guides/agents/cs2.md +56 -0
  34. package/guides/agents/data.md +87 -0
  35. package/guides/agents/design.md +77 -0
  36. package/guides/agents/frontend.md +92 -0
  37. package/guides/agents/infrastructure.md +81 -0
  38. package/guides/agents/setup.md +279 -0
  39. package/guides/agents/verify.md +132 -0
  40. package/guides/agents/viz.md +106 -0
  41. package/guides/backend.md +146 -0
  42. package/guides/content.md +147 -0
  43. package/guides/cs2.md +190 -0
  44. package/guides/data.md +123 -0
  45. package/guides/design.md +116 -0
  46. package/guides/frontend.md +151 -0
  47. package/guides/infrastructure.md +179 -0
  48. package/guides/output-contract.md +98 -0
  49. package/hooks/no-stop-open-epics.js +125 -0
  50. package/package.json +31 -0
  51. package/rules/work-items-rpc.md +399 -0
  52. package/scripts/install-rdc-skills.js +559 -0
  53. package/scripts/install.ps1 +165 -0
  54. package/scripts/install.sh +132 -0
  55. package/scripts/lib/assertions.mjs +264 -0
  56. package/scripts/lib/manifest-schema.mjs +607 -0
  57. package/scripts/lib/runner.mjs +429 -0
  58. package/scripts/lib/sandbox.mjs +435 -0
  59. package/scripts/self-test.mjs +1108 -0
  60. package/scripts/uninstall.ps1 +77 -0
  61. package/scripts/uninstall.sh +69 -0
  62. package/scripts/update.ps1 +43 -0
  63. package/scripts/update.sh +43 -0
  64. package/scripts/watch-init.mjs +100 -0
  65. package/skills/.gitkeep +0 -0
  66. package/skills/build/SKILL.md +238 -0
  67. package/skills/collab/SKILL.md +218 -0
  68. package/skills/deploy/SKILL.md +144 -0
  69. package/skills/fixit/SKILL.md +112 -0
  70. package/skills/handoff/SKILL.md +175 -0
  71. package/skills/help/SKILL.md +101 -0
  72. package/skills/overnight/SKILL.md +220 -0
  73. package/skills/plan/SKILL.md +96 -0
  74. package/skills/preplan/SKILL.md +87 -0
  75. package/skills/prototype/SKILL.md +151 -0
  76. package/skills/release/SKILL.md +221 -0
  77. package/skills/report/SKILL.md +101 -0
  78. package/skills/review/SKILL.md +120 -0
  79. package/skills/self-test/SKILL.md +127 -0
  80. package/skills/status/SKILL.md +86 -0
  81. package/skills/tests/README.md +29 -0
  82. package/skills/tests/rdc-build.test.json +22 -0
  83. package/skills/tests/rdc-deploy.test.json +15 -0
  84. package/skills/tests/rdc-fixit.test.json +21 -0
  85. package/skills/tests/rdc-handoff.test.json +14 -0
  86. package/skills/tests/rdc-overnight.test.json +21 -0
  87. package/skills/tests/rdc-plan.test.json +14 -0
  88. package/skills/tests/rdc-preplan.test.json +15 -0
  89. package/skills/tests/rdc-prototype.test.json +14 -0
  90. package/skills/tests/rdc-release.test.json +15 -0
  91. package/skills/tests/rdc-report.test.json +14 -0
  92. package/skills/tests/rdc-review.test.json +14 -0
  93. package/skills/tests/rdc-status.test.json +16 -0
  94. package/skills/tests/rdc-workitems.test.json +15 -0
  95. package/skills/watch/SKILL.md +92 -0
  96. package/skills/workitems/SKILL.md +147 -0
  97. package/tests/validate-skills.js +183 -0
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: rdc:release
3
+ description: >-
4
+ Atomic release for ANY LIFEAI repo. Usage `rdc:release <repo> [version]` — one skill, all repos. Known repos: clauth, rdc-skills, regen-root, regen-media, gws. Handles npm publish, monorepo develop→main promotion, and MCP server restarts. No user handoff.
5
+ ---
6
+
7
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
8
+ > Checklist-only output. No tool-call narration. No raw git/npm/CI dumps.
9
+ > One checklist upfront, updated in place, shown again at end with 1-line verdict.
10
+
11
+ > **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.
12
+
13
+ # rdc:release — Atomic LIFEAI Release
14
+
15
+ ## Purpose
16
+
17
+ One skill. All repos. No confusion about which release path to use.
18
+
19
+ When user says **"release"**, **"publish"**, **"promote"**, **"deploy to main"**, **"ship"**, or **"bump the version"** — this is the skill. Always. No exceptions.
20
+
21
+ Dave has Bash access. He should never be asked to run commands. This skill runs the complete loop and shows one checklist + one verdict.
22
+
23
+ ## When to Use
24
+ - User says "release", "publish", "promote", "deploy to main", "ship", or "bump the version"
25
+ - A package, plugin, or app needs to be versioned and pushed to its distribution channel
26
+ - After landing significant changes that must be published (clauth, rdc-skills, regen-media, gws)
27
+ - After develop is verified and staging passes — promoting to main
28
+
29
+ ## Arguments
30
+
31
+ - `rdc:release <repo>` — patch bump (default), full loop
32
+ - `rdc:release <repo> <version>` — explicit version (e.g. `1.6.0`)
33
+ - `rdc:release <repo> --minor` | `--major` | `--patch` — semver bump
34
+ - `rdc:release <repo> --dry-run` — show checklist and planned version, do nothing
35
+ - `rdc:release` (no args) — list known repos, ask which
36
+
37
+ ## Known Repos — The Single Lookup Table
38
+
39
+ Resolve `<repo>` here. If not in this table, ask Dave for source path + deploy mechanism before proceeding.
40
+
41
+ | Repo | Type | Source path | Release mechanism | Post-release |
42
+ |------|------|-------------|-------------------|--------------|
43
+ | `clauth` | npm package | `C:/Dev/clauth` | bump + tag → GitHub Actions → npm publish | `npm install -g @lifeaitools/clauth@latest` → daemon restart |
44
+ | `rdc-skills` | local install | `C:/Dev/rdc-skills` | bump + tag → `install.sh` | copy to `~/.claude/skills/user/` + project |
45
+ | `regen-root` | monorepo | `C:/Dev/regen-root` | merge develop→main via GitHub PR → Coolify auto-deploys | run `rdc:deploy <affected-slug>` gate checks |
46
+ | `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 |
47
+ | `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 |
48
+
49
+ > **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.
50
+
51
+ ---
52
+
53
+ ## Checklists
54
+
55
+ ### Package release checklist (clauth, rdc-skills)
56
+
57
+ ```
58
+ rdc:release: <repo> vX.Y.Z → vA.B.C
59
+ [ ] Source path resolved
60
+ [ ] Working tree clean (git status)
61
+ [ ] Current version detected (package.json)
62
+ [ ] New version computed
63
+ [ ] Dry-run gate (if --dry-run, stop here and print planned commands)
64
+ [ ] package.json bumped
65
+ [ ] Commit created
66
+ [ ] Tag vA.B.C created + pushed
67
+ [ ] CI run located (gh run list)
68
+ [ ] CI completed successfully (poll 20s, 10min timeout)
69
+ [ ] npm registry shows vA.B.C (if npm — poll 15s, 3min timeout)
70
+ [ ] Local install executed
71
+ [ ] Installed version verified
72
+ [ ] Post-install action (daemon restart if clauth)
73
+ [ ] Smoke test passed
74
+ ✅ rdc:release <repo>: vA.B.C live
75
+ ```
76
+
77
+ ### Monorepo release checklist (regen-root)
78
+
79
+ ```
80
+ rdc:release: regen-root — develop → main
81
+ [ ] Source path: C:/Dev/regen-root
82
+ [ ] develop branch clean and pushed (git status + git push)
83
+ [ ] Commits ahead of main summarised (git log main..develop --oneline)
84
+ [ ] Dry-run gate (if --dry-run, stop here)
85
+ [ ] Root package.json version bumped on develop
86
+ [ ] Version bump committed + pushed to develop
87
+ [ ] GitHub PR: develop → main created (or existing PR located)
88
+ [ ] PR merged via GitHub API (merge method: merge)
89
+ [ ] main pulled locally (git fetch origin main)
90
+ [ ] Coolify auto-deploy confirmed in progress (poll deployment status)
91
+ [ ] Affected apps gate-checked via rdc:deploy health probes
92
+ [ ] deployment_registry updated (last_deploy_at)
93
+ ✅ rdc:release regen-root: main promoted, Coolify deployed
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Execution Details
99
+
100
+ ### Package repos (clauth, rdc-skills)
101
+
102
+ #### 1. Version bump
103
+ - Read `package.json`, parse `version`
104
+ - Apply: patch (default), minor, major, or explicit
105
+ - Rewrite all `version` fields (some packages have `claude.version` too)
106
+
107
+ #### 2. Commit + tag + push
108
+ ```bash
109
+ cd <source_path>
110
+ git add package.json
111
+ git commit -m "chore(release): vA.B.C"
112
+ git tag vA.B.C
113
+ git push && git push --tags
114
+ ```
115
+ Never `--no-verify`. Never `--force`. Fix pre-commit hook failures at root cause.
116
+
117
+ #### 3. CI poll (clauth only — GitHub Actions publishes to npm)
118
+ ```bash
119
+ gh run list --repo LIFEAI/clauth --limit 5 --json status,conclusion,headBranch,databaseId
120
+ # Poll every 20s until conclusion ∈ {success, failure, cancelled} — 10min timeout
121
+ ```
122
+
123
+ #### 4. npm poll (clauth only)
124
+ ```bash
125
+ npm view @lifeaitools/clauth version
126
+ # Poll every 15s until new version appears — 3min timeout
127
+ ```
128
+
129
+ #### 5. Install
130
+ - **clauth:** `npm install -g @lifeaitools/clauth@latest`
131
+ - **rdc-skills:** `bash C:/Dev/rdc-skills/scripts/install.sh`
132
+ - If only 1 file copied (known installer bug), fall back:
133
+ `cp C:/Dev/rdc-skills/skills/**/*.md ~/.claude/skills/user/ && cp C:/Dev/rdc-skills/skills/**/*.md C:/Dev/regen-root/.claude/skills/user/`
134
+
135
+ #### 6. Verify
136
+ - **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
137
+ - **rdc-skills:** `ls ~/.claude/skills/user/rdc-release/SKILL.md` — must exist
138
+ - **npm:** `npm list -g --depth=0 @lifeaitools/clauth` — version matches
139
+
140
+ #### 7. Post-install
141
+ - **clauth:** `curl -s -X POST http://127.0.0.1:52437/restart` → wait 3s → ping again
142
+ - **rdc-skills:** none
143
+
144
+ #### 8. Smoke test
145
+ - **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`
146
+ - **rdc-skills:** read frontmatter of one new/updated SKILL.md — parse succeeds
147
+
148
+ ---
149
+
150
+ ### Monorepo release (regen-root)
151
+
152
+ #### 1. Git state check
153
+ ```bash
154
+ cd C:/Dev/regen-root
155
+ git status # must be clean on develop
156
+ git push origin develop # ensure latest is pushed
157
+ git log origin/main..develop --oneline # summarise what's going to main
158
+ ```
159
+
160
+ #### 2. Bump root version on develop
161
+ ```bash
162
+ # Read current version from package.json, apply patch bump
163
+ # Commit: "chore(release): vA.B.C — promote develop → main"
164
+ git add package.json && git commit -m "chore(release): vA.B.C"
165
+ git push origin develop
166
+ ```
167
+
168
+ #### 3. GitHub PR: develop → main
169
+ - Check for open PR from develop→main: `gh pr list --repo LIFEAI/regen-root --base main --head develop`
170
+ - If exists: use it. If not: create it via `mcp__claude_ai_Github_Proxy_MCP__create_pull_request`
171
+ - Merge via `mcp__claude_ai_Github_Proxy_MCP__merge_pull_request` with `merge_method: merge`
172
+
173
+ #### 4. Confirm Coolify auto-deploy
174
+ - Coolify watches `main` for all production apps
175
+ - Poll the deployment for each affected app (identified by which `watch_paths` match changed files)
176
+ - Use clauth daemon + Coolify REST to poll: `GET /api/v1/applications/<uuid>/deployments?per_page=1`
177
+ - Wait for `status = finished`
178
+
179
+ #### 5. Gate checks
180
+ For each affected app, verify: HTTP 200, TLS valid, container running.
181
+ Use `rdc:deploy diagnose <slug>` for any that fail.
182
+
183
+ #### 6. Update registry
184
+ ```sql
185
+ UPDATE deployment_registry SET last_deploy_at = now() WHERE slug IN (<affected slugs>);
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Failure Modes
191
+
192
+ | Failure | Marker | Action |
193
+ |---------|--------|--------|
194
+ | Dirty working tree | `[!]` | Abort — show one-line diff summary, ask to commit or stash |
195
+ | Pre-commit hook fails | `[!]` | Fix root cause, re-stage, retry — NEVER `--no-verify` |
196
+ | CI fails | `[!]` | Print run URL + last 20 log lines |
197
+ | npm not registered | `[!]` | Check CI actually published — not a silent skip |
198
+ | PR merge blocked | `[!]` | Show blocker (branch protection, conflict) — resolve and retry |
199
+ | Coolify deploy failed | `[!]` | Run `rdc:deploy diagnose <slug>` — fix before declaring done |
200
+ | Gate non-200 | `[!]` | Don't update registry until fixed |
201
+
202
+ Show full checklist with `[!]` markers even on failure.
203
+
204
+ ---
205
+
206
+ ## Hard Rules
207
+
208
+ - **Never push directly to `main`** — always via GitHub PR merge (`mcp__claude_ai_Github_Proxy_MCP__merge_pull_request`)
209
+ - **Never `--force`, never `--no-verify`, never `--no-gpg-sign`**
210
+ - **Never declare success** without verified install or verified Coolify gate
211
+ - **Never release without an explicit `rdc:release` invocation** from the user
212
+ - **Monorepo MCP servers** (`regen-media`, `gws`) are released via `rdc:release regen-root` — not separately
213
+
214
+ ---
215
+
216
+ ## Related
217
+
218
+ - `.claude/rules/clauth.md` — clauth release source of truth
219
+ - `.claude/rules/coolify-deployment.md` — Coolify watch_paths, deploy rules
220
+ - `memory/feedback_version_bump_must_tag.md` — never bump without tagging
221
+ - `memory/feedback_use_rdc_release.md` — "promote/deploy to main" always triggers this skill
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: rdc:report
3
+ description: >-
4
+ Usage `rdc:report [--unattended]` — nightly markdown report, writes to .rdc/reports/YYYY-MM-DD.md. Covers completed/open work items, per-project progress, infra status, git stats, test counts.
5
+ ---
6
+
7
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
8
+ > Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
9
+ > One checklist upfront, updated in place, shown again at end with a 1-line verdict.
10
+
11
+ > If dispatching subagents or running as a subagent: read `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` first (fallback: `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md`).
12
+
13
+ > **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. Git push is skipped under `RDC_TEST=1`.
14
+
15
+
16
+ # rdc:report — Nightly Report
17
+
18
+ ## When to Use
19
+ - End of a build session
20
+ - Project lead asks for a report or summary
21
+ - Nightly scheduled task
22
+ - Before handing off to another session
23
+ - Called by `rdc:overnight` at the end of every session
24
+
25
+ ## Arguments
26
+ - `rdc:report` — interactive, prints summary to conversation
27
+ - `rdc:report --unattended` — silent mode, writes file only, returns status block
28
+
29
+ ## Procedure
30
+
31
+ 1. **Query completed work (last 24h or since last report):**
32
+ ```sql
33
+ SELECT title, labels, completed_at, notes
34
+ FROM work_items
35
+ WHERE completed_at > now() - interval '24 hours'
36
+ ORDER BY completed_at;
37
+ ```
38
+
39
+ 2. **Query open work:**
40
+ ```sql
41
+ SELECT title, status, priority, labels
42
+ FROM work_items
43
+ WHERE status IN ('todo', 'in_progress', 'blocked')
44
+ ORDER BY priority, created_at;
45
+ ```
46
+
47
+ 3. **Git stats (since last report or last 24h):**
48
+ ```bash
49
+ git log --since="24 hours ago" --shortstat --oneline
50
+ git diff --shortstat HEAD~N # where N = commits in window
51
+ ```
52
+
53
+ 4. **Infrastructure deployment snapshot** (if MCP available):
54
+ - List all apps with current status
55
+ - Flag any failures
56
+
57
+ 5. **Write report** to `.rdc/reports/YYYY-MM-DD.md` (fallback: `.rdc/reports/YYYY-MM-DD.md` if `.rdc/` does not exist):
58
+ ```markdown
59
+ # Daily Report — YYYY-MM-DD
60
+
61
+ ## Completed Today
62
+ | Item | Project | Priority |
63
+
64
+ ## Git Activity
65
+ - Commits: N
66
+ - Files changed: N
67
+ - Lines: +N / -N
68
+
69
+ ## Open Work
70
+ ### Urgent (N)
71
+ ### High (N)
72
+ ### Normal (N)
73
+
74
+ ## Deployment Status
75
+ | App | Domain | Status |
76
+
77
+ ## Blockers
78
+ <any blocked items or failed deploys>
79
+
80
+ ## Next Session Recommendation
81
+ <highest priority unstarted work>
82
+ ```
83
+
84
+ 6. **Check if weekly rollup needed** (if today is Sunday):
85
+ - Aggregate daily reports for the week
86
+ - Write `.rdc/reports/week-YYYY-WNN.md` (fallback: `.rdc/reports/week-YYYY-WNN.md`)
87
+
88
+ 7. **Report results:**
89
+ - Interactive: print summary to conversation
90
+ - Unattended: no interactive output, emit status block only:
91
+ ```
92
+ REPORT_STATUS: { report_path, completed_count, open_count, blockers_count }
93
+ ```
94
+
95
+ ## Rules
96
+ - Reports go in `.rdc/reports/` (fallback: `.rdc/reports/`) — create dir if missing
97
+ - One report per day — overwrite if re-run same day
98
+ - Keep under 100 lines — scannable, not exhaustive
99
+ - Include links to relevant CLAUDE.md files where helpful
100
+ - Always end with "Next Session Recommendation"
101
+ - Unattended: NEVER print to conversation — write file only
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: rdc:review
3
+ description: >-
4
+ Usage `rdc:review [--unattended]` — tests, typecheck, stale docs, export conflicts across modified packages. Fixes issues found. Use after a build session or before merging to main.
5
+ ---
6
+
7
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
8
+ > Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
9
+ > One checklist upfront, updated in place, shown again at end with a 1-line verdict.
10
+
11
+ > If dispatching subagents or running as a subagent: read `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` first (fallback: `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md`).
12
+
13
+ > **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.
14
+
15
+
16
+ # rdc:review — Quality Gate
17
+
18
+ ## When to Use
19
+ - After a build session (especially overnight builds)
20
+ - Before merging development → main/production
21
+ - Project lead asks "review the work", "is everything clean"
22
+ - Before any production deployment
23
+ - Called by `rdc:overnight` after each epic build completes
24
+
25
+ ## Arguments
26
+ - `rdc:review` — interactive review, pauses on issues needing judgment
27
+ - `rdc:review --unattended` — silent mode, auto-fixes everything fixable
28
+
29
+ ## Procedure
30
+
31
+ 1. **Identify modified packages:**
32
+ ```bash
33
+ git diff --name-only origin/main...HEAD | grep "^packages/" | cut -d/ -f2 | sort -u
34
+ ```
35
+
36
+ 2. **Run tests for each modified package:**
37
+ ```bash
38
+ cd packages/<name> && npx vitest run 2>&1 | tail -10
39
+ ```
40
+ Report: package → test count → pass/fail → new tests added
41
+
42
+ **IMPORTANT:** `pnpm build` must NEVER be run (crashes system). Use `npx tsc --noEmit --project <path>/tsconfig.json` for typecheck instead. For packages without tests, typecheck is the verification method. Do NOT run vitest across the entire monorepo — check only modified packages individually.
43
+
44
+ 3. **Check test coverage delta:**
45
+ ```bash
46
+ git diff origin/main...HEAD -- packages/*/src/ | grep -c "^+" | head -5
47
+ git diff origin/main...HEAD -- packages/*/test* packages/*/src/**/*.test.* packages/*/src/**/*.spec.* 2>/dev/null | grep -c "^+" || echo 0
48
+ ```
49
+ Flag any package where implementation lines added > 50 but test lines added = 0.
50
+
51
+ 4. **Check for export conflicts:**
52
+ - Read `packages/*/src/index.ts` for any package with new exports
53
+ - Look for duplicate export names across the barrel
54
+ - Verify aliased exports don't shadow each other
55
+
56
+ 5. **Check for TODO/FIXME/HACK:**
57
+ ```bash
58
+ grep -rn "TODO\|FIXME\|HACK\|XXX" packages/*/src/ --include="*.ts" --include="*.tsx"
59
+ ```
60
+
61
+ 6. **Check package versions:**
62
+ - Any package with significant new code should have a version bump
63
+ - Compare package.json versions to what's in `docs/SYSTEM-STATE.md`
64
+
65
+ 7. **Check for stale CLAUDE.md:**
66
+ - If new modules were added to a package, does its CLAUDE.md mention them?
67
+ - Flag any package where exports grew by >10 lines but CLAUDE.md wasn't updated
68
+
69
+ 8. **Orphan work item audit:**
70
+ ```sql
71
+ SELECT id, title, item_type, status, source, created_at::date
72
+ FROM work_items
73
+ WHERE parent_id IS NULL
74
+ AND item_type NOT IN ('epic', 'bug')
75
+ AND status NOT IN ('done', 'archived')
76
+ ORDER BY created_at DESC;
77
+ ```
78
+ For each orphaned task found:
79
+ - If it clearly belongs to an open epic → attach it: `UPDATE work_items SET parent_id = '<epic-id>' WHERE id = '<task-id>'`
80
+ - If unclear → report (interactive) or flag in REVIEW_STATUS (unattended)
81
+ - Never silently leave orphaned tasks
82
+
83
+ 9. **Verification gate — dispatch the verify agent:**
84
+ After any fixes land, run the verify gate on every touched package. See `guides/agents/verify.md`.
85
+ **Iron Law: no CLEAN verdict without fresh evidence.** Quote the vitest + tsc output in the report.
86
+ If verify fails → do NOT emit CLEAN. Loop back, fix, re-run verify.
87
+
88
+ 10. **Fix issues found:**
89
+ - Failing tests → fix and commit
90
+ - Export conflicts → resolve and commit
91
+ - Missing version bumps → bump and commit
92
+ - All fixes as separate commits with descriptive messages
93
+
94
+ **Judgment calls:**
95
+ - Interactive: report — don't guess
96
+ - Unattended: escalate via advisor tool with: error message, surrounding context,
97
+ two most likely fix paths. Resume with advisor's recommendation.
98
+ If advisor unavailable: take the most conservative path, flag in status block.
99
+
100
+ 11. **Report:**
101
+ - Interactive:
102
+ ```
103
+ ## Review Results
104
+ | Package | Tests | Pass/Fail | New Tests | Issues |
105
+ ## Fixed
106
+ ## Remaining Issues
107
+ ## Verdict: CLEAN / HAS ISSUES
108
+ ```
109
+ - Unattended: emit status block only:
110
+ ```
111
+ REVIEW_STATUS: { verdict: "CLEAN|HAS_ISSUES", packages_checked, tests_passed, tests_failed, new_tests_added, fixes_applied, escalations }
112
+ ```
113
+
114
+ ## Rules
115
+ - Do NOT run `pnpm build` (crashes system) — vitest only
116
+ - Interactive: fix what you can, flag what needs decision
117
+ - Unattended: fix everything fixable; escalate judgment calls to advisor
118
+ - Each fix is a separate commit (not batched)
119
+ - Always push fixes to origin after committing *(skip if `$RDC_TEST=1` — echo `[RDC_TEST] skipping git push` instead)*
120
+ - Unattended: NEVER pause for input
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: rdc:self-test
3
+ description: >-
4
+ Usage `rdc:self-test [--strict] [--skill <name>] [--json] [--fix] [--tier2] [--parallel <n>] [--quick]` — validates every rdc-*.md skill: frontmatter, Usage marker, name↔filename match, referenced guides/rules/hooks exist, output contract banner, plugin manifest, duplicate-name + collision checks. Tier 1 static lint; Tier 2 behavioral runs via headless claude in isolated worktrees + Supabase branch. Run before every release.
5
+ ---
6
+
7
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
8
+ > Checklist-only output. No tool-call narration. No raw runner dumps — summarize.
9
+ > One checklist upfront, updated in place, shown again at end with a 1-line verdict.
10
+
11
+ > **Sandbox contract:** This skill honors `RDC_TEST=1` per `guides/agent-bootstrap.md` § RDC_TEST Sandbox Contract. Tier 2 behavioral runs and any git push are skipped under `RDC_TEST=1`; Tier 1 static lint runs normally.
12
+
13
+
14
+ # rdc:self-test — Skill Library Self-Test (Tier 1)
15
+
16
+ ## When to Use
17
+ - Before every `rdc:release rdc-skills` tag push
18
+ - After editing any skill description or frontmatter
19
+ - When a skill mysteriously disappears from the menu (backtick bug repro)
20
+ - In CI on every rdc-skills PR (once wired)
21
+
22
+ ## Tiers
23
+
24
+ | Tier | What it checks | Status |
25
+ |------|----------------|--------|
26
+ | Tier 1 | Static lint — frontmatter, Usage line, referenced files, name match | ✅ live |
27
+ | Tier 2 | Behavioral — headless Claude runs each skill in sandbox, asserts artifacts | ✅ live — 13 manifests, blocked by check-cwd.js hook (see Rules) |
28
+ | Tier 3 | Golden checklists — snapshot output format, regress on drift | 🔒 future |
29
+
30
+ ## Interactive UI
31
+
32
+ Launch the interactive menu — pick tier, pick skill, see live output:
33
+
34
+ ```bash
35
+ node C:/Dev/rdc-skills/scripts/self-test-ui.mjs
36
+ ```
37
+
38
+ Menu options:
39
+ - **1** — Full Tier 1 test (all skills)
40
+ - **2** — Pick a specific skill from a numbered list
41
+ - **3** — Choose tier (Tier 1 static lint | Tier 2 behavioral | Tier 3 🔒 future)
42
+
43
+ Test output streams live to the terminal. No server, no extra processes.
44
+
45
+ ## Procedure (Tier 1)
46
+
47
+ 1. **Run the linter (direct or via UI):**
48
+ ```bash
49
+ node C:/Dev/rdc-skills/scripts/self-test.mjs
50
+ # or interactively:
51
+ node C:/Dev/rdc-skills/scripts/self-test-ui.mjs
52
+ ```
53
+
54
+ 2. **Interpret exit codes:**
55
+ - `0` = all skills pass
56
+ - `1` = at least one FAIL or (in `--strict` mode) at least one WARN
57
+ - `2` = runner itself crashed (e.g., skills dir unreadable)
58
+ - `3` = `.claude-plugin/plugin.json` missing entirely (distinct from skill failures)
59
+
60
+ 3. **Common findings and fixes:**
61
+
62
+ | Finding code | Cause | Fix |
63
+ |---|---|---|
64
+ | `description-backtick-leading` | Folded YAML starts with `` ` `` — parser drops skill | Rewrite description to start with a word |
65
+ | `usage-marker-missing` | No `` Usage `rdc:name <args>` `` in description | Front-load arg contract |
66
+ | `usage-marker-mismatch` | `Usage` line references a different skill's name (copy-paste drift) | Fix the skill name in the Usage marker |
67
+ | `name-filename-mismatch` | frontmatter `name:` ≠ filename | `--fix` auto-renames; or rewrite name |
68
+ | `guide-not-found` / `rule-not-found` / `hook-not-found` | Dead reference in skill body | Create file or fix link |
69
+ | `banner-missing` | Skill missing OUTPUT CONTRACT banner | `--fix` auto-inserts |
70
+ | `manifest-missing` / `manifest-version-mismatch` | `.claude-plugin/plugin.json` missing or out-of-sync with `package.json` | Create/update manifest |
71
+ | `duplicate-skill-name` / `skill-guide-filename-collision` | Two skills claim same name, or skill collides with agent guide | Rename one |
72
+ | `orphan-hook` | File under `hooks/` isn't referenced by any skill, settings.json, or plugin.json | Wire it up or delete |
73
+
74
+ 4. **Flags:**
75
+ - `--strict` — promotes warnings to failures (use in CI and before release)
76
+ - `--skill <name>` — run against a single skill (e.g. `--skill rdc:build`)
77
+ - `--json` — machine-readable schema v2 (per-skill `findings[]` with `code` + `level`, plugin_manifest block, global_findings, summary.exit_code). Consumed by Tier 2 runner as pre-gate.
78
+ - `--fix` — auto-repair fixable findings: insert missing OUTPUT CONTRACT banner, rename files to match frontmatter name. Prints `FIXED:` lines + touched file list so you can git diff + commit. Backtick-leading descriptions are NOT auto-fixed (need human rewrite).
79
+
80
+ 5. **Report to the project lead:**
81
+ ```
82
+ Self-test: X/Y pass, Z warnings, W failures
83
+ Failures: <list>
84
+ Verdict: PASS | FAIL
85
+ ```
86
+
87
+ ## Procedure (Tier 2)
88
+
89
+ Tier 2 runs each skill end-to-end in an isolated sandbox and asserts on observed state (files touched, commits made, work items, exit code). Use it before shipping behavioral changes — Tier 1 alone can't catch runtime drift.
90
+
91
+ 1. **Prerequisites:**
92
+ - `claude` CLI on PATH (headless mode: `claude --print`)
93
+ - clauth daemon unlocked (`curl -s http://127.0.0.1:52437/ping`)
94
+ - Supabase MCP reachable (runner creates a throwaway test branch)
95
+ - Clean git tree in `rdc-skills` (worktrees are added under `.rdc/sandbox/<run-id>/`)
96
+
97
+ 2. **Run:**
98
+ ```bash
99
+ node scripts/self-test.mjs --tier2 # all skills with manifests
100
+ node scripts/self-test.mjs --tier2 --skill rdc:build # single skill
101
+ node scripts/self-test.mjs --tier2 --parallel 3 # up to 3 skills in parallel
102
+ node scripts/self-test.mjs --tier2 --quick # skip long-running assertions
103
+ ```
104
+
105
+ 3. **What it does:**
106
+ - Runs Tier 1 as a pre-gate (fails fast if static lint fails)
107
+ - Creates one Supabase test branch for the run
108
+ - For each skill: `git worktree add` into `.rdc/sandbox/<run-id>/<skill>/`, sets `RDC_TEST=1`, invokes `claude --print` with the skill prompt, waits for exit
109
+ - Asserts per the skill's manifest: exit code, files touched, commits made, stdout patterns
110
+ - Cleans up worktrees + deletes the Supabase branch at the end (even on failure)
111
+
112
+ 4. **Reports:**
113
+ - `.rdc/reports/self-test-tier2-<iso>.json` — full per-skill result, findings, timings
114
+ - Exit codes: `0` pass, `1` fail (one or more skills failed assertions), `2` runner error (couldn't set up sandbox / branch)
115
+
116
+ 5. **Adding a new manifest:**
117
+ - Create `skills/tests/<skill>.test.json` (one per skill, colocated)
118
+ - Validate the shape against the schema at `scripts/lib/manifest-schema.mjs`
119
+ - Test it in isolation: `node scripts/self-test.mjs --tier2 --skill rdc:name`
120
+ - Commit the manifest alongside any skill body changes
121
+
122
+ ## Rules
123
+ - Run Tier 1 **before every `rdc:release rdc-skills`** — it catches the backtick-drift class of bugs that break the skill menu silently.
124
+ - Use `--strict` in CI. Warnings matter in the release path.
125
+ - Do NOT skip findings by relaxing the linter. Fix the skill.
126
+ - Run Tier 2 before tagging a release. Gate the tag if any manifested skill fails.
127
+ - Tier 2 blocker: `check-cwd.js` SessionStart hook blocks headless sessions not launched from the monorepo root — runner uses `--dangerously-skip-permissions` to bypass. If tier2 tests fail with `exit_code: -1`, verify the flag is present in `scripts/lib/runner.mjs`.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: rdc:status
3
+ description: >-
4
+ Usage `rdc:status` — open epics, work items by project, Coolify health, blockers, next recommended action. Read-only situational awareness.
5
+ ---
6
+
7
+ > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
8
+ > Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
9
+ > One checklist upfront, updated in place, shown again at end with a 1-line verdict.
10
+
11
+ > If dispatching subagents or running as a subagent: read `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` first (fallback: `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md`).
12
+
13
+
14
+ # rdc:status — Project Dashboard
15
+
16
+ ## When to Use
17
+ - Start of any session
18
+ - Project lead asks "what's the status", "where are we", "what's open"
19
+ - Before deciding what to work on next
20
+
21
+ ## Procedure
22
+
23
+ 1. **Open epics:**
24
+ ```sql
25
+ SELECT get_open_epics();
26
+ ```
27
+
28
+ 2. **Work item counts by status:**
29
+ ```sql
30
+ SELECT status, count(*) FROM work_items
31
+ WHERE status != 'archived'
32
+ GROUP BY status ORDER BY status;
33
+ ```
34
+
35
+ 3. **Items by label/project (top 10 labels):**
36
+ ```sql
37
+ SELECT unnest(labels) as label, count(*),
38
+ count(*) FILTER (WHERE status = 'done') as done,
39
+ count(*) FILTER (WHERE status = 'todo') as todo,
40
+ count(*) FILTER (WHERE status = 'in_progress') as wip
41
+ FROM work_items
42
+ GROUP BY label ORDER BY count DESC LIMIT 10;
43
+ ```
44
+
45
+ 4. **Recent activity (last 48 hours):**
46
+ ```sql
47
+ SELECT title, status, updated_at
48
+ FROM work_items
49
+ WHERE updated_at > now() - interval '48 hours'
50
+ ORDER BY updated_at DESC LIMIT 15;
51
+ ```
52
+
53
+ 5. **Git status:**
54
+ ```bash
55
+ git log --oneline -10
56
+ git status
57
+ git branch -v
58
+ ```
59
+
60
+ 6. **Infrastructure health** (if MCP available):
61
+ - Get infrastructure overview or diagnose issues
62
+ - Report any apps with failed builds or down containers
63
+
64
+ 7. **Present as a compact dashboard:**
65
+ ```
66
+ ## Open Epics (N)
67
+ <table>
68
+
69
+ ## Work Items: X done | Y todo | Z in_progress
70
+
71
+ ## Recent (48h)
72
+ <list>
73
+
74
+ ## Deployments
75
+ <green/red/yellow status>
76
+
77
+ ## Recommended Next
78
+ <highest priority unstarted epic>
79
+ ```
80
+
81
+ ## Rules
82
+ - Keep output concise — this is a glance, not a deep dive
83
+ - Always end with a recommendation for what to work on next
84
+ - After the Recommended Next section, suggest which guide file from `.rdc/guides/` (fallback: `.rdc/guides/`) the recommended work would need
85
+ - Use database MCP for queries (not raw curl)
86
+ - If infrastructure MCP is unavailable, skip deployment status and note it
@@ -0,0 +1,29 @@
1
+ # Tier 2 Test Manifests
2
+
3
+ Each rdc:* skill has a colocated test manifest at `skills/tests/rdc-<name>.test.json`.
4
+ These drive the Tier 2 behavioral runner (`scripts/self-test.mjs --tier2`).
5
+
6
+ ## Schema
7
+
8
+ See `../../scripts/lib/manifest-schema.mjs` — the `validateManifest` function
9
+ is the source of truth. Top-level fields:
10
+
11
+ - `manifest_version` (int) — currently 1
12
+ - `skill` (string) — `rdc:<name>`
13
+ - `description` (string) — what this test verifies
14
+ - `fixture` (object) — prompt, precondition files, env vars
15
+ - `assertions` (object) — what to check after the skill runs
16
+ - `teardown` (object) — cleanup policy
17
+
18
+ ## Authoring a manifest
19
+
20
+ 1. Start from an existing manifest in this dir
21
+ 2. Set `fixture.env.RDC_TEST = "1"` (required — sandbox contract)
22
+ 3. Write assertions tight enough to catch real regressions but not flaky
23
+ 4. Run `node scripts/self-test.mjs --tier2 --skill rdc:<name>` to smoke-test
24
+ 5. Commit manifest + any skill changes together
25
+
26
+ ## Adding a new skill
27
+
28
+ New skills MUST ship with a manifest. Tier 2 CI will block tag push if a
29
+ new skill lands without one.