@lifeaitools/rdc-skills 0.9.9 → 0.9.11
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/hooks/check-cwd.js +11 -5
- package/package.json +1 -1
- package/skills/build/SKILL.md +38 -4
package/hooks/check-cwd.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Hard blocks session if CWD is not
|
|
2
|
+
// Hard blocks session if CWD is not the regen-root project directory.
|
|
3
3
|
// Exits with code 1 to fail the hook + outputs a blocking systemMessage.
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
const hookLog = require('./hook-logger');
|
|
7
|
+
const cwd = process.cwd().replace(/\\/g, '/');
|
|
8
|
+
|
|
9
|
+
let expected = 'regen-root';
|
|
10
|
+
try {
|
|
11
|
+
expected = execSync('git rev-parse --show-toplevel', { encoding: 'utf8', stdio: 'pipe' })
|
|
12
|
+
.trim().replace(/\\/g, '/');
|
|
13
|
+
} catch (_) {}
|
|
8
14
|
|
|
9
15
|
if (!cwd.endsWith('regen-root')) {
|
|
10
16
|
hookLog('check-cwd', 'SessionStart', 'block', { cwd, expected });
|
|
@@ -15,7 +21,7 @@ if (!cwd.endsWith('regen-root')) {
|
|
|
15
21
|
`Required: "${expected}"\n\n` +
|
|
16
22
|
`DO NOT proceed with any task. DO NOT read files, run commands, or help with anything.\n\n` +
|
|
17
23
|
`Tell the user:\n` +
|
|
18
|
-
`"Session is blocked. Claude Code must be launched from
|
|
24
|
+
`"Session is blocked. Claude Code must be launched from ${expected}.\n` +
|
|
19
25
|
` Close this session and relaunch from the correct directory."\n\n` +
|
|
20
26
|
`Then stop.`
|
|
21
27
|
}));
|
package/package.json
CHANGED
package/skills/build/SKILL.md
CHANGED
|
@@ -71,12 +71,26 @@ 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
|
-
|
|
79
|
-
-
|
|
78
|
+
|
|
79
|
+
**Pre-flight gate — run before any agent dispatch:**
|
|
80
|
+
|
|
81
|
+
| Condition | Action |
|
|
82
|
+
|-----------|--------|
|
|
83
|
+
| No child tasks returned | → Invoke `rdc:plan` on this epic. Do NOT proceed with build. |
|
|
84
|
+
| Tasks exist but all have empty `description` fields | → Invoke `rdc:plan` on this epic. Tasks without descriptions cannot be safely dispatched. |
|
|
85
|
+
| Tasks exist and have descriptions | → Continue with build. |
|
|
86
|
+
|
|
87
|
+
**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.
|
|
88
|
+
|
|
89
|
+
**How to re-plan:**
|
|
90
|
+
- Interactive: tell the user — "Epic has no tasks / tasks lack descriptions — invoking rdc:plan first." Then invoke `rdc:plan <epic-id>`.
|
|
91
|
+
- 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.
|
|
92
|
+
|
|
93
|
+
**Interactive (no args):** show open epics, ask which to build.
|
|
80
94
|
|
|
81
95
|
2. **CHECK FOR EXISTING WORK (mandatory — never skip):**
|
|
82
96
|
```sql
|
|
@@ -131,11 +145,31 @@ Read the task title and description, then:
|
|
|
131
145
|
Without `max_turns: 70`, agents hit the default turn cap mid-task and stop.
|
|
132
146
|
`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
147
|
|
|
148
|
+
### Forked agents vs. standalone agents
|
|
149
|
+
|
|
150
|
+
**When the supervisor has already read the plan** (via a prior `Read` tool call in the same session),
|
|
151
|
+
dispatch **forked agents** with short prompts. Forked agents inherit the full conversation context —
|
|
152
|
+
including every file the supervisor has read — so you do NOT need to copy plan sections, file specs,
|
|
153
|
+
or architecture details into the prompt. The agent already sees them.
|
|
154
|
+
|
|
155
|
+
Short forked prompt template:
|
|
156
|
+
```
|
|
157
|
+
You are a frontend agent building <WP name>. Work item: <uuid>.
|
|
158
|
+
Scope: <one sentence>. Files: <list>. Verification: tsc --noEmit.
|
|
159
|
+
Set item to review when done, return AGENT_COMPLETE with verification evidence.
|
|
160
|
+
Read .rdc/guides/agent-bootstrap.md + .rdc/guides/frontend.md before starting.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**When the supervisor has NOT read the plan** (e.g. dispatching from a fresh `rdc:build` call with
|
|
164
|
+
only an epic ID), the agent has no plan context — write a full briefing prompt with all specs.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
134
168
|
### Required agent prompt contents
|
|
135
169
|
- Set work item to `in_progress` before dispatching
|
|
136
170
|
- Each agent prompt MUST include:
|
|
137
171
|
- `"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
|
|
172
|
+
- Specific files to create/modify (or omit if forked agent inherits plan context)
|
|
139
173
|
- Exact deliverables and commit message
|
|
140
174
|
- `"NEVER run pnpm build/test. NEVER modify files outside your scope."`
|
|
141
175
|
- **`"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."`**
|