@lifeaitools/rdc-skills 0.35.8 → 0.35.9

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.
package/commands/help.md DELETED
@@ -1,93 +0,0 @@
1
- ---
2
- name: help
3
- description: rdc:help () — list all MCP skills with usage, requirements and slash form
4
- ---
5
-
6
- > **Output contract:** Checklist/table output only. No raw MCP/JSON/log dumps.
7
-
8
- # rdc:help — Manifest-Driven Skill Reference
9
-
10
- Print a concise skill reference from the plugin manifest, then stop. Do not
11
- ask which command to run unless the user explicitly asks for a recommendation.
12
-
13
- ## Source Of Truth
14
-
15
- Resolve the manifest in this order and use the first existing file:
16
-
17
- 1. `{PLUGIN_ROOT}/.claude-plugin/plugin.json`
18
- 2. `C:/Dev/rdc-skills/.claude-plugin/plugin.json`
19
- 3. `~/.claude/plugins/cache/rdc-skills/rdc-skills/latest/.claude-plugin/plugin.json`
20
-
21
- Read `skills_meta` from the manifest. Accept either the current object map shape
22
- (`skills_meta.<name>`) or an older array shape (`skills_meta[]`); normalize to
23
- entries before rendering. Group entries by `category` in this order:
24
- `planning`, `build`, `deploy`, `release`, `dev-loop`, `reporting`, `tooling`,
25
- `infra`.
26
-
27
- For each row, show:
28
-
29
- ```text
30
- {slash} — {usage} — needs: {requires or "(none)"} — cf: {yes|no}
31
- ```
32
-
33
- At the end, render a short decision tree from `skills_meta[].triggers`.
34
-
35
- If the manifest is unreachable, say `manifest fallback used` and render the
36
- static fallback table from `skills/help/SKILL.md`.
37
-
38
- ## Direct MCP / curl Access
39
-
40
- Show this block after the command table so non-Claude callers have the same
41
- entry point. Do not summarize, compress, relabel, or omit the curl examples;
42
- this block is the public direct-caller contract for MCP/API/curl users.
43
-
44
- ```text
45
- MCP endpoint: https://rdc-skills.regendevcorp.com/mcp
46
- Health: curl -s https://rdc-skills.regendevcorp.com/health
47
- Header: Accept: application/json, text/event-stream
48
- Tools: rdc_skill_list, rdc_skill_search, rdc_skill_get
49
- Variants: cli for Claude Code/Codex/local terminal; cloud for claude.ai
50
- Response: SSE `data:` line contains the JSON-RPC envelope; tool text is result.content[0].text
51
- Catalog: rdc_skill_list returns aliases, args, requires, produces, follows, leads_to, output_contract, codeflow_required, and variants
52
- ```
53
-
54
- Minimal curl examples:
55
-
56
- ```bash
57
- curl -s -X POST https://rdc-skills.regendevcorp.com/mcp \
58
- -H 'Content-Type: application/json' \
59
- -H 'Accept: application/json, text/event-stream' \
60
- -d '{"jsonrpc":"2.0","id":0,"method":"tools/list"}' \
61
- | sed -n 's/^data: //p'
62
-
63
- curl -s -X POST https://rdc-skills.regendevcorp.com/mcp \
64
- -H 'Content-Type: application/json' \
65
- -H 'Accept: application/json, text/event-stream' \
66
- -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"rdc_skill_list","arguments":{}}}'
67
-
68
- curl -s -X POST https://rdc-skills.regendevcorp.com/mcp \
69
- -H 'Content-Type: application/json' \
70
- -H 'Accept: application/json, text/event-stream' \
71
- -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"rdc_skill_search","arguments":{"query":"turn this article into social posts"}}}'
72
-
73
- curl -s -X POST https://rdc-skills.regendevcorp.com/mcp \
74
- -H 'Content-Type: application/json' \
75
- -H 'Accept: application/json, text/event-stream' \
76
- -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"rdc_skill_get","arguments":{"name":"rdc:build","variant":"cli"}}}'
77
-
78
- curl -s -X POST https://rdc-skills.regendevcorp.com/mcp \
79
- -H 'Content-Type: application/json' \
80
- -H 'Accept: application/json, text/event-stream' \
81
- -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"rdc_skill_get","arguments":{"name":"rdc:build","variant":"cli","format":"json"}}}'
82
- ```
83
-
84
- Required exact token for tests and direct callers: `"format":"json"`
85
-
86
- ## Hard Rules
87
-
88
- - `cf: yes` skills must consult CodeFlow before acting.
89
- - Never run `pnpm build` at monorepo root. Use scoped typecheck/tests.
90
- - Never commit to `main` without explicit approval.
91
- - Never overlap agents on the same files.
92
- - Update work items in real time for skills that require work-items RPCs.
93
- - Credentials come from clauth: `curl -s http://127.0.0.1:52437/v/<service>`.
@@ -1,222 +0,0 @@
1
- ---
2
- name: overnight
3
- description: rdc:overnight ([scope]) — drain the work queue unattended, end to end
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
- > 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`).
11
-
12
- > **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.
13
-
14
-
15
- # rdc:overnight — Overnight Build Supervisor
16
-
17
- ## When to Use
18
- - Starting an unattended multi-hour build session
19
- - Project lead says "run overnight", "build everything", "go while I sleep"
20
- - Kicking off a full epic queue after scoping is agreed
21
-
22
- ## Arguments
23
- - `/rdc:overnight` — work all urgent/high priority todo epics
24
- - `/rdc:overnight <epic-id>` — work a specific epic only
25
- - `/rdc:overnight label=<label>` — work epics matching label
26
-
27
- ## Phase 1 — Pre-flight
28
-
29
- **First action — set the overnight sentinel** so the `no-stop-open-epics` Stop hook engages (interactive sessions are not gated by it):
30
-
31
- ```bash
32
- mkdir -p {PROJECT_ROOT}/.rdc && touch {PROJECT_ROOT}/.rdc/overnight.lock
33
- ```
34
-
35
- **Last action at end of run (success OR failure) — remove the sentinel:**
36
-
37
- ```bash
38
- rm -f {PROJECT_ROOT}/.rdc/overnight.lock
39
- ```
40
-
41
- If the sentinel file does not exist, the Stop hook will NOT block — which means interactive sessions stop freely and only `rdc:overnight` is held to the "drain the queue" contract.
42
-
43
- Before touching any code, verify the environment is safe:
44
-
45
- 1. **Clauth daemon alive:**
46
- ```bash
47
- curl -s http://127.0.0.1:52437/ping
48
- ```
49
- If not responding: report `BLOCKED: credential daemon offline` and exit. Do not proceed.
50
-
51
- 2. **Git state clean:**
52
- ```bash
53
- git status --short
54
- ```
55
- Must be on the development branch with no uncommitted changes. If dirty: commit or stash first.
56
-
57
- 3. **Baseline review:**
58
- Run `rdc:review --unattended`. If `REVIEW_STATUS.verdict = "HAS_ISSUES"` and
59
- issues cannot be auto-fixed: report `BLOCKED: codebase has pre-existing issues` and exit.
60
- A dirty baseline overnight compounds into a disaster by morning.
61
-
62
- If all three pass: proceed to Phase 2.
63
-
64
- ## Phase 2 — Load Scope
65
-
66
- Determine which epics to work:
67
-
68
- - **Specific epic arg:** load that one epic via `get_work_items_by_epic()`
69
- - **Label filter:** `SELECT get_open_epics(p_label_filter := '<label>')`
70
- - **No arg (default):** `SELECT get_open_epics()` filtered to:
71
- - `priority IN ('urgent', 'high')`
72
- - `status IN ('todo', 'in_progress')`
73
- - Order: urgent first, then high, then by `created_at`
74
-
75
- Log the epic queue at the start of `.rdc/overnights/overnight-<YYYY-MM-DD>.md` (fallback: `.rdc/overnights/overnight-<YYYY-MM-DD>.md` if `.rdc/` does not exist).
76
-
77
- ## Phase 3 — Epic Loop
78
-
79
- For each epic in the queue, run this sequence:
80
-
81
- ### 3a. Research (if needed)
82
- Condition: epic has 0 child tasks AND no matching doc in `.rdc/plans/` (or `.rdc/plans/` as fallback)
83
-
84
- ```
85
- rdc:preplan <topic> --unattended
86
- ```
87
-
88
- Check `PREPLAN_STATUS.recommendation_confidence`:
89
- - `"high"` or `"medium"`: proceed
90
- - `"low"`: escalate via advisor tool (see Escalation Protocol below)
91
- - If advisor gives direction: proceed with that direction
92
- - If advisor cannot resolve: skip this epic, log reason, move to next
93
-
94
- ### 3b. Plan (if no tasks exist)
95
- Condition: epic has 0 child tasks after preplan
96
-
97
- ```
98
- rdc:plan <epic-id> --unattended
99
- ```
100
-
101
- Check `PLAN_STATUS.task_count > 0` before continuing.
102
- If 0 tasks created: escalate via advisor, then skip if still unresolved.
103
- If `PLAN_STATUS.held_for_design_review > 0`: do not silently promote those tasks to todo. Log the held task IDs and their durable assessment, request human Design Review, and continue only with the independently admitted portion of the epic.
104
-
105
- ### 3c. Build
106
-
107
- This skill delegates to rdc:build which uses typed agent dispatch. See rdc:build for agent type classification.
108
-
109
- ```
110
- rdc:build <epic-id> --unattended
111
- ```
112
-
113
- Agents receive the relevant guide file from `.rdc/guides/` (fallback: `.rdc/guides/`) based on their work package type.
114
-
115
- After each wave: check `BUILD_STATUS`. If `escalated: true`, log the escalation
116
- in the overnight doc and continue — don't stop the loop.
117
- After each wave and after every resumed epic, require the `runOrchestrator()` receipt from `rdc:build`. `admission_refocus` or `pipeline_blocked` means the epic is held for durable Design Review or validator closure; log that state and do not hand-reconstruct a dispatch wave.
118
-
119
- ### 3d. Review
120
-
121
- ```
122
- rdc:review --unattended
123
- ```
124
-
125
- Check `REVIEW_STATUS.verdict`:
126
- - `"CLEAN"`: re-run the durable CodeFlow supervisor. Mark an epic `done` only when its receipt is `pipeline_complete` and every executable child is design-review admitted and validator-closed (`status = done`); otherwise preserve the epic/task hold and log `admission_refocus` or `pipeline_blocked`.
127
- - `"HAS_ISSUES"` with `escalations > 0`: log issues, push what's clean, continue
128
- - `"HAS_ISSUES"` with `escalations = 0` (all auto-fixed): push, continue
129
-
130
- ### 3e. Commit checkpoint
131
-
132
- After each epic (pass or fail):
133
- ```bash
134
- if [ "$RDC_TEST" != "1" ]; then
135
- git push origin {development-branch}
136
- else
137
- echo "[RDC_TEST] skipping git push origin {development-branch}"
138
- fi
139
- ```
140
-
141
- This ensures every epic's work is saved regardless of what comes next.
142
-
143
- ## Phase 4 — Exit
144
-
145
- After all epics are processed:
146
-
147
- 1. Run `rdc:report --unattended`
148
-
149
- 2. Write session summary to `.rdc/overnights/overnight-<YYYY-MM-DD>.md` (fallback: `.rdc/overnights/overnight-<YYYY-MM-DD>.md`):
150
- ```markdown
151
- # Overnight Session — YYYY-MM-DD
152
-
153
- ## Started
154
- <timestamp>
155
-
156
- ## Epics Attempted
157
- | Epic | Status | Tasks Done | Commits |
158
-
159
- ## Epics Completed
160
- <list with epic IDs>
161
-
162
- ## Escalations
163
- N advisor calls — details:
164
- - <epic>: <what was escalated> → <advisor response>
165
-
166
- ## Blockers Remaining
167
- <any epics skipped or partially done>
168
-
169
- ## Git Summary
170
- - Total commits: N
171
- - Push status: ✅
172
-
173
- ## Completed
174
- <timestamp>
175
- ```
176
-
177
- 3. Final push:
178
- ```bash
179
- if [ "$RDC_TEST" != "1" ]; then
180
- git push origin {development-branch}
181
- else
182
- echo "[RDC_TEST] skipping final git push origin {development-branch}"
183
- fi
184
- ```
185
-
186
- ## Escalation Protocol
187
-
188
- The advisor tool pairs this executor with a high-level model for high-stakes decisions.
189
- Use it when genuinely stuck — not for every small uncertainty.
190
-
191
- **Escalation triggers:**
192
- - `PREPLAN_STATUS.recommendation_confidence = "low"` (too many unknowns)
193
- - `PLAN_STATUS.task_count = 0` after planning (nothing actionable)
194
- - Build agent fails twice on the same task
195
- - `REVIEW_STATUS` has unfixable issues requiring architectural judgment
196
- - Credential daemon goes down mid-session (escalate before exiting)
197
-
198
- **How to escalate:**
199
- Provide the advisor with:
200
- 1. What was attempted and what failed
201
- 2. The error or ambiguity in detail
202
- 3. Two most likely paths forward with tradeoffs
203
- 4. Which epic/task is blocked
204
-
205
- **After advisor responds:**
206
- - Log the guidance in the overnight doc
207
- - Resume the loop from where it stopped
208
- - If advisor cannot resolve: mark task/epic `blocked`, log reason, skip to next
209
-
210
- **Max escalations:** 3 per epic. After 3, skip the epic and log.
211
-
212
- ## Safety Rules
213
-
214
- - Branch: development branch always — NEVER touch main/production
215
- - NEVER run `pnpm build` — use `npx tsc --noEmit` for typecheck, vitest for tests only on modified packages
216
- - NEVER let agents overlap on the same files
217
- - Push after every epic, not just at the end
218
- - Update Supabase work items in real time throughout
219
- - **A clean review never overrides a durable Design Review hold, an incomplete checklist, or missing validator closure**
220
- - Max 2 hours per epic — if exceeded, skip and log `TIMEOUT`
221
- - If credential daemon goes down mid-session: write current state to overnight doc, push, exit gracefully
222
- - If git push fails: log the failure, attempt rebase, retry once — do not force push
package/commands/plan.md DELETED
@@ -1,178 +0,0 @@
1
- ---
2
- name: plan
3
- description: rdc:plan (topic) — produce architecture, decisions and an epic with tasks
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
- > 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`).
11
-
12
-
13
- # rdc:plan — Architecture & Work Packages
14
-
15
- ## When to Use
16
- - After `/rdc:preplan` produced research findings
17
- - Project lead gives architectural direction ("build X with Y approach")
18
- - An epic exists but needs breakdown into implementable tasks
19
- - Before any large build session
20
- - Called by `rdc:overnight` when an epic has no child tasks
21
-
22
- ## Arguments
23
- - `rdc:plan <topic>` — interactive planning session
24
- - `rdc:plan <epic-id> --unattended` — silent mode for overnight builds
25
-
26
- ## Procedure
27
-
28
- 1. **Load source documents — MANDATORY before any planning decisions.**
29
-
30
- **Step 1a — Always load these regardless of topic:**
31
- ```
32
- .claude/rules/infrastructure-contract.md — hard deployment + registry rules
33
- .claude/rules/work-items-rpc.md — work item schema, RPC, status enums
34
- .claude/rules/system-quick-links.md — routing map to all system architecture docs
35
- .claude/rules/version-numbering.md — version bump rules for affected packages
36
- docs/CODING-STANDARDS.md — SOLID/Clean-Architecture standard; names
37
- ATF's Test-Ladder and rdc-harness's
38
- proof-ledger pattern where either applies
39
- (regen-root; skip if absent)
40
- ```
41
-
42
- **Step 1b — Identify affected domains, then load the matching architecture doc:**
43
-
44
- | Domain keywords in topic | Architecture doc to read |
45
- |--------------------------|---------------------------|
46
- | PRT, trust, capital, NAV, investor, land, DST | `docs/systems/prt/ARCHITECTURE.md` |
47
- | CS 2.0, HAIL, PAL, virtue, quad-pixel, ontology, BPMN, cognitive | `docs/systems/cs2/ARCHITECTURE.md` |
48
- | marketing, CRM, campaign, contact, outreach, RDC app | `docs/systems/rdc/ARCHITECTURE.md` |
49
- | Claude workflow, skills, agents, dispatch, rdc:build | `docs/systems/claude-workflow/ARCHITECTURE.md` |
50
- | Life AI, LIFEAI platform, life.ai | `docs/systems/lifeai/ARCHITECTURE.md` |
51
- | media, R2, images, regen-media, MCP image | `docs/systems/media/ARCHITECTURE.md` |
52
- | UI, component, brand, design token, shared, OG image | `docs/systems/shared/ARCHITECTURE.md` |
53
-
54
- If the topic spans multiple domains: read ALL matching architecture docs before proceeding.
55
- A plan that contradicts an existing architecture doc is invalid — load them first.
56
-
57
- **Step 1c — Load domain-specific rules and context files:**
58
-
59
- | Domain | Additional files to read |
60
- |--------|---------------------------|
61
- | CS 2.0 / any CS2 paradigm work | `.claude/rules/cs2-architecture-first.md` |
62
- | Database, schema, migrations, RPC | `.claude/context/supabase-schema.md` |
63
- | UI, components, brand, tokens | `.claude/context/design-system-global.md` |
64
- | Deploy, infrastructure, DNS, SSL | `.claude/context/coolify-deployment.md` |
65
- | Credentials, MCP, clauth, subagents | `.claude/context/clauth.md` |
66
- | OG images, social meta, brand assets | `.claude/context/brand-gate.md` |
67
- | Cross-platform, Cowork, subagent MCP | `.claude/context/platform-cross-ref.md` |
68
- | MCP server development | `.claude/context/mcp-server-auth.md` |
69
-
70
- **Step 1d — Load CLAUDE.md for every affected package:**
71
- - Identify which packages in `packages/` will be created or modified
72
- - Read `packages/<name>/CLAUDE.md` for each one that has one
73
- - Mandatory: `packages/supabase/CLAUDE.md` if any DB work is involved
74
- - Mandatory: `packages/ui/CLAUDE.md` if any UI work is involved
75
- - Read `packages/<name>/package.json` to understand current exports and dependencies
76
-
77
- 2. **Gather additional inputs:**
78
- - Research doc from preplan (if exists): `.rdc/research/<topic>.md` (fallback: `.rdc/research/<topic>.md`)
79
- - Project lead's architectural direction from conversation
80
- - Existing Supabase epics: `SELECT get_open_epics()`
81
- - Check `prototype_registry` for any existing prototypes on this topic:
82
- ```sql
83
- SELECT name, component, source_path, status FROM prototype_registry
84
- WHERE status IN ('prototype', 'converting') ORDER BY created_at DESC;
85
- ```
86
- - Check `design_context` for prior design decisions:
87
- ```sql
88
- SELECT topic, context_type, summary FROM design_context
89
- WHERE topic ILIKE '%<topic>%' ORDER BY created_at DESC;
90
- ```
91
-
92
- 3. **Read the codebase** — understand current state:
93
- - What packages are affected?
94
- - What types/interfaces already exist?
95
- - What tests exist?
96
- - What's the dependency graph?
97
-
98
- 4. **Make design decisions** — for each major choice:
99
- - State the decision clearly
100
- - Document what was chosen and what was rejected
101
- - Explain WHY (tradeoff rationale)
102
- - Note consequences and reversibility
103
- - **Verify the decision does not contradict any loaded architecture doc** — if it does, flag the conflict before proceeding
104
-
105
- 5. **Define work packages** — break into agent-dispatchable units:
106
- - Each work package = one agent assignment
107
- - No file overlap between packages
108
- - Each package has: scope, files to create/modify, test requirements
109
- - Assign an agent type to each work package from the typed dispatch table in rdc:build
110
- - Include the guide file path (from `.rdc/guides/`, fallback `.rdc/guides/`) in each work package description
111
- - Include any relevant architecture doc, context file, or package CLAUDE.md the agent must read
112
- - Estimate: small (1 agent, <500 LOC), medium (1 agent, 500-1500 LOC), large (needs splitting)
113
- - Attach a **Design Review contract** to every executable package. It must contain:
114
- - architecture alignment: registered architecture-evidence reference(s), declared target boundary, and a concrete alignment claim;
115
- - completeness: independently observable acceptance criteria plus at least one required `decomp-*` and `test-*` checklist row; and
116
- - proportionality: estimated files/LOC, declared surfaces, and change kind.
117
- - Do not invent architecture evidence. Missing, unregistered, broad-refactor, multi-surface, or disproportionate contracts are intentionally routed to human Design Review.
118
- - **ATF Test-Ladder / rdc-harness (WIP — best-effort, not a hard gate yet):** if the
119
- package being planned has its own ATF `STP-001.md` or ships an `rdc-harness`-style
120
- `tools/proof-ledger.mjs`/`tools/mutate-check.mjs` pair, name it in the work package's
121
- test requirements as an additional validation signal alongside vitest/tsc. Neither
122
- system is fleet-wide or hook-enforced yet — do not fabricate a ladder or a proof
123
- ledger for a package that doesn't already have one.
124
-
125
- 6. **Write plan doc** to `.rdc/plans/<topic-slug>.md` (fallback: `.rdc/plans/<topic-slug>.md` if `.rdc/` does not exist):
126
- ```markdown
127
- # Plan: <Topic>
128
- > Generated: <date> | Epic: <id if exists>
129
-
130
- ## Source Documents Read
131
- (list every architecture doc, rules file, context file, and package CLAUDE.md loaded in Step 1)
132
-
133
- ## Goal
134
- ## Design Decisions
135
- ## Work Packages
136
- (each package must include: agent type, guide file, architecture docs agent must read, files to create/modify, test requirements)
137
- ## Sequencing (what can parallelize, what depends on what)
138
- ## Risks & Mitigations
139
- ## Architecture Doc Conflicts (if any)
140
- ```
141
-
142
- 7. **Create Supabase epic + child tasks:**
143
- - Epic via `insert_work_item(p_item_type := 'epic', ...)`
144
- - Immediately call `set_epic_governance_refs(p_epic_id, p_plan_ref := '.rdc/plans/<topic-slug>.md', p_spec_ref := '.rdc/plans/<topic-slug>.md', p_architecture_ref := '<ARCHITECTURE.md path or NULL — set only when this plan crosses an architectural boundary>', p_scoping_statement := '<in/out of scope, one paragraph>')` so `rdc:build`/`rdc:overnight`/`rdc:fixit`/`rdc:refactor` never have to guess or stall on these fields
145
- - One task per work package only through `upsert_admitted_work_item(...)`, never a direct `work_items` write. Supply a stable source fingerprint, the package checklist, and the Design Review contract from Step 5.
146
- - Read the durable result for each package:
147
- - `dispatchable: true` / `automatic_approved` → task may become `todo`;
148
- - `dispatchable: false` / `needs_human` or `pending` → keep the task `blocked`, label it `needs-human-design-review`, and include the assessment in the plan status.
149
- - If (and only if) the epic's `architecture_ref` is set, each task's checklist passed to `upsert_admitted_work_item` MUST also include one required `architecture-fidelity-<slug>` row naming the specific architecture doc + boundary — the exit gate hard-rejects `done` on any task under an `architecture_ref` epic missing this row. Do not add it under an epic with no `architecture_ref` — that holds ordinary work for a review it doesn't need.
150
- - Set priorities: urgent/high/normal based on sequencing
151
-
152
- 8. **Report results:**
153
- - Interactive: present the plan for approval before building
154
- - Unattended: skip approval, proceed immediately, emit status block:
155
- ```
156
- PLAN_STATUS: { epic_id, task_count, dispatchable_task_count, held_for_design_review, doc_path, waves, source_docs_read: [list], architecture_conflicts: [] }
157
- ```
158
-
159
- ## Unattended Escalation
160
-
161
- When `--unattended` and genuine architectural ambiguity is detected — meaning multiple
162
- valid approaches exist with significantly different tradeoffs (not just minor style choices)
163
- — escalate via the advisor tool. Provide: the decision point, the options with tradeoffs,
164
- and the project context. Resume with advisor's recommendation. If advisor is unavailable,
165
- choose the most conservative/reversible approach and document the decision.
166
-
167
- ## Rules
168
- - **Source documents in Step 1 are MANDATORY — a plan that hasn't read the architecture docs is invalid**
169
- - Interactive: ALWAYS get approval before proceeding to build
170
- - Unattended: proceed immediately without approval
171
- - Plan doc goes in `.rdc/plans/` (fallback: `.rdc/plans/` if `.rdc/` does not exist) — not `.planning/`
172
- - Each work package must be independently executable by an agent
173
- - No file overlap between work packages
174
- - Include test requirements in every work package
175
- - **No executable work item is dispatchable without a durable Design Review decision; a planner cannot self-approve by supplying prose-only evidence**
176
- - Reference affected CLAUDE.md files and architecture docs in each work package description
177
- - Reference the relevant guide file from `.rdc/guides/` (fallback: `.rdc/guides/`) for agent context
178
- - Always list source docs read in the output doc header and status block
@@ -1,134 +0,0 @@
1
- ---
2
- name: preplan
3
- description: rdc:preplan (topic) — research the unknowns before committing to an architecture
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
- > 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`).
11
-
12
-
13
- # rdc:preplan — Research Before Planning
14
-
15
- ## When to Use
16
- - Starting a new feature area you haven't built before
17
- - Need to understand how best-in-class projects solve a problem
18
- - Codebase has unknowns that need mapping before planning
19
- - Project lead says "research", "look into", "what's the best way to", "how do others do"
20
- - Called by `rdc:overnight` before planning an epic with no existing tasks
21
-
22
- ## Arguments
23
- - `rdc:preplan <topic>` — interactive research session
24
- - `rdc:preplan <topic> --unattended` — silent mode for overnight builds
25
-
26
- ## Procedure
27
-
28
- 1. **Parse the topic** from user input or epic title/description.
29
- - Interactive: if vague, ask ONE clarifying question before proceeding
30
- - Unattended: infer from the epic title + description — never pause to ask
31
-
32
- 2. **Load source documents — MANDATORY before any analysis.**
33
-
34
- **Step 2a — Always load these regardless of topic:**
35
- ```
36
- .claude/rules/infrastructure-contract.md — hard deployment + registry rules
37
- .claude/rules/work-items-rpc.md — work item schema and RPC patterns
38
- .claude/rules/system-quick-links.md — routing map to system architecture docs
39
- docs/CODING-STANDARDS.md — SOLID/Clean-Architecture standard; names
40
- ATF's Test-Ladder and rdc-harness's
41
- proof-ledger pattern where either applies
42
- (regen-root; skip if absent)
43
- ```
44
-
45
- **Step 2b — Identify affected domains, then load the matching architecture doc:**
46
-
47
- | Domain keywords in topic | Architecture doc to read |
48
- |--------------------------|---------------------------|
49
- | PRT, trust, capital, NAV, investor, land, DST | `docs/systems/prt/ARCHITECTURE.md` |
50
- | CS 2.0, HAIL, PAL, virtue, quad-pixel, ontology, BPMN, cognitive | `docs/systems/cs2/ARCHITECTURE.md` |
51
- | marketing, CRM, campaign, contact, outreach, RDC app | `docs/systems/rdc/ARCHITECTURE.md` |
52
- | Claude workflow, skills, agents, dispatch, rdc:build | `docs/systems/claude-workflow/ARCHITECTURE.md` |
53
- | Life AI, LIFEAI platform, life.ai | `docs/systems/lifeai/ARCHITECTURE.md` |
54
- | media, R2, images, regen-media, MCP image | `docs/systems/media/ARCHITECTURE.md` |
55
- | UI, component, brand, design token, shared, OG image | `docs/systems/shared/ARCHITECTURE.md` |
56
-
57
- If topic spans multiple domains, read ALL matching architecture docs.
58
- If unsure which domain applies, read `docs/systems/claude-workflow/ARCHITECTURE.md` as the fallback.
59
-
60
- **Step 2c — Load domain-specific rules and context files:**
61
-
62
- | Domain | Additional files to read |
63
- |--------|---------------------------|
64
- | CS 2.0 / any CS2 paradigm work | `.claude/rules/cs2-architecture-first.md` |
65
- | Database, schema, migrations, RPC | `.claude/context/supabase-schema.md` |
66
- | UI, components, brand, tokens | `.claude/context/design-system-global.md` |
67
- | Deploy, infrastructure, DNS, SSL | `.claude/context/coolify-deployment.md` |
68
- | Credentials, MCP, clauth, subagents | `.claude/context/clauth.md` |
69
- | OG images, social meta, brand assets | `.claude/context/brand-gate.md` |
70
- | Cross-platform, Cowork, subagent MCP | `.claude/context/platform-cross-ref.md` |
71
-
72
- **Step 2d — Load CLAUDE.md for every affected package:**
73
- - Identify which packages in `packages/` are relevant to the topic
74
- - Read `packages/<name>/CLAUDE.md` for each one
75
- - At minimum read `packages/supabase/CLAUDE.md` if any DB work is involved
76
- - At minimum read `packages/ui/CLAUDE.md` if any UI work is involved
77
-
78
- 3. **Web research** — search for current (2025-2026) best practices:
79
- - How do major projects solve this?
80
- - What tools/libraries exist?
81
- - What are the common tradeoffs?
82
-
83
- 4. **Codebase analysis** — what do we already have?
84
- - Search relevant packages for existing code
85
- - Check `.rdc/research/` for prior research on this topic (fallback: `.rdc/research/`)
86
- - Check `docs/archive/` for historical work
87
- - Research agents should read relevant guides from `.rdc/guides/` (fallback: `.rdc/guides/`)
88
- - Check work items for related epics
89
-
90
- 5. **Best-in-class comparison** — create a comparison table:
91
- | Approach | Pros | Cons | Fit for Us |
92
-
93
- 6. **Surface unknowns** — what questions remain unanswered?
94
-
95
- 7. **Write research doc** to `.rdc/research/<topic-slug>.md` (fallback: `.rdc/research/<topic-slug>.md` if `.rdc/` does not exist):
96
- ```markdown
97
- # Research: <Topic>
98
- > Generated: <date> | Requested by: Project Lead
99
-
100
- ## Source Documents Read
101
- (list every architecture doc, rules file, context file, and package CLAUDE.md loaded in Step 2)
102
-
103
- ## Question
104
- ## What We Already Have
105
- ## Best-in-Class Analysis
106
- ## Comparison Table
107
- ## Unknowns & Open Questions
108
- ## Recommendation (preliminary — not a decision)
109
- ```
110
-
111
- 8. **Report results:**
112
- - Interactive: summarize findings. Do NOT create epics or write code.
113
- - Unattended: skip summary, emit status block only:
114
- ```
115
- PREPLAN_STATUS: { topic, doc_path, unknowns_count, recommendation_confidence: "high|medium|low", source_docs_read: [list] }
116
- ```
117
-
118
- ## Unattended Escalation
119
-
120
- When `--unattended` and `recommendation_confidence` is `"low"` (≥5 unresolved unknowns,
121
- or no clear best-fit approach exists), escalate via the advisor tool rather than stopping.
122
- Provide the advisor with: topic, unknowns list, comparison table. Resume with advisor's
123
- direction if given. If advisor cannot resolve, log and skip to next step.
124
-
125
- ## Rules
126
- - **Source documents in Step 2 are MANDATORY — research without them is blind**
127
- - Output is a RESEARCH DOC, not a plan
128
- - Do not make architectural decisions — surface options with tradeoffs
129
- - Do not create work items
130
- - Do not write code
131
- - Web search is mandatory — don't just analyze the codebase
132
- - Keep the doc under 200 lines — concise, not exhaustive
133
- - Unattended: NEVER pause for input; infer and proceed
134
- - Always list source docs read in the output doc header