declare-cc 0.6.0 → 1.0.1

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 — visible in real time through a browser 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
 
@@ -66,36 +64,39 @@ Works backward from declarations: "What must be true for D-01 to hold?" Each mil
66
64
 
67
65
  **Creates:** `MILESTONES.md` with milestones (M-01, M-02, ...)
68
66
 
69
- ### 4. Plan & Execute
67
+ ### 4. Plan Actions
70
68
 
71
69
  ```
72
- /declare:plan M-01 # Research → plan → verify loop (planner + checker agents)
73
- /declare:execute M-01 # Wave-based execution with parallel agents
70
+ /declare:actions M-01
74
71
  ```
75
72
 
76
- 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.
73
+ Or press **P** on any milestone card in the dashboard. The AI derives 2-5 concrete actions per milestone by asking "What work must be done to achieve this?" Actions are auto-accepted and appear as cards immediately — the action list IS the plan.
77
74
 
78
- **Creates:** `.planning/milestones/M-XX-*/PLAN.md` and `EXEC-PLAN-*.md` files
75
+ Each action has a title and a "produces" field describing its deliverable. No separate exec-plan files — the milestone's action list is the execution plan.
79
76
 
80
- ### 5. Verify & Sync
77
+ **Creates:** `.planning/milestones/M-XX-*/PLAN.md`
81
78
 
82
- ```
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
86
- ```
79
+ ### 5. Review & Execute
80
+
81
+ In the dashboard, review each action card. Press **A** to approve, **E** to edit, **D** to delete. Once all actions for a milestone are approved, press **E** to execute.
87
82
 
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.
83
+ The executor gets the full why-chain context: declaration statement milestone description action details + sibling actions. It reads your codebase, implements the changes, and commits.
89
84
 
90
- ### 6. Navigate
85
+ ### 6. Verify & Complete
86
+
87
+ ```
88
+ /declare:verify M-01 # Conversational UAT — validates deliverables
89
+ /declare:audit M-01 # Cross-reference actions against declarations
90
+ /declare:complete-milestone M-01 # Archive, tag release, prepare next cycle
91
+ ```
91
92
 
92
- Understand your graph at any point:
93
+ ### 7. Navigate
93
94
 
94
95
  ```
95
- /declare:trace A-03 # Why does this action exist? Walk the why-chain up to its declaration
96
+ /declare:trace A-03 # Why does this action exist? Walk the why-chain
96
97
  /declare:visualize # ASCII tree of the full DAG with status markers
97
- /declare:prioritize M-01 # Rank actions by unblocking power (dependency weight)
98
- /declare:status # Layer counts, health indicators, integrity/alignment metrics
98
+ /declare:prioritize M-01 # Rank actions by unblocking power
99
+ /declare:status # Layer counts, health indicators
99
100
  /declare:dashboard # Live interactive DAG in the browser
100
101
  ```
101
102
 
@@ -119,19 +120,55 @@ The graph engine (`DeclareDag`) uses dual adjacency lists for O(1) bidirectional
119
120
 
120
121
  ---
121
122
 
122
- ## Live DAG Dashboard
123
+ ## Dashboard
123
124
 
124
125
  ```
125
126
  /declare:dashboard
126
127
  ```
127
128
 
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.
129
+ Starts a local server and opens an interactive browser view. The dashboard is the primary interface for planning, review, and execution.
130
+
131
+ ### Lifecycle Column Browser
132
+
133
+ Drill into the three-layer DAG: Declarations → Milestones → Actions. Each level groups cards into lifecycle stages:
134
+
135
+ | Stage | Meaning |
136
+ |-------|---------|
137
+ | **Needs Planning** | Approved but no actions derived yet |
138
+ | **Needs Approval** | Has unapproved items (milestones or actions) |
139
+ | **Ready to Execute** | All items approved, ready to run |
140
+ | **In Execution** | Currently being executed by an agent |
141
+ | **Done** | Completed (collapsible) |
142
+
143
+ Cards show inline status: title, description, status badges, action counts, and review state. The action buttons row (Plan, Edit, Delete, Approve, Execute) is always visible — no hidden menus.
144
+
145
+ ### Keyboard Shortcuts
146
+
147
+ Single keys act on the focused card (use arrow keys to navigate):
129
148
 
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.
149
+ | Key | Action |
150
+ |-----|--------|
151
+ | **P** | Plan — derive actions/milestones |
152
+ | **A** | Approve the focused card |
153
+ | **E** | Edit (opens inline textarea) |
154
+ | **D** | Delete |
155
+ | **Arrow Up/Down** | Move focus between cards |
156
+ | **Arrow Right/Enter** | Drill into card |
157
+ | **Arrow Left** | Go back one level |
158
+ | **Ctrl+Shift+A** | Approve all visible |
159
+ | **Ctrl+Shift+P** | Global plan (top-right button) |
131
160
 
132
- **Sidebar:** Click any node to see its full causal chain — declaration → milestone → action — with context and status. Chain nodes are clickable.
161
+ ### Activity Panel
133
162
 
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.
163
+ Right-side panel showing real-time agent activity. Every agent spawn planning, execution, revision appears as a persistent card with type, target, elapsed time, and status. Cards survive page refresh. Completed agents show "View Result".
164
+
165
+ ### Command Bar
166
+
167
+ Press **C** to open the command input at the bottom. Type natural language or slash commands. The command bar dispatches to the server API.
168
+
169
+ ### Mesh UI Integration
170
+
171
+ The server writes `.planning/server.port` on startup (deleted on shutdown) so external tools like the Mesh UI Declare plugin can discover and embed the dashboard.
135
172
 
136
173
  ---
137
174
 
@@ -141,8 +178,6 @@ Declare doesn't just track what's done — it tracks whether commitments are bei
141
178
 
142
179
  ### Integrity States
143
180
 
144
- Every node in the graph has an integrity status:
145
-
146
181
  | Status | Meaning |
147
182
  |--------|---------|
148
183
  | `KEPT` | Commitment fulfilled as declared |
@@ -150,14 +185,14 @@ Every node in the graph has an integrity status:
150
185
  | `BROKEN` | Commitment not fulfilled, no acknowledgment |
151
186
  | `RENEGOTIATED` | Commitment explicitly changed through renegotiation flow |
152
187
 
153
- The **honor protocol** for a commitment you can't keep: acknowledge the break, inform affected parties, clean up the mess, renegotiate a new commitment. This matches the Erhard/Jensen model — integrity isn't about being perfect, it's about restoring wholeness when things break.
188
+ The **honor protocol** for a commitment you can't keep: acknowledge the break, inform affected parties, clean up the mess, renegotiate a new commitment.
154
189
 
155
190
  ### Alignment Monitoring
156
191
 
157
192
  - **Drift detection** — Are current actions still aligned with declared futures?
158
193
  - **Occurrence checks** — AI verifies declarations still hold at milestone completion
159
- - **Performance scoring** — Alignment × Integrity as qualitative HIGH/MEDIUM/LOW (never numeric scores)
160
194
  - **Renegotiation flow** — When a declaration no longer fits, renegotiate it into `FUTURE-ARCHIVE.md`
195
+ - **Wholeness visualization** — Each node shows its computed wholeness state in the dashboard
161
196
 
162
197
  ---
163
198
 
@@ -171,8 +206,7 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
171
206
  | `/declare:future` | Guided conversation to capture declared futures |
172
207
  | `/declare:milestones` | Derive milestones backward from declarations |
173
208
  | `/declare:actions [M-XX]` | Derive actions for a milestone |
174
- | `/declare:plan [M-XX]` | Research plan verify loop (planner + checker agents) |
175
- | `/declare:execute [M-XX]` | Wave-based execution with parallel agents |
209
+ | `/declare:execute [M-XX]` | Execute actions with full context |
176
210
 
177
211
  ### Planning Support
178
212
 
@@ -221,7 +255,7 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
221
255
  | Command | What it does |
222
256
  |---------|--------------|
223
257
  | `/declare:new-project` | Deep context gathering, PROJECT.md + STATE.md creation |
224
- | `/declare:new-milestone` | Archive declarations, reset for next milestone cycle |
258
+ | `/declare:new-cycle` | Archive declarations, reset for next cycle |
225
259
  | `/declare:complete-milestone` | Snapshot graph, tag release, prepare next cycle |
226
260
 
227
261
  ### Maintenance
@@ -240,38 +274,23 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
240
274
  ## Project Structure
241
275
 
242
276
  ```
243
- FUTURE.md # Declared futures (D-01, D-02, ...)
244
- MILESTONES.md # Derived milestones (M-01, M-02, ...)
277
+ FUTURE.md # Active declared futures
278
+ MILESTONES.md # Active milestones
279
+ FUTURE-ARCHIVE.md # Completed cycle declarations
245
280
 
246
281
  .planning/
247
282
  ├── PROJECT.md # Project context and goals
248
283
  ├── STATE.md # Current work state
249
284
  ├── config.json # Project settings
285
+ ├── agent-state.json # Agent lifecycle state
286
+ ├── server.port # Active server port (auto-managed)
250
287
  ├── 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
288
+ ├── M-XX-slug/
289
+ ├── PLAN.md # Actions for this milestone
290
+ ├── execution.log # Execution output log
291
+ └── VERIFICATION.md # Integrity proof after execution
292
+ │ └── v1.0/ # Archived milestone cycle
255
293
  └── codebase/ # Codebase analysis artifacts
256
-
257
- agents/ # Declare-specific agent definitions
258
- ├── declare-planner.md
259
- ├── declare-plan-checker.md
260
- ├── declare-researcher.md
261
- ├── declare-research-synthesizer.md
262
- ├── declare-codebase-mapper.md
263
- └── declare-debugger.md
264
-
265
- workflows/
266
- ├── discuss.md # Context capture workflow
267
- └── verify.md # UAT workflow
268
-
269
- dist/declare-tools.cjs # Bundled CLI (zero runtime deps)
270
- src/ # Source (Node.js, CJS)
271
- ├── graph/engine.js # DeclareDag — dual adjacency lists, Kahn's sort
272
- ├── artifacts/ # Markdown parsers/writers
273
- ├── commands/ # CLI command implementations
274
- └── server/ # DAG web server + dashboard frontend
275
294
  ```
276
295
 
277
296
  ---
@@ -284,12 +303,11 @@ src/ # Source (Node.js, CJS)
284
303
  npx declare-cc@latest
285
304
  ```
286
305
 
287
- Or clone and install locally:
306
+ Or install globally:
288
307
 
289
308
  ```bash
290
- git clone https://github.com/decocms/declare-cc.git
291
- cd declare-cc
292
- node bin/install.js --claude --local
309
+ npm install -g declare-cc
310
+ declare # Opens dashboard for current directory
293
311
  ```
294
312
 
295
313
  Requires Node.js 18+.
@@ -300,11 +318,11 @@ Requires Node.js 18+.
300
318
  /declare:init # Scaffold the project
301
319
  /declare:future # Declare 3-5 futures
302
320
  /declare:milestones # Derive milestones backward
303
- /declare:plan M-01 # Research + plan first milestone
304
- /declare:execute M-01 # Execute with wave scheduling
305
- /declare:dashboard # View the live DAG
321
+ /declare:dashboard # Open the live dashboard
306
322
  ```
307
323
 
324
+ Then in the dashboard: press **P** to plan actions, **A** to approve, **E** to execute. Everything flows through the card-based UI.
325
+
308
326
  ### Recommended: Skip Permissions Mode
309
327
 
310
328
  Declare spawns agents and runs CLI tools frequently. For frictionless operation:
@@ -339,27 +357,32 @@ Add to `.claude/settings.json`:
339
357
 
340
358
  ## Architecture
341
359
 
342
- ### Wave-Based Execution
360
+ ### Concurrent Planning
361
+
362
+ Multiple milestones can be planned simultaneously. The action derivation runner uses a session Map — no singleton locks, no 409 errors. Each session broadcasts independently via SSE.
363
+
364
+ ### Rich Execution Context
343
365
 
344
- Actions are grouped into waves based on their dependencies in the DAG. Within each wave, independent actions run in parallel via spawned agents. Waves run sequentially.
366
+ When an action executes, the AI agent receives the full why-chain:
345
367
 
346
368
  ```
347
- WAVE 1 (parallel) WAVE 2 (parallel) WAVE 3
348
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
349
- A-01 │ A-02 │ │ A-03 │ A-04 │ │ A-05 │
350
- │ Schema │ │ Auth │→ │ API │ │ Storage │→ │ UI │
351
- └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
352
- │ │ ↑ ↑ ↑
353
- └───────────┴──────────────┴───────────┘ │
354
- A-03 needs A-01, A-04 needs A-02 │
355
- A-05 needs A-03 + A-04 │
369
+ Declaration: D-01 "The system handles all edge cases gracefully"
370
+
371
+ Milestone: M-03 Error Recovery and Resilience
372
+
373
+ Action: A-07 — Implement retry logic with exponential backoff
374
+ Produces: Retry wrapper for all external API calls
375
+
376
+ Other actions (context only):
377
+ - A-06: Add circuit breaker pattern [DONE]
378
+ - A-08: Build error reporting dashboard
356
379
  ```
357
380
 
358
- Each agent gets a fresh context window. Your main session stays light.
381
+ The executor reads the codebase, implements changes, verifies them, and commits — all autonomously.
359
382
 
360
383
  ### Status Propagation
361
384
 
362
- The DAG maintains status consistency bottom-up. Run `sync-status` after any verification pass:
385
+ The DAG maintains status consistency bottom-up:
363
386
 
364
387
  ```
365
388
  Actions → check produced files exist → mark DONE
@@ -406,8 +429,8 @@ Declare is forked from [GSD (Get Shit Done)](https://github.com/gsd-build/get-sh
406
429
  |-----|---------|-----|
407
430
  | Linear phases (1, 2, 3...) | Three-layer DAG (D → M → A) | Phases are past-derived sequencing; DAGs represent causal structure |
408
431
  | `ROADMAP.md` | `FUTURE.md` + `MILESTONES.md` | The present is given by the future you're living into |
409
- | `STATE.md` tracking | Graph node statuses | Status lives in the graph, not a separate file |
410
- | Sequential execution | Topology-aware wave scheduling | Actions execute in causal order, not linear sequence |
432
+ | Separate EXEC-PLAN files per action | Action list IS the plan | Actions define what to do; the executor gets full context automatically |
433
+ | Sequential execution | Concurrent planning + execution | Multiple milestones plan/execute in parallel |
411
434
  | Phase numbers | Milestone IDs (M-XX) | Milestones derive from declarations, not arbitrary ordering |
412
435
 
413
436
  ---