declare-cc 0.5.4 → 0.5.6
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/milestones.md +18 -6
- package/commands/declare/plan.md +41 -11
- package/dist/declare-tools.cjs +1 -1
- package/package.json +3 -2
- package/scripts/release.js +50 -0
- package/workflows/scope.md +94 -0
|
@@ -24,12 +24,24 @@ If no declarations exist in the graph, tell the user to run `/declare:future` fi
|
|
|
24
24
|
|
|
25
25
|
Note all declarations and milestones from the graph -- the workflow needs full context.
|
|
26
26
|
|
|
27
|
-
**Step 2:
|
|
27
|
+
**Step 2: Scope review (first-time derivation only).**
|
|
28
|
+
|
|
29
|
+
Skip this step if `$ARGUMENTS` contains a specific declaration ID (e.g., `D-01`) — targeted re-derivation skips scope review.
|
|
30
|
+
|
|
31
|
+
Otherwise, check if any milestones already exist in the graph. If milestones already exist, this is a re-derivation — skip scope review and proceed to Step 3.
|
|
32
|
+
|
|
33
|
+
If this is the first time deriving milestones (no milestones in the graph yet), run the scope review workflow before deriving anything:
|
|
34
|
+
|
|
35
|
+
@workflows/scope.md
|
|
36
|
+
|
|
37
|
+
Pass all declarations from the loaded graph into the scope workflow. After the scope is confirmed, continue to Step 3.
|
|
38
|
+
|
|
39
|
+
**Step 3: Determine derivation scope.**
|
|
28
40
|
|
|
29
41
|
- If `$ARGUMENTS` contains a declaration ID (e.g., `D-01`), derive only for that specific declaration.
|
|
30
42
|
- Otherwise, derive for all declarations that have no milestones yet (declarations with empty milestones arrays in the graph).
|
|
31
43
|
|
|
32
|
-
**Step
|
|
44
|
+
**Step 4: Follow the milestone derivation workflow.**
|
|
33
45
|
|
|
34
46
|
Read and follow the full workflow instructions:
|
|
35
47
|
|
|
@@ -37,7 +49,7 @@ Read and follow the full workflow instructions:
|
|
|
37
49
|
|
|
38
50
|
Pass the loaded graph state into the workflow so it knows about existing declarations and milestones.
|
|
39
51
|
|
|
40
|
-
**Step
|
|
52
|
+
**Step 5: Per-declaration milestone confirmation with checkboxes.**
|
|
41
53
|
|
|
42
54
|
After the workflow proposes milestones for a declaration, present them using AskUserQuestion with multi-select checkboxes:
|
|
43
55
|
|
|
@@ -50,7 +62,7 @@ Which of these milestones should we create for D-XX?
|
|
|
50
62
|
- [ ] Milestone C -- because [reason]
|
|
51
63
|
```
|
|
52
64
|
|
|
53
|
-
**Step
|
|
65
|
+
**Step 6: Persist all accepted milestones in one batch call.**
|
|
54
66
|
|
|
55
67
|
Build a JSON array of the checked milestones, then create them all at once:
|
|
56
68
|
|
|
@@ -60,7 +72,7 @@ node dist/declare-tools.cjs add-milestones --json '[{"title":"Milestone A","real
|
|
|
60
72
|
|
|
61
73
|
This creates all milestones and makes a single git commit. Parse the JSON output — it returns `{ milestones: [{ id, title, realizes, status }], committed, hash }`.
|
|
62
74
|
|
|
63
|
-
**Step
|
|
75
|
+
**Step 7: Inconsistency flagging.**
|
|
64
76
|
|
|
65
77
|
If milestones already exist for a declaration being processed (re-derivation case):
|
|
66
78
|
- Show existing milestones for that declaration
|
|
@@ -68,7 +80,7 @@ If milestones already exist for a declaration being processed (re-derivation cas
|
|
|
68
80
|
- Offer to keep, re-derive, or adjust
|
|
69
81
|
- Do NOT auto-reconcile -- the user decides what to update
|
|
70
82
|
|
|
71
|
-
**Step
|
|
83
|
+
**Step 8: Show summary and suggest next step.**
|
|
72
84
|
|
|
73
85
|
After all declarations processed:
|
|
74
86
|
|
package/commands/declare/plan.md
CHANGED
|
@@ -60,7 +60,37 @@ If no actions found, display: "No actions found for M-XX. Run `/declare:actions
|
|
|
60
60
|
|
|
61
61
|
If all actions already have EXEC-PLANs and status is not PENDING, display: "All actions for M-XX already have EXEC-PLANs. Use `/declare:execute M-XX` to run them." and exit.
|
|
62
62
|
|
|
63
|
-
**Step 3:
|
|
63
|
+
**Step 3: Ensure milestone context exists.**
|
|
64
|
+
|
|
65
|
+
Check if CONTEXT.md exists at `milestoneFolderPath/CONTEXT.md`.
|
|
66
|
+
|
|
67
|
+
If CONTEXT.md does **not** exist, use AskUserQuestion:
|
|
68
|
+
- header: "Context"
|
|
69
|
+
- question: "Milestone [M-XX] has no implementation context yet. Discussing decisions now gives the planner the information it needs to create better EXEC-PLANs."
|
|
70
|
+
- options:
|
|
71
|
+
- "Discuss first (Recommended)" — Run discuss workflow, then proceed to planning
|
|
72
|
+
- "Plan without context" — Skip; planner will use its own judgment
|
|
73
|
+
|
|
74
|
+
If "Discuss first":
|
|
75
|
+
|
|
76
|
+
Display: `Running /declare:discuss [M-XX]...`
|
|
77
|
+
|
|
78
|
+
Spawn a Task agent:
|
|
79
|
+
- subagent_type: `general-purpose`
|
|
80
|
+
- description: `Discuss M-XX implementation decisions`
|
|
81
|
+
- prompt:
|
|
82
|
+
```
|
|
83
|
+
Run /declare:discuss [M-XX] for the Declare project.
|
|
84
|
+
Working directory: [absolute cwd]
|
|
85
|
+
Follow all instructions in commands/declare/discuss.md.
|
|
86
|
+
After capturing context, return DONE.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Wait for the task to complete. Then reload `contextPath` — CONTEXT.md should now exist.
|
|
90
|
+
|
|
91
|
+
If "Plan without context": continue to Step 4.
|
|
92
|
+
|
|
93
|
+
**Step 4: Research check (unless --skip-research).**
|
|
64
94
|
|
|
65
95
|
If `researchPath` exists, display:
|
|
66
96
|
```
|
|
@@ -79,7 +109,7 @@ If `researchPath` does not exist, assess whether research is needed:
|
|
|
79
109
|
|
|
80
110
|
- If actions are purely internal (refactoring, adding features to existing patterns, docs) → skip silently.
|
|
81
111
|
|
|
82
|
-
**Step
|
|
112
|
+
**Step 5: Load context files.**
|
|
83
113
|
|
|
84
114
|
```bash
|
|
85
115
|
cat [contextPath] 2>/dev/null # CONTEXT.md if exists
|
|
@@ -91,7 +121,7 @@ cat .planning/STATE.md 2>/dev/null # Current position and decisions
|
|
|
91
121
|
|
|
92
122
|
Also read the milestone's PLAN.md (at `milestoneFolderPath/PLAN.md`) for action details.
|
|
93
123
|
|
|
94
|
-
**Step
|
|
124
|
+
**Step 6: Spawn declare-planner.**
|
|
95
125
|
|
|
96
126
|
Spawn a Task agent using `agents/declare-planner.md` with the following prompt:
|
|
97
127
|
|
|
@@ -118,7 +148,7 @@ Return: PLANNING COMPLETE with wave structure and EXEC-PLANs created.
|
|
|
118
148
|
|
|
119
149
|
Wait for the planner to complete.
|
|
120
150
|
|
|
121
|
-
**Step
|
|
151
|
+
**Step 7: Spawn declare-plan-checker.**
|
|
122
152
|
|
|
123
153
|
After planner completes, spawn a Task agent using `agents/declare-plan-checker.md` with the following prompt:
|
|
124
154
|
|
|
@@ -141,15 +171,15 @@ Return: VERIFICATION PASSED or ISSUES FOUND with structured issues YAML.
|
|
|
141
171
|
|
|
142
172
|
Wait for the checker to complete.
|
|
143
173
|
|
|
144
|
-
**Step
|
|
174
|
+
**Step 8: Evaluate checker result.**
|
|
145
175
|
|
|
146
176
|
Parse the checker's return.
|
|
147
177
|
|
|
148
|
-
If **VERIFICATION PASSED**: proceed to Step
|
|
178
|
+
If **VERIFICATION PASSED**: proceed to Step 10.
|
|
149
179
|
|
|
150
|
-
If **ISSUES FOUND**: proceed to Step
|
|
180
|
+
If **ISSUES FOUND**: proceed to Step 9 (revision loop).
|
|
151
181
|
|
|
152
|
-
**Step
|
|
182
|
+
**Step 9: Revision loop (max 3 iterations).**
|
|
153
183
|
|
|
154
184
|
Track revision count. If revision count >= 3, skip to Step 9 with a warning.
|
|
155
185
|
|
|
@@ -175,11 +205,11 @@ Make targeted fixes only — do not rewrite working plans.
|
|
|
175
205
|
Return: REVISION COMPLETE with changes made.
|
|
176
206
|
```
|
|
177
207
|
|
|
178
|
-
After revision, re-run checker (Step
|
|
208
|
+
After revision, re-run checker (Step 7). Increment revision count.
|
|
179
209
|
|
|
180
210
|
Repeat until VERIFICATION PASSED or revision count reaches 3.
|
|
181
211
|
|
|
182
|
-
**Step
|
|
212
|
+
**Step 10: Commit EXEC-PLANs.**
|
|
183
213
|
|
|
184
214
|
Pass each file as a separate `--files` argument (not space-separated in one argument):
|
|
185
215
|
|
|
@@ -189,7 +219,7 @@ node dist/declare-tools.cjs commit "docs(${MILESTONE}): create exec-plans for mi
|
|
|
189
219
|
|
|
190
220
|
If the commit reports `nothing_to_commit`, the planner already committed the files — that is fine, continue.
|
|
191
221
|
|
|
192
|
-
**Step
|
|
222
|
+
**Step 11: Present results.**
|
|
193
223
|
|
|
194
224
|
Display final summary:
|
|
195
225
|
|
package/dist/declare-tools.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "declare-cc",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "A future-driven meta-prompting engine for agentic development, rooted in declared futures and causal graph structure.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"declare-cc": "bin/install.js"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"test": "node --test src/graph/engine.test.js",
|
|
46
|
-
"build": "node esbuild.config.js"
|
|
46
|
+
"build": "node esbuild.config.js",
|
|
47
|
+
"release": "node scripts/release.js"
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Release script: bump version, build, commit, tag.
|
|
3
|
+
// Usage: npm run release -- <version>
|
|
4
|
+
// Example: npm run release -- 0.5.6
|
|
5
|
+
//
|
|
6
|
+
// After this runs, publish manually:
|
|
7
|
+
// npm publish --otp=<your-2fa-code>
|
|
8
|
+
// git push && git push --tags
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
const { execSync } = require('child_process');
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
const version = process.argv[2];
|
|
17
|
+
if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
|
|
18
|
+
console.error('Usage: npm run release -- <version> (e.g. 0.5.6)');
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const root = path.join(__dirname, '..');
|
|
23
|
+
const pkgPath = path.join(root, 'package.json');
|
|
24
|
+
|
|
25
|
+
function run(cmd) {
|
|
26
|
+
console.log(`> ${cmd}`);
|
|
27
|
+
execSync(cmd, { cwd: root, stdio: 'inherit' });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 1. Bump version in package.json
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
32
|
+
const prev = pkg.version;
|
|
33
|
+
pkg.version = version;
|
|
34
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
35
|
+
console.log(`Bumped ${prev} → ${version}`);
|
|
36
|
+
|
|
37
|
+
// 2. Build
|
|
38
|
+
run('npm run build');
|
|
39
|
+
|
|
40
|
+
// 3. Commit + tag
|
|
41
|
+
run(`git add package.json package-lock.json dist/`);
|
|
42
|
+
run(`git commit -m "chore: bump version to ${version}"`);
|
|
43
|
+
run(`git tag v${version}`);
|
|
44
|
+
|
|
45
|
+
console.log(`
|
|
46
|
+
Done. To publish:
|
|
47
|
+
|
|
48
|
+
npm publish --otp=<your-2fa-code>
|
|
49
|
+
git push && git push --tags
|
|
50
|
+
`);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Declaration Scope Review
|
|
2
|
+
|
|
3
|
+
You are reviewing the full set of declared futures with the user before deriving milestones. This is a synthesis checkpoint — confirm the foundation is solid so milestone derivation builds on the right ground.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Before working backward to milestones, establish:
|
|
8
|
+
1. The declarations collectively tell a coherent story
|
|
9
|
+
2. The scope boundary is clear (what's in, what's out)
|
|
10
|
+
3. No important futures are missing or redundant
|
|
11
|
+
4. The framing reflects what the user actually intends to build
|
|
12
|
+
|
|
13
|
+
## Opening
|
|
14
|
+
|
|
15
|
+
Synthesize all declarations into a scope statement. Do not simply list them — draw out what they *mean together*:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Looking at your declarations as a whole:
|
|
19
|
+
|
|
20
|
+
[D-01]: [statement]
|
|
21
|
+
[D-02]: [statement]
|
|
22
|
+
...
|
|
23
|
+
|
|
24
|
+
Here's the scope I see:
|
|
25
|
+
|
|
26
|
+
[2-3 sentence synthesis: what this project creates, who it serves, what fundamentally changes]
|
|
27
|
+
|
|
28
|
+
In scope: [concrete things the declarations cover]
|
|
29
|
+
Assumed out of scope: [what the declarations imply is NOT the focus]
|
|
30
|
+
|
|
31
|
+
Does this framing match your intent?
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Present this as text, then use AskUserQuestion:
|
|
35
|
+
|
|
36
|
+
- header: "Scope"
|
|
37
|
+
- question: "Does this framing capture what you're building?"
|
|
38
|
+
- options:
|
|
39
|
+
- "Yes, this is right — derive milestones" (Recommended)
|
|
40
|
+
- "A declaration needs adjusting"
|
|
41
|
+
- "Something important is missing"
|
|
42
|
+
- "The scope feels off"
|
|
43
|
+
|
|
44
|
+
## If "A declaration needs adjusting"
|
|
45
|
+
|
|
46
|
+
Ask which declaration and what's off. Work through the refinement conversationally. If the updated statement is meaningfully different:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
node dist/declare-tools.cjs add-declaration --title "[revised title]" --statement "[revised statement]"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Note: if removing the old version matters, flag it to the user — they can delete the old declaration or keep both if they serve different purposes.
|
|
53
|
+
|
|
54
|
+
After the change, re-synthesize and confirm once more.
|
|
55
|
+
|
|
56
|
+
## If "Something important is missing"
|
|
57
|
+
|
|
58
|
+
Guide the user to state the missing future using the same language principles as in `/declare:future`: present-tense, stated as fact, not goal language. Validate and add:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node dist/declare-tools.cjs add-declaration --title "[title]" --statement "[statement]"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
After adding, re-synthesize and confirm.
|
|
65
|
+
|
|
66
|
+
## If "The scope feels off"
|
|
67
|
+
|
|
68
|
+
Probe what specifically feels wrong:
|
|
69
|
+
|
|
70
|
+
- Too broad? — Help identify which declarations to narrow or which to defer
|
|
71
|
+
- Too narrow? — Something missing (redirect to above)
|
|
72
|
+
- Wrong framing? — Rephrase the synthesis, not the declarations, and re-confirm
|
|
73
|
+
|
|
74
|
+
One pass of adjustment is enough. After a second confirmation attempt, proceed.
|
|
75
|
+
|
|
76
|
+
## After Confirmation
|
|
77
|
+
|
|
78
|
+
Once framing is confirmed, briefly acknowledge it and move forward:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Scope confirmed.
|
|
82
|
+
|
|
83
|
+
[N] declarations covering [core theme]. Deriving milestones by working backward from each.
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then immediately proceed to milestone derivation — do not ask more questions here.
|
|
87
|
+
|
|
88
|
+
## Design Principles
|
|
89
|
+
|
|
90
|
+
- **Synthesize, don't list.** The user already saw their declarations. Show what they mean together.
|
|
91
|
+
- **Name what's out.** Explicit scope exclusions prevent milestone sprawl during derivation.
|
|
92
|
+
- **One round of adjustment.** If the user modifies and re-confirms, proceed. Don't loop more than twice.
|
|
93
|
+
- **Be concrete.** Don't say "the project creates value" — say "the project gives developers a self-hosted AI coding workflow that runs without a cloud dependency."
|
|
94
|
+
- **No emojis.** Keep tone grounded.
|