@lifeaitools/rdc-skills 0.35.4 → 0.35.6

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdc",
3
- "version": "0.35.4",
3
+ "version": "0.35.6",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code — plan, build, review, overnight unattended builds with work-item tracking and TDD enforcement.",
5
5
  "author": {
6
6
  "name": "LIFEAI",
package/commands/build.md CHANGED
@@ -69,6 +69,25 @@ Read the task title and description, then:
69
69
  - Mentions visualization, chart, diagram, SVG → `viz`
70
70
  - Multiple types? Dispatch multiple agents, each with its guide.
71
71
 
72
+ ### Execution primitive for create/open/build/deploy checklist rows
73
+
74
+ When a dispatched agent's checklist row is to materialize a product shape,
75
+ open a signed edit session, run a target's declared build gates, or deploy
76
+ to dev-PM2/npm-registry, it uses the real, tested `rdc-harness` CLI instead
77
+ of hand-rolled bash/curl:
78
+
79
+ ```bash
80
+ node C:/Dev/rdc-harness/bin/rdc-harness.mjs <create|open|edit|build|deploy> <slug> --monorepo-root <the dispatched agent's own worktree>
81
+ ```
82
+
83
+ One JSON receipt per call, exit 0/1 — tick the checklist row with the parsed
84
+ receipt as evidence, not the raw dump. No Coolify awareness (production
85
+ deploy stays `/rdc:deploy`'s own path) and no live co-editing surface
86
+ outside `site-html`/`site-ts` (other classes get file-boundary save only —
87
+ real, currently-unbuilt gap for other product classes, not something to
88
+ paper over here). `open`/`edit` require `RDC_HARNESS_ISSUER_SECRET` set
89
+ explicitly per-session — never a default.
90
+
72
91
  ## Procedure
73
92
 
74
93
  1. **Load the epic and its durable admission decisions:**
@@ -27,11 +27,30 @@ No raw MCP dumps. No UUIDs unless asked.
27
27
  - `rdc:deploy audit` — fleet-wide scan for missed failures
28
28
  - `rdc:deploy audit --fix` — fleet scan + auto-remediate safe issues
29
29
  - `rdc:deploy maintenance <service>` — create, update, or verify a template-declared private service; no public domain or host port
30
+ - `rdc:deploy dev <slug>` — deploy to PM2 dev (Vultr), not Coolify — see Mode 0
30
31
  - `rdc:deploy` (no args) — print mode menu, ask which
31
32
 
32
33
  ## Modes
33
34
 
34
- ### Mode 1deploy <slug> [build-id]
35
+ ### Mode 0dev <slug> (PM2 development, not Coolify)
36
+
37
+ PM2 dev deploys route through the real, tested `rdc-harness` CLI instead of
38
+ raw PM2/curl — it already implements this path (`shipRoute: pm2-development`,
39
+ via `@lifeaitools/regen-deploy-mgr` on loopback :52438, never raw PM2):
40
+
41
+ ```
42
+ rdc:deploy dev: <slug>
43
+ [ ] node C:/Dev/rdc-harness/bin/rdc-harness.mjs deploy <slug> --monorepo-root <caller's own worktree>
44
+ [ ] JSON receipt parsed — shipRoute confirmed "pm2-development" (else: not this product's route, see receipt.reason)
45
+ [ ] Receipt reports ok / the specific refusal, reported verbatim — not narrated
46
+ ✅ rdc:deploy dev: <slug> — <receipt outcome in one line>
47
+ ```
48
+
49
+ A receipt with `applicable: false, reason: 'not_pm2_shipped'` means this slug
50
+ ships a different way (registry, static, or Coolify) — report that plainly,
51
+ do not retry as Coolify without confirming that's actually the right route.
52
+
53
+ ### Mode 1 — deploy <slug> [build-id] (Coolify — staging/production)
35
54
 
36
55
  ```
37
56
  rdc:deploy: <slug> → <domain>
package/commands/fixit.md CHANGED
@@ -70,6 +70,23 @@ This signals the Stop hook that fixit is handling its own documentation.
70
70
 
71
71
  ### 4. Make the fix
72
72
 
73
+ If the fix is a create/open/build/deploy step against a real fleet
74
+ repository (materialize a product shape, open a signed edit session, run a
75
+ target's declared build gates, or deploy to dev-PM2/npm-registry), use the
76
+ real, tested `rdc-harness` CLI instead of hand-rolled bash/curl:
77
+
78
+ ```bash
79
+ node C:/Dev/rdc-harness/bin/rdc-harness.mjs <create|open|edit|build|deploy> <slug> --monorepo-root <your own worktree, never the shared checkout>
80
+ ```
81
+
82
+ One JSON receipt on stdout, exit 0/1 — use it as the evidence for whichever
83
+ checklist/commit step it satisfies. It has no Coolify awareness (deploy here
84
+ means PM2 dev or npm publish only — Coolify stays this skill's own §5.5 path)
85
+ and no live co-editing surface outside `site-html`/`site-ts` targets (other
86
+ classes get boundary-checked file save only). `open`/`edit` need
87
+ `RDC_HARNESS_ISSUER_SECRET` set explicitly — no default exists or should.
88
+ For anything not create/open/build/deploy shaped, edit files directly as below.
89
+
73
90
  Do the minimal work, conforming to `docs/CODING-STANDARDS.md` where present
74
91
  (regen-root; skip if absent). Scope creep rule: if you discover the fix requires more than originally scoped, **stop immediately**:
75
92
  1. Close the work item: `update_work_item_status('<id>', 'blocked', '["Escalated — scope exceeded fixit threshold"]')`
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: flow
3
+ description: >-
4
+ Usage `rdc:flow [status|<state> ["<reason>"]|normal]` — show or set the current flow state. Flow is the single FSM surface for both work-shape (plan/design/collab/build/refactor/overnight/harness-testing) and ceremony relaxation (hotfix/maintenance). Supersedes `rdc:mode` — hotfix/maintenance are flow values now, not a separate system.
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
+ # rdc:flow — the one FSM surface
12
+
13
+ ## When to Use
14
+ - Starting a turn — declare what kind of work this is (`build` needs a work item, `plan`/`design`/`collab` don't)
15
+ - A production incident where process ceremony is costing minutes that matter (`hotfix`)
16
+ - Routine upkeep that needs the same relaxation, without calling it an incident (`maintenance`)
17
+ - Checking what's currently declared, and why
18
+
19
+ ## The one thing to understand first
20
+
21
+ **There used to be two systems — mode (safety relaxation) and flow (work-shape declaration) — kept deliberately separate.** Operator instruction, 2026-08-25/26, direct and live: *"no special modes -- flow states only -- move hotfix to a flow state -- move env-bypass to a flow state -- the fsm will set what is enabled."*
22
+
23
+ `hotfix` and `maintenance` are now real flow values, carrying the exact same safety guarantee they always did as modes: a reason is required to enter either, and only the named ceremony allowlist (`HOTFIX_DISABLES`/`HOTFIX_RELAXES_GATES` in `$LIFEAI_ENV/hooks/lib/rdc-flow.mjs` and `C:/Dev/rdc-harness/fsm-daemon/src/matrix.js`) is ever relaxed — never a safety guard (`execution-scope`, `rm-rf-danger`, `push-force`, credential-exposure, etc.).
24
+
25
+ `rdc:mode` still exists for backward compatibility — the old mode axis is untouched, working code — but new work should use `rdc:flow` for everything, including what used to be a mode change.
26
+
27
+ ## States
28
+
29
+ | State | Meaning | Requires a reason | Work item required |
30
+ |---|---|---|---|
31
+ | `plan` / `design` / `collab` | Conversational — nothing shipping | no | no |
32
+ | `build` / `refactor` / `overnight` | Shipping code | no | **yes** |
33
+ | `harness-testing` | Proving/testing rdc-harness's own binding guard | no | yes |
34
+ | `hotfix` | Incident — ceremony relaxed for a bounded reason | **yes** | no |
35
+ | `maintenance` | Routine upkeep — same relaxation power as hotfix, different label | **yes** | no |
36
+
37
+ ## Usage
38
+
39
+ ```
40
+ rdc:flow # status — the default
41
+ rdc:flow status
42
+ rdc:flow build # declare shipping work — no reason needed
43
+ rdc:flow hotfix "prod checkout 500s" # relax ceremony — reason required
44
+ rdc:flow normal # clear — back to no flow declared
45
+ ```
46
+
47
+ ## Steps
48
+
49
+ ### 1. Read the current state
50
+
51
+ ```bash
52
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.currentState(),null,2)))"
53
+ ```
54
+
55
+ `currentState()` reads BOTH axes at once — the declared flow AND any live `rdc-mode.mjs` hotfix/maintenance window — because a relaxed mode overrides a required flow (loosest state wins) and a status check that only showed flow would miss that override entirely. Report `flow` (or `null` if nothing declared — the fail-closed default), `flowReason`/`flowSetBy`/`flowSetAt` when set, and `mode` (`normal` unless a hotfix/maintenance window is open), with `modeReason`/`modeMinutesLeft` when it isn't.
56
+
57
+ ### 2. Setting a plain work-shape flow — no reason required
58
+
59
+ ```bash
60
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.setFlow(process.argv[1],{setBy:process.argv[2]}),null,2)))" "<flow>" "<session-id>"
61
+ ```
62
+
63
+ ### 3. Setting hotfix or maintenance — a reason is REQUIRED
64
+
65
+ Refuse to proceed without one — `setFlow` throws on an empty reason for these two values, by design, same as `setMode` always did: an unexplained disarm is how a temporary state becomes permanent.
66
+
67
+ ```bash
68
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.setFlow('hotfix',{reason:process.argv[1],setBy:process.argv[2]}),null,2)))" "<reason>" "<session-id>"
69
+ ```
70
+
71
+ Then state plainly, in the checklist: **which guards are now relaxed, that the safety set is still armed, and that this stays active until explicitly cleared (no TTL — active management, not a silent timer).**
72
+
73
+ ### 4. Returning to normal
74
+
75
+ ```bash
76
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>{m.clearFlow();console.log('cleared')})"
77
+ ```
78
+
79
+ Do this **as soon as the incident is over**, or the moment the declared work-shape changes.
80
+
81
+ ## Rules
82
+
83
+ - **A reason is mandatory for `hotfix`/`maintenance`.** Every other flow value is a plain, reason-free declaration.
84
+ - **No TTL, ever, by default.** A flow — including `hotfix`/`maintenance` — stays active until explicitly cleared or replaced. Never a silent expiry.
85
+ - **Fail-closed.** No flow declared, an unreadable daemon, or a malformed response all read as `{flow: null}` — same behavior a work-shipping turn always had before this mechanism existed.
86
+ - **Never widen the relaxation set to unblock yourself.** A guard blocking a hotfix flow is information. Editing the allowlist to get past a red guard is the same violation as editing code to satisfy a failing gate (`.claude/rules/debugging-protocol.md` Rule 10).
87
+ - **hotfix/maintenance flow is not a bypass of review.** Work done under it still needs its work item, its evidence, and its close.
88
+
89
+ ## Verification
90
+
91
+ ```bash
92
+ node --test $LIFEAI_ENV/tests/rdc-flow.test.mjs
93
+ node --test C:/Dev/rdc-harness/fsm-daemon/tests/matrix.test.js
94
+ ```
package/commands/mode.md CHANGED
@@ -8,6 +8,12 @@ description: >-
8
8
  > Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
9
9
  > One checklist upfront, updated in place, shown again at end with a 1-line verdict.
10
10
 
11
+ > **Superseded by `rdc:flow`, 2026-08-26.** `hotfix`/`maintenance` are now
12
+ > flow values (same reason-required, same relaxation allowlist, no TTL by
13
+ > default) — one FSM surface instead of two. This skill's underlying code
14
+ > (`rdc-mode.mjs`) is untouched and still works; new work should use
15
+ > `rdc:flow hotfix "<reason>"` instead of `rdc:mode hotfix ...`.
16
+
11
17
  # rdc:mode — operating mode
12
18
 
13
19
  ## When to Use
@@ -64,7 +70,7 @@ rdc:mode normal # close it early
64
70
  ### 1. Read the current mode
65
71
 
66
72
  ```bash
