declare-cc 0.5.9 → 1.0.0

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/README.md CHANGED
@@ -4,8 +4,6 @@
4
4
 
5
5
  **A future-driven meta-prompting engine for agentic development.**
6
6
 
7
- Forked from [GSD (Get Shit Done)](https://github.com/gsd-build/get-shit-done) — replaces linear phase-based planning with a three-layer DAG rooted in declared futures.
8
-
9
7
  [![npm](https://img.shields.io/npm/v/declare-cc?style=for-the-badge&color=7c3aed)](https://www.npmjs.com/package/declare-cc)
10
8
  [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
11
9
 
@@ -23,14 +21,14 @@ npx declare-cc@latest
23
21
 
24
22
  Most planning tools start from the present and work forward — "what should we do first?" Declare starts from the future and works backward — "what must be true for this to succeed?"
25
23
 
26
- You declare present-tense statements of fact about your project's future. The system derives milestones ("what must be true?") and actions ("what must be done?") through causal structure, then executes them in topological order with wave-based parallelism.
24
+ You declare present-tense statements of fact about your project's future. The system derives milestones ("what must be true?") and actions ("what must be done?") through causal structure, then executes them in topological order with wave-based parallelism — visible in real time through a browser-based dashboard.
27
25
 
28
26
  Built on the Erhard/Jensen/Zaffron ontological model:
29
27
  - **Integrity** as wholeness and completeness (not morality)
30
28
  - **Alignment** as shared future (not agreement)
31
29
  - **Performance** as the product of both
32
30
 
33
- This is a fork of [GSD](https://github.com/gsd-build/get-shit-done). It carries forward GSD's agent orchestration, slash command patterns, esbuild bundling, markdown artifacts, and atomic git commits — but replaces the linear phase model with a declarative graph structure. See [Fork Boundary](#fork-boundary) for details.
31
+ Originally forked from [GSD (Get Shit Done)](https://github.com/gsd-build/get-shit-done). See [Fork Boundary](#fork-boundary) for details.
34
32
 
35
33
  ---
36
34
 
@@ -42,7 +40,7 @@ This is a fork of [GSD](https://github.com/gsd-build/get-shit-done). It carries
42
40
  /declare:init
43
41
  ```
44
42
 
45
- Scaffolds the project structure: `FUTURE.md`, `MILESTONES.md`, `.planning/` directory, and the graph config. Installs slash commands if needed.
43
+ Scaffolds the project structure: `FUTURE.md`, `MILESTONES.md`, `.planning/` directory, and the graph config.
46
44
 
47
45
  ### 2. Declare Futures
48
46
 
@@ -69,24 +67,25 @@ Works backward from declarations: "What must be true for D-01 to hold?" Each mil
69
67
  ### 4. Plan & Execute
70
68
 
71
69
  ```
70
+ /declare:actions M-01 # Derive actions for the milestone
72
71
  /declare:plan M-01 # Research → plan → verify loop (planner + checker agents)
73
72
  /declare:execute M-01 # Wave-based execution with parallel agents
74
73
  ```
75
74
 
76
75
  The planner agent derives concrete actions, the checker agent validates them, and the executor runs them in topological waves. Each action gets its own atomic commit.
77
76
 
77
+ Or use the dashboard — review plans in the column browser, approve them, then hit Go in execution mode. The pipeline runner handles wave scheduling, progress tracking, and failure recovery.
78
+
78
79
  **Creates:** `.planning/milestones/M-XX-*/PLAN.md` and `EXEC-PLAN-*.md` files
79
80
 
80
- ### 5. Verify & Sync
81
+ ### 5. Verify & Complete
81
82
 
82
83
  ```
83
- /declare:verify M-01 # Conversational UAT — validates deliverables
84
- /declare:audit M-01 # Cross-reference actions against declarations
85
- node dist/declare-tools.cjs sync-status # Propagate DONE bottom-up through the graph
84
+ /declare:verify M-01 # Conversational UAT — validates deliverables
85
+ /declare:audit M-01 # Cross-reference actions against declarations
86
+ /declare:complete-milestone M-01 # Archive, tag release, prepare next cycle
86
87
  ```
87
88
 
88
- `sync-status` walks the DAG bottom-up: marks actions DONE (by file existence or milestone status), then milestones (all actions DONE), then declarations (all milestones DONE). Run it after any verification pass.
89
-
90
89
  ### 6. Navigate
91
90
 
92
91
  Understand your graph at any point:
@@ -119,19 +118,37 @@ The graph engine (`DeclareDag`) uses dual adjacency lists for O(1) bidirectional
119
118
 
120
119
  ---
121
120
 
122
- ## Live DAG Dashboard
121
+ ## Dashboard
123
122
 
124
123
  ```
125
124
  /declare:dashboard
126
125
  ```
127
126
 
128
- Starts a local server and opens an interactive browser view of your full graph. Nodes are rendered in three layers (Declarations Milestones → Actions) with live status colors.
127
+ Starts a local server and opens an interactive browser view of your project. The dashboard is the primary interface for planning and execution.
128
+
129
+ ### Column Browser (Planning Mode)
130
+
131
+ The three-layer DAG rendered as a navigable column browser — Declarations on the left, Milestones in the center, Actions on the right. Click any node to see its detail panel with full causal chain, context, and status. Chain nodes are clickable for navigation.
132
+
133
+ Declarations, milestones, and actions can be created, reviewed, and approved directly in the browser. The review/annotation panel supports iterative cycles: generate plan, annotate corrections, send back for revision, repeat until approved.
134
+
135
+ ### Execution Mode
136
+
137
+ When all plans in scope are approved, transition to execution mode — a dedicated full-screen view showing the ordered execution pipeline. Features include:
129
138
 
130
- **Focus mode:** Click any node to filter the graph to its causal chain. The surrounding nodes slide out, the relevant subtree centers itself with smooth FLIP animations. Click again or press Esc to exit.
139
+ - **Pre-execution wave order** Review the execution sequence before starting, with drag-to-reorder within dependency constraints
140
+ - **Pipeline runner** — Manifest-driven execution with wave scheduling, transient retry, and execution reports
141
+ - **Live progress** — Progress bar, status dots per action, elapsed time
142
+ - **Failure handling** — Pause-on-failure with View Output, Skip, and Stop options
143
+ - **State persistence** — Execution state survives browser refresh
131
144
 
132
- **Sidebar:** Click any node to see its full causal chain — declaration → milestone → action — with context and status. Chain nodes are clickable.
145
+ ### Activity Panel
133
146
 
134
- **Status colors:** DONE nodes retain their type hue (dimmed blue for declarations, dimmed purple for milestones, dimmed green for actions) so the graph stays readable as a living document rather than collapsing to grey.
147
+ A right-side panel showing real-time agent activity. Every agent spawn execution, revision, research appears as a persistent activity card showing agent type, target node, elapsed time, and live status. Cards survive page refresh and navigation. Completed agents show a "View Result" button that navigates to the produced output.
148
+
149
+ ### Status Colors
150
+
151
+ DONE nodes retain their type hue (dimmed blue for declarations, dimmed purple for milestones, dimmed green for actions) so the graph stays readable as a living document rather than collapsing to grey. Integrity state is visualized per-node with wholeness indicators.
135
152
 
136
153
  ---
137
154
 
@@ -156,8 +173,9 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
156
173
 
157
174
  - **Drift detection** — Are current actions still aligned with declared futures?
158
175
  - **Occurrence checks** — AI verifies declarations still hold at milestone completion
159
- - **Performance scoring** — Alignment × Integrity as qualitative HIGH/MEDIUM/LOW (never numeric scores)
176
+ - **Performance scoring** — Alignment x Integrity as qualitative HIGH/MEDIUM/LOW (never numeric scores)
160
177
  - **Renegotiation flow** — When a declaration no longer fits, renegotiate it into `FUTURE-ARCHIVE.md`
178
+ - **Wholeness visualization** — Each node shows its computed wholeness state in the dashboard
161
179
 
162
180
  ---
163
181
 
@@ -221,7 +239,7 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
221
239
  | Command | What it does |
222
240
  |---------|--------------|
223
241
  | `/declare:new-project` | Deep context gathering, PROJECT.md + STATE.md creation |
224
- | `/declare:new-milestone` | Archive declarations, reset for next milestone cycle |
242
+ | `/declare:new-cycle` | Archive declarations, reset for next cycle |
225
243
  | `/declare:complete-milestone` | Snapshot graph, tag release, prepare next cycle |
226
244
 
227
245
  ### Maintenance
@@ -240,38 +258,49 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
240
258
  ## Project Structure
241
259
 
242
260
  ```
243
- FUTURE.md # Declared futures (D-01, D-02, ...)
244
- MILESTONES.md # Derived milestones (M-01, M-02, ...)
261
+ FUTURE.md # Active declared futures
262
+ MILESTONES.md # Active milestones
263
+ FUTURE-ARCHIVE.md # Completed cycle declarations
245
264
 
246
265
  .planning/
247
266
  ├── PROJECT.md # Project context and goals
248
267
  ├── STATE.md # Current work state
249
268
  ├── config.json # Project settings
269
+ ├── agent-state.json # Agent lifecycle state (server-side tracking)
250
270
  ├── milestones/
251
- └── M-XX-slug/
252
- ├── PLAN.md # Actions for this milestone
253
- ├── EXEC-PLAN-*.md # Per-action execution plans
254
- └── VERIFICATION.md # Integrity proof after execution
271
+ ├── M-XX-slug/
272
+ ├── PLAN.md # Actions for this milestone
273
+ ├── EXEC-PLAN-*.md # Per-action execution plans
274
+ └── VERIFICATION.md # Integrity proof after execution
275
+ │ └── v1.0/ # Archived milestone cycle
255
276
  └── codebase/ # Codebase analysis artifacts
256
277
 
257
- agents/ # Declare-specific agent definitions
278
+ agents/ # Agent definitions (10 specialized agents)
258
279
  ├── declare-planner.md
259
280
  ├── declare-plan-checker.md
281
+ ├── declare-executor.md
260
282
  ├── declare-researcher.md
261
283
  ├── declare-research-synthesizer.md
262
284
  ├── declare-codebase-mapper.md
285
+ ├── declare-roadmapper.md
286
+ ├── declare-verifier.md
287
+ ├── declare-integration-checker.md
263
288
  └── declare-debugger.md
264
289
 
265
- workflows/
266
- ├── discuss.md # Context capture workflow
267
- └── verify.md # UAT workflow
290
+ workflows/ # Conversational workflow definitions
291
+ ├── actions.md
292
+ ├── discuss.md
293
+ ├── future.md
294
+ ├── milestones.md
295
+ ├── scope.md
296
+ └── verify.md
268
297
 
269
298
  dist/declare-tools.cjs # Bundled CLI (zero runtime deps)
270
- src/ # Source (Node.js, CJS)
299
+ src/ # Source (~26K LOC)
271
300
  ├── graph/engine.js # DeclareDag — dual adjacency lists, Kahn's sort
272
301
  ├── artifacts/ # Markdown parsers/writers
273
- ├── commands/ # CLI command implementations
274
- └── server/ # DAG web server + dashboard frontend
302
+ ├── commands/ # 40+ CLI command implementations
303
+ └── server/ # HTTP API, SSE streaming, dashboard frontend
275
304
  ```
276
305
 
277
306
  ---
@@ -284,6 +313,13 @@ src/ # Source (Node.js, CJS)
284
313
  npx declare-cc@latest
285
314
  ```
286
315
 
316
+ Or install globally:
317
+
318
+ ```bash
319
+ npm install -g declare-cc
320
+ declare # Opens dashboard for current directory
321
+ ```
322
+
287
323
  Or clone and install locally:
288
324
 
289
325
  ```bash
@@ -357,9 +393,13 @@ WAVE 1 (parallel) WAVE 2 (parallel) WAVE 3
357
393
 
358
394
  Each agent gets a fresh context window. Your main session stays light.
359
395
 
396
+ ### Agent Lifecycle Tracking
397
+
398
+ Every spawned agent is tracked server-side with full lifecycle state: spawn, progress, completion. The `AgentRegistry` persists state to disk so agents survive server restarts and browser refreshes. The HTTP API exposes agent state for the dashboard's activity panel.
399
+
360
400
  ### Status Propagation
361
401
 
362
- The DAG maintains status consistency bottom-up. Run `sync-status` after any verification pass:
402
+ The DAG maintains status consistency bottom-up:
363
403
 
364
404
  ```
365
405
  Actions → check produced files exist → mark DONE
package/bin/declare.js ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const bundlePath = path.resolve(__dirname, '../dist/declare-tools.cjs');
8
+
9
+ if (!fs.existsSync(bundlePath)) {
10
+ console.error('[declare] Bundle not found: ' + bundlePath);
11
+ console.error('[declare] Run `npm run build` in the declare-cc package directory.');
12
+ process.exit(1);
13
+ }
14
+
15
+ // Forward argv as-is — declare-tools.cjs reads process.argv
16
+ require(bundlePath);
@@ -144,7 +144,7 @@ Locate or create a `## Current State` section. Update it to reflect the complete
144
144
  **Version shipped:** vX.Y (YYYY-MM-DD)
145
145
  **Milestones completed:** [N] ([M-01, M-02, ...])
146
146
  **Known gaps:** [list incomplete milestones, or "None"]
147
- **Next step:** Run /declare:new-milestone to start vX.Z cycle
147
+ **Next step:** Run /declare:new-cycle to start vX.Z cycle
148
148
  ```
149
149
 
150
150
  If the section already exists, update it in place. If it does not exist, append it after the last section.
@@ -197,7 +197,7 @@ git commit -m "chore: archive vX.Y milestone snapshot
197
197
 
198
198
  Next: Start the next milestone cycle.
199
199
 
200
- Run /declare:new-milestone
200
+ Run /declare:new-cycle
201
201
  ```
202
202
 
203
203
  **Error handling:**
@@ -212,4 +212,4 @@ Run /declare:new-milestone
212
212
  - Archive is a snapshot, not a destructive operation — FUTURE.md and MILESTONES.md remain in place.
213
213
  - PROJECT.md is the persistent memory across versions — always update it.
214
214
  - Git tag marks the historical release point for the snapshot.
215
- - This command archives only — use /declare:new-milestone to reset for the next cycle.
215
+ - This command archives only — use /declare:new-cycle to reset for the next cycle.
@@ -126,7 +126,7 @@ Spawning [count] agent(s)...
126
126
 
127
127
  **3c. Spawn executor agents in parallel using the Task tool:**
128
128
 
129
- For each action in the wave, spawn a Task with instructions like:
129
+ For each action in the wave, spawn a Task with `model: "opus"` and instructions like:
130
130
 
131
131
  ```
132
132
  Execute the plan at [outputPath].
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Start a new Declare milestone cycle — archive declarations, reset FUTURE.md and MILESTONES.md, preserve PROJECT.md and STATE.md
2
+ description: Start a new Declare cycle — archive current declarations to FUTURE-ARCHIVE.md, reset FUTURE.md and MILESTONES.md, preserve PROJECT.md and STATE.md
3
3
  allowed-tools:
4
4
  - Read
5
5
  - Write
@@ -77,6 +77,7 @@ Display: `Running /declare:discuss [M-XX]...`
77
77
 
78
78
  Spawn a Task agent:
79
79
  - subagent_type: `general-purpose`
80
+ - model: `opus`
80
81
  - description: `Discuss M-XX implementation decisions`
81
82
  - prompt:
82
83
  ```
@@ -123,7 +124,7 @@ Also read the milestone's PLAN.md (at `milestoneFolderPath/PLAN.md`) for action
123
124
 
124
125
  **Step 6: Spawn declare-planner.**
125
126
 
126
- Spawn a Task agent using `agents/declare-planner.md` with the following prompt:
127
+ Spawn a Task agent using `agents/declare-planner.md` with `model: "opus"` and the following prompt:
127
128
 
128
129
  ```
129
130
  Plan milestone ${MILESTONE} actions.
@@ -150,7 +151,7 @@ Wait for the planner to complete.
150
151
 
151
152
  **Step 7: Spawn declare-plan-checker.**
152
153
 
153
- After planner completes, spawn a Task agent using `agents/declare-plan-checker.md` with the following prompt:
154
+ After planner completes, spawn a Task agent using `agents/declare-plan-checker.md` with `model: "haiku"` and the following prompt:
154
155
 
155
156
  ```
156
157
  Verify EXEC-PLAN files for milestone ${MILESTONE}.
@@ -183,7 +184,7 @@ If **ISSUES FOUND**: proceed to Step 9 (revision loop).
183
184
 
184
185
  Track revision count. If revision count >= 3, skip to Step 9 with a warning.
185
186
 
186
- Spawn declare-planner again in revision mode:
187
+ Spawn declare-planner again in revision mode with `model: "opus"`:
187
188
 
188
189
  ```
189
190
  Revise EXEC-PLAN files for milestone ${MILESTONE} based on checker feedback.
@@ -283,6 +284,7 @@ After displaying the summary, reload the graph and check for milestones that sti
283
284
  For each wave, spawn one Task agent per milestone **in the same response** so they execute in parallel:
284
285
 
285
286
  Subagent type: `gsd-executor`
287
+ model: `opus`
286
288
  Prompt per milestone:
287
289
  ```
288
290
  Execute milestone [M-XX] "[title]" for the Declare project.
@@ -89,11 +89,11 @@ Evaluate project state and present the appropriate option(s):
89
89
 
90
90
  **Route C — All milestones for active declarations complete:**
91
91
  - "All milestones for the current declaration wave are complete."
92
- - Offer: "Run `/declare:complete-milestone` or plan the next milestone with `/declare:new-milestone`"
92
+ - Offer: "Run `/declare:complete-milestone` or plan the next milestone with `/declare:new-cycle`"
93
93
 
94
94
  **Route D — No active milestone:**
95
95
  - "No active milestone found."
96
- - Offer: "Run `/declare:new-milestone` to plan the next milestone, or `/declare:status` to review the full graph"
96
+ - Offer: "Run `/declare:new-cycle` to plan the next milestone, or `/declare:status` to review the full graph"
97
97
 
98
98
  **Route E — No declarations exist:**
99
99
  - "No declarations found. Start by defining what you want to be true."
@@ -62,9 +62,9 @@ Spawning 4 researchers: STACK, FEATURES, ARCHITECTURE, PITFALLS...
62
62
 
63
63
  Spawn all 4 Task agents in the same response so they run in parallel. Each agent researches a specific domain.
64
64
 
65
- For each researcher, the prompt follows this pattern (fill in milestone-specific context):
65
+ For each researcher, the prompt follows this pattern (fill in milestone-specific context). Each researcher Task is spawned with `model: "sonnet"`.
66
66
 
67
- **STACK researcher:**
67
+ **STACK researcher** (model: `sonnet`):
68
68
 
69
69
  ```
70
70
  First, read agents/declare-researcher.md for your role and instructions.
@@ -91,7 +91,7 @@ Do NOT commit — the synthesizer will commit everything together.
91
91
  </output>
92
92
  ```
93
93
 
94
- **FEATURES researcher:**
94
+ **FEATURES researcher** (model: `sonnet`):
95
95
 
96
96
  ```
97
97
  First, read agents/declare-researcher.md for your role and instructions.
@@ -118,7 +118,7 @@ Do NOT commit — the synthesizer will commit everything together.
118
118
  </output>
119
119
  ```
120
120
 
121
- **ARCHITECTURE researcher:**
121
+ **ARCHITECTURE researcher** (model: `sonnet`):
122
122
 
123
123
  ```
124
124
  First, read agents/declare-researcher.md for your role and instructions.
@@ -145,7 +145,7 @@ Do NOT commit — the synthesizer will commit everything together.
145
145
  </output>
146
146
  ```
147
147
 
148
- **PITFALLS researcher:**
148
+ **PITFALLS researcher** (model: `sonnet`):
149
149
 
150
150
  ```
151
151
  First, read agents/declare-researcher.md for your role and instructions.
@@ -191,7 +191,7 @@ Spawning synthesizer...
191
191
 
192
192
  If any researcher returned `## RESEARCH BLOCKED`, surface the blocker to the user before spawning the synthesizer. Ask whether to continue with partial research or abort.
193
193
 
194
- **Step 7: Spawn declare-research-synthesizer.**
194
+ **Step 7: Spawn declare-research-synthesizer** (model: `sonnet`).
195
195
 
196
196
  ```
197
197
  First, read agents/declare-research-synthesizer.md for your role and instructions.
@@ -118,7 +118,7 @@ Evaluate the current project state and present the most relevant next step:
118
118
 
119
119
  **Route D — No active milestone:**
120
120
  - "No active milestone found."
121
- - Offer: "`/declare:new-milestone` to plan next milestone" or "`/declare:status` to review graph"
121
+ - Offer: "`/declare:new-cycle` to plan next milestone" or "`/declare:status` to review graph"
122
122
 
123
123
  **Route E — No project initialized:**
124
124
  - "Project not initialized."
@@ -51,6 +51,7 @@ node dist/declare-tools.cjs commit "test(${MILESTONE_ID}): complete UAT - ${PASS
51
51
  **On gaps found — spawn parallel declare-debugger agents (one per gap):**
52
52
 
53
53
  For each gap in the UAT Gaps section, spawn a declare-debugger agent with:
54
+ - `model: "opus"`
54
55
  - `symptoms_prefilled: true` (skip symptom gathering)
55
56
  - `goal: find_root_cause_only` (diagnose but don't fix)
56
57
  - Pre-filled symptoms from the gap's test_id, expected, and actual fields