declare-cc 0.4.0 → 0.4.3
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/commands/declare/plan.md +56 -4
- package/dist/declare-tools.cjs +3 -2
- package/package.json +1 -1
package/commands/declare/plan.md
CHANGED
|
@@ -181,10 +181,14 @@ Repeat until VERIFICATION PASSED or revision count reaches 3.
|
|
|
181
181
|
|
|
182
182
|
**Step 9: Commit EXEC-PLANs.**
|
|
183
183
|
|
|
184
|
+
Pass each file as a separate `--files` argument (not space-separated in one argument):
|
|
185
|
+
|
|
184
186
|
```bash
|
|
185
|
-
node dist/declare-tools.cjs commit "docs(${MILESTONE}): create exec-plans for milestone actions" --files [
|
|
187
|
+
node dist/declare-tools.cjs commit "docs(${MILESTONE}): create exec-plans for milestone actions" --files [path/to/A-01-EXEC-PLAN.md] --files [path/to/A-02-EXEC-PLAN.md]
|
|
186
188
|
```
|
|
187
189
|
|
|
190
|
+
If the commit reports `nothing_to_commit`, the planner already committed the files — that is fine, continue.
|
|
191
|
+
|
|
188
192
|
**Step 10: Present results.**
|
|
189
193
|
|
|
190
194
|
Display final summary:
|
|
@@ -211,11 +215,59 @@ Display final summary:
|
|
|
211
215
|
|
|
212
216
|
### Next Steps
|
|
213
217
|
|
|
214
|
-
Execute: `/declare:execute M-XX`
|
|
215
|
-
|
|
216
|
-
/clear first — fresh context window
|
|
217
218
|
```
|
|
218
219
|
|
|
220
|
+
After displaying the summary, reload the graph and check for milestones that still have no EXEC-PLANs (hasPlan is false OR actions array for that milestone has no EXEC-PLAN files):
|
|
221
|
+
|
|
222
|
+
- If **other milestones still need planning**, list them and suggest planning those next:
|
|
223
|
+
```
|
|
224
|
+
Remaining milestones to plan:
|
|
225
|
+
/declare:plan M-02 — [title]
|
|
226
|
+
/declare:plan M-03 — [title]
|
|
227
|
+
|
|
228
|
+
Plan all milestones before executing. Run /declare:execute only when all are planned.
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
- If **this was the last milestone to plan**, compute dependency waves before spawning anything — do not blindly parallelize all milestones.
|
|
232
|
+
|
|
233
|
+
**Step A: Compute milestone dependency waves.**
|
|
234
|
+
|
|
235
|
+
Load the graph, then read each milestone's PLAN.md. For each action, check its `dependsOn` field. If an action in M-02 lists `dependsOn: ["A-01"]` and A-01 belongs to M-01, then M-02 depends on M-01.
|
|
236
|
+
|
|
237
|
+
Build a milestone-level dependency graph from these cross-milestone action references. Run a topological sort (Kahn's algorithm) to group milestones into waves:
|
|
238
|
+
- Wave 1: milestones with no dependencies on other pending milestones
|
|
239
|
+
- Wave 2: milestones whose dependencies are all in wave 1
|
|
240
|
+
- …and so on
|
|
241
|
+
|
|
242
|
+
If no cross-milestone `dependsOn` edges exist, all milestones go into wave 1 (full parallelism). Show the wave plan before executing:
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
## Milestone Execution Waves
|
|
246
|
+
|
|
247
|
+
Wave 1 (parallel): M-01 [title], M-03 [title]
|
|
248
|
+
Wave 2 (after wave 1): M-02 [title]
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Step B: Execute wave by wave using the Task tool.**
|
|
252
|
+
|
|
253
|
+
For each wave, spawn one Task agent per milestone **in the same response** so they execute in parallel:
|
|
254
|
+
|
|
255
|
+
Subagent type: `gsd-executor`
|
|
256
|
+
Prompt per milestone:
|
|
257
|
+
```
|
|
258
|
+
Execute milestone [M-XX] "[title]" for the Declare project.
|
|
259
|
+
Working directory: [absolute path to cwd]
|
|
260
|
+
Run: /declare:execute [M-XX]
|
|
261
|
+
EXEC-PLANs are in: [absolute path to milestone folder]
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Wait for the entire wave to complete before spawning the next wave.
|
|
265
|
+
|
|
266
|
+
After all waves finish, propagate statuses:
|
|
267
|
+
```bash
|
|
268
|
+
node dist/declare-tools.cjs sync-status
|
|
269
|
+
```
|
|
270
|
+
|
|
219
271
|
If max revisions reached with issues remaining, display blocker list prominently:
|
|
220
272
|
|
|
221
273
|
```
|
package/dist/declare-tools.cjs
CHANGED
|
@@ -1329,7 +1329,7 @@ var require_help = __commonJS({
|
|
|
1329
1329
|
usage: "/declare:help"
|
|
1330
1330
|
}
|
|
1331
1331
|
],
|
|
1332
|
-
version: "0.
|
|
1332
|
+
version: "0.4.0"
|
|
1333
1333
|
};
|
|
1334
1334
|
}
|
|
1335
1335
|
module2.exports = { runHelp: runHelp2 };
|
|
@@ -1537,7 +1537,8 @@ var require_add_milestones_batch = __commonJS({
|
|
|
1537
1537
|
dag.addNode(m.id, "milestone", m.title, m.status || "PENDING");
|
|
1538
1538
|
}
|
|
1539
1539
|
for (let i = 0; i < inputs.length; i++) {
|
|
1540
|
-
const
|
|
1540
|
+
const realizesRaw = inputs[i].realizes;
|
|
1541
|
+
const realizes = Array.isArray(realizesRaw) ? realizesRaw.map((s) => String(s).trim()).filter(Boolean) : String(realizesRaw).split(",").map((s) => s.trim()).filter(Boolean);
|
|
1541
1542
|
for (const declId of realizes) {
|
|
1542
1543
|
if (!dag.getNode(declId)) {
|
|
1543
1544
|
return { error: `Item ${i}: declaration not found: ${declId}` };
|
package/package.json
CHANGED