67
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>console.log(JSON.stringify(m.currentMode(),null,2)))"
73
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>console.log(JSON.stringify(m.currentMode(),null,2)))"
68
74
  ```
69
75
 
70
76
  Report `mode`, and when not normal also `reason`, `setBy`, and `minutesLeft`.
@@ -78,7 +84,7 @@ unexplained disarm is how a temporary state becomes permanent, and the reason is
78
84
  the entire content of the audit line.
79
85
 
80
86
  ```bash
81
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>console.log(JSON.stringify(m.setMode('hotfix',{reason:process.argv[1],minutes:Number(process.argv[2]||60),setBy:process.argv[3]}),null,2)))" "<reason>" "<minutes>" "<session-id>"
87
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>console.log(JSON.stringify(m.setMode('hotfix',{reason:process.argv[1],minutes:Number(process.argv[2]||60),setBy:process.argv[3]}),null,2)))" "<reason>" "<minutes>" "<session-id>"
82
88
  ```
83
89
 
84
90
  Then state plainly, in the checklist: **which guards are now off, that the safety
@@ -87,7 +93,7 @@ set is still armed, and the exact wall-clock time the window closes.**
87
93
  ### 3. Returning to normal
88
94
 
89
95
  ```bash
90
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>{m.clearMode();console.log('normal')})"
96
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>{m.clearMode();console.log('normal')})"
91
97
  ```
92
98
 
93
99
  Do this **as soon as the incident is over**. The window expiring on its own is
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: open
3
+ description: >-
4
+ Usage `rdc:open [<slug>]` — orient before working. Answers where you are (repo, worktree, branch, dirty state) and what the target is (runtime, port, host, deploy path) from the registry, then names the harness shape to use. Run this first in any session that will change something.
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
+
10
+ # rdc:open — you are here, this is the thing, use this shape
11
+
12
+ ## Why this exists
13
+
14
+ Orientation ran **3.4× production work** across a measured 36-hour window —
15
+ 47.6% of tool calls establishing position and identity, 14.1% actually changing
16
+ something. `git rev-parse` alone was 316 calls, 6% of everything.
17
+
18
+ Cross-session rediscovery was **1.4%**. That number is the point: agents are not
19
+ forgetting what they learned, they are working new ground almost every time and
20
+ nothing tells them where they are. This is a surfacing problem, not a memory
21
+ problem, so caching buys nothing and an opening statement buys everything.
22
+
23
+ ## When to Use
24
+
25
+ - **First call of any session that will change something.** Before the first
26
+ read, not after the third `git status`.
27
+ - When you are handed a slug and do not know its runtime, port, or host.
28
+ - After a compaction, when position facts have aged out of context.
29
+ - Before any deploy — `rdc:deploy` assumes you already know the target's shape.
30
+
31
+ Not needed for a pure conversation turn.
32
+
33
+ ## What it answers
34
+
35
+ | Question | Source | Never |
36
+ |---|---|---|
37
+ | which repo / worktree / branch am I in | `git rev-parse`, `git status` | assumed from a hardcoded path |
38
+ | is my tree clean, am I behind | `git status -sb` | inferred from elapsed time |
39
+ | what IS this slug | `get_deployment('<slug>')` | guessed from the directory name |
40
+ | runtime, port, PM2 name, host | the registry | inferred from files on disk |
41
+ | who depends on it | the registry | assumed to be nothing |
42
+
43
+ **Two guesses this replaces, both measured wrong in practice:** filesystem
44
+ inference said `node-build` where the registry says `ts-server`; and
45
+ directory-name-as-slug fails outright — `packages/codeflow` is `codeflow-mcp`,
46
+ `apps/admin` is `portal`.
47
+
48
+ ## Steps
49
+
50
+ 1. **Position.** `node scripts/orient.mjs` — repo, worktree, branch @ sha,
51
+ upstream, dirty count. Relative paths from here are correct by construction;
52
+ a hardcoded `C:/Dev/regen-root/...` from a lane points at a *different
53
+ checkout*.
54
+ 2. **Target.** `node scripts/orient.mjs <slug>` — resolves the slug through
55
+ `get_deployment`, printing runtime, port, host, deploy path and dependents.
56
+ `monorepo_path` NULL means a standalone repo, not in this tree.
57
+ 3. **Harness.** Name the shape the target's class implies:
58
+
59
+ | class | build | dev | prod |
60
+ |---|---|---|---|
61
+ | `apps/<name>` | `pnpm --filter @regen/<name> build` | PM2 @ Vultr | Coolify |
62
+ | `packages/<name>` | `pnpm --filter @regen/<name> build` | imported | `npm publish` |
63
+ | `sites/`, `models/` | static/vite | PM2 @ Vultr | Coolify |
64
+ | standalone | its own tooling | — | Coolify |
65
+
66
+ 4. **State the ground in one line** and start. Do not re-derive it later in the
67
+ turn.
68
+
69
+ ## Checklist
70
+
71
+ ```
72
+ [ ] position resolved — repo, worktree, branch, dirty count
73
+ [ ] target resolved from the registry (or: no slug given, position only)
74
+ [ ] harness shape named for the target's class
75
+ [ ] blockers noted — behind upstream, dirty tree, service down
76
+ ```
77
+
78
+ ## Related
79
+
80
+ - `rdc:flow` — declares what KIND of work this is. `rdc:open` says where you are;
81
+ `rdc:flow` says what you are doing. Both, in that order.
82
+ - `rdc:status` — open epics and queue. That is the work; this is the ground.
83
+ - `$LIFEAI_ENV/docs/GATES-GUARDS-DENIES.md` — when a guard stops you, that names
84
+ the shape that works.
@@ -39,6 +39,17 @@ rdc:release: <repo> vX.Y.Z -> vA.B.C
39
39
  - Never force push or bypass hooks.
40
40
  - Never declare success without verifying the installed or deployed version.
41
41
 
42
+ For a `package`-class target that already resolves through `rdc-harness`
43
+ (a real monorepo subtree, not a standalone repo like this one), its
44
+ `packages/deploy/src/runners/registry-release.mjs` runner already proves the
45
+ "Tests/self-test passed" through "Local install/update executed" steps
46
+ safely — real `npm pack`, isolated-prefix install (never the real global
47
+ store), real verify, and `--live` explicitly gates the actual publish. Where
48
+ applicable, `node C:/Dev/rdc-harness/bin/rdc-harness.mjs deploy <slug>
49
+ [--live]` can supply those checklist rows' evidence directly instead of
50
+ hand-rolling the same pack/install/verify cycle. This does not replace
51
+ version bump/tag/push — the harness CLI does neither.
52
+
42
53
  ## RDC Skills Package
43
54
 
44
55
  After publishing this package to npm, a clean-box install should use: