@lifeaitools/rdc-skills 0.9.10 → 0.9.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/rdc-skills",
3
- "version": "0.9.10",
3
+ "version": "0.9.12",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code \u00e2\u20ac\u201d plan, build, review, overnight builds",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -71,12 +71,42 @@ Read the task title and description, then:
71
71
 
72
72
  ## Procedure
73
73
 
74
- 1. **Load the epic:**
74
+ 1. **Load the epic and run pre-flight gate:**
75
75
  ```sql
76
76
  SELECT get_work_items_by_epic('<epic-id>', 'todo');
77
77
  ```
78
- - Interactive (no args): show open epics, ask which to build
79
- - Unattended (no tasks found): escalate via advisor tool
78
+
79
+ **Session lock claim the epic immediately (before any agent dispatch):**
80
+
81
+ After loading the epic, check its status:
82
+ - If `status = 'in_progress'` → **ABORT** with:
83
+ ```
84
+ SKIP: epic <id> is already in_progress — claimed by another session. Pick a different epic.
85
+ ```
86
+ Do NOT proceed. Do NOT dispatch any agents.
87
+ - If `status = 'todo'` or `status = 'blocked'` → immediately claim it:
88
+ ```sql
89
+ SELECT update_work_item_status('<epic-id>'::uuid, 'in_progress',
90
+ '["Claimed by build session — dispatching agents"]'::jsonb
91
+ );
92
+ ```
93
+ This is an atomic Supabase write. A concurrent session that loads the same epic after this point will see `in_progress` and abort. **Do this before any classification, planning, or agent dispatch.**
94
+
95
+ **Pre-flight gate — run after claiming:**
96
+
97
+ | Condition | Action |
98
+ |-----------|--------|
99
+ | No child tasks returned | → Invoke `rdc:plan` on this epic. Do NOT proceed with build. |
100
+ | Tasks exist but all have empty `description` fields | → Invoke `rdc:plan` on this epic. Tasks without descriptions cannot be safely dispatched. |
101
+ | Tasks exist and have descriptions | → Continue with build. |
102
+
103
+ **Re-planning is not a failure — it is correct behavior.** The build skill is the last gate before agent dispatch; catching an under-specified epic here is cheaper than a wasted agent run.
104
+
105
+ **How to re-plan:**
106
+ - Interactive: tell the user — "Epic has no tasks / tasks lack descriptions — invoking rdc:plan first." Then invoke `rdc:plan <epic-id>`.
107
+ - Unattended: invoke `rdc:plan <epic-id> --unattended` inline, wait for it to complete, then reload tasks and re-run this gate once. If tasks still missing after re-plan, escalate via advisor.
108
+
109
+ **Interactive (no args):** show open epics, ask which to build.
80
110
 
81
111
  2. **CHECK FOR EXISTING WORK (mandatory — never skip):**
82
112
  ```sql
@@ -131,11 +161,31 @@ Read the task title and description, then:
131
161
  Without `max_turns: 70`, agents hit the default turn cap mid-task and stop.
132
162
  `isolation: "worktree"` gives each agent its own git worktree and branch — eliminates push race conditions and index lock contention when multiple agents commit in parallel. The supervisor merges worktree branches after each wave (Step 9).
133
163
 
164
+ ### Forked agents vs. standalone agents
165
+
166
+ **When the supervisor has already read the plan** (via a prior `Read` tool call in the same session),
167
+ dispatch **forked agents** with short prompts. Forked agents inherit the full conversation context —
168
+ including every file the supervisor has read — so you do NOT need to copy plan sections, file specs,
169
+ or architecture details into the prompt. The agent already sees them.
170
+
171
+ Short forked prompt template:
172
+ ```
173
+ You are a frontend agent building <WP name>. Work item: <uuid>.
174
+ Scope: <one sentence>. Files: <list>. Verification: tsc --noEmit.
175
+ Set item to review when done, return AGENT_COMPLETE with verification evidence.
176
+ Read .rdc/guides/agent-bootstrap.md + .rdc/guides/frontend.md before starting.
177
+ ```
178
+
179
+ **When the supervisor has NOT read the plan** (e.g. dispatching from a fresh `rdc:build` call with
180
+ only an epic ID), the agent has no plan context — write a full briefing prompt with all specs.
181
+
182
+ ---
183
+
134
184
  ### Required agent prompt contents
135
185
  - Set work item to `in_progress` before dispatching
136
186
  - Each agent prompt MUST include:
137
187
  - `"Read {PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md first (fallback: .rdc/guides/agent-bootstrap.md), then {PROJECT_ROOT}/.rdc/guides/<type>.md (fallback: .rdc/guides/<type>.md) before starting."`
138
- - Specific files to create/modify
188
+ - Specific files to create/modify (or omit if forked agent inherits plan context)
139
189
  - Exact deliverables and commit message
140
190
  - `"NEVER run pnpm build/test. NEVER modify files outside your scope."`
141
191
  - **`"You are running in an isolated git worktree. Commit your work normally. Do NOT push to origin — the supervisor merges your branch after the wave completes."`**