@lifeaitools/rdc-skills 0.35.7 → 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.
@@ -1,211 +0,0 @@
1
- ---
2
- name: deploy
3
- description: rdc:deploy (slug, [action]) - [--fix, --hotfix] — ship to PM2 dev; promote to Coolify production
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
-
11
- # rdc:deploy — Coolify Operations
12
-
13
- **READ FIRST:** `guides/output-contract.md`. Checklist-only output. No narration.
14
- No raw MCP dumps. No UUIDs unless asked.
15
-
16
- > **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.
17
- >
18
- > *Under `$RDC_TEST=1`:* Modes 1 (deploy) and 2 (new) are **entirely skipped** — echo `[RDC_TEST] skipping Coolify deploy/create` and mark every `[ ]` line in those checklists as `[~]`. Modes 3 (diagnose) and 4 (audit without `--fix`) are **read-only and run normally**. Mode 4 with `--fix` skips all remediation — echo `[RDC_TEST] skipping audit --fix remediation` and report findings only. Registry SELECTs, Coolify status reads, HTTP gate probes, TLS checks, and DNS lookups are NOT destructive and run normally. Anything that writes (create app, set watch_paths, deploy trigger, env var write, DNS write, CF cache purge, registry UPDATE/INSERT) is gated.
19
-
20
- ## Arguments
21
-
22
- - `rdc:deploy <slug>` — deploy existing app (latest commit on its watched branch)
23
- - `rdc:deploy <slug> <build-id>` — deploy specific commit/tag
24
- - `rdc:deploy new <slug>` — create a new Coolify app from registry
25
- - `rdc:deploy diagnose <slug>` — debug why an app is broken
26
- - `rdc:deploy audit` — fleet-wide scan for missed failures
27
- - `rdc:deploy audit --fix` — fleet scan + auto-remediate safe issues
28
- - `rdc:deploy maintenance <service>` — create, update, or verify a template-declared private service; no public domain or host port
29
- - `rdc:deploy dev <slug>` — deploy to PM2 dev (Vultr), not Coolify — see Mode 0
30
- - `rdc:deploy` (no args) — print mode menu, ask which
31
-
32
- ## Modes
33
-
34
- ### Mode 0 — dev <slug> (PM2 development, not Coolify)
35
-
36
- PM2 dev deploys route through the real, tested `rdc-harness` CLI instead of
37
- raw PM2/curl — it already implements this path (`shipRoute: pm2-development`,
38
- via `@lifeaitools/regen-deploy-mgr` on loopback :52438, never raw PM2):
39
-
40
- ```
41
- rdc:deploy dev: <slug>
42
- [ ] node C:/Dev/rdc-harness/bin/rdc-harness.mjs deploy <slug> --monorepo-root <caller's own worktree>
43
- [ ] JSON receipt parsed — shipRoute confirmed "pm2-development" (else: not this product's route, see receipt.reason)
44
- [ ] Receipt reports ok / the specific refusal, reported verbatim — not narrated
45
- ✅ rdc:deploy dev: <slug> — <receipt outcome in one line>
46
- ```
47
-
48
- A receipt with `applicable: false, reason: 'not_pm2_shipped'` means this slug
49
- ships a different way (registry, static, or Coolify) — report that plainly,
50
- do not retry as Coolify without confirming that's actually the right route.
51
-
52
- ### Mode 1 — deploy <slug> [build-id] (Coolify — staging/production)
53
-
54
- ```
55
- rdc:deploy: <slug> → <domain>
56
- [ ] Registry lookup (slug, uuid, branch, type, env_vars_needed)
57
- [ ] Git state verified (branch matches Coolify, commit pushed)
58
- [ ] Build-id resolved (default: HEAD of watched branch)
59
- [ ] Env vars present in Coolify (compare to registry)
60
- [ ] Type-specific preflight (see docs/runbooks/coolify-deploy-checklist.md)
61
- [ ] Deploy triggered
62
- [ ] Deployment reached "finished" state
63
- [ ] Gate: HTTP 200
64
- [ ] Gate: TLS valid (no SSL cipher mismatch)
65
- [ ] Gate: cache headers correct on HTML
66
- [ ] Gate: container running on declared port
67
- [ ] Cloudflare cache purged (if proxied)
68
- [ ] deployment_registry updated (last_deploy_at, status)
69
- ✅ rdc:deploy: <slug> deployed in Nm Ns
70
- ```
71
-
72
- ### Mode 2 — new <slug>
73
-
74
- ```
75
- rdc:deploy new: <slug>
76
- [ ] Registry entry loaded (or interactive create)
77
- [ ] DNS path chosen (A: staging wildcard B: apex C: other zone)
78
- [ ] DNS record verified or wildcard confirmed
79
- [ ] Cloudflare proxy setting correct for DNS path
80
- [ ] server_uuid, project_uuid, environment_uuid, github_app_uuid resolved
81
- [ ] Build type chosen (Next.js / Vite / static / standalone)
82
- [ ] Type-specific fields filled (ports, build cmd, install cmd, start cmd)
83
- [ ] Application created via /applications/private-github-app
84
- [ ] watch_paths set and verified
85
- [ ] Env vars set in Coolify
86
- [ ] First deploy triggered
87
- [ ] Gate passed (5 checks)
88
- [ ] deployment_registry row inserted
89
- ✅ rdc:deploy new: <slug> live at <domain>
90
- ```
91
-
92
- ### Mode 3 — diagnose <slug>
93
-
94
- ```
95
- rdc:deploy diagnose: <slug>
96
- [ ] App located (uuid, domain, last deploy)
97
- [ ] Container state (running / restarting / stopped)
98
- [ ] Last 100 log lines scanned for known error patterns
99
- [ ] Port mismatch check (declared vs actual)
100
- [ ] Env var drift check (registry vs Coolify)
101
- [ ] watch_paths sanity check
102
- [ ] HTTP / TLS reachability
103
- [ ] Cloudflare proxy state check
104
- [ ] Disk space on server
105
- [ ] Branch mismatch check (Coolify git_branch vs expected)
106
- ⚠️ rdc:deploy diagnose: <root cause in one sentence> — fix: <one command>
107
- ```
108
-
109
- ### Mode 4 — audit
110
-
111
- ```
112
- rdc:deploy audit: fleet scan
113
- [ ] Inventory join: Coolify apps ⋈ deployment_registry
114
- [ ] Orphans (in one but not the other)
115
- [ ] Monorepo apps missing watch_paths
116
- [ ] Stale deploys (>14 days since last success)
117
- [ ] Registry rows with status='broken'
118
- [ ] Failed deployments in last 7 days
119
- [ ] HTTP gate sweep (non-200 per domain)
120
- [ ] TLS cert expiry <30 days
121
- [ ] Port mismatches (ports_exposes vs actual container port)
122
- [ ] Env var drift (registry.env_vars_needed vs Coolify env)
123
- [ ] Branch mismatches (Coolify git_branch ≠ expected)
124
- [ ] Disk space on 64.237.54.189
125
- [ ] DNS/proxy misconfigs on configured staging wildcard
126
- [ ] Duplicate apps (same repo, multiple UUIDs)
127
-
128
- Findings:
129
- | Severity | App | Issue | Fix |
130
- |----------|-----|-------|-----|
131
- | HIGH | ... | ... | ... |
132
- ⚠️ rdc:deploy audit: N HIGH · M MED · K LOW — run `rdc:deploy audit --fix` to auto-remediate safe issues
133
- ```
134
-
135
- Severity rules:
136
- - **HIGH** — user-facing down (HTTP non-200, TLS invalid, container not running)
137
- - **MED** — degraded or drifting (watch_paths missing, env var drift, stale deploy, branch mismatch)
138
- - **LOW** — cleanup (orphans, duplicates, registry status stale)
139
-
140
- `--fix` auto-remediates only: missing watch_paths, registry row updates, CF cache purges. Never touches env vars, DNS, or container config without explicit confirmation.
141
-
142
- ### Mode 7 — maintenance <service> (private infrastructure)
143
-
144
- Use maintenance only for a service declared in the `private-service` template.
145
- It creates, updates, or verifies a Coolify-network service with no public
146
- domain, no DNS route, and no host-port publication. Secret checks use key names
147
- only; values are never retrieved or emitted. Retiring a service is outside this
148
- mode and requires separate explicit approval.
149
-
150
- ```
151
- rdc:deploy maintenance: <service>
152
- [ ] Template and source/branch/Dockerfile/internal-port/health-path resolved
153
- [ ] Private-only contract: domains empty, host port absent, network alias declared
154
- [ ] Required secret keys confirmed by name only
155
- [ ] Explicit deploy completed
156
- [ ] Health gate passes inside the container
157
- [ ] Existing Coolify-network workload reaches the alias and health path
158
- [ ] No public domain, TLS route, DNS record, or host endpoint is present
159
- ✅ rdc:deploy maintenance: <service> healthy on the private network
160
- ```
161
-
162
- For `clauth`, require `CLAUTH_MACHINE_ID` and `CLAUTH_MASTER_PASSWORD`, port
163
- `52437`, and `/ping`. The container may bind `0.0.0.0` internally only;
164
- consumers must use its Coolify network alias rather than `localhost`.
165
-
166
- ## Coolify Access — clauth + REST API
167
-
168
- All Coolify operations use the clauth daemon and the Coolify REST API directly.
169
- There is no Coolify MCP server — do not reference `@masonator/coolify-mcp`.
170
-
171
- ```bash
172
- _COOLIFY=$(curl -s http://127.0.0.1:52437/v/coolify-api)
173
- curl -s -H "Authorization: Bearer $_COOLIFY" "$DEPLOY_API_BASE/api/v1/applications"
174
- ```
175
-
176
- **Triggering the actual deploy is different — use the wrapper, not raw curl.**
177
- `hooks/lib/guard-rules.mjs`'s `coolify-direct` rule blocks a raw curl (or any command whose
178
- TEXT contains the literal URL) to `/api/v1/deploy` — the deploy-trigger endpoint — on
179
- purpose, so a production deploy is never one arbitrary curl an agent can fire silently. This
180
- is NOT a bug to route around with SSH or a differently-worded command
181
- (`.rdc/lessons/2026-08-07-deploy-coolify-direct-blocks-own-documented-step.md`). The
182
- sanctioned way to actually trigger a deploy for Mode 1's "Deploy triggered" step is:
183
-
184
- ```bash
185
- python3 scripts/coolify-deployments.py deploy <application-uuid>
186
- ```
187
-
188
- Run from the regen-root repo root. Poll `status <deployment-uuid>` (the same script) or
189
- `GET /api/v1/deployments/<deployment-uuid>` (read-only, not blocked) until `status` is
190
- `finished`/`failed`/`cancelled` before moving to the gate checks.
191
-
192
- If clauth daemon is not responding:
193
- ```
194
- BLOCKED: clauth daemon not responding. Run scripts\restart-clauth.bat, unlock at http://127.0.0.1:52437
195
- ```
196
-
197
- ## References
198
-
199
- - Type-specific checklists + DNS tree + gate commands: `docs/runbooks/coolify-deploy-checklist.md`
200
- - Rules / registry RPCs / hard limits: `.claude/rules/coolify-deployment.md`
201
- - Infrastructure constants:
202
- ```
203
- Server UUID: ih386anenvvvn6fy1umtyow0
204
- Server IP: 64.237.54.189
205
- Dashboard: <deployment-dashboard-url>
206
- GitHub App UUID: xdmcy60putp5h9j7k4kwg9c3
207
- ```
208
-
209
- ## Supersedes
210
-
211
- `coolify-deploy` standalone skill (kept for back-compat; new work uses `rdc:deploy`).
@@ -1,30 +0,0 @@
1
- ---
2
- name: design
3
- description: rdc:design (topic) — design Studio, palette and token-aware UI work
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
-
9
- # rdc:design — RDC Design Skill
10
-
11
- Use `skills/design/SKILL.md` as the source of truth.
12
-
13
- ## When to Use
14
-
15
- - Studio, Palette Library, brand-token, theme, component, or live-editor work
16
- - Any design task that must understand RDC's real token tables and Studio routes
17
- - UI critique, audit, polish, colorize, type, layout, or craft work in `{PROJECT_ROOT}`
18
- - Agent-side color-system exploration using Rampa CLI
19
-
20
- ## Arguments
21
-
22
- - `rdc:design studio <target>`
23
- - `rdc:design tokens <brand-or-route>`
24
- - `rdc:design palette <brief>`
25
- - `rdc:design theme <brief>`
26
- - `rdc:design colorize <target>`
27
- - `rdc:design audit <target>`
28
- - `rdc:design critique <target>`
29
- - `rdc:design polish <target>`
30
- - `rdc:design craft <feature>`
package/commands/edit.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- name: edit
3
- description: rdc:edit (target) — open the local website editor for a target
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
-
9
- # rdc:edit — Local Website Editor
10
-
11
- Use `skills/edit/SKILL.md` as the source of truth.
12
-
13
- ## When to Use
14
-
15
- - The user wants to open a site or route in the local editor app
16
- - The user says "open this in the editor" or "edit this site"
17
- - The target belongs in `@regen/editor-host`, not Studio
18
-
19
- ## Arguments
20
-
21
- - `rdc:edit <site|brand|route|file>`
22
-
23
- ## Notes
24
-
25
- - `prtrust.fund` and `dev.prtrust.fund` resolve to the `prt` brand/app pair.
26
- - `test`, `studio_test`, and `studio-test` resolve to the bundled local test target.
27
- - Under `RDC_TEST=1`, report the resolved editor URL instead of forcing a foreground browser action.
package/commands/fixit.md DELETED
@@ -1,172 +0,0 @@
1
- ---
2
- name: fixit
3
- description: rdc:fixit (description) — make a scoped fix under 5 files and ship it 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
- > 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:fixit — Sanctioned Quick Fix
16
-
17
- ## When to Use
18
- - Typo or single-line text correction
19
- - Config value change (env vars, constants, feature flags)
20
- - Emergency hotfix that cannot wait for a full build cycle
21
- - Dependency version bump
22
- - CSS/styling tweak on a single component
23
- - Broken import or export fix
24
- - Single-file logic correction
25
-
26
- ## When NOT to Use — escalate to rdc:build instead
27
- - New feature of any size
28
- - Refactor touching >5 files
29
- - Anything requiring architecture decisions
30
- - Work that will take longer than 30 minutes
31
- - Schema changes or migrations
32
-
33
- ## Arguments
34
- - `rdc:fixit <description>` — fix the described issue
35
-
36
- ## Procedure
37
-
38
- ### 1. Scope check (mandatory — do this before touching any file)
39
-
40
- Will this fix touch more than **5 files** or take more than **30 minutes**?
41
-
42
- - **YES** → Stop. Use `/rdc:build` instead. Explain to the user why.
43
- - **NO** → Continue.
44
-
45
- ### 2. Create a minimal work item (before touching any code)
46
-
47
- ```sql
48
- SELECT insert_work_item(
49
- p_title := 'fixit: <description>',
50
- p_item_type := 'bug',
51
- p_priority := 'urgent',
52
- p_status := 'in_progress',
53
- p_source := 'fixit'
54
- );
55
- ```
56
-
57
- Note the returned `id`.
58
-
59
- ### 3. Write the fixit session marker
60
-
61
- Write to `{USER_HOME}/.claude/fixit.marker`:
62
- ```
63
- <work_item_id>
64
- <ISO timestamp>
65
- <description>
66
- ```
67
-
68
- This signals the Stop hook that fixit is handling its own documentation.
69
-
70
- ### 4. Make the fix
71
-
72
- If the fix is a create/open/build/deploy step against a real fleet
73
- repository (materialize a product shape, open a signed edit session, run a
74
- target's declared build gates, or deploy to dev-PM2/npm-registry), use the
75
- real, tested `rdc-harness` CLI instead of hand-rolled bash/curl:
76
-
77
- ```bash
78
- node C:/Dev/rdc-harness/bin/rdc-harness.mjs <create|open|edit|build|deploy> <slug> --monorepo-root <your own worktree, never the shared checkout>
79
- ```
80
-
81
- One JSON receipt on stdout, exit 0/1 — use it as the evidence for whichever
82
- checklist/commit step it satisfies. It has no Coolify awareness (deploy here
83
- means PM2 dev or npm publish only — Coolify stays this skill's own §5.5 path)
84
- and no live co-editing surface outside `site-html`/`site-ts` targets (other
85
- classes get boundary-checked file save only). `open`/`edit` need
86
- `RDC_HARNESS_ISSUER_SECRET` set explicitly — no default exists or should.
87
- For anything not create/open/build/deploy shaped, edit files directly as below.
88
-
89
- Do the minimal work, conforming to `docs/CODING-STANDARDS.md` where present
90
- (regen-root; skip if absent). Scope creep rule: if you discover the fix requires more than originally scoped, **stop immediately**:
91
- 1. Close the work item: `update_work_item_status('<id>', 'blocked', '["Escalated — scope exceeded fixit threshold"]')`
92
- 2. Delete the marker file
93
- 3. Tell the user to use `/rdc:build` instead
94
-
95
- ### 5. Commit
96
-
97
- ```bash
98
- git add <specific files only — never git add -A for a fixit>
99
- git commit -m "fix(<scope>): <description>"
100
- if [ "$RDC_TEST" != "1" ]; then
101
- git push origin {development-branch}
102
- else
103
- echo "[RDC_TEST] skipping git push origin {development-branch}"
104
- fi
105
- ```
106
-
107
- ### 5.5 Deliver to done (MANDATORY — a fixit is not done until the change is LIVE)
108
-
109
- ⛔ **"Committed and pushed" is NOT done.** Editing code and walking away is the exact
110
- failure this step exists to prevent. Carry the change to where it is consumed and verify it:
111
-
112
- | Target shape | "Done" = delivered means | How + structural proof |
113
- |---|---|---|
114
- | Published package (npm / PyPI) | new version live on the registry | `npm publish --access public` (or repo release path); verify `npm view <pkg> version` == new version |
115
- | Deployed app (`apps/*`, sites) | change live on the running host | `/rdc:deploy <slug>` (dev) / `promote` (prod); verify HTTP 200 + content probe |
116
- | Shared lib consumed in-repo | landed on the integration branch | `node scripts/land.mjs`; verify branch contains the SHA |
117
- | Standalone repo | its own release ritual completed | repo release script/tag; verify the artifact/tag exists |
118
- | Pure doc / internal-only change, NO consumer | committed + landed | no deploy; the ONLY case where commit == done |
119
-
120
- - **A version bump obligates a release.** A bumped-but-unshipped version is an unfinished fixit.
121
- - **Verify structurally** (registry version, HTTP status, tag presence), never by assumption.
122
- - **If delivery can't complete in-session** (missing OTP/secret, human approval, denied
123
- command, manual prod promotion): set the work item `blocked` with the exact remaining
124
- command + reason and tell the user the one step to run — do NOT mark `done`.
125
-
126
- Under `RDC_TEST=1`: echo `[RDC_TEST] skipping delivery (publish/deploy)` and proceed.
127
-
128
- **ATF Test-Ladder / rdc-harness (WIP — best-effort, not a hard gate yet):** if the touched
129
- package/repo already ships an ATF `STP-001.md` or an `rdc-harness`-style
130
- `tools/mutate-check.mjs`/`tools/proof-ledger.mjs` pair, run it and quote the result. Neither
131
- is fleet-wide yet — its absence is not itself a fixit failure.
132
-
133
- ### 6. Report, review, close, and clean up
134
-
135
- **Precondition: Step 5.5 delivery is verified.** If delivery is blocked, set `blocked` (not
136
- `done`) with the remaining step — never mark an undelivered change `done`.
137
-
138
- ```sql
139
- SELECT submit_implementation_report('<id>'::uuid,
140
- '{"tldr":"<one sentence>","assumptions":[],"deviations":[],"uncertainty":[],"detail":"<what was fixed>","flags":[],"transactional":false,"memory_records":[],"codeflow_post":{"agent_session_id":"<agent-session-id>","summary":"<what changed and why>","files_changed":["<path>"],"verification":["<command/evidence>"],"commit":"<hash optional>"}}'::jsonb
141
- );
142
-
143
- SELECT update_work_item_status('<id>'::uuid, 'review',
144
- '["Fixed via rdc:fixit; ready for validation"]'::jsonb,
145
- '<agent-session-id>',
146
- 'agent'
147
- );
148
-
149
- SELECT update_work_item_status('<id>'::uuid, 'done',
150
- '["Validator verified rdc:fixit report, CodeFlow post, and checklist evidence"]'::jsonb,
151
- '<validator-session-id>',
152
- 'validator'
153
- );
154
- ```
155
-
156
- ```bash
157
- rm {USER_HOME}/.claude/fixit.marker
158
- ```
159
-
160
- ### 7. Confirm to user
161
-
162
- Report: what was fixed, file(s) changed, commit hash. One sentence.
163
-
164
- ## Rules
165
- - Work item created BEFORE any code change — never after
166
- - `git add` specific files only — never `-A` or `.` for a fixit
167
- - Branch: development branch always
168
- - Never run `pnpm build` — not needed for a fixit
169
- - If scope expands mid-fix: stop, escalate to rdc:build, don't finish under fixit
170
- - Marker file must be cleaned up whether fix succeeds or escalates
171
- - **Done = delivered, not committed.** Live where consumed (published/deployed/landed) +
172
- verified. A version bump obligates a publish. Can't deliver in-session → `blocked`, never `done`.
@@ -1,188 +0,0 @@
1
- ---
2
- name: handoff
3
- description: rdc:handoff () - [--from-prototype] — turn a plan or prototype into work items and artifacts
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:handoff — Planning → CLI Bridge
14
-
15
- ## When to Use
16
-
17
- - A prototype has been built and needs production implementation
18
- - A design decision has been made and needs to be executed
19
- - Project lead says "hand this off", "give this to the CLI", "write it up"
20
- - A plan exists in the conversation but hasn't been saved to disk or database yet
21
-
22
- ## What This Skill Produces
23
-
24
- 1. **Plan doc** → `.rdc/plans/<topic-slug>.md` (fallback: `.rdc/plans/<topic-slug>.md`)
25
- 2. **Database epic + child tasks** (with agent types and guide file refs)
26
- 3. **Prototype registry entry** (if a prototype was built)
27
- 4. **Design context entries** (for decisions made in the session)
28
-
29
- ## Procedure
30
-
31
- ### Step 1 — Extract the Plan
32
-
33
- Identify from the conversation:
34
- - What is the goal?
35
- - What prototypes or designs were built? Where are they?
36
- - What decisions were made? What was rejected and why?
37
- - What is the sequencing (what depends on what)?
38
- - Which agent types are needed?
39
-
40
- ### Step 2 — Write the Plan Doc
41
-
42
- ```
43
- .rdc/plans/<topic-slug>.md
44
- ```
45
- (fallback: `.rdc/plans/<topic-slug>.md` if `.rdc/` does not exist)
46
-
47
- Template:
48
- ```markdown
49
- # Plan: <Topic>
50
- > Route: <app route or package>
51
- > Status: Ready for CLI build
52
- > Created: <date>
53
- > Source: planning session
54
-
55
- ---
56
-
57
- ## What Already Exists (Do NOT Re-implement)
58
-
59
- [List any existing components, database tables, or files
60
- that agents must use rather than recreate]
61
-
62
- ## What Was Built in Planning (Prototype)
63
-
64
- [Describe the prototype — file location, key design decisions,
65
- what to preserve vs what to adapt]
66
-
67
- ## Work Packages
68
-
69
- ### Package 1 — <Name>
70
- - Agent type: frontend | backend | data | design | infra | content | cs2 | viz
71
- - Guide: .rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md)
72
- - Files to create/modify: [list]
73
- - Deliverables: [specific outputs]
74
- - Depends on: [other packages if sequential]
75
-
76
- ### Package 2 — <Name>
77
- [...]
78
-
79
- ## Sequencing
80
-
81
- Wave 1 (parallel): Package 1, Package 2
82
- Wave 2 (after Wave 1): Package 3
83
-
84
- ## Definition of Done
85
-
86
- - [ ] [specific acceptance criterion]
87
- - [ ] [build verification: zero new TS errors]
88
- - [ ] [functional test]
89
- ```
90
-
91
- ### Step 3 — Create Database Epic + Tasks
92
-
93
- ```sql
94
- -- Check for existing epics first
95
- SELECT get_open_epics();
96
-
97
- -- Create epic
98
- SELECT insert_work_item(
99
- p_title := 'EPIC: <Topic>',
100
- p_description := 'See .rdc/plans/<topic-slug>.md for full spec.',
101
- p_item_type := 'epic',
102
- p_priority := 'high',
103
- p_labels := ARRAY['<system-label>'],
104
- p_source := 'planning'
105
- );
106
-
107
- -- Immediately populate governance refs — the handoff's plan doc IS the plan_ref/spec_ref.
108
- -- Set architecture_ref ONLY when this handoff crosses an architectural boundary (storage
109
- -- authority, process topology, auth boundary, deployment model, persistence, service
110
- -- ownership, public contract); leave it NULL for ordinary feature work, or every task
111
- -- below gets held for a review it doesn't need.
112
- SELECT set_epic_governance_refs(
113
- p_epic_id := '<epic-uuid>'::uuid,
114
- p_plan_ref := '.rdc/plans/<topic-slug>.md',
115
- p_spec_ref := '.rdc/plans/<topic-slug>.md',
116
- p_architecture_ref := '<docs/systems/<system>/ARCHITECTURE.md or NULL>',
117
- p_scoping_statement := '<one paragraph: what is explicitly in scope and what is explicitly out of scope>'
118
- );
119
-
120
- -- Create tasks (one per work package)
121
- SELECT insert_work_item(
122
- p_title := '<Package Name>',
123
- p_description := 'What: <deliverable>
124
- Where: <files>
125
- Agent type: <type>
126
- Guide: .rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md)
127
- Design doc: .rdc/plans/<topic-slug>.md (fallback: .rdc/plans/<topic-slug>.md)
128
- Depends on: <other task if applicable>
129
- Est: <hours>',
130
- p_parent_id := '<epic-uuid>'::uuid,
131
- p_item_type := 'task',
132
- p_priority := 'high',
133
- p_labels := ARRAY['<label>'],
134
- p_estimated_hours := 2,
135
- p_source := 'planning'
136
- -- If the epic has architecture_ref set, also add a required
137
- -- architecture-fidelity-<slug> checklist row via p_checklist here — the exit gate
138
- -- hard-rejects `done` on any task under an architecture_ref epic that lacks one.
139
- );
140
- ```
141
-
142
- ### Step 4 — Register Prototype (if one was built)
143
-
144
- ```sql
145
- INSERT INTO prototype_registry (name, component, source_path, notes, created_by)
146
- VALUES (
147
- '<Component Name> v1',
148
- '<ComponentName>',
149
- 'docs/source/<filename>.jsx',
150
- '<Key design decisions, data shapes, what to preserve>',
151
- 'planning'
152
- )
153
- ON CONFLICT DO NOTHING;
154
- ```
155
-
156
- ### Step 5 — Record Design Decisions
157
-
158
- ```sql
159
- INSERT INTO design_context (topic, context_type, summary, source, created_by)
160
- VALUES
161
- ('<Topic>', 'decision', '<What was decided and why>', 'planning session', 'planning'),
162
- ('<Topic>', 'rejected', '<What was considered but not chosen, and why>', 'planning session', 'planning');
163
- ```
164
-
165
- ## System Labels Reference
166
-
167
- | Label | When |
168
- |-------|------|
169
- | `project-a` | Your-app-specific label |
170
- | `marketing` | Marketing / outreach work |
171
- | `ui` | Component library work |
172
- | `data` | Schema, migrations |
173
- | `infrastructure` | CI/CD, deployment |
174
- | `cs2` | Core paradigm packages |
175
- | `website` | Public-facing sites |
176
- | `media` | Media/asset work |
177
-
178
- ## Output
179
-
180
- When complete, tell the project lead:
181
- ```
182
- Handoff complete:
183
- - Plan: .rdc/plans/<topic-slug>.md
184
- - Epic: <epic-id> ("<title>")
185
- - Tasks: <N> tasks created, wave structure: [Wave 1: X, Y | Wave 2: Z]
186
- - Prototype: registered at docs/source/<file> (if applicable)
187
- - CLI agents will pick this up on next run.
188
- ```