@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,159 @@
1
+ ---
2
+ name: rdc:release
3
+ description: >-
4
+ Atomic release. Usage `rdc:release <repo> [version]` or `rdc:release <repo> --patch|--minor|--major` or `rdc:release <repo> --dry-run` — bump, commit, tag, push, wait CI, install, verify, restart. Known repos: clauth, rdc-skills, regen-media, gws. 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 (git tag push, CI poll, npm publish verification, global install, daemon restart) short-circuit under the flag — the checklist still runs, but each destructive step echoes `[RDC_TEST] skipping <step>` instead of mutating external state.
12
+
13
+ # rdc:release — Atomic LIFEAI Package Release
14
+
15
+ ## Purpose
16
+
17
+ Dave has Bash access. Therefore Dave should never be asked to run install
18
+ commands. This skill handles the complete release loop for any LIFEAI-published
19
+ package so the user sees one checklist and one verdict, not a series of "now run
20
+ this" handoffs.
21
+
22
+ ## Arguments
23
+
24
+ - `rdc:release <repo>` — patch bump (default), full loop
25
+ - `rdc:release <repo> <version>` — explicit version (e.g. `1.6.0`)
26
+ - `rdc:release <repo> --minor` | `--major` | `--patch` — semver bump
27
+ - `rdc:release <repo> --dry-run` — show checklist and planned version, do nothing
28
+ - `rdc:release` (no args) — list known repos, ask which
29
+
30
+ ## Known repos
31
+
32
+ Resolve `<repo>` to source path + install mechanism:
33
+
34
+ | Repo | Source path | Publish | Install | Post-install |
35
+ |------|-------------|---------|---------|--------------|
36
+ | `clauth` | `C:/Dev/clauth` | npm via tag → GitHub Actions | `npm install -g @lifeaitools/clauth@latest` | `curl -s -X POST http://127.0.0.1:52437/restart` |
37
+ | `rdc-skills` | `C:/Dev/rdc-skills` | local (no npm) | `bash C:/Dev/rdc-skills/scripts/install.sh` + cp fallback | none |
38
+ | `regen-media` | `C:/Dev/regen-root/mcp-servers/regen-media` | local | restart MCP server | none |
39
+ | `gws` | `C:/Dev/regen-root/mcp-servers/gws` | local | restart MCP server | none |
40
+
41
+ Add new repos to this table as they emerge. If user specifies an unknown repo,
42
+ ask for the source path and install command.
43
+
44
+ ## Checklist (run every mode)
45
+
46
+ ```
47
+ rdc:release: <repo> vX.Y.Z → vA.B.C
48
+ [ ] Source path resolved
49
+ [ ] Working tree clean (git status)
50
+ [ ] Current version detected (package.json)
51
+ [ ] New version computed
52
+ [ ] Dry-run gate (if --dry-run, stop here)
53
+ [ ] package.json bumped (all version fields)
54
+ [ ] Commit created
55
+ [ ] Tag vA.B.C created
56
+ [ ] Push to origin
57
+ [ ] Push --tags to origin
58
+ [ ] CI run located (gh run list, if applicable)
59
+ [ ] CI completed successfully (poll every 20s, 10min timeout)
60
+ [ ] npm registry shows vA.B.C (if npm package, poll every 15s, 3min timeout)
61
+ [ ] Local install executed
62
+ [ ] Installed version verified matches vA.B.C
63
+ [ ] Post-install action (daemon restart, etc., if applicable)
64
+ [ ] Smoke test (ping health endpoint or binary --version)
65
+ ✅ rdc:release <repo>: vA.B.C live and installed
66
+ ```
67
+
68
+ ## Execution details (silent to user — don't narrate)
69
+
70
+ ### 1. Version bump
71
+ - Read `package.json`, parse version
72
+ - Apply bump: patch (default), minor, major, or explicit
73
+ - Rewrite all `version` fields (some packages have version in `claude.version` too)
74
+
75
+ ### 2. Commit + tag + push
76
+ ```bash
77
+ cd <source_path>
78
+ git add package.json
79
+ git commit -m "chore(release): vA.B.C"
80
+ if [ "$RDC_TEST" != "1" ]; then
81
+ git tag vA.B.C
82
+ git push && git push --tags
83
+ else
84
+ echo "[RDC_TEST] skipping git tag + git push --tags"
85
+ fi
86
+ ```
87
+ Never `--no-verify`. Never `--force`. If pre-commit hook fails, fix root cause, don't skip.
88
+
89
+ *Under `$RDC_TEST=1`, sections 3 (CI poll), 4 (npm registry poll), 5 (install), 6 (verify install), 7 (post-install), and 8 (smoke test) are also skipped — echo `[RDC_TEST] skipping <section>` for each and mark the checklist line as `[~]`.*
90
+
91
+ ### 3. CI poll (for repos with GH Actions publish)
92
+ ```bash
93
+ # Locate the run triggered by the tag push
94
+ gh run list --repo LIFEAI/<repo> --limit 5 --json status,conclusion,headBranch,databaseId
95
+ # Poll its status field every 20s until conclusion ∈ {success, failure, cancelled}
96
+ # Max 10 minutes — if timeout, fail with [!] and report run URL
97
+ ```
98
+
99
+ ### 4. npm registry poll (only if published to npm)
100
+ ```bash
101
+ npm view @lifeaitools/<repo> version
102
+ # Poll every 15s until matches new version
103
+ # Max 3 minutes — usually lands within 30-60s after CI success
104
+ ```
105
+
106
+ ### 5. Install
107
+ - **clauth:** `npm install -g @lifeaitools/clauth@latest`
108
+ - **rdc-skills:** `bash C:/Dev/rdc-skills/scripts/install.sh` — if output shows only one file copied (known bug), fall back to `cp C:/Dev/rdc-skills/skills/*.md ~/.claude/skills/user/ && cp C:/Dev/rdc-skills/skills/*.md C:/Dev/regen-root/.claude/skills/user/`
109
+ - **MCP servers:** restart the server process (find its PID, kill, respawn — or document how)
110
+
111
+ ### 6. Verify install
112
+ - **clauth:** `curl -s http://127.0.0.1:52437/ping | jq -r .app_version` — must equal new version
113
+ - **rdc-skills:** `ls ~/.claude/skills/user/rdc-release.md` (or whichever file is new in this release) — must exist
114
+ - **Global npm:** `npm list -g --depth=0 @lifeaitools/<repo>` — version matches
115
+
116
+ ### 7. Post-install
117
+ - **clauth:** `curl -s -X POST http://127.0.0.1:52437/restart` — wait 3s — ping again
118
+ - Others: N/A
119
+
120
+ ### 8. Smoke test
121
+ - **clauth:** new tool roundtrip (e.g., `curl -s http://127.0.0.1:52437/get/openai | head -c 10` succeeds without error)
122
+ - **rdc-skills:** load one new skill file and check frontmatter parses
123
+ - **MCP:** server responds to `tools/list`
124
+
125
+ ## Failure modes → checklist outcome
126
+
127
+ | Failure | Marker | Next |
128
+ |---------|--------|------|
129
+ | Dirty working tree | `[!]` line 2 | Abort with one-sentence diff summary; ask user to commit or stash |
130
+ | Pre-commit hook fails | `[!]` line 7 | Fix root cause, re-stage, retry (NEVER --no-verify) |
131
+ | CI fails | `[!]` line 11 | Print run URL, tail 20 lines of failing job, ask user |
132
+ | npm doesn't register | `[!]` line 12 | Print npm error, check if CI actually published (not a silent skip) |
133
+ | Install script broken | `[!]` line 13 | Fall back to manual cp; note the installer bug as a task |
134
+ | Version mismatch after install | `[!]` line 14 | Uninstall + clean install; if still wrong, likely cache issue |
135
+ | Post-install restart fails | `[!]` line 15 | Print ping error; instruct user to run `scripts\restart-clauth.bat` manually |
136
+
137
+ Even on failure, show the full checklist with `[!]` markers so user sees exactly
138
+ where it stopped.
139
+
140
+ ## Dry-run mode
141
+
142
+ Prints the checklist + resolved version bump + every command that WOULD run, but
143
+ executes nothing beyond reads. Use when user says "what would you do" or before
144
+ risky major bumps.
145
+
146
+ ## Never
147
+
148
+ - Never release on behalf of the user without an explicit `rdc:release` invocation
149
+ - Never skip CI verification ("it'll probably work" is how stale installs happen)
150
+ - Never `--force` push, never `--no-verify`, never `--no-gpg-sign`
151
+ - Never touch `main` — release tags go on the default branch the repo uses (`master` for clauth, rdc-skills)
152
+ - Never declare success without verifying the installed version matches
153
+
154
+ ## Related
155
+
156
+ - `.claude/rules/clauth.md` — clauth release workflow source of truth
157
+ - `feedback_version_bump_must_tag.md` (memory) — never bump without tagging
158
+ - `feedback_clauth_ci.md` (memory) — CI publish pattern
159
+ - `feedback_just_do_it.md` (memory) — don't hand commands to Dave; run them
@@ -0,0 +1,99 @@
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
+
14
+ # rdc:report — Nightly Report
15
+
16
+ ## When to Use
17
+ - End of a build session
18
+ - Project lead asks for a report or summary
19
+ - Nightly scheduled task
20
+ - Before handing off to another session
21
+ - Called by `rdc:overnight` at the end of every session
22
+
23
+ ## Arguments
24
+ - `rdc:report` — interactive, prints summary to conversation
25
+ - `rdc:report --unattended` — silent mode, writes file only, returns status block
26
+
27
+ ## Procedure
28
+
29
+ 1. **Query completed work (last 24h or since last report):**
30
+ ```sql
31
+ SELECT title, labels, completed_at, notes
32
+ FROM work_items
33
+ WHERE completed_at > now() - interval '24 hours'
34
+ ORDER BY completed_at;
35
+ ```
36
+
37
+ 2. **Query open work:**
38
+ ```sql
39
+ SELECT title, status, priority, labels
40
+ FROM work_items
41
+ WHERE status IN ('todo', 'in_progress', 'blocked')
42
+ ORDER BY priority, created_at;
43
+ ```
44
+
45
+ 3. **Git stats (since last report or last 24h):**
46
+ ```bash
47
+ git log --since="24 hours ago" --shortstat --oneline
48
+ git diff --shortstat HEAD~N # where N = commits in window
49
+ ```
50
+
51
+ 4. **Infrastructure deployment snapshot** (if MCP available):
52
+ - List all apps with current status
53
+ - Flag any failures
54
+
55
+ 5. **Write report** to `.rdc/reports/YYYY-MM-DD.md` (fallback: `.rdc/reports/YYYY-MM-DD.md` if `.rdc/` does not exist):
56
+ ```markdown
57
+ # Daily Report — YYYY-MM-DD
58
+
59
+ ## Completed Today
60
+ | Item | Project | Priority |
61
+
62
+ ## Git Activity
63
+ - Commits: N
64
+ - Files changed: N
65
+ - Lines: +N / -N
66
+
67
+ ## Open Work
68
+ ### Urgent (N)
69
+ ### High (N)
70
+ ### Normal (N)
71
+
72
+ ## Deployment Status
73
+ | App | Domain | Status |
74
+
75
+ ## Blockers
76
+ <any blocked items or failed deploys>
77
+
78
+ ## Next Session Recommendation
79
+ <highest priority unstarted work>
80
+ ```
81
+
82
+ 6. **Check if weekly rollup needed** (if today is Sunday):
83
+ - Aggregate daily reports for the week
84
+ - Write `.rdc/reports/week-YYYY-WNN.md` (fallback: `.rdc/reports/week-YYYY-WNN.md`)
85
+
86
+ 7. **Report results:**
87
+ - Interactive: print summary to conversation
88
+ - Unattended: no interactive output, emit status block only:
89
+ ```
90
+ REPORT_STATUS: { report_path, completed_count, open_count, blockers_count }
91
+ ```
92
+
93
+ ## Rules
94
+ - Reports go in `.rdc/reports/` (fallback: `.rdc/reports/`) — create dir if missing
95
+ - One report per day — overwrite if re-run same day
96
+ - Keep under 100 lines — scannable, not exhaustive
97
+ - Include links to relevant CLAUDE.md files where helpful
98
+ - Always end with "Next Session Recommendation"
99
+ - 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,107 @@
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
+
12
+ # rdc:self-test — Skill Library Self-Test (Tier 1)
13
+
14
+ ## When to Use
15
+ - Before every `rdc:release rdc-skills` tag push
16
+ - After editing any skill description or frontmatter
17
+ - When a skill mysteriously disappears from the menu (backtick bug repro)
18
+ - In CI on every rdc-skills PR (once wired)
19
+
20
+ ## Tiers
21
+
22
+ | Tier | What it checks | Status |
23
+ |------|----------------|--------|
24
+ | Tier 1 | Static lint — frontmatter, Usage line, referenced files, name match | ✅ live |
25
+ | Tier 2 | Behavioral — headless Claude runs each skill in sandbox, asserts artifacts | ✅ live, see `.rdc/plans/skill-self-test-tier-2.md` |
26
+ | Tier 3 | Golden checklists — snapshot output format, regress on drift | 🔒 future |
27
+
28
+ ## Procedure (Tier 1)
29
+
30
+ 1. **Run the linter:**
31
+ ```bash
32
+ node C:/Dev/rdc-skills/scripts/self-test.mjs
33
+ ```
34
+
35
+ 2. **Interpret exit codes:**
36
+ - `0` = all skills pass
37
+ - `1` = at least one FAIL or (in `--strict` mode) at least one WARN
38
+ - `2` = runner itself crashed (e.g., skills dir unreadable)
39
+ - `3` = `.claude-plugin/plugin.json` missing entirely (distinct from skill failures)
40
+
41
+ 3. **Common findings and fixes:**
42
+
43
+ | Finding code | Cause | Fix |
44
+ |---|---|---|
45
+ | `description-backtick-leading` | Folded YAML starts with `` ` `` — parser drops skill | Rewrite description to start with a word |
46
+ | `usage-marker-missing` | No `` Usage `rdc:name <args>` `` in description | Front-load arg contract |
47
+ | `usage-marker-mismatch` | `Usage` line references a different skill's name (copy-paste drift) | Fix the skill name in the Usage marker |
48
+ | `name-filename-mismatch` | frontmatter `name:` ≠ filename | `--fix` auto-renames; or rewrite name |
49
+ | `guide-not-found` / `rule-not-found` / `hook-not-found` | Dead reference in skill body | Create file or fix link |
50
+ | `banner-missing` | Skill missing OUTPUT CONTRACT banner | `--fix` auto-inserts |
51
+ | `manifest-missing` / `manifest-version-mismatch` | `.claude-plugin/plugin.json` missing or out-of-sync with `package.json` | Create/update manifest |
52
+ | `duplicate-skill-name` / `skill-guide-filename-collision` | Two skills claim same name, or skill collides with agent guide | Rename one |
53
+ | `orphan-hook` | File under `hooks/` isn't referenced by any skill, settings.json, or plugin.json | Wire it up or delete |
54
+
55
+ 4. **Flags:**
56
+ - `--strict` — promotes warnings to failures (use in CI and before release)
57
+ - `--skill <name>` — run against a single skill (e.g. `--skill rdc:build`)
58
+ - `--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.
59
+ - `--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).
60
+
61
+ 5. **Report to the project lead:**
62
+ ```
63
+ Self-test: X/Y pass, Z warnings, W failures
64
+ Failures: <list>
65
+ Verdict: PASS | FAIL
66
+ ```
67
+
68
+ ## Procedure (Tier 2)
69
+
70
+ 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.
71
+
72
+ 1. **Prerequisites:**
73
+ - `claude` CLI on PATH (headless mode: `claude --print`)
74
+ - clauth daemon unlocked (`curl -s http://127.0.0.1:52437/ping`)
75
+ - Supabase MCP reachable (runner creates a throwaway test branch)
76
+ - Clean git tree in `rdc-skills` (worktrees are added under `.rdc/sandbox/<run-id>/`)
77
+
78
+ 2. **Run:**
79
+ ```bash
80
+ node scripts/self-test.mjs --tier2 # all skills with manifests
81
+ node scripts/self-test.mjs --tier2 --skill rdc:build # single skill
82
+ node scripts/self-test.mjs --tier2 --parallel 3 # up to 3 skills in parallel
83
+ node scripts/self-test.mjs --tier2 --quick # skip long-running assertions
84
+ ```
85
+
86
+ 3. **What it does:**
87
+ - Runs Tier 1 as a pre-gate (fails fast if static lint fails)
88
+ - Creates one Supabase test branch for the run
89
+ - 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
90
+ - Asserts per the skill's manifest: exit code, files touched, commits made, stdout patterns
91
+ - Cleans up worktrees + deletes the Supabase branch at the end (even on failure)
92
+
93
+ 4. **Reports:**
94
+ - `.rdc/reports/self-test-tier2-<iso>.json` — full per-skill result, findings, timings
95
+ - Exit codes: `0` pass, `1` fail (one or more skills failed assertions), `2` runner error (couldn't set up sandbox / branch)
96
+
97
+ 5. **Adding a new manifest:**
98
+ - Create `skills/tests/<skill>.test.json` (one per skill, colocated)
99
+ - Validate the shape against the schema at `scripts/lib/manifest-schema.mjs`
100
+ - Test it in isolation: `node scripts/self-test.mjs --tier2 --skill rdc:name`
101
+ - Commit the manifest alongside any skill body changes
102
+
103
+ ## Rules
104
+ - Run Tier 1 **before every `rdc:release rdc-skills`** — it catches the backtick-drift class of bugs that break the skill menu silently.
105
+ - Use `--strict` in CI. Warnings matter in the release path.
106
+ - Do NOT skip findings by relaxing the linter. Fix the skill.
107
+ - Tier 2 is in planning — see epic `462b3e0a-37dd-4c9d-bed7-a1ad260b8bc1`.
@@ -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,92 @@
1
+ ---
2
+ name: rdc:watch
3
+ description: >-
4
+ Usage `rdc:watch` — initialize a session log and open a browser viewer that tails Claude activity live. Zero infra, pure filesystem + static HTML.
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:watch — Session Log Watcher
15
+
16
+ ## When to Use
17
+ - Start of any long-running session where Dave needs visibility into what you're doing
18
+ - Before `rdc:overnight`, `rdc:build` on a large epic, or any multi-hour grind
19
+ - Anytime the user asks for "a log", "a viewer", "tail", or "what are you doing right now"
20
+
21
+ ## Procedure
22
+
23
+ 1. **Initialize the log and viewer.** Run the helper script from the plugin directory in the user's current project:
24
+ ```bash
25
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/watch-init.mjs
26
+ ```
27
+ (If `CLAUDE_PLUGIN_ROOT` is not set, resolve the plugin path from your invocation context. On Windows it's typically `C:/Dev/rdc-skills`.)
28
+
29
+ 2. **Parse the output.** The script prints `run_id`, `log_path`, `current`, `viewer`, and `open_hint`. Capture `log_path` and `viewer` for the rest of the session.
30
+
31
+ 3. **Open the viewer in the browser.** Run the exact `open_hint` line from the script output. On Windows that's `start "" "<viewer-path>"`.
32
+
33
+ 4. **Report to the user.** One line:
34
+ ```
35
+ watcher live at <viewer-path> — tailing <log-path>
36
+ ```
37
+
38
+ 5. **Append one line per substantive action for the rest of the session.** Use the documented format — one line, no multi-line payloads:
39
+ ```
40
+ [<ISO-timestamp>] [<kind>] <message>
41
+ ```
42
+ Append to BOTH `<log-path>` (the full history) AND `current.log` (what the viewer polls). The viewer diffs `current.log` by length and only appends new lines.
43
+
44
+ ### Log format
45
+
46
+ - `ISO-timestamp` — `new Date().toISOString()`
47
+ - `kind` — one of: `dispatch`, `commit`, `test`, `error`, `note`, `banner`
48
+ - `message` — single line, no newlines. Keep under ~200 chars.
49
+
50
+ ### Kinds
51
+
52
+ | Kind | When to append |
53
+ |------|----------------|
54
+ | `dispatch` | About to dispatch a subagent — include role + epic/task id |
55
+ | `commit` | After a git commit lands — include short sha + subject |
56
+ | `test` | Test run kicked off or result came back |
57
+ | `error` | Anything that failed — include what and why in one line |
58
+ | `note` | General progress ticks (reading files, analyzing, planning) |
59
+ | `banner` | Session start/end markers, major phase changes |
60
+
61
+ ### Examples
62
+
63
+ ```
64
+ [2026-04-15T23:14:02.318Z] [dispatch] frontend agent → epic abc123 task 4 (rebuild DynamicForm)
65
+ [2026-04-15T23:17:41.902Z] [commit] 3f2a1b9 feat(marketing-engine): DynamicForm rhf+zod
66
+ [2026-04-15T23:18:05.113Z] [test] pnpm --filter @regen/rdc-marketing-engine test
67
+ [2026-04-15T23:18:41.002Z] [error] tsc: src/components/Form.tsx:42 — Property 'foo' does not exist
68
+ [2026-04-15T23:19:00.000Z] [note] retrying with corrected type import
69
+ [2026-04-15T23:45:10.000Z] [banner] Phase 2 complete — moving to review
70
+ ```
71
+
72
+ ### Appending from bash (Windows-safe)
73
+
74
+ ```bash
75
+ printf '[%s] [%s] %s\n' "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" "dispatch" "your message" >> "$LOG_PATH"
76
+ printf '[%s] [%s] %s\n' "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" "dispatch" "your message" >> "$CURRENT_PATH"
77
+ ```
78
+
79
+ Or from Node:
80
+ ```js
81
+ import { appendFileSync } from "node:fs";
82
+ const line = `[${new Date().toISOString()}] [note] ${msg}\n`;
83
+ appendFileSync(logPath, line);
84
+ appendFileSync(currentPath, line);
85
+ ```
86
+
87
+ ## Notes
88
+
89
+ - Log files live in the **user's project**, not the rdc-skills repo. Path: `<projectRoot>/.rdc/session-log/`
90
+ - Each invocation creates a **new run id** and overwrites `current.log`. Prior run logs remain on disk as `<runId>.log`.
91
+ - The viewer is a single static HTML file polling `current.log` via `fetch()` every 2s — no server, no deps.
92
+ - This skill does NOT replace `rdc:report` (the end-of-session Obsidian writeup). It's a live tail for attended or semi-attended sessions.