@lifeaitools/rdc-skills 0.35.8 → 0.35.10

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.8",
3
+ "version": "0.35.10",
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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": "lifeai.plugin.v1",
3
3
  "id": "rdc-skills",
4
- "version": "0.35.8",
4
+ "version": "0.35.10",
5
5
  "publisher": "LIFEAI",
6
6
  "core": false,
7
7
  "documentation": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/rdc-skills",
3
- "version": "0.35.8",
3
+ "version": "0.35.10",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code - plan, build, review, overnight builds",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1000,30 +1000,60 @@ function runPreflight() {
1000
1000
  }
1001
1001
 
1002
1002
  // ── Commands listing ──────────────────────────────────────────────────────────
1003
+ /**
1004
+ * List EVERY `/rdc:*` verb — from commands/ AND skills/.
1005
+ *
1006
+ * This enumerated `commands/` only. That was harmless while every verb shipped
1007
+ * as both a command and a skill, and became actively misleading the moment the
1008
+ * duplicates were removed (2026-08-29): the printed surface fell from 32 to 13
1009
+ * while the real surface was unchanged at 56, because a skill provides the
1010
+ * `rdc:` slash form on its own.
1011
+ *
1012
+ * Verified live, not assumed: `commands/status.md` was deleted and `rdc:status`
1013
+ * still resolved, loading `skills/status/SKILL.md`.
1014
+ *
1015
+ * A listing that under-reports by 43 verbs is worse than no listing — it reads
1016
+ * as "those commands are gone", which is exactly the conclusion I drew from it
1017
+ * before checking. The installer's output IS the document an operator reads
1018
+ * after an install, so it has to describe what actually exists.
1019
+ */
1003
1020
  function listCommands() {
1004
- const cmdsDir = path.join(repoRoot, 'commands');
1005
- if (!fs.existsSync(cmdsDir)) return;
1006
- const files = fs.readdirSync(cmdsDir).filter(f => f.endsWith('.md')).sort();
1007
- const plugin = readJson(path.join(repoRoot, '.claude-plugin', 'plugin.json'), {});
1008
- const skillCount = Array.isArray(plugin.skills_meta)
1009
- ? plugin.skills_meta.length
1010
- : (plugin.skills_meta && typeof plugin.skills_meta === 'object' ? Object.keys(plugin.skills_meta).length : null);
1011
- console.log('');
1012
- if (skillCount !== null) {
1013
- console.log(` \x1b[32mAvailable MCP skills (${skillCount}) and /rdc:* command shorthands (${files.length}):\x1b[0m`);
1014
- console.log(' Use MCP tools rdc_skill_list, rdc_skill_search, and rdc_skill_get for the full skill catalog.');
1015
- } else {
1016
- console.log(` \x1b[32mAvailable /rdc:* command shorthands (${files.length}):\x1b[0m`);
1021
+ const cmdsDir = path.join(repoRoot, 'commands');
1022
+ const skillDir = path.join(repoRoot, 'skills');
1023
+
1024
+ const verbs = new Map(); // name -> { desc, from }
1025
+ const add = (name, desc, from) => {
1026
+ if (!verbs.has(name)) verbs.set(name, { desc: desc || '', from });
1027
+ };
1028
+
1029
+ if (fs.existsSync(cmdsDir)) {
1030
+ for (const f of fs.readdirSync(cmdsDir).filter((x) => x.endsWith('.md'))) {
1031
+ const fm = readFrontmatter(path.join(cmdsDir, f));
1032
+ add(f.replace(/\.md$/, ''), fm.description, 'command');
1033
+ }
1034
+ }
1035
+ if (fs.existsSync(skillDir)) {
1036
+ for (const d of fs.readdirSync(skillDir, { withFileTypes: true })) {
1037
+ if (!d.isDirectory()) continue;
1038
+ const skillFile = path.join(skillDir, d.name, 'SKILL.md');
1039
+ if (!fs.existsSync(skillFile)) continue; // `tests/` is a fixture dir, not a skill
1040
+ add(d.name, readFrontmatter(skillFile).description, 'skill');
1041
+ }
1017
1042
  }
1043
+ if (verbs.size === 0) return;
1044
+
1045
+ const names = [...verbs.keys()].sort();
1046
+ const nCmd = [...verbs.values()].filter((v) => v.from === 'command').length;
1018
1047
  console.log('');
1019
- const COL = 18;
1020
- for (const f of files) {
1021
- const name = 'rdc:' + f.replace(/\.md$/, '');
1022
- const fm = readFrontmatter(path.join(cmdsDir, f));
1023
- const desc = (fm.description || '').replace(/\n/g, ' ').replace(/\s+/g, ' ').trim();
1024
- const short = desc.length > 70 ? desc.slice(0, 70) + '…' : desc;
1025
- const pad = ' '.repeat(Math.max(1, COL - name.length));
1026
- console.log(` \x1b[36m/${name}\x1b[0m${pad}${short}`);
1048
+ console.log(` \x1b[32mAvailable /rdc:* verbs (${names.length}) — ${nCmd} command, ${names.length - nCmd} skill:\x1b[0m`);
1049
+ console.log(' Use MCP tools rdc_skill_list, rdc_skill_search, and rdc_skill_get for the full catalog.');
1050
+ console.log('');
1051
+ const COL = 26;
1052
+ for (const n of names) {
1053
+ const desc = (verbs.get(n).desc || '').replace(/\s+/g, ' ').trim();
1054
+ const short = desc.length > 70 ? `${desc.slice(0, 70)}…` : desc;
1055
+ const label = `rdc:${n}`;
1056
+ console.log(` \x1b[36m/${label}\x1b[0m${' '.repeat(Math.max(1, COL - label.length))}${short}`);
1027
1057
  }
1028
1058
  console.log('');
1029
1059
  }
@@ -505,6 +505,41 @@ chitchat MCP + SSE; you are the build half of a live session.
505
505
  - `type: stop` ends the session; send a final summary, then `chitchat_stop`.
506
506
  - Stream progress mid-work with `chitchat_reply` on long tasks.
507
507
 
508
+ ### File-relay transport (the second way `listen` arrives)
509
+
510
+ Merged from `commands/collab.md` on 2026-08-29, which is now removed. This
511
+ skill documented only the chitchat/SSE transport; the command documented a
512
+ FILE relay, and neither mentioned the other. Two transports for one mode, each
513
+ written down in a place the other's reader would not look.
514
+
515
+ Invoked as `/rdc:collab --session <session_id>`. claude.ai writes tasks into an
516
+ inbox; you read, act, commit, write the response to an outbox, and loop.
517
+
518
+ ```
519
+ sessionDir = .rdc/relay/sessions/<session_id>/
520
+ inbox = sessionDir/inbox/
521
+ outbox = sessionDir/outbox/
522
+ ```
523
+
524
+ 1. **Parse** `--session <uuid>`. With no `--session`, list
525
+ `.rdc/relay/sessions/` and show what is available. If the directories do not
526
+ exist, say so — `chitchat_start` has to run from claude.ai first. Do not
527
+ create them.
528
+ 2. **Announce.** Set `sessionDir/status.json` to
529
+ `{ "status": "active", "cli_connected_at": "<iso>", "session_id": "<id>" }`
530
+ and write a ready signal to the outbox, so claude.ai knows the CLI attached.
531
+ 3. **Poll** the inbox for `.md` files not ending in `.processed`, oldest first
532
+ by name. Nothing found → wait 5s and poll again; after 10 minutes idle print
533
+ a `Still listening...` heartbeat and keep waiting.
534
+ 4. **Process one message.** Read its frontmatter `type`. `stop` ends the
535
+ session. Anything else is a task: rename the file to `<name>.processed`
536
+ FIRST so a crash cannot replay it, then act with full capabilities — edits,
537
+ commits to the lane, `npx tsc --noEmit` (never `pnpm build`), other skills —
538
+ and write the response to the outbox when done.
539
+
540
+ `agent-bootstrap.md` rules apply throughout, and Dave typing in the terminal is
541
+ a high-priority override in this transport exactly as in the other.
542
+
508
543
  ---
509
544
 
510
545
  ## Dave interjections
@@ -38,8 +38,16 @@ No raw MCP dumps. No UUIDs unless asked.
38
38
  - `rdc:deploy audit` — fleet-wide scan for missed failures
39
39
  - `rdc:deploy audit --fix` — fleet scan + auto-remediate safe issues
40
40
  - `rdc:deploy maintenance <service>` — create, update, or verify one allowlisted private infrastructure service (Mode 7)
41
+ - `rdc:deploy dev <slug>` — explicit alias for the first form above. Plain
42
+ `rdc:deploy <slug>` already targets PM2 dev, so this only makes the intent
43
+ unmissable when a reader expects Coolify.
41
44
  - `rdc:deploy` (no args) — print mode menu, ask which
42
45
 
46
+ > `<ref>` is what `commands/deploy.md` called `<build-id>` before that file was
47
+ > removed (2026-08-29). Same thing — a registered manifest ref, a commit, or a
48
+ > tag. With no ref, the deployment is the latest commit on the app's WATCHED
49
+ > branch, not on whatever branch happens to be checked out locally.
50
+
43
51
  ## Modes
44
52
 
45
53
  ### Mode 1 — deploy <slug> [ref]
@@ -159,6 +159,9 @@ Est: <hours>',
159
159
  p_labels := ARRAY['<label>'],
160
160
  p_estimated_hours := 2,
161
161
  p_source := 'planning'
162
+ -- If the epic has architecture_ref set, also add a required
163
+ -- architecture-fidelity-<slug> checklist row via p_checklist here — the exit gate
164
+ -- hard-rejects `done` on any task under an architecture_ref epic that lacks one.
162
165
  );
163
166
  ```
164
167
 
@@ -33,6 +33,30 @@ description: rdc:plan (topic) — produce architecture, decisions and an epic wi
33
33
  - Relevant CLAUDE.md files from affected packages
34
34
  - Existing Supabase epics: `SELECT get_open_epics()`
35
35
 
36
+ 1b. **Identify the affected domains, then load the matching architecture doc.**
37
+
38
+ Merged from `commands/plan.md` on 2026-08-29, which is now removed. This file
39
+ referenced architecture docs 9 times and the command 28 — but only the
40
+ command carried the ROUTING, so the instruction to load the right doc lived
41
+ in the copy a reader might never open.
42
+
43
+ | Domain keywords in the topic | Architecture doc to read |
44
+ |---|---|
45
+ | PRT, trust, capital, NAV, investor, land, DST | `docs/systems/prt/ARCHITECTURE.md` |
46
+ | CS 2.0, HAIL, PAL, virtue, quad-pixel, ontology, BPMN, cognitive | `docs/systems/cs2/ARCHITECTURE.md` |
47
+ | marketing, CRM, campaign, contact, outreach, RDC app | `docs/systems/rdc/ARCHITECTURE.md` |
48
+ | Claude workflow, skills, agents, dispatch, rdc:build | `docs/systems/claude-workflow/ARCHITECTURE.md` |
49
+ | Life AI, LIFEAI platform, life.ai | `docs/systems/lifeai/ARCHITECTURE.md` |
50
+ | media, R2, images, regen-media, MCP image | `docs/systems/media/ARCHITECTURE.md` |
51
+ | UI, component, brand, design token, shared, OG image | `docs/systems/shared/ARCHITECTURE.md` |
52
+
53
+ `.claude/rules/system-quick-links.md` is the routing map to all of them. A
54
+ topic spanning several domains reads ALL the matching docs before proceeding.
55
+
56
+ **A plan that contradicts an existing architecture doc is invalid.** Load them
57
+ first, and when a decision conflicts with one, flag the conflict rather than
58
+ quietly planning around it.
59
+
36
60
  2. **Read the codebase** — understand current state:
37
61
  - What packages are affected?
38
62
  - What types/interfaces already exist?
@@ -74,6 +74,31 @@ If blocked, abort immediately with the message above. Do NOT proceed to the vers
74
74
 
75
75
  If PUBLISH.md is absent and app has no `app_deployments` row (library/package), skip this gate.
76
76
 
77
+ ## Rules
78
+
79
+ Merged from `commands/release.md` on 2026-08-29, which is now removed. Each of
80
+ these was in the command and NOT in this file, which is precisely the drift that
81
+ shipping one verb as two documents produces.
82
+
83
+ - Do not release without explicit user authorization.
84
+ - Prefer repo-local release instructions in `.rdc/release.json`, README, package
85
+ scripts, or CI workflows.
86
+ - **Never force push or bypass hooks.**
87
+ - **Never declare success without verifying the installed or deployed version.**
88
+ A publish that exits 0 is not a published package — the registry can lag
89
+ minutes behind, so check the version endpoint, not the success line.
90
+
91
+ For a `package`-class target that already resolves through `rdc-harness` (a real
92
+ monorepo subtree, not a standalone repo like this one),
93
+ `packages/deploy/src/runners/registry-release.mjs` already proves the
94
+ "Tests/self-test passed" through "Local install/update executed" rows safely:
95
+ real `npm pack`, isolated-prefix install (never the real global store), real
96
+ verify, and `--live` explicitly gating the actual publish. Where applicable,
97
+ `node C:/Dev/rdc-harness/bin/rdc-harness.mjs deploy <slug> [--live]` can supply
98
+ that evidence directly instead of hand-rolling the same pack/install/verify
99
+ cycle. It does **not** replace version bump, tag or push — the harness CLI does
100
+ none of those.
101
+
77
102
  ## Resolution Order
78
103
 
79
104
  1. Current repo if `<repo>` is `.` or omitted and the user clearly refers to the current workspace.
@@ -7,10 +7,22 @@ import { fileURLToPath } from 'node:url';
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
  const root = resolve(__dirname, '..');
9
9
 
10
+ /**
11
+ * `help` has ONE surface now.
12
+ *
13
+ * It used to ship as both commands/help.md and skills/help/SKILL.md, which is
14
+ * half of why a single verb appeared four times in the command list. The
15
+ * command was removed on 2026-08-29 after checking substance rather than
16
+ * counting lines: the skill already carried the manifest resolution order, the
17
+ * plugin.json path and the slash forms.
18
+ *
19
+ * Kept as a map rather than collapsed to one constant so the loop below still
20
+ * names which document failed — and so restoring a second surface, if that ever
21
+ * becomes right, is one line.
22
+ */
10
23
  const files = {
11
24
  readme: join(root, 'README.md'),
12
25
  skillHelp: join(root, 'skills', 'help', 'SKILL.md'),
13
- commandHelp: join(root, 'commands', 'help.md'),
14
26
  };
15
27
 
16
28
  const docs = Object.fromEntries(
@@ -40,12 +52,14 @@ assert.match(docs.readme, /Nineteen[\s\S]*\/rdc:\*` command shorthands/i, 'READM
40
52
  assert.match(docs.readme, /Use `rdc_skill_list` for the authoritative live catalog/, 'README should point callers to live MCP catalog');
41
53
  assert.doesNotMatch(docs.readme, /All user-invocable skills become available as slash commands/, 'README must not imply all MCP skills are slash commands');
42
54
  assert.doesNotMatch(docs.readme, /29 skills organized into 6 categories/, 'README must not carry stale category count');
43
- assert.match(docs.commandHelp, /all MCP skills/, 'command help should refer to MCP skill catalog');
55
+ // One surface, so these assert once. They were duplicated across commandHelp
56
+ // and skillHelp; the negative pair moves to the surviving document rather than
57
+ // being dropped — a stale-wording check is worth keeping regardless of which
58
+ // file carries the text.
44
59
  assert.match(docs.skillHelp, /all MCP skills/, 'skill help should refer to MCP skill catalog');
45
60
  assert.match(docs.skillHelp, /manifest-driven/i, 'skill help should be manifest-driven');
46
- assert.match(docs.commandHelp, /manifest-driven/i, 'command help should be manifest-driven');
47
- assert.doesNotMatch(docs.commandHelp, /Print the full usage menu below verbatim/, 'command help must not use stale static menu wording');
48
- assert.doesNotMatch(docs.commandHelp, /get\/<service>/, 'command help must use current clauth /v/<service> wording');
61
+ assert.doesNotMatch(docs.skillHelp, /Print the full usage menu below verbatim/, 'help must not use stale static menu wording');
62
+ assert.doesNotMatch(docs.skillHelp, /get\/<service>/, 'help must use current clauth /v/<service> wording');
49
63
 
50
64
  const skillDirs = readdirSync(join(root, 'skills'))
51
65
  .filter((name) => {
@@ -60,15 +60,33 @@ assert.equal(
60
60
  realSkillDirs.length,
61
61
  `plugin.json skills_meta (${skillCount}) must match the actual skill directories on disk (${realSkillDirs.length}): ${realSkillDirs.join(', ')}`,
62
62
  );
63
+ // The listing must report EVERY /rdc:* verb, and say which surface each comes
64
+ // from. It used to enumerate commands/ only, which was harmless while every verb
65
+ // shipped as both a command and a skill — and became actively misleading the
66
+ // moment the duplicates were removed (2026-08-29): the printed surface fell from
67
+ // 32 to 13 while the real surface was unchanged, because a skill provides the
68
+ // slash form on its own (verified live: commands/status.md deleted, rdc:status
69
+ // still resolved). A listing that under-reports by 43 verbs reads as "those
70
+ // commands are gone".
63
71
  assert.match(
64
72
  source,
65
- /Available MCP skills.*\/rdc:\* command shorthands/,
66
- 'installer should distinguish the full MCP skill catalog from slash-command shorthands',
73
+ /Available \/rdc:\* verbs/,
74
+ 'installer should list every /rdc:* verb, not only the command-backed ones',
67
75
  );
68
76
  assert.match(
69
77
  source,
70
- /Object\.keys\(plugin\.skills_meta\)\.length/,
71
- 'installer should count object-shaped skills_meta manifests',
78
+ /command, \$\{[^}]*\} skill/,
79
+ 'installer should say how many verbs come from commands and how many from skills',
80
+ );
81
+ assert.match(
82
+ source,
83
+ /readdirSync\(skillDir, \{ withFileTypes: true \}\)/,
84
+ 'installer should enumerate the real skill directories, not a manifest count that can drift from disk',
85
+ );
86
+ assert.match(
87
+ source,
88
+ /SKILL\.md'\)\)\) continue/,
89
+ 'installer must skip a directory with no SKILL.md — tests/ is a fixture dir, not a skill',
72
90
  );
73
91
  assert.match(
74
92
  source,
package/commands/build.md DELETED
@@ -1,223 +0,0 @@
1
- ---
2
- name: build
3
- description: rdc:build (epic-id) - [--no-review] — execute a planned epic, then gate and ship to dev
4
- ---
5
-
6
- > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
7
- > Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
8
- > One checklist upfront, updated in place, shown again at end with a 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.
11
-
12
-
13
- # rdc:build — Typed Agent Dispatch Engine
14
-
15
- ## When to Use
16
- - Plan is approved and ready to execute
17
- - Project lead says "build it", "go", "execute", "do not stop"
18
- - An epic exists with child tasks ready for implementation
19
- - Called by `rdc:overnight` as part of the automated build loop
20
-
21
- ## Arguments
22
- - `rdc:build <epic-id>` — build from a specific Supabase epic
23
- - `rdc:build <topic>` — find the epic by label/title match
24
- - `rdc:build` (no args) — show open epics and ask which to build (interactive only)
25
- - `rdc:build <epic-id> --unattended` — silent mode for overnight builds
26
-
27
- ## Agent Types & Guide Files
28
-
29
- Every dispatched agent MUST read two files before starting — in this order:
30
- 1. `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` — credentials, git rules, completion report format
31
- (fallback: `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` if `.rdc/` does not exist)
32
- 2. `{PROJECT_ROOT}/.rdc/guides/<type>.md` — role-specific guide
33
- (fallback: `{PROJECT_ROOT}/.rdc/guides/<type>.md`)
34
-
35
- Include both lines in every agent prompt:
36
- ```
37
- "Read {PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md first (fallback: .rdc/guides/agent-bootstrap.md), then {PROJECT_ROOT}/.rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md) before starting."
38
- ```
39
-
40
- | Agent Type | Guide File | When to dispatch |
41
- |-----------|-----------|-----------------|
42
- | `frontend` | `.rdc/guides/frontend.md` | React components, pages, UI, Tailwind, animation |
43
- | `backend` | `.rdc/guides/backend.md` | API routes, server components, database queries, auth |
44
- | `data` | `.rdc/guides/data.md` | Migrations, schema changes, RPC functions |
45
- | `design` | `.rdc/guides/design.md` | Visual design, brand palettes, OG images, token work |
46
- | `infra` | `.rdc/guides/infrastructure.md` | CI/CD, deployment, DNS, SSL |
47
- | `content` | `.rdc/guides/content.md` | Marketing copy, messaging, tone |
48
- | `cs2` | `.rdc/guides/cs2.md` | CS 2.0 paradigm work (generic) |
49
- | `hail` | `.rdc/guides/cs2.md` + `packages/hail/CLAUDE.md` | Grammar, DSL compiler, evolution |
50
- | `pal` | `.rdc/guides/cs2.md` + `packages/pal/CLAUDE.md` | Sessions, moment windows, graph memory |
51
- | `bpmn` | `.rdc/guides/cs2.md` + `docs/systems/<domain>/flowable-bpmn-architecture.md` | BPMN flows, governance |
52
- | `virtue` | `.rdc/guides/cs2.md` + `packages/virtue-engine/CLAUDE.md` | Virtue weights, coherence, certification |
53
- | `viz` | `.rdc/guides/frontend.md` + `.rdc/guides/design.md` | Custom viz components, charts, diagrams |
54
-
55
- ### How to classify a task → agent type
56
-
57
- Read the task title and description, then:
58
- - Mentions React, component, page, UI, Tailwind → `frontend`
59
- - Mentions API route, server, database query, auth → `backend`
60
- - Mentions migration, schema, table, RPC → `data`
61
- - Mentions brand, palette, typography, OG image → `design`
62
- - Mentions deploy, infrastructure, CI, DNS → `infra`
63
- - Mentions copy, messaging, email template → `content`
64
- - Mentions grammar, DSL, compiler → `hail`
65
- - Mentions session, moment, memory graph → `pal`
66
- - Mentions BPMN, flow, governance → `bpmn`
67
- - Mentions virtue, coherence, certification → `virtue`
68
- - Mentions visualization, chart, diagram, SVG → `viz`
69
- - Multiple types? Dispatch multiple agents, each with its guide.
70
-
71
- ### Execution primitive for create/open/build/deploy checklist rows
72
-
73
- When a dispatched agent's checklist row is to materialize a product shape,
74
- open a signed edit session, run a target's declared build gates, or deploy
75
- to dev-PM2/npm-registry, it uses the real, tested `rdc-harness` CLI instead
76
- 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 <the dispatched agent's own worktree>
80
- ```
81
-
82
- One JSON receipt per call, exit 0/1 — tick the checklist row with the parsed
83
- receipt as evidence, not the raw dump. No Coolify awareness (production
84
- deploy stays `/rdc:deploy`'s own path) and no live co-editing surface
85
- outside `site-html`/`site-ts` (other classes get file-boundary save only —
86
- real, currently-unbuilt gap for other product classes, not something to
87
- paper over here). `open`/`edit` require `RDC_HARNESS_ISSUER_SECRET` set
88
- explicitly per-session — never a default.
89
-
90
- ## Procedure
91
-
92
- 1. **Load the epic and its durable admission decisions:**
93
- ```sql
94
- SELECT get_work_items_by_epic('<epic-id>');
95
- ```
96
- - Read `design_review_state` and `status` for every executable child.
97
- - Only `automatic_approved`, `human_approved`, or legacy `not_required` rows may be considered for dispatch.
98
- - For `pending`, `needs_human`, or `rejected`, write an `admission_refocus` receipt, keep the child blocked, and route it to the reviewer/planner. **Do not dispatch it, retry it, or call the epic complete.**
99
- - Interactive (no args): show open epics, ask which to build
100
- - Unattended (no tasks found): escalate via advisor tool
101
- - **Read the epic's `plan_ref`, `spec_ref`, `architecture_ref`, and `scoping_statement` fields** (returned on the epic row itself). `scoping_statement` bounds what this build may touch — do not silently expand past it. If `architecture_ref` is set, this epic crosses an architectural boundary: read that doc now, before classifying or dispatching any task, and carry it into every agent prompt in step 7.
102
-
103
- 1a. **Run the durable CodeFlow supervisor before each wave and after every gate-changing action.**
104
- - Invoke `runOrchestrator()` with the project manifest, `SupabaseStateStore`, and the real phase dispatcher. It is the sole authority for resuming/refocusing a phase DAG; do not reconstruct waves by hand from task prose.
105
- - A returned `admission_refocus` or `pipeline_blocked` is a durable hold, not a failed attempt to work around. Preserve its task state and route the required Design Review or validator closure.
106
- - Only a returned `pipeline_complete` whose phase tasks are all design-review admitted **and** durably `done` permits an epic completion claim. If the project lacks a real dispatcher/manifest, report `BLOCKED: CodeFlow supervisor entrypoint unavailable` rather than emulating completion.
107
-
108
- 2. **CHECK FOR EXISTING WORK (mandatory — never skip):**
109
- ```sql
110
- -- Check if prototypes exist from earlier sessions
111
- SELECT name, component, source_path, status, notes
112
- FROM prototype_registry
113
- WHERE status IN ('prototype', 'converting')
114
- ORDER BY created_at DESC;
115
-
116
- -- Check for design decisions on this topic
117
- SELECT topic, context_type, summary, source
118
- FROM design_context
119
- WHERE topic ILIKE '%<epic-topic>%'
120
- ORDER BY created_at DESC;
121
- ```
122
- **If a prototype exists: ADAPT IT. Do not build from scratch.**
123
- Tell the agent: "Read <source_path> first and convert it to the production contract."
124
-
125
- **If design decisions exist: follow them.** Include the summary in the agent prompt.
126
-
127
- 3. **Load the plan** (if exists): check `.rdc/plans/` for matching topic (fallback: `.rdc/plans/`).
128
-
129
- 4. **Read CLAUDE.md files** for all affected packages, plus `docs/CODING-STANDARDS.md`
130
- (SOLID/Clean-Architecture standard — regen-root; skip if absent) — carry it into every
131
- dispatched agent prompt.
132
-
133
- 5. **Classify each task** → assign agent type from the table above.
134
-
135
- 6. **Use the supervisor-resolved waves** — parallelize only phases returned by `runOrchestrator()` after its durable admission check:
136
- - Wave 1: independent tasks (different packages/files)
137
- - Wave 2: tasks that depend on Wave 1 outputs
138
- - Wave 3: integration tasks
139
-
140
- 7. **For each wave — dispatch typed agents in parallel:**
141
- - Set work item to `in_progress` before dispatching
142
- - Each agent prompt MUST include:
143
- - `"Read {PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md first (fallback: .rdc/guides/agent-bootstrap.md), then {PROJECT_ROOT}/.rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md) before starting."`
144
- - Specific files to create/modify
145
- - Exact deliverables and commit message
146
- - The epic's `scoping_statement` — explicit boundary on what this task may and may not touch
147
- - `"NEVER run pnpm build/test. NEVER modify files outside your scope."`
148
- - **If the epic's `architecture_ref` is set:** include `"Read <architecture_ref> before implementing. Your task's checklist requires a checked architecture-fidelity-<slug> row before this item can close — when you tick it, its evidence must cite the specific section/boundary of <architecture_ref> your implementation conforms to, not just 'done'."` A task under an `architecture_ref` epic will hard-fail at the exit gate (step 9) without this row checked with real evidence.
149
- - Use `run_in_background: true` for parallel execution
150
- - NEVER let agents overlap on the same files
151
-
152
- 8. **Post-wave test gate (mandatory):**
153
- After all agents in a wave complete, before marking tasks done:
154
- ```bash
155
- # For each package modified in this wave:
156
- cd packages/<name> && npx vitest run 2>&1 | tail -20
157
- ```
158
- - All tests must pass before proceeding to next wave
159
- - If tests fail: fix before marking the wave done
160
- - NEVER use `pnpm build` or `pnpm turbo test` — vitest only per package
161
- - New code must have tests: if a modified package shows 0 new test files, flag it
162
-
163
- 9. **As agents complete:**
164
- - Verify commit landed on the development branch
165
- - Push to origin *(skip if `$RDC_TEST=1` — echo `[RDC_TEST] skipping git push` instead)*
166
- - Ensure the agent submitted `implementation_report.codeflow_post`, then set the work item to `review`; the validator closes `done`
167
- - Re-invoke `runOrchestrator()` after the durable status/gate update. A task in `review` remains incomplete even when its phase gate passed.
168
- - **If the epic's `architecture_ref` is set:** before the validator attempts `done`, confirm the task's checklist has a checked `architecture-fidelity-*` row with real evidence (a cited doc section, not a bare "matches"). `update_work_item_status(..., 'done')` will hard-reject otherwise — catching this here avoids a wasted validator round-trip.
169
- - Continue to next wave
170
-
171
- **If an agent fails:**
172
- - Interactive: diagnose before retrying
173
- - Unattended: retry once; on second failure escalate via advisor
174
- ```
175
- BUILD_STATUS: { wave, tasks_done, tasks_failed, commits, escalated: true }
176
- ```
177
-
178
- 10. **Final verification gate (mandatory — before marking work or epic done):**
179
- Dispatch the verify agent (see `guides/agents/verify.md`) across every package/app touched in this build.
180
- The Iron Law: **NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.**
181
- - Run `npx vitest run --dir <pkg>` fresh for each touched package
182
- - Run `npx tsc --noEmit --project <pkg>/tsconfig.json` for each
183
- - Read the full output — zero failures, zero type errors
184
- - If any step fails: fix and re-run the entire gate. Do not skip.
185
- - NEVER `pnpm build` / `pnpm test` / `pnpm -r` (crashes machine)
186
- - **ATF Test-Ladder / rdc-harness (WIP — best-effort, not a hard gate yet):** if a
187
- touched package/repo ships an ATF `STP-001.md` or an `rdc-harness`-style
188
- `tools/mutate-check.mjs`/`tools/proof-ledger.mjs` pair, run it and quote the result
189
- alongside vitest/tsc. A red mutation gate is a real finding — report it, do not
190
- silently drop it because it isn't wired into this checklist as required yet.
191
- Absence of either system in the target is not a failure; do not install one ad hoc.
192
-
193
- 11. **After verification passes:**
194
- - Push all commits:
195
- ```bash
196
- if [ "$RDC_TEST" != "1" ]; then
197
- git push origin {development-branch}
198
- else
199
- echo "[RDC_TEST] skipping git push origin {development-branch}"
200
- fi
201
- ```
202
- - Re-invoke `runOrchestrator()` and require its `pipeline_complete` receipt before `bump_epic_version()` or any epic completion claim. A clean code review or green test suite is not a substitute for admitted, validator-closed work items.
203
- - Report summary with verification evidence quoted
204
-
205
- ## Agent TDD Requirements
206
-
207
- When dispatching agents, include in every prompt:
208
- ```
209
- TDD REQUIREMENT: Write tests FIRST for new functions/modules.
210
- Run: npx vitest run packages/<name> to verify red → implement → verify green.
211
- NEVER run pnpm build or pnpm turbo. Use npx vitest run only.
212
- ```
213
-
214
- ## Rules
215
- - Branch: development branch only (auto-commit, no confirmation needed)
216
- - NEVER let two agents edit the same file
217
- - NEVER run `pnpm build` (crashes system) — code only
218
- - Every agent reads its guide file — no exceptions
219
- - Update Supabase work items IN REAL TIME — not batch at end
220
- - **Never dispatch, resume, or complete around `design_review_state`; the durable database result and `runOrchestrator()` receipt win over an agent's narrative**
221
- - Push after each wave, not just at the end
222
- - Unattended: NEVER pause — continue automatically
223
- - Unattended: max 2 retries per task before escalating to advisor