@lifeaitools/rdc-skills 0.35.5 → 0.35.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.
Files changed (106) hide show
  1. package/.claude-plugin/plugin.json +180 -44
  2. package/.github/workflows/self-test.yml +34 -34
  3. package/CHANGELOG.md +393 -393
  4. package/MANIFEST.md +224 -224
  5. package/README.md +10 -3
  6. package/clauth-plugin.json +1 -1
  7. package/commands/analyze-tests.md +1 -4
  8. package/commands/build.md +1 -2
  9. package/commands/check-clean-code.md +1 -3
  10. package/commands/check-packages.md +1 -3
  11. package/commands/collab.md +1 -2
  12. package/commands/compare-compliance.md +1 -4
  13. package/commands/deploy.md +1 -2
  14. package/commands/design.md +1 -2
  15. package/commands/edit.md +1 -2
  16. package/commands/fixit.md +1 -2
  17. package/commands/flow.md +5 -6
  18. package/commands/full-analysis.md +1 -7
  19. package/commands/get-refactoring-plan.md +1 -5
  20. package/commands/handoff.md +1 -2
  21. package/commands/help.md +1 -3
  22. package/commands/mode.md +4 -5
  23. package/commands/overnight.md +1 -2
  24. package/commands/plan.md +1 -2
  25. package/commands/preplan.md +1 -2
  26. package/commands/prototype.md +1 -2
  27. package/commands/quick-check.md +1 -4
  28. package/commands/recover.md +1 -2
  29. package/commands/release.md +2 -2
  30. package/commands/report.md +1 -2
  31. package/commands/review-arch.md +1 -4
  32. package/commands/review.md +1 -5
  33. package/commands/self-test.md +1 -2
  34. package/commands/status.md +1 -2
  35. package/commands/suggest-patterns.md +1 -4
  36. package/commands/validate-solid.md +1 -3
  37. package/commands/watch.md +1 -2
  38. package/commands/workitems.md +1 -2
  39. package/guides/agents/backend.md +102 -102
  40. package/guides/agents/content.md +94 -94
  41. package/guides/agents/cs2.md +56 -56
  42. package/guides/agents/data.md +86 -86
  43. package/guides/agents/design.md +77 -77
  44. package/guides/agents/frontend.md +91 -91
  45. package/guides/agents/infrastructure.md +81 -81
  46. package/guides/agents/setup.md +272 -272
  47. package/guides/agents/verify.md +119 -119
  48. package/guides/agents/viz.md +106 -106
  49. package/guides/orchestration-epic.md +17 -17
  50. package/hooks/require-work-item-on-commit.js +69 -4
  51. package/package.json +1 -1
  52. package/scripts/gen-skill-descriptions.mjs +190 -0
  53. package/scripts/self-test.mjs +1459 -1459
  54. package/skills/architecture-reviewer/SKILL.md +1 -11
  55. package/skills/behavior-audit/SKILL.md +1 -1
  56. package/skills/behavior-audit/agents/openai.yaml +4 -4
  57. package/skills/brochure/SKILL.md +1 -1
  58. package/skills/brochurify/SKILL.md +1 -1
  59. package/skills/build/SKILL.md +1 -1
  60. package/skills/channel-formatter/SKILL.md +1 -1
  61. package/skills/clean-code-analyzer/SKILL.md +1 -6
  62. package/skills/co-develop/SKILL.md +1 -1
  63. package/skills/collab/SKILL.md +3 -3
  64. package/skills/convert/SKILL.md +1 -1
  65. package/skills/deploy/SKILL.md +1 -1
  66. package/skills/design/SKILL.md +1 -1
  67. package/skills/edit/SKILL.md +1 -1
  68. package/skills/env/SKILL.md +57 -14
  69. package/skills/extract-verifier-rules/SKILL.md +1 -1
  70. package/skills/fixit/SKILL.md +1 -1
  71. package/skills/fs-mcp/SKILL.md +1 -1
  72. package/skills/handoff/SKILL.md +1 -1
  73. package/skills/help/SKILL.md +1 -1
  74. package/skills/housekeeping/SKILL.md +1 -1
  75. package/skills/lifeai-brochure-author/SKILL.md +1 -1
  76. package/skills/new-model/SKILL.md +1 -7
  77. package/skills/onramp/SKILL.md +1 -1
  78. package/skills/overnight/SKILL.md +1 -1
  79. package/skills/package-design/SKILL.md +1 -4
  80. package/skills/pattern-advisor/SKILL.md +1 -6
  81. package/skills/pattern-refactoring-guide/SKILL.md +1 -4
  82. package/skills/plan/SKILL.md +1 -1
  83. package/skills/preplan/SKILL.md +1 -1
  84. package/skills/prototype/SKILL.md +1 -1
  85. package/skills/refactor/SKILL.md +1 -1
  86. package/skills/regen-media/SKILL.md +1 -1
  87. package/skills/release/SKILL.md +1 -1
  88. package/skills/report/SKILL.md +1 -1
  89. package/skills/review/SKILL.md +1 -1
  90. package/skills/rpms-filemap/SKILL.md +1 -1
  91. package/skills/self-test/SKILL.md +1 -1
  92. package/skills/solid-validator/SKILL.md +1 -6
  93. package/skills/status/SKILL.md +1 -1
  94. package/skills/terminal-config/SKILL.md +1 -1
  95. package/skills/testing-strategy/SKILL.md +1 -6
  96. package/skills/tests/onramp.test.json +101 -101
  97. package/skills/tests/rdc-env.test.json +12 -12
  98. package/skills/tests/rdc-new-model.test.json +12 -12
  99. package/skills/tests/rdc-refactor.test.json +29 -29
  100. package/skills/tests/rdc-regen-media.test.json +29 -29
  101. package/skills/watch/SKILL.md +1 -1
  102. package/skills/workitems/SKILL.md +1 -1
  103. package/tests/clauth-plugin-postinstall.test.mjs +14 -1
  104. package/tests/help-surface.test.mjs +2 -2
  105. package/tests/require-work-item-on-commit.test.mjs +54 -0
  106. package/ecosystem.local.config.cjs +0 -18
package/commands/flow.md CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: flow
3
- description: >-
4
- Usage `rdc:flow [status|<state> ["<reason>"]|normal]` — show or set the current flow state. Flow is the single FSM surface for both work-shape (plan/design/collab/build/refactor/overnight/harness-testing) and ceremony relaxation (hotfix/maintenance). Supersedes `rdc:mode` — hotfix/maintenance are flow values now, not a separate system.
3
+ description: rdc:flow [status|<state> ["<reason>"]|normal] — show or set the flow state
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -49,7 +48,7 @@ rdc:flow normal # clear — back to no flow declared
49
48
  ### 1. Read the current state
50
49
 
51
50
  ```bash
52
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>console.log(JSON.stringify(m.currentState(),null,2)))"
51
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.currentState(),null,2)))"
53
52
  ```
54
53
 
55
54
  `currentState()` reads BOTH axes at once — the declared flow AND any live `rdc-mode.mjs` hotfix/maintenance window — because a relaxed mode overrides a required flow (loosest state wins) and a status check that only showed flow would miss that override entirely. Report `flow` (or `null` if nothing declared — the fail-closed default), `flowReason`/`flowSetBy`/`flowSetAt` when set, and `mode` (`normal` unless a hotfix/maintenance window is open), with `modeReason`/`modeMinutesLeft` when it isn't.
@@ -57,7 +56,7 @@ node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>cons
57
56
  ### 2. Setting a plain work-shape flow — no reason required
58
57
 
59
58
  ```bash
60
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>console.log(JSON.stringify(m.setFlow(process.argv[1],{setBy:process.argv[2]}),null,2)))" "<flow>" "<session-id>"
59
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.setFlow(process.argv[1],{setBy:process.argv[2]}),null,2)))" "<flow>" "<session-id>"
61
60
  ```
62
61
 
63
62
  ### 3. Setting hotfix or maintenance — a reason is REQUIRED
@@ -65,7 +64,7 @@ node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>cons
65
64
  Refuse to proceed without one — `setFlow` throws on an empty reason for these two values, by design, same as `setMode` always did: an unexplained disarm is how a temporary state becomes permanent.
66
65
 
67
66
  ```bash
68
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>console.log(JSON.stringify(m.setFlow('hotfix',{reason:process.argv[1],setBy:process.argv[2]}),null,2)))" "<reason>" "<session-id>"
67
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>console.log(JSON.stringify(m.setFlow('hotfix',{reason:process.argv[1],setBy:process.argv[2]}),null,2)))" "<reason>" "<session-id>"
69
68
  ```
70
69
 
71
70
  Then state plainly, in the checklist: **which guards are now relaxed, that the safety set is still armed, and that this stays active until explicitly cleared (no TTL — active management, not a silent timer).**
@@ -73,7 +72,7 @@ Then state plainly, in the checklist: **which guards are now relaxed, that the s
73
72
  ### 4. Returning to normal
74
73
 
75
74
  ```bash
76
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-flow.mjs').then(m=>{m.clearFlow();console.log('cleared')})"
75
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-flow.mjs').href).then(m=>{m.clearFlow();console.log('cleared')})"
77
76
  ```
78
77
 
79
78
  Do this **as soon as the incident is over**, or the moment the declared work-shape changes.
@@ -1,12 +1,6 @@
1
1
  ---
2
2
  name: full-analysis
3
- description: >-
4
- Usage `rdc:full-analysis <path> [--diff <ref>]` — runs all seven surfaces
5
- (solid-validator, architecture-reviewer, clean-code-analyzer,
6
- package-design, pattern-advisor, testing-strategy, and
7
- pattern-refactoring-guide on anything the others flag) and merges into
8
- one report. The full form/fit/function pass — use before merging a new
9
- package or a significant refactor, not for routine edits.
3
+ description: rdc:full-analysis <path> [--diff <ref>] — run all seven review surfaces over a path
10
4
  ---
11
5
 
12
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,10 +1,6 @@
1
1
  ---
2
2
  name: get-refactoring-plan
3
- description: >-
4
- Usage `rdc:get-refactoring-plan <finding>` — turns a solid-validator/
5
- architecture-reviewer/pattern-advisor finding into a step-ordered
6
- before/after refactor plan. Produces a plan, does not apply it. See
7
- skills/pattern-refactoring-guide.
3
+ description: rdc:get-refactoring-plan <finding> — turn a finding into a step-ordered before/after plan
8
4
  ---
9
5
 
10
6
  # get-refactoring-plan
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: handoff
3
- description: >-
4
- Usage `rdc:handoff <topic>` — structured handoff from planning session to CLI agents. Produces plan doc in .rdc/plans/, work items in DB, prototype registry entry if applicable. Use when plan/prototype is finalized and ready for implementation.
3
+ description: rdc:handoff () - [--from-prototype] — turn a plan or prototype into work items and artifacts
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
package/commands/help.md CHANGED
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: help
3
- description: >-
4
- Usage `rdc:help` or `rdc` — manifest-driven menu of all MCP skills with
5
- argument syntax, requirements, decision hints, and direct MCP/curl access.
3
+ description: rdc:help () — list all MCP skills with usage, requirements and slash form
6
4
  ---
7
5
 
8
6
  > **Output contract:** Checklist/table output only. No raw MCP/JSON/log dumps.
package/commands/mode.md CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: mode
3
- description: >-
4
- Usage `rdc:mode [status|hotfix "<reason>" [minutes]|normal]` — show or set the operating mode. HotFix relaxes ceremony gates for a bounded window; it never relaxes a safety guard.
3
+ description: rdc:mode [status|hotfix "<reason>" [minutes]|normal] — show or set the operating mode
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -70,7 +69,7 @@ rdc:mode normal # close it early
70
69
  ### 1. Read the current mode
71
70
 
72
71
  ```bash
73
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>console.log(JSON.stringify(m.currentMode(),null,2)))"
72
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>console.log(JSON.stringify(m.currentMode(),null,2)))"
74
73
  ```
75
74
 
76
75
  Report `mode`, and when not normal also `reason`, `setBy`, and `minutesLeft`.
@@ -84,7 +83,7 @@ unexplained disarm is how a temporary state becomes permanent, and the reason is
84
83
  the entire content of the audit line.
85
84
 
86
85
  ```bash
87
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>console.log(JSON.stringify(m.setMode('hotfix',{reason:process.argv[1],minutes:Number(process.argv[2]||60),setBy:process.argv[3]}),null,2)))" "<reason>" "<minutes>" "<session-id>"
86
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>console.log(JSON.stringify(m.setMode('hotfix',{reason:process.argv[1],minutes:Number(process.argv[2]||60),setBy:process.argv[3]}),null,2)))" "<reason>" "<minutes>" "<session-id>"
88
87
  ```
89
88
 
90
89
  Then state plainly, in the checklist: **which guards are now off, that the safety
@@ -93,7 +92,7 @@ set is still armed, and the exact wall-clock time the window closes.**
93
92
  ### 3. Returning to normal
94
93
 
95
94
  ```bash
96
- node -e "import('file:///C:/Dev/lifeai-env/hooks/lib/rdc-mode.mjs').then(m=>{m.clearMode();console.log('normal')})"
95
+ node -e "import(require('url').pathToFileURL(process.env.LIFEAI_ENV + '/hooks/lib/rdc-mode.mjs').href).then(m=>{m.clearMode();console.log('normal')})"
97
96
  ```
98
97
 
99
98
  Do this **as soon as the incident is over**. The window expiring on its own is
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: overnight
3
- description: >-
4
- Usage `rdc:overnight [epic-id|label=X]` — unattended overnight supervisor, chains preplan → plan → build → review → report across all high-priority epics in --unattended mode. Use for "run overnight", "build while I sleep".
3
+ description: rdc:overnight ([scope]) — drain the work queue unattended, end to end
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
package/commands/plan.md CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: plan
3
- description: >-
4
- Usage `rdc:plan <topic> [--unattended]` — architecture doc with design decisions, tradeoffs, work packages. Creates Supabase epics/tasks. Use after rdc:preplan or when given clear architectural direction.
3
+ description: rdc:plan (topic) — produce architecture, decisions and an epic with tasks
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: preplan
3
- description: >-
4
- Usage `rdc:preplan <topic> [--unattended]` — research best practices, analyze codebase, compare approaches, surface unknowns before committing to a plan. Produces a research doc. No decisions, no code.
3
+ description: rdc:preplan (topic) — research the unknowns before committing to an architecture
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: prototype
3
- description: >-
4
- Usage `rdc:prototype <description>` — build JSX/TSX prototype for review before CLI handoff. Saves to docs/source/, registers in prototype_registry. Use for "mock this up", "show me what it looks like". Reference material only, not production.
3
+ description: rdc:prototype (description) — build a JSX/TSX mockup for visual review
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,9 +1,6 @@
1
1
  ---
2
2
  name: quick-check
3
- description: >-
4
- Usage `rdc:quick-check <path>` — fast mechanical-only pass: solid-validator
5
- score + boundary check. No dispatched judgment agents. For a tight
6
- iteration loop, not a merge gate.
3
+ description: rdc:quick-check <path> — fast mechanical pass, SOLID score and boundary check
7
4
  ---
8
5
 
9
6
  # quick-check
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: recover
3
- description: >-
4
- Usage `rdc:recover [list|start]` — deterministic post-crash recovery: detect, repair (CodeFlow/PM2 only), verify, then find and resume abandoned Claude/Codex worktree-lane sessions.
3
+ description: rdc:recover [list|start] — detect, repair and resume after a crash
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: >-
3
- Atomic release. Usage `rdc:release <repo> [version]` or `rdc:release <repo> --patch|--minor|--major|--dry-run` — bump, commit, tag, push, wait CI/publish, install, and verify. Uses repo-local release metadata.
2
+
3
+ description: rdc:release (repo, [version]) - [--patch, --minor, --major, --dry-run] — bump, tag, publish and verify a package
4
4
  ---
5
5
 
6
6
  # rdc:release — Generic Release
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: report
3
- description: >-
4
- Usage `rdc:report [--unattended]` — nightly markdown report, writes to .rdc/reports/YYYY-MM-DD.md. Covers completed/open work items, per-project progress, infra status, git stats, test counts.
3
+ description: rdc:report () — write the session summary to .rdc/reports/
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,9 +1,6 @@
1
1
  ---
2
2
  name: review-arch
3
- description: >-
4
- Usage `rdc:review-arch <path> [--diff <ref>]` — layering/dependency-
5
- direction review, mechanical + judgment (FIT corner). See
6
- skills/architecture-reviewer.
3
+ description: rdc:review-arch <path> [--diff <ref>] — review layering and dependency direction
7
4
  ---
8
5
 
9
6
  # review-arch
@@ -1,10 +1,6 @@
1
1
  ---
2
2
  name: review
3
- description: >-
4
- Usage `rdc:review [--unattended]` — post-build quality gate: tsc, tests,
5
- stale docs, export conflicts, a mandatory pr-review-toolkit:code-reviewer
6
- pass, and the form/fit/function gate (solid-validator + architecture-
7
- reviewer) across modified packages. See skills/review.
3
+ description: rdc:review () - [--unattended] — post-build gate over tsc, tests, docs and code review
8
4
  ---
9
5
 
10
6
  # review
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: self-test
3
- description: >-
4
- Usage `rdc:self-test [--strict] [--skill <name>] [--json] [--fix] [--tier2] [--parallel <n>] [--quick]` — validates every rdc-*.md skill: frontmatter, Usage marker, name↔filename match, referenced guides/rules/hooks exist, output contract banner, plugin manifest, duplicate-name + collision checks. Tier 1 static lint; Tier 2 behavioral runs via headless Claude or Codex in isolated worktrees + Supabase branch. Run before every release.
3
+ description: rdc:self-test () - [--strict] — validate every rdc skill, the manifest and tooling
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: status
3
- description: >-
4
- Usage `rdc:status` — open epics, work items by project, Coolify health, blockers, next recommended action. Read-only situational awareness.
3
+ description: rdc:status () — snapshot open epics, health, blockers and next action
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,9 +1,6 @@
1
1
  ---
2
2
  name: suggest-patterns
3
- description: >-
4
- Usage `rdc:suggest-patterns <path>` — design pattern suggestions,
5
- advisory only, "no pattern needed" is a valid verdict. See
6
- skills/pattern-advisor.
3
+ description: rdc:suggest-patterns <path> — suggest design patterns; "none needed" is a valid verdict
7
4
  ---
8
5
 
9
6
  # suggest-patterns
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: validate-solid
3
- description: >-
4
- Usage `rdc:validate-solid <path> [--diff <ref>]` — deterministic SOLID +
5
- Clean Architecture scoring (FORM corner). See skills/solid-validator.
3
+ description: rdc:validate-solid <path> [--diff <ref>] — score SOLID and Clean Architecture deterministically
6
4
  ---
7
5
 
8
6
  # validate-solid
package/commands/watch.md CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: watch
3
- description: >-
4
- Usage `rdc:watch` — initialize a session-log viewer and report its path; open it only during attended, non-test use. Zero infra, pure filesystem + static HTML.
3
+ description: rdc:watch () — open a live session-log viewer and report its path
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: 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.
3
+ description: rdc:workitems ([subcommand]) — create, update and query work items directly
5
4
  ---
6
5
 
7
6
  > **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
@@ -1,104 +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
-
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
60
  -- Implementation agents submit report + CodeFlow post, then move to review
61
61
  SELECT update_work_item_status('<uuid>'::uuid, 'review', '["Implementation complete; ready for validator"]'::jsonb, '<agent-session-id>', 'agent');
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
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