@lifeaitools/rdc-skills 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +15 -0
- package/.claude-plugin/marketplace.json +21 -0
- package/.claude-plugin/plugin.json +11 -0
- package/.github/workflows/publish.yml +25 -0
- package/.github/workflows/self-test.yml +53 -0
- package/CHANGELOG.md +246 -0
- package/LICENSE +21 -0
- package/MANIFEST.md +190 -0
- package/README.md +188 -0
- package/README.sandbox.md +3 -0
- package/assets/watcher/viewer.html +164 -0
- package/commands/build.md +183 -0
- package/commands/collab.md +180 -0
- package/commands/deploy.md +138 -0
- package/commands/fixit.md +112 -0
- package/commands/handoff.md +173 -0
- package/commands/help.md +88 -0
- package/commands/overnight.md +220 -0
- package/commands/plan.md +158 -0
- package/commands/preplan.md +131 -0
- package/commands/prototype.md +145 -0
- package/commands/release.md +159 -0
- package/commands/report.md +99 -0
- package/commands/review.md +120 -0
- package/commands/self-test.md +107 -0
- package/commands/status.md +86 -0
- package/commands/watch.md +92 -0
- package/commands/workitems.md +132 -0
- package/guides/.gitkeep +0 -0
- package/guides/agent-bootstrap.md +191 -0
- package/guides/agents/backend.md +104 -0
- package/guides/agents/content.md +94 -0
- package/guides/agents/cs2.md +56 -0
- package/guides/agents/data.md +87 -0
- package/guides/agents/design.md +77 -0
- package/guides/agents/frontend.md +92 -0
- package/guides/agents/infrastructure.md +81 -0
- package/guides/agents/setup.md +279 -0
- package/guides/agents/verify.md +132 -0
- package/guides/agents/viz.md +106 -0
- package/guides/backend.md +146 -0
- package/guides/content.md +147 -0
- package/guides/cs2.md +190 -0
- package/guides/data.md +123 -0
- package/guides/design.md +116 -0
- package/guides/frontend.md +151 -0
- package/guides/infrastructure.md +179 -0
- package/guides/output-contract.md +98 -0
- package/hooks/no-stop-open-epics.js +125 -0
- package/package.json +31 -0
- package/rules/work-items-rpc.md +399 -0
- package/scripts/install-rdc-skills.js +559 -0
- package/scripts/install.ps1 +165 -0
- package/scripts/install.sh +132 -0
- package/scripts/lib/assertions.mjs +264 -0
- package/scripts/lib/manifest-schema.mjs +607 -0
- package/scripts/lib/runner.mjs +429 -0
- package/scripts/lib/sandbox.mjs +435 -0
- package/scripts/self-test.mjs +1108 -0
- package/scripts/uninstall.ps1 +77 -0
- package/scripts/uninstall.sh +69 -0
- package/scripts/update.ps1 +43 -0
- package/scripts/update.sh +43 -0
- package/scripts/watch-init.mjs +100 -0
- package/skills/.gitkeep +0 -0
- package/skills/build/SKILL.md +238 -0
- package/skills/collab/SKILL.md +218 -0
- package/skills/deploy/SKILL.md +144 -0
- package/skills/fixit/SKILL.md +112 -0
- package/skills/handoff/SKILL.md +175 -0
- package/skills/help/SKILL.md +101 -0
- package/skills/overnight/SKILL.md +220 -0
- package/skills/plan/SKILL.md +96 -0
- package/skills/preplan/SKILL.md +87 -0
- package/skills/prototype/SKILL.md +151 -0
- package/skills/release/SKILL.md +221 -0
- package/skills/report/SKILL.md +101 -0
- package/skills/review/SKILL.md +120 -0
- package/skills/self-test/SKILL.md +127 -0
- package/skills/status/SKILL.md +86 -0
- package/skills/tests/README.md +29 -0
- package/skills/tests/rdc-build.test.json +22 -0
- package/skills/tests/rdc-deploy.test.json +15 -0
- package/skills/tests/rdc-fixit.test.json +21 -0
- package/skills/tests/rdc-handoff.test.json +14 -0
- package/skills/tests/rdc-overnight.test.json +21 -0
- package/skills/tests/rdc-plan.test.json +14 -0
- package/skills/tests/rdc-preplan.test.json +15 -0
- package/skills/tests/rdc-prototype.test.json +14 -0
- package/skills/tests/rdc-release.test.json +15 -0
- package/skills/tests/rdc-report.test.json +14 -0
- package/skills/tests/rdc-review.test.json +14 -0
- package/skills/tests/rdc-status.test.json +16 -0
- package/skills/tests/rdc-workitems.test.json +15 -0
- package/skills/watch/SKILL.md +92 -0
- package/skills/workitems/SKILL.md +147 -0
- package/tests/validate-skills.js +183 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rdc:workitems
|
|
3
|
+
description: >-
|
|
4
|
+
Usage `rdc:workitems <action> [args]` — create, update, query work items via Supabase RPCs. Actions: add, update, done, list, epics. Use for "add to backlog", "mark done", "show open epics", any work item CRUD.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
8
|
+
> Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
|
|
9
|
+
> One checklist upfront, updated in place, shown again at end with a 1-line verdict.
|
|
10
|
+
|
|
11
|
+
> If dispatching subagents or running as a subagent: read `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md` first (fallback: `{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md`).
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# rdc:workitems — Work Item Management
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
1. **Epic first, always.** Never create a task without a parent epic.
|
|
19
|
+
2. **Label everything.** Minimum one system label per item.
|
|
20
|
+
3. **Check first.** `get_open_epics()` before creating anything new.
|
|
21
|
+
4. **Link design docs.** Put `.rdc/plans/` or `.rdc/research/` paths in descriptions (fallback: `.rdc/plans/` / `.rdc/research/`).
|
|
22
|
+
|
|
23
|
+
## Read Epics
|
|
24
|
+
|
|
25
|
+
```sql
|
|
26
|
+
SELECT get_open_epics();
|
|
27
|
+
SELECT get_open_epics('urgent');
|
|
28
|
+
SELECT get_open_epics(p_label_filter := 'custom-label');
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Create Epic
|
|
32
|
+
|
|
33
|
+
```sql
|
|
34
|
+
SELECT insert_work_item(
|
|
35
|
+
p_title := 'EPIC: Clear descriptive title',
|
|
36
|
+
p_description := 'What and why. Reference .rdc/plans/<n>.md if applicable.',
|
|
37
|
+
p_item_type := 'epic',
|
|
38
|
+
p_priority := 'high',
|
|
39
|
+
p_labels := ARRAY['system-label'],
|
|
40
|
+
p_source := 'planning'
|
|
41
|
+
);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Create Task
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
SELECT insert_work_item(
|
|
48
|
+
p_title := 'Specific actionable task title',
|
|
49
|
+
p_description := 'What: <deliverable>
|
|
50
|
+
Where: <files to create/modify>
|
|
51
|
+
Agent type: frontend | backend | data | design | infra | content | cs2
|
|
52
|
+
Guide: .rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md)
|
|
53
|
+
Design doc: .rdc/plans/<n>.md (fallback: .rdc/plans/<n>.md, if exists)
|
|
54
|
+
Depends on: <other task title if sequential>
|
|
55
|
+
Est: <hours>',
|
|
56
|
+
p_parent_id := '<epic-uuid>'::uuid,
|
|
57
|
+
p_item_type := 'task',
|
|
58
|
+
p_priority := 'high',
|
|
59
|
+
p_labels := ARRAY['system-label'],
|
|
60
|
+
p_estimated_hours := 2,
|
|
61
|
+
p_source := 'planning'
|
|
62
|
+
);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Update Status
|
|
66
|
+
|
|
67
|
+
```sql
|
|
68
|
+
SELECT update_work_item_status('<uuid>'::uuid, 'in_progress');
|
|
69
|
+
SELECT update_work_item_status('<uuid>'::uuid, 'done', '["What was completed"]'::jsonb);
|
|
70
|
+
SELECT update_work_item_status('<uuid>'::uuid, 'blocked', '["Why it is blocked"]'::jsonb);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Read Tasks in an Epic
|
|
74
|
+
|
|
75
|
+
```sql
|
|
76
|
+
SELECT get_work_items_by_epic('<epic-uuid>'::uuid);
|
|
77
|
+
SELECT get_work_items_by_epic('<epic-uuid>'::uuid, 'todo');
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Bump Epic Version
|
|
81
|
+
|
|
82
|
+
```sql
|
|
83
|
+
SELECT bump_epic_version('<epic-uuid>'::uuid, '0.2.0', 'What changed', 'planning');
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Valid Values
|
|
87
|
+
|
|
88
|
+
| Field | Values |
|
|
89
|
+
|-------|--------|
|
|
90
|
+
| status | `todo` `in_progress` `blocked` `review` `done` `archived` |
|
|
91
|
+
| priority | `urgent` `high` `normal` `low` |
|
|
92
|
+
| item_type | `epic` `task` `subtask` `bug` `spike` |
|
|
93
|
+
|
|
94
|
+
## System Labels
|
|
95
|
+
|
|
96
|
+
| Label | When |
|
|
97
|
+
|-------|------|
|
|
98
|
+
| `project-a` | Your-app-specific work |
|
|
99
|
+
| `project-b` | Another app work |
|
|
100
|
+
| `cs2` | Core paradigm packages |
|
|
101
|
+
| `hail` | Grammar, DSL compiler |
|
|
102
|
+
| `pal` | Moment windows, memory |
|
|
103
|
+
| `virtue` | Virtue engine, coherence |
|
|
104
|
+
| `marketing` | Outreach, campaigns |
|
|
105
|
+
| `media` | Assets, R2, image pipeline |
|
|
106
|
+
| `infrastructure` | CI/CD, deployment |
|
|
107
|
+
| `ui` | Component library |
|
|
108
|
+
| `data` | Schema, migrations |
|
|
109
|
+
| `content` | Copy, messaging |
|
|
110
|
+
| `website` | Public-facing sites |
|
|
111
|
+
|
|
112
|
+
## Agent Type → Guide File Reference
|
|
113
|
+
|
|
114
|
+
| Type | Guide | Use For |
|
|
115
|
+
|------|-------|---------|
|
|
116
|
+
| `frontend` | .rdc/guides/frontend.md | React, pages, UI, Tailwind |
|
|
117
|
+
| `backend` | .rdc/guides/backend.md | API routes, database, auth |
|
|
118
|
+
| `data` | .rdc/guides/data.md | Migrations, schema, RPC |
|
|
119
|
+
| `design` | .rdc/guides/design.md | Brand, palette, OG images |
|
|
120
|
+
| `infra` | .rdc/guides/infrastructure.md | CI/CD, deploy, DNS |
|
|
121
|
+
| `content` | .rdc/guides/content.md | Copy, messaging, tone |
|
|
122
|
+
| `cs2` | .rdc/guides/cs2.md | CS 2.0 paradigm |
|
|
123
|
+
| `hail` | .rdc/guides/cs2.md + packages/hail/CLAUDE.md | Grammar, DSL |
|
|
124
|
+
| `viz` | .rdc/guides/frontend.md + design.md | Custom visualizations |
|
|
125
|
+
|
|
126
|
+
## What NOT to Do
|
|
127
|
+
|
|
128
|
+
- Never raw INSERT/UPDATE against work items — RPC functions only
|
|
129
|
+
- Never create tasks without a parent epic
|
|
130
|
+
- Never leave labels empty
|
|
131
|
+
- Never write vague titles ("Fix stuff") — be specific
|
|
132
|
+
- Never put design intention in the task — put it in `.rdc/research/` (fallback: `.rdc/research/`) and link
|
package/guides/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Agent Bootstrap — Read This First
|
|
2
|
+
> Every dispatched agent reads this before their role-specific guide.
|
|
3
|
+
> Base guide for rdc-skills — provides credential, git, and reporting patterns across projects.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Who You Are
|
|
8
|
+
|
|
9
|
+
You are a subagent dispatched by the rdc:build supervisor. You have a specific
|
|
10
|
+
scope (files, package, feature) that will be in your prompt. Stay in that scope.
|
|
11
|
+
NEVER modify files outside it.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Credentials — Daemon Access Pattern
|
|
16
|
+
|
|
17
|
+
You do NOT have access to cloud MCP connectors. Instead, all credentials
|
|
18
|
+
come from a daemon running locally (typically on localhost:52437).
|
|
19
|
+
|
|
20
|
+
**Ping first to confirm availability:**
|
|
21
|
+
```bash
|
|
22
|
+
curl -s http://127.0.0.1:52437/ping
|
|
23
|
+
```
|
|
24
|
+
If it doesn't respond — report BLOCKED, do not proceed.
|
|
25
|
+
|
|
26
|
+
**Get a credential:**
|
|
27
|
+
```bash
|
|
28
|
+
curl -s http://127.0.0.1:52437/get/<service>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Pattern for extracting key/value without printing:**
|
|
32
|
+
```bash
|
|
33
|
+
# Correct pattern — never echo the key
|
|
34
|
+
KEY=$(curl -s http://127.0.0.1:52437/get/<service> | python3 -c "import sys,json; print(json.load(sys.stdin)['key'])")
|
|
35
|
+
curl -s -H "Authorization: Bearer $KEY" https://api.example.com/...
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Never print credentials to stdout.** Capture to a variable, use inline, discard.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Project Directory Convention
|
|
43
|
+
|
|
44
|
+
This plugin uses the `.rdc/` directory convention. Check for it first:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Check if .rdc/ exists at project root
|
|
48
|
+
ls {PROJECT_ROOT}/.rdc/config.json 2>/dev/null && echo "using .rdc/" || echo "using docs/ fallback"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Path resolution rule:**
|
|
52
|
+
- Guides: `{PROJECT_ROOT}/.rdc/guides/` → fallback: `{PROJECT_ROOT}/docs/guides/`
|
|
53
|
+
- Plans: `{PROJECT_ROOT}/.rdc/plans/` → fallback: `{PROJECT_ROOT}/docs/plans/`
|
|
54
|
+
- Reports: `{PROJECT_ROOT}/.rdc/reports/` → fallback: `{PROJECT_ROOT}/docs/reports/`
|
|
55
|
+
- Research: `{PROJECT_ROOT}/.rdc/research/` → fallback: `{PROJECT_ROOT}/docs/research/`
|
|
56
|
+
|
|
57
|
+
If `.rdc/config.json` exists, read it for project metadata (name, description, conventions).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Database Access — Check Project Overlay
|
|
62
|
+
|
|
63
|
+
The project overlay guide will specify:
|
|
64
|
+
- Database project reference / instance name
|
|
65
|
+
- Whether to use MCP connectors or daemon
|
|
66
|
+
- Available RPC functions
|
|
67
|
+
- Work item management patterns
|
|
68
|
+
|
|
69
|
+
Read the project-specific agent-bootstrap.md overlay for exact connection details.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Git Rules
|
|
74
|
+
|
|
75
|
+
- Branch: Always use the project's primary development branch (typically `develop` or `main`)
|
|
76
|
+
- Auto-commit after completing your scope — no confirmation needed
|
|
77
|
+
- Commit message must use conventional format: `feat/fix/chore/refactor(<scope>): description`
|
|
78
|
+
- Push to origin after committing
|
|
79
|
+
- NEVER force-push
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Build Rules
|
|
84
|
+
|
|
85
|
+
Never run `pnpm build` or equivalent full builds locally — they consume excessive memory.
|
|
86
|
+
Type-check only: `npx tsc --noEmit --project <path>/tsconfig.json`
|
|
87
|
+
Run tests only for modified packages: modify tests in isolation, not whole suite.
|
|
88
|
+
|
|
89
|
+
Check the project overlay for specific language, package manager, and build constraints.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## RDC_TEST Sandbox Contract
|
|
94
|
+
|
|
95
|
+
When `RDC_TEST=1` is set, the skill is running inside the Tier 2 sandbox harness. Short-circuit all destructive external side effects.
|
|
96
|
+
|
|
97
|
+
**How to detect:** `process.env.RDC_TEST === '1'` (Node/JS) or `[ "$RDC_TEST" = "1" ]` (bash). The Tier 2 runner sets this before invoking `claude --print`.
|
|
98
|
+
|
|
99
|
+
**Allowed under RDC_TEST** — run normally, no guard:
|
|
100
|
+
|
|
101
|
+
| Operation | Why |
|
|
102
|
+
|-----------|-----|
|
|
103
|
+
| Local git commits | Commit to the worktree branch; never pushed |
|
|
104
|
+
| Local filesystem writes | Inside the sandbox worktree |
|
|
105
|
+
| Supabase reads | Assertions read prod DB; no writes |
|
|
106
|
+
| Service reads | Coolify status, CF DNS lookup, GitHub read — all safe |
|
|
107
|
+
| `clauth` credential reads | Read-only against the daemon |
|
|
108
|
+
|
|
109
|
+
**Short-circuit under RDC_TEST** — must be wrapped in a guard:
|
|
110
|
+
|
|
111
|
+
- Supabase INSERT/UPDATE/DELETE (work items, prototype_registry, design_context, etc.) — runner uses main-db mode, no test branch
|
|
112
|
+
- Coolify app deploys / restarts / config writes
|
|
113
|
+
- Cloudflare DNS writes / cache purges
|
|
114
|
+
- R2 object writes / deletes
|
|
115
|
+
- `git push` to any remote
|
|
116
|
+
- `gh pr create`, `gh release create`, tag pushes
|
|
117
|
+
- `npm publish`
|
|
118
|
+
- Any webhook fire, email send, Slack post
|
|
119
|
+
- MCP connector tools that mutate external state (e.g. `mcp__coolify__deploy`)
|
|
120
|
+
|
|
121
|
+
**Bash pattern:**
|
|
122
|
+
```bash
|
|
123
|
+
if [ "$RDC_TEST" != "1" ]; then
|
|
124
|
+
curl -X POST "https://deploy.regendevcorp.com/api/v1/applications/$UUID/deploy" ...
|
|
125
|
+
else
|
|
126
|
+
echo "[RDC_TEST] skipping Coolify deploy"
|
|
127
|
+
fi
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Node/JS pattern:**
|
|
131
|
+
```js
|
|
132
|
+
if (process.env.RDC_TEST !== '1') {
|
|
133
|
+
await deployToCoolify(...);
|
|
134
|
+
} else {
|
|
135
|
+
console.log('[RDC_TEST] skipping Coolify deploy');
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Why this matters:** Tier 2 runs every skill in a throwaway sandbox. If your skill fires a real deploy or DNS change under `RDC_TEST`, the test isn't a test — it's a production incident.
|
|
140
|
+
|
|
141
|
+
**New-skill contract:** every new `rdc:*` skill MUST honor `RDC_TEST` before shipping. Tier 2 manifests will fail any skill that writes to external state under the flag.
|
|
142
|
+
|
|
143
|
+
**Known blocker:** The `check-cwd.js` SessionStart hook hard-blocks Claude sessions launched from `C:/Dev/rdc-skills`. The hook must check `process.env.RDC_TEST === '1'` and call `process.exit(0)` early to allow Tier 2 sandbox runs. Without this bypass, all Tier 2 headless invocations fail with `exit_code: -1`. File: `~/.claude/hooks/check-cwd.js`.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Completion Report
|
|
148
|
+
|
|
149
|
+
When your scope is done, return a structured report to the supervisor:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
AGENT_COMPLETE: {
|
|
153
|
+
scope: "<what you were assigned>",
|
|
154
|
+
files_changed: ["path/to/file", ...],
|
|
155
|
+
work_item_id: "<id if you had one>",
|
|
156
|
+
commits: ["<hash> <message>"],
|
|
157
|
+
blockers: ["<anything that needs supervisor attention>"]
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If you hit a blocker mid-task: stop, report it, do not guess or work around it.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Self-Check Rules — Prevent Getting Lost
|
|
166
|
+
|
|
167
|
+
### 10-Minute Rule
|
|
168
|
+
If you have been working on a **single step** for more than 10 minutes without measurable progress (no new files changed, no successful tool calls, no forward movement), **stop immediately**. Do not keep trying variations. Report it as a blocker.
|
|
169
|
+
|
|
170
|
+
### 2-Retry Rule
|
|
171
|
+
If the **same command or approach fails twice**, stop. Do not attempt a third variation or creative workaround. Report the failure with the exact error output.
|
|
172
|
+
|
|
173
|
+
### Scope Drift Rule
|
|
174
|
+
If you discover that fixing your assigned task would also require changing files **outside your scope**, stop. Do not fix them. Add them to `blockers` in your AGENT_COMPLETE report. The supervisor assigns them separately.
|
|
175
|
+
|
|
176
|
+
### What "measurable progress" means
|
|
177
|
+
- A file was created or modified ✅
|
|
178
|
+
- A tool call succeeded and returned useful data ✅
|
|
179
|
+
- A command ran without error ✅
|
|
180
|
+
- Trying the same thing with slightly different parameters ❌
|
|
181
|
+
- Reading the same file again hoping for different insight ❌
|
|
182
|
+
- Rephrasing a failing query ❌
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Now read your role-specific guide
|
|
187
|
+
|
|
188
|
+
Path: `{PROJECT_ROOT}/.rdc/guides/<type>.md` (e.g., `frontend.md`, `backend.md`, `data.md`)
|
|
189
|
+
Fallback: `{PROJECT_ROOT}/docs/guides/<type>.md` if `.rdc/` does not exist.
|
|
190
|
+
|
|
191
|
+
The project overlay will specify the exact location if it differs from the convention above.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
2
|
+
> Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
|
|
3
|
+
> One checklist upfront, updated in place, shown again at end with a 1-line verdict.
|
|
4
|
+
|
|
5
|
+
> 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`).
|
|
6
|
+
|
|
7
|
+
> **Sandbox contract:** This guide honors `RDC_TEST=1` per `guides/agent-bootstrap.md` § RDC_TEST Sandbox Contract. Destructive external calls short-circuit under the flag.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# rdc:backend — Backend Agent
|
|
11
|
+
|
|
12
|
+
## Mandatory First Step
|
|
13
|
+
|
|
14
|
+
Read the guide before ANY code:
|
|
15
|
+
```
|
|
16
|
+
{PROJECT_ROOT}/.rdc/guides/backend.md
|
|
17
|
+
(fallback: {PROJECT_ROOT}/.rdc/guides/backend.md)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Database Client — One Pattern Per Context
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// Server component / API route
|
|
24
|
+
import { createServerClient } from "@regen/supabase";
|
|
25
|
+
const supabase = await createServerClient();
|
|
26
|
+
|
|
27
|
+
// Client component
|
|
28
|
+
import { createBrowserClient } from "@regen/supabase";
|
|
29
|
+
const supabase = createBrowserClient();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Non-public schemas:
|
|
33
|
+
```ts
|
|
34
|
+
const { data } = await supabase.schema("custom").from("table_name").select("*");
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Credentials — Daemon First
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
curl -s http://127.0.0.1:52437/get/<service>
|
|
41
|
+
```
|
|
42
|
+
- Never hardcode credentials
|
|
43
|
+
- Never print keys to stdout
|
|
44
|
+
- If daemon is down: report BLOCKED — do not work around it
|
|
45
|
+
|
|
46
|
+
## Work Items — RPC Only
|
|
47
|
+
|
|
48
|
+
```sql
|
|
49
|
+
-- Read epics
|
|
50
|
+
SELECT get_open_epics();
|
|
51
|
+
|
|
52
|
+
-- Create
|
|
53
|
+
SELECT insert_work_item(
|
|
54
|
+
p_title := 'Task title',
|
|
55
|
+
p_priority := 'high',
|
|
56
|
+
p_parent_id := '<epic-uuid>'::uuid,
|
|
57
|
+
p_source := 'agent'
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
-- Update
|
|
61
|
+
SELECT update_work_item_status('<uuid>'::uuid, 'done', '["What was done"]'::jsonb);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**NEVER write raw INSERT/UPDATE against work items.**
|
|
65
|
+
|
|
66
|
+
## API Route Pattern
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { createServerClient } from "@regen/supabase";
|
|
70
|
+
import { NextResponse } from "next/server";
|
|
71
|
+
|
|
72
|
+
export async function GET() {
|
|
73
|
+
const supabase = await createServerClient();
|
|
74
|
+
const { data, error } = await supabase.from("table").select("*");
|
|
75
|
+
if (error) return NextResponse.json({ error: error.message }, { status: 500 });
|
|
76
|
+
return NextResponse.json(data);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function POST(request: Request) {
|
|
80
|
+
const body = await request.json();
|
|
81
|
+
const supabase = await createServerClient();
|
|
82
|
+
const { data, error } = await supabase.from("table").insert(body).select().single();
|
|
83
|
+
if (error) return NextResponse.json({ error: error.message }, { status: 400 });
|
|
84
|
+
return NextResponse.json(data, { status: 201 });
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Auth
|
|
89
|
+
|
|
90
|
+
Use the auth helpers from your project's auth package for protected apps.
|
|
91
|
+
|
|
92
|
+
## Schema-Driven Forms
|
|
93
|
+
|
|
94
|
+
When working with schema-driven forms (common in dynamic CRUD), never hardcode columns.
|
|
95
|
+
Use the schema table to drive form rendering instead.
|
|
96
|
+
|
|
97
|
+
## Safety Rules
|
|
98
|
+
|
|
99
|
+
- Branch: development branch — auto-commit after logical blocks
|
|
100
|
+
- NEVER run `pnpm build`
|
|
101
|
+
- NEVER overlap with other agents on the same files
|
|
102
|
+
- Update work items in real time — not batch at end
|
|
103
|
+
- Push after each logical block *(skip if `$RDC_TEST=1` — echo `[RDC_TEST] skipping git push` instead)*
|
|
104
|
+
- Write tests FIRST — red → implement → green
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
2
|
+
> Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
|
|
3
|
+
> One checklist upfront, updated in place, shown again at end with a 1-line verdict.
|
|
4
|
+
|
|
5
|
+
> 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`).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# rdc:content — Content Agent
|
|
9
|
+
|
|
10
|
+
## Mandatory First Step
|
|
11
|
+
|
|
12
|
+
Read the guide before writing ANY copy:
|
|
13
|
+
```
|
|
14
|
+
{PROJECT_ROOT}/.rdc/guides/content.md
|
|
15
|
+
(fallback: {PROJECT_ROOT}/.rdc/guides/content.md)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Core Message Development
|
|
19
|
+
|
|
20
|
+
Before writing any copy:
|
|
21
|
+
|
|
22
|
+
1. Define the lead word or core concept (e.g., "Stewardship", "Community", "Trust")
|
|
23
|
+
2. State the core message in 1-2 sentences
|
|
24
|
+
3. List language to always use
|
|
25
|
+
4. List language to never use
|
|
26
|
+
5. Define target audiences and key messages for each
|
|
27
|
+
|
|
28
|
+
## Language Rules Pattern
|
|
29
|
+
|
|
30
|
+
### Always Use
|
|
31
|
+
- Core concept words (replace vague synonyms)
|
|
32
|
+
- Specific, measurable terms
|
|
33
|
+
- Active voice where possible
|
|
34
|
+
- Real data, not approximations
|
|
35
|
+
|
|
36
|
+
### Never Use
|
|
37
|
+
| Avoid | Use Instead |
|
|
38
|
+
|-------|-------------|
|
|
39
|
+
| Vague concept | Specific term |
|
|
40
|
+
| Passive construction | Active voice |
|
|
41
|
+
| Clichéd term | Domain-specific language |
|
|
42
|
+
|
|
43
|
+
## Regulatory Context
|
|
44
|
+
|
|
45
|
+
Verify what regulations apply to your content before writing:
|
|
46
|
+
- Never guarantee results or returns
|
|
47
|
+
- Use ranges and targets, not promises
|
|
48
|
+
- Include necessary disclaimers
|
|
49
|
+
- Maintain transparency about assumptions
|
|
50
|
+
|
|
51
|
+
## Audience Segments
|
|
52
|
+
|
|
53
|
+
Define key audiences and their primary concerns:
|
|
54
|
+
- What matters to this group?
|
|
55
|
+
- What is their current perception?
|
|
56
|
+
- What action do you want them to take?
|
|
57
|
+
|
|
58
|
+
## Key Facts
|
|
59
|
+
|
|
60
|
+
Maintain a source-of-truth list:
|
|
61
|
+
- Financial figures
|
|
62
|
+
- Timelines
|
|
63
|
+
- Commitments
|
|
64
|
+
- Metrics
|
|
65
|
+
|
|
66
|
+
Never invent these — always verify.
|
|
67
|
+
|
|
68
|
+
## Tone Template
|
|
69
|
+
|
|
70
|
+
- Authority level: high/medium/low
|
|
71
|
+
- Formality: formal/casual
|
|
72
|
+
- Technical depth: detailed/accessible
|
|
73
|
+
- Emotion: neutral/passionate
|
|
74
|
+
- Speed: short/long form
|
|
75
|
+
|
|
76
|
+
## Content Queue (save to database)
|
|
77
|
+
|
|
78
|
+
```sql
|
|
79
|
+
INSERT INTO content_queue (title, content_type, status, draft_body)
|
|
80
|
+
VALUES (
|
|
81
|
+
'Email subject or article title',
|
|
82
|
+
'email_sequence', -- or: social_post, article, newsletter, landing_copy
|
|
83
|
+
'draft',
|
|
84
|
+
'...'
|
|
85
|
+
);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Safety Rules
|
|
89
|
+
|
|
90
|
+
- Never invent data — verify all figures
|
|
91
|
+
- Never make legal claims — use "may be" language
|
|
92
|
+
- Use prohibited words list when provided
|
|
93
|
+
- Always include disclaimers for regulated content
|
|
94
|
+
- Branch: development branch — commit content files to repo
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
2
|
+
> Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
|
|
3
|
+
> One checklist upfront, updated in place, shown again at end with a 1-line verdict.
|
|
4
|
+
|
|
5
|
+
> 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`).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# rdc:cs2 — CS 2.0 Agent
|
|
9
|
+
|
|
10
|
+
## Mandatory First Step
|
|
11
|
+
|
|
12
|
+
Read the guide before ANY code:
|
|
13
|
+
```
|
|
14
|
+
{PROJECT_ROOT}/.rdc/guides/cs2.md
|
|
15
|
+
(fallback: {PROJECT_ROOT}/.rdc/guides/cs2.md)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Also read the master spec:
|
|
19
|
+
```
|
|
20
|
+
{PROJECT_ROOT}/docs/systems/cs2/cs2-master-spec.md
|
|
21
|
+
{PROJECT_ROOT}/docs/systems/cs2/package-map.md
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## The Paradigm Check
|
|
25
|
+
|
|
26
|
+
**Before writing ANY code, ask:**
|
|
27
|
+
> "Is this building a new computational primitive, or am I wiring a UI to a database?"
|
|
28
|
+
|
|
29
|
+
If the latter — STOP. That is CS 1.0 thinking. Route to `rdc:frontend` + `rdc:backend`.
|
|
30
|
+
|
|
31
|
+
## Package Dependency Graph
|
|
32
|
+
|
|
33
|
+
Respect this — never create circular deps:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Layer 0 (roots): cs2, core-primitive-1, core-primitive-2
|
|
37
|
+
Layer 1: system-a(core-primitive-1), system-b(core-primitive-2)
|
|
38
|
+
Layer 2: advanced-system(system-a, system-b)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Apps depend on `@regen/` packages. **Apps never depend on each other.**
|
|
42
|
+
|
|
43
|
+
## TypeScript — No `any`, No Escape Hatches
|
|
44
|
+
|
|
45
|
+
CS 2.0 packages must be fully typed. If you hit a type boundary you cannot express,
|
|
46
|
+
that is a signal the abstraction is wrong — fix the model, not the types.
|
|
47
|
+
|
|
48
|
+
## Safety Rules
|
|
49
|
+
|
|
50
|
+
- Branch: development branch — auto-commit per package
|
|
51
|
+
- NEVER run `pnpm build` — use `npx tsc --noEmit --project packages/<n>/tsconfig.json`
|
|
52
|
+
- Respect the dependency graph — no circular deps
|
|
53
|
+
- Never self-modify governance weights from executing layers
|
|
54
|
+
- All immutable proofs are permanent — never update committed data
|
|
55
|
+
- NEVER overlap agents on the same package
|
|
56
|
+
- Write tests FIRST — red → implement → green
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
2
|
+
> Checklist-only output. No tool-call narration. No raw MCP/JSON/log dumps.
|
|
3
|
+
> One checklist upfront, updated in place, shown again at end with a 1-line verdict.
|
|
4
|
+
|
|
5
|
+
> 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`).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# rdc:data — Data Agent
|
|
9
|
+
|
|
10
|
+
## Mandatory First Step
|
|
11
|
+
|
|
12
|
+
Read the guide before ANY operations:
|
|
13
|
+
```
|
|
14
|
+
{PROJECT_ROOT}/.rdc/guides/data.md
|
|
15
|
+
(fallback: {PROJECT_ROOT}/.rdc/guides/data.md)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Migration Pattern
|
|
19
|
+
|
|
20
|
+
Always use database MCP `apply_migration` — never raw shell commands:
|
|
21
|
+
|
|
22
|
+
```sql
|
|
23
|
+
-- Example migration
|
|
24
|
+
ALTER TABLE example_table ADD COLUMN IF NOT EXISTS new_column TEXT;
|
|
25
|
+
|
|
26
|
+
-- Verify after applying
|
|
27
|
+
SELECT column_name, data_type
|
|
28
|
+
FROM information_schema.columns
|
|
29
|
+
WHERE table_name = 'example_table'
|
|
30
|
+
ORDER BY ordinal_position;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
After `apply_migration`: always verify with queries.
|
|
34
|
+
|
|
35
|
+
## Work Items — RPC Only
|
|
36
|
+
|
|
37
|
+
```sql
|
|
38
|
+
SELECT get_open_epics();
|
|
39
|
+
SELECT insert_work_item(p_title := 'Task', p_priority := 'high', p_labels := ARRAY['data'], p_source := 'agent');
|
|
40
|
+
SELECT update_work_item_status('<uuid>'::uuid, 'done');
|
|
41
|
+
SELECT get_work_items_by_epic('<epic-uuid>'::uuid);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**NEVER raw INSERT/UPDATE against work_items.**
|
|
45
|
+
|
|
46
|
+
## Schema-Driven Form Seeding
|
|
47
|
+
|
|
48
|
+
When adding columns to dynamic form tables:
|
|
49
|
+
|
|
50
|
+
```sql
|
|
51
|
+
INSERT INTO field_schema (
|
|
52
|
+
table_name, column_name, input_type, label, section, display_order,
|
|
53
|
+
required, readonly, hidden, col_span
|
|
54
|
+
)
|
|
55
|
+
VALUES
|
|
56
|
+
('example_table', 'new_column', 'text', 'New Column', 'Section', 90, false, false, false, 1)
|
|
57
|
+
ON CONFLICT (table_name, column_name) DO NOTHING;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Valid `input_type` values: `text` `textarea` `email` `url` `phone` `select` `tags`
|
|
61
|
+
`json` `toggle` `currency` `number` `date` `richtext`
|
|
62
|
+
|
|
63
|
+
## Non-Public Schema Access
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const { data } = await supabase.schema("custom_schema").from("table_name").select("*");
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Design Decisions (record architectural choices)
|
|
70
|
+
|
|
71
|
+
```sql
|
|
72
|
+
INSERT INTO design_context (topic, context_type, summary, source, created_by)
|
|
73
|
+
VALUES (
|
|
74
|
+
'TopicName', 'decision',
|
|
75
|
+
'2-3 sentence summary of what was decided and why',
|
|
76
|
+
'agent session', 'agent'
|
|
77
|
+
);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Safety Rules
|
|
81
|
+
|
|
82
|
+
- Branch: development branch — auto-commit after each migration
|
|
83
|
+
- Always verify migrations with queries
|
|
84
|
+
- Never drop columns without explicit instruction
|
|
85
|
+
- Never truncate tables without explicit instruction
|
|
86
|
+
- NEVER overlap with other agents on schema changes mid-build
|
|
87
|
+
- Write tests for RPC functions FIRST
|