declare-cc 1.0.0 → 1.0.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/README.md CHANGED
@@ -7,100 +7,83 @@
7
7
  [![npm](https://img.shields.io/npm/v/declare-cc?style=for-the-badge&color=7c3aed)](https://www.npmjs.com/package/declare-cc)
8
8
  [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
9
9
 
10
- ```bash
11
- npx declare-cc@latest
12
- ```
13
-
14
10
  *Declare what's true when this succeeds. The system derives the rest backward.*
15
11
 
16
12
  </div>
17
13
 
18
14
  ---
19
15
 
20
- ## What This Is
21
-
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?"
23
-
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.
16
+ ## Setup
25
17
 
26
- Built on the Erhard/Jensen/Zaffron ontological model:
27
- - **Integrity** as wholeness and completeness (not morality)
28
- - **Alignment** as shared future (not agreement)
29
- - **Performance** as the product of both
18
+ Add to your project:
30
19
 
31
- Originally forked from [GSD (Get Shit Done)](https://github.com/gsd-build/get-shit-done). See [Fork Boundary](#fork-boundary) for details.
20
+ ```bash
21
+ npm install --save-dev declare-cc
22
+ ```
32
23
 
33
- ---
24
+ Add a script to `package.json`:
34
25
 
35
- ## How It Works
26
+ ```json
27
+ {
28
+ "scripts": {
29
+ "plan": "dcl"
30
+ }
31
+ }
32
+ ```
36
33
 
37
- ### 1. Initialize
34
+ Run it:
38
35
 
39
- ```
40
- /declare:init
36
+ ```bash
37
+ npm run plan
41
38
  ```
42
39
 
43
- Scaffolds the project structure: `FUTURE.md`, `MILESTONES.md`, `.planning/` directory, and the graph config.
40
+ This auto-initializes a `.planning/` directory if one doesn't exist, starts the Declare server, writes the port to `.planning/server.port`, and opens the dashboard in your browser.
44
41
 
45
- ### 2. Declare Futures
42
+ Or run directly:
46
43
 
47
- ```
48
- /declare:future
44
+ ```bash
45
+ npx dcl
49
46
  ```
50
47
 
51
- A guided conversation captures 3-5 declarations about your project's future. Each declaration is a present-tense statement of fact — not a goal, not a wish.
48
+ Requires Node.js 18+.
52
49
 
53
- The system detects past-derived language ("I want to avoid...", "We need to fix...") and uses Socratic reframing to help you declare from the future rather than react to the past.
50
+ ---
54
51
 
55
- **Creates:** `FUTURE.md` with declarations (D-01, D-02, ...)
52
+ ## What This Is
56
53
 
57
- ### 3. Derive Milestones
54
+ 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?"
58
55
 
59
- ```
60
- /declare:milestones
61
- ```
56
+ 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 spawns Claude Code agents to execute them — visible in real time through a browser dashboard.
62
57
 
63
- Works backward from declarations: "What must be true for D-01 to hold?" Each milestone maps to one or more declarations through causal edges in the DAG.
58
+ ---
64
59
 
65
- **Creates:** `MILESTONES.md` with milestones (M-01, M-02, ...)
60
+ ## How It Works
66
61
 
67
- ### 4. Plan & Execute
62
+ Everything happens through the dashboard. `dcl` opens it, and you drive the workflow with keyboard shortcuts and card-based UI.
68
63
 
69
- ```
70
- /declare:actions M-01 # Derive actions for the milestone
71
- /declare:plan M-01 # Research → plan → verify loop (planner + checker agents)
72
- /declare:execute M-01 # Wave-based execution with parallel agents
73
- ```
64
+ ### 1. Declare Futures
74
65
 
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.
66
+ Create declarations directly in the dashboard present-tense statements about your project's future. Not goals, not wishes.
76
67
 
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.
68
+ ### 2. Derive Milestones
78
69
 
79
- **Creates:** `.planning/milestones/M-XX-*/PLAN.md` and `EXEC-PLAN-*.md` files
70
+ Press **P** on a declaration card. The AI works backward: "What must be true for this to hold?" Milestones appear as cards immediately.
80
71
 
81
- ### 5. Verify & Complete
72
+ ### 3. Plan Actions
82
73
 
83
- ```
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
87
- ```
74
+ Press **P** on a milestone card. The AI derives 2-5 concrete actions. Actions auto-accept and appear as cards — the action list IS the plan.
88
75
 
89
- ### 6. Navigate
76
+ ### 4. Review & Approve
90
77
 
91
- Understand your graph at any point:
78
+ Navigate with **Arrow keys**. Press **A** to approve, **E** to edit, **D** to delete. Milestones only move to "Ready to Execute" when all their actions are approved.
92
79
 
93
- ```
94
- /declare:trace A-03 # Why does this action exist? Walk the why-chain up to its declaration
95
- /declare:visualize # ASCII tree of the full DAG with status markers
96
- /declare:prioritize M-01 # Rank actions by unblocking power (dependency weight)
97
- /declare:status # Layer counts, health indicators, integrity/alignment metrics
98
- /declare:dashboard # Live interactive DAG in the browser
99
- ```
80
+ ### 5. Execute
81
+
82
+ Press **E** on an approved action. A Claude Code agent spawns with full context: declaration → milestone → action + sibling actions. It reads your codebase, implements changes, and commits.
100
83
 
101
84
  ---
102
85
 
103
- ## The Three-Layer DAG
86
+ ## The DAG
104
87
 
105
88
  ```
106
89
  Declarations (D-XX) "What is true when this succeeds"
@@ -112,145 +95,57 @@ Milestones (M-XX) "What must be true" (derived backward)
112
95
  Actions (A-XX) "What must be done" (derived backward)
113
96
  ```
114
97
 
115
- Each layer connects to the one above through causal edges. Every action traces back to a declaration. Orphan nodes (actions without a milestone, milestones without a declaration) are detected and flagged.
116
-
117
- The graph engine (`DeclareDag`) uses dual adjacency lists for O(1) bidirectional lookups — trace upward (why-chains) or traverse downward (what depends on this) with equal efficiency.
98
+ Every action traces back to a declaration through causal edges.
118
99
 
119
100
  ---
120
101
 
121
102
  ## Dashboard
122
103
 
123
- ```
124
- /declare:dashboard
125
- ```
126
-
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
104
+ ### Lifecycle Stages
136
105
 
137
- When all plans in scope are approved, transition to execution mode — a dedicated full-screen view showing the ordered execution pipeline. Features include:
106
+ Cards are grouped into stages at each level:
138
107
 
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
108
+ | Stage | Meaning |
109
+ |-------|---------|
110
+ | **Needs Planning** | Approved, no actions yet |
111
+ | **Needs Approval** | Has unapproved items |
112
+ | **Ready to Execute** | All approved, ready to run |
113
+ | **In Execution** | Agent running |
114
+ | **Done** | Completed |
144
115
 
145
- ### Activity Panel
116
+ ### Keyboard Shortcuts
146
117
 
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.
118
+ | Key | Action |
119
+ |-----|--------|
120
+ | **P** | Plan (derive milestones/actions) |
121
+ | **A** | Approve |
122
+ | **E** | Edit / Execute |
123
+ | **D** | Delete |
124
+ | **Arrow keys** | Navigate cards, drill in/out |
125
+ | **Ctrl+Shift+A** | Approve all visible |
126
+ | **C** | Command bar |
148
127
 
149
- ### Status Colors
128
+ ### Server Discovery
150
129
 
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.
130
+ On startup, the server writes the port number to `.planning/server.port` (plain text, e.g. `3847`). On shutdown, it deletes this file. External tools can read this file to embed the dashboard in an iframe.
152
131
 
153
132
  ---
154
133
 
155
- ## Integrity & Alignment
156
-
157
- Declare doesn't just track what's done — it tracks whether commitments are being honored.
158
-
159
- ### Integrity States
160
-
161
- Every node in the graph has an integrity status:
162
-
163
- | Status | Meaning |
164
- |--------|---------|
165
- | `KEPT` | Commitment fulfilled as declared |
166
- | `HONORED` | Commitment couldn't be kept, but the honor protocol was followed |
167
- | `BROKEN` | Commitment not fulfilled, no acknowledgment |
168
- | `RENEGOTIATED` | Commitment explicitly changed through renegotiation flow |
169
-
170
- 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.
171
-
172
- ### Alignment Monitoring
173
-
174
- - **Drift detection** — Are current actions still aligned with declared futures?
175
- - **Occurrence checks** — AI verifies declarations still hold at milestone completion
176
- - **Performance scoring** — Alignment x Integrity as qualitative HIGH/MEDIUM/LOW (never numeric scores)
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
179
-
180
- ---
181
-
182
- ## Commands
183
-
184
- ### Core Workflow
185
-
186
- | Command | What it does |
187
- |---------|--------------|
188
- | `/declare:init` | Scaffold project structure and install commands |
189
- | `/declare:future` | Guided conversation to capture declared futures |
190
- | `/declare:milestones` | Derive milestones backward from declarations |
191
- | `/declare:actions [M-XX]` | Derive actions for a milestone |
192
- | `/declare:plan [M-XX]` | Research → plan → verify loop (planner + checker agents) |
193
- | `/declare:execute [M-XX]` | Wave-based execution with parallel agents |
194
-
195
- ### Planning Support
196
-
197
- | Command | What it does |
198
- |---------|--------------|
199
- | `/declare:discuss [M-XX]` | Gather milestone context through adaptive questioning |
200
- | `/declare:research [M-XX]` | Spawn 4 parallel researchers, synthesize into RESEARCH.md |
201
- | `/declare:map-codebase` | Parallel codebase analysis → `.planning/codebase/` docs |
202
-
203
- ### Quality Loop
134
+ ## CLI Commands
204
135
 
205
- | Command | What it does |
206
- |---------|--------------|
207
- | `/declare:verify [M-XX]` | Conversational UAT — validates deliverables, spawns debuggers on failure |
208
- | `/declare:audit [M-XX]` | Cross-reference actions against declarations, identify gaps |
209
- | `/declare:debug` | Systematic debugging with scientific method and checkpoint persistence |
210
-
211
- ### Navigation
136
+ The dashboard is the primary interface. All operations are also available as slash commands in Claude Code:
212
137
 
213
138
  | Command | What it does |
214
139
  |---------|--------------|
215
- | `/declare:trace <node>` | Walk the why-chain from any node up to its declaration |
216
- | `/declare:visualize` | ASCII tree of the full DAG with status markers |
217
- | `/declare:prioritize [M-XX]` | Rank actions by dependency weight (unblocking power) |
218
- | `/declare:status` | Graph health, layer counts, integrity and alignment metrics |
219
- | `/declare:dashboard` | Live interactive DAG in the browser |
220
-
221
- ### Productivity
222
-
223
- | Command | What it does |
224
- |---------|--------------|
225
- | `/declare:quick` | Ad-hoc task with atomic commit, outside milestone structure |
226
- | `/declare:add-todo` | Capture an idea or task for later |
227
- | `/declare:check-todos` | List pending todos, route to milestone or quick task |
228
-
229
- ### Session Management
230
-
231
- | Command | What it does |
232
- |---------|--------------|
233
- | `/declare:progress` | Current position, recent work summary, route to next action |
234
- | `/declare:pause` | Snapshot work state to `.continue-here.md` for safe handoff |
235
- | `/declare:resume` | Restore full context from previous session |
236
-
237
- ### Lifecycle
238
-
239
- | Command | What it does |
240
- |---------|--------------|
241
- | `/declare:new-project` | Deep context gathering, PROJECT.md + STATE.md creation |
242
- | `/declare:new-cycle` | Archive declarations, reset for next cycle |
243
- | `/declare:complete-milestone` | Snapshot graph, tag release, prepare next cycle |
244
-
245
- ### Maintenance
246
-
247
- | Command | What it does |
248
- |---------|--------------|
249
- | `/declare:health` | Diagnose `.planning/` directory health, repair issues |
250
- | `/declare:settings` | Configure workflow toggles interactively |
251
- | `/declare:set-profile` | Switch model profile (quality / balanced / budget) |
252
- | `/declare:update` | Update to latest npm version with local-patch preservation |
253
- | `/declare:reapply-patches` | Reapply local modifications after an update |
140
+ | `/declare:future` | Guided conversation to capture futures |
141
+ | `/declare:milestones` | Derive milestones from declarations |
142
+ | `/declare:actions M-XX` | Derive actions for a milestone |
143
+ | `/declare:execute M-XX` | Execute actions |
144
+ | `/declare:verify M-XX` | Conversational UAT |
145
+ | `/declare:audit M-XX` | Cross-reference against declarations |
146
+ | `/declare:trace A-XX` | Walk the why-chain to its declaration |
147
+ | `/declare:status` | Graph health and layer counts |
148
+ | `/declare:dashboard` | Open the dashboard |
254
149
  | `/declare:help` | Show all commands |
255
150
 
256
151
  ---
@@ -258,205 +153,22 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
258
153
  ## Project Structure
259
154
 
260
155
  ```
261
- FUTURE.md # Active declared futures
262
- MILESTONES.md # Active milestones
263
- FUTURE-ARCHIVE.md # Completed cycle declarations
264
-
265
156
  .planning/
266
- ├── PROJECT.md # Project context and goals
267
- ├── STATE.md # Current work state
268
- ├── config.json # Project settings
269
- ├── agent-state.json # Agent lifecycle state (server-side tracking)
157
+ ├── server.port # Active server port (auto-managed)
158
+ ├── config.json # Settings
159
+ ├── agent-state.json # Agent lifecycle state
270
160
  ├── milestones/
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
276
- └── codebase/ # Codebase analysis artifacts
277
-
278
- agents/ # Agent definitions (10 specialized agents)
279
- ├── declare-planner.md
280
- ├── declare-plan-checker.md
281
- ├── declare-executor.md
282
- ├── declare-researcher.md
283
- ├── declare-research-synthesizer.md
284
- ├── declare-codebase-mapper.md
285
- ├── declare-roadmapper.md
286
- ├── declare-verifier.md
287
- ├── declare-integration-checker.md
288
- └── declare-debugger.md
289
-
290
- workflows/ # Conversational workflow definitions
291
- ├── actions.md
292
- ├── discuss.md
293
- ├── future.md
294
- ├── milestones.md
295
- ├── scope.md
296
- └── verify.md
297
-
298
- dist/declare-tools.cjs # Bundled CLI (zero runtime deps)
299
- src/ # Source (~26K LOC)
300
- ├── graph/engine.js # DeclareDag — dual adjacency lists, Kahn's sort
301
- ├── artifacts/ # Markdown parsers/writers
302
- ├── commands/ # 40+ CLI command implementations
303
- └── server/ # HTTP API, SSE streaming, dashboard frontend
161
+ └── M-XX-slug/
162
+ └── PLAN.md # Actions for this milestone
163
+ FUTURE.md # Declared futures
164
+ MILESTONES.md # Derived milestones
304
165
  ```
305
166
 
306
167
  ---
307
168
 
308
- ## Getting Started
309
-
310
- ### Install
311
-
312
- ```bash
313
- npx declare-cc@latest
314
- ```
315
-
316
- Or install globally:
317
-
318
- ```bash
319
- npm install -g declare-cc
320
- declare # Opens dashboard for current directory
321
- ```
322
-
323
- Or clone and install locally:
324
-
325
- ```bash
326
- git clone https://github.com/decocms/declare-cc.git
327
- cd declare-cc
328
- node bin/install.js --claude --local
329
- ```
330
-
331
- Requires Node.js 18+.
332
-
333
- ### Quick Start
334
-
335
- ```
336
- /declare:init # Scaffold the project
337
- /declare:future # Declare 3-5 futures
338
- /declare:milestones # Derive milestones backward
339
- /declare:plan M-01 # Research + plan first milestone
340
- /declare:execute M-01 # Execute with wave scheduling
341
- /declare:dashboard # View the live DAG
342
- ```
343
-
344
- ### Recommended: Skip Permissions Mode
345
-
346
- Declare spawns agents and runs CLI tools frequently. For frictionless operation:
347
-
348
- ```bash
349
- claude --dangerously-skip-permissions
350
- ```
351
-
352
- <details>
353
- <summary><strong>Alternative: Granular Permissions</strong></summary>
354
-
355
- Add to `.claude/settings.json`:
356
-
357
- ```json
358
- {
359
- "permissions": {
360
- "allow": [
361
- "Bash(node:*)",
362
- "Bash(git add:*)",
363
- "Bash(git commit:*)",
364
- "Bash(git status:*)",
365
- "Bash(git log:*)",
366
- "Bash(git diff:*)"
367
- ]
368
- }
369
- }
370
- ```
371
-
372
- </details>
373
-
374
- ---
375
-
376
- ## Architecture
377
-
378
- ### Wave-Based Execution
379
-
380
- 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.
381
-
382
- ```
383
- WAVE 1 (parallel) WAVE 2 (parallel) WAVE 3
384
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
385
- │ A-01 │ │ A-02 │ │ A-03 │ │ A-04 │ │ A-05 │
386
- │ Schema │ │ Auth │→ │ API │ │ Storage │→ │ UI │
387
- └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
388
- │ │ ↑ ↑ ↑
389
- └───────────┴──────────────┴───────────┘ │
390
- A-03 needs A-01, A-04 needs A-02 │
391
- A-05 needs A-03 + A-04 │
392
- ```
393
-
394
- Each agent gets a fresh context window. Your main session stays light.
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
-
400
- ### Status Propagation
401
-
402
- The DAG maintains status consistency bottom-up:
403
-
404
- ```
405
- Actions → check produced files exist → mark DONE
406
-
407
- Milestones → all actions DONE → mark DONE
408
-
409
- Declarations → all milestones DONE → mark DONE
410
- ```
411
-
412
- ### Atomic Git Commits
413
-
414
- Every action gets its own commit:
415
-
416
- ```
417
- feat(M-01): create database schema
418
- feat(M-01): implement auth service
419
- feat(M-01): build API endpoints
420
- ```
421
-
422
- Git bisect finds the exact failing action. Each action is independently revertable.
423
-
424
- ### Zero Runtime Dependencies
425
-
426
- The entire CLI bundles to a single `dist/declare-tools.cjs` via esbuild. No `node_modules` at runtime.
427
-
428
- ---
429
-
430
- ## Fork Boundary
431
-
432
- Declare is forked from [GSD (Get Shit Done)](https://github.com/gsd-build/get-shit-done), a meta-prompting and context engineering system for Claude Code.
433
-
434
- ### What's Carried Forward
435
-
436
- - **Agent orchestration** — Planner, executor, researcher, verifier agent patterns
437
- - **Slash command interface** — `.claude/commands/` directory, markdown meta-prompts
438
- - **esbuild bundling** — Single-file CJS distribution, zero runtime deps
439
- - **Markdown artifacts** — `.planning/` directory as source of truth
440
- - **Atomic git commits** — Every state change produces a traceable commit
441
- - **Context engineering** — Fresh context per agent, structured XML plans
442
-
443
- ### What's Replaced
444
-
445
- | GSD | Declare | Why |
446
- |-----|---------|-----|
447
- | Linear phases (1, 2, 3...) | Three-layer DAG (D → M → A) | Phases are past-derived sequencing; DAGs represent causal structure |
448
- | `ROADMAP.md` | `FUTURE.md` + `MILESTONES.md` | The present is given by the future you're living into |
449
- | `STATE.md` tracking | Graph node statuses | Status lives in the graph, not a separate file |
450
- | Sequential execution | Topology-aware wave scheduling | Actions execute in causal order, not linear sequence |
451
- | Phase numbers | Milestone IDs (M-XX) | Milestones derive from declarations, not arbitrary ordering |
452
-
453
- ---
454
-
455
169
  ## License
456
170
 
457
- MIT License. See [LICENSE](LICENSE) for details.
458
-
459
- ---
171
+ MIT See [LICENSE](LICENSE).
460
172
 
461
173
  <div align="center">
462
174
 
@@ -1552,7 +1552,7 @@ var require_help = __commonJS({
1552
1552
  usage: "/declare:help"
1553
1553
  }
1554
1554
  ],
1555
- version: "1.0.0"
1555
+ version: "1.0.3"
1556
1556
  };
1557
1557
  }
1558
1558
  module2.exports = { runHelp: runHelp2 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declare-cc",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
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",