declare-cc 1.0.1 → 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,102 +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 — visible in real time through a browser 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 Actions
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
71
- ```
64
+ ### 1. Declare Futures
72
65
 
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.
66
+ Create declarations directly in the dashboard present-tense statements about your project's future. Not goals, not wishes.
74
67
 
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.
68
+ ### 2. Derive Milestones
76
69
 
77
- **Creates:** `.planning/milestones/M-XX-*/PLAN.md`
70
+ Press **P** on a declaration card. The AI works backward: "What must be true for this to hold?" Milestones appear as cards immediately.
78
71
 
79
- ### 5. Review & Execute
72
+ ### 3. Plan Actions
80
73
 
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.
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.
82
75
 
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.
76
+ ### 4. Review & Approve
84
77
 
85
- ### 6. Verify & Complete
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.
86
79
 
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
- ```
80
+ ### 5. Execute
92
81
 
93
- ### 7. Navigate
94
-
95
- ```
96
- /declare:trace A-03 # Why does this action exist? Walk the why-chain
97
- /declare:visualize # ASCII tree of the full DAG with status markers
98
- /declare:prioritize M-01 # Rank actions by unblocking power
99
- /declare:status # Layer counts, health indicators
100
- /declare:dashboard # Live interactive DAG in the browser
101
- ```
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.
102
83
 
103
84
  ---
104
85
 
105
- ## The Three-Layer DAG
86
+ ## The DAG
106
87
 
107
88
  ```
108
89
  Declarations (D-XX) "What is true when this succeeds"
@@ -114,159 +95,57 @@ Milestones (M-XX) "What must be true" (derived backward)
114
95
  Actions (A-XX) "What must be done" (derived backward)
115
96
  ```
116
97
 
117
- 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.
118
-
119
- 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.
120
99
 
121
100
  ---
122
101
 
123
102
  ## Dashboard
124
103
 
125
- ```
126
- /declare:dashboard
127
- ```
104
+ ### Lifecycle Stages
128
105
 
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:
106
+ Cards are grouped into stages at each level:
134
107
 
135
108
  | Stage | Meaning |
136
109
  |-------|---------|
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.
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
116
  ### Keyboard Shortcuts
146
117
 
147
- Single keys act on the focused card (use arrow keys to navigate):
148
-
149
118
  | Key | Action |
150
119
  |-----|--------|
151
- | **P** | Plan derive actions/milestones |
152
- | **A** | Approve the focused card |
153
- | **E** | Edit (opens inline textarea) |
120
+ | **P** | Plan (derive milestones/actions) |
121
+ | **A** | Approve |
122
+ | **E** | Edit / Execute |
154
123
  | **D** | Delete |
155
- | **Arrow Up/Down** | Move focus between cards |
156
- | **Arrow Right/Enter** | Drill into card |
157
- | **Arrow Left** | Go back one level |
124
+ | **Arrow keys** | Navigate cards, drill in/out |
158
125
  | **Ctrl+Shift+A** | Approve all visible |
159
- | **Ctrl+Shift+P** | Global plan (top-right button) |
160
-
161
- ### Activity Panel
126
+ | **C** | Command bar |
162
127
 
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".
128
+ ### Server Discovery
164
129
 
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.
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.
172
131
 
173
132
  ---
174
133
 
175
- ## Integrity & Alignment
176
-
177
- Declare doesn't just track what's done — it tracks whether commitments are being honored.
178
-
179
- ### Integrity States
180
-
181
- | Status | Meaning |
182
- |--------|---------|
183
- | `KEPT` | Commitment fulfilled as declared |
184
- | `HONORED` | Commitment couldn't be kept, but the honor protocol was followed |
185
- | `BROKEN` | Commitment not fulfilled, no acknowledgment |
186
- | `RENEGOTIATED` | Commitment explicitly changed through renegotiation flow |
187
-
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.
189
-
190
- ### Alignment Monitoring
191
-
192
- - **Drift detection** — Are current actions still aligned with declared futures?
193
- - **Occurrence checks** — AI verifies declarations still hold at milestone completion
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
196
-
197
- ---
198
-
199
- ## Commands
200
-
201
- ### Core Workflow
202
-
203
- | Command | What it does |
204
- |---------|--------------|
205
- | `/declare:init` | Scaffold project structure and install commands |
206
- | `/declare:future` | Guided conversation to capture declared futures |
207
- | `/declare:milestones` | Derive milestones backward from declarations |
208
- | `/declare:actions [M-XX]` | Derive actions for a milestone |
209
- | `/declare:execute [M-XX]` | Execute actions with full context |
210
-
211
- ### Planning Support
212
-
213
- | Command | What it does |
214
- |---------|--------------|
215
- | `/declare:discuss [M-XX]` | Gather milestone context through adaptive questioning |
216
- | `/declare:research [M-XX]` | Spawn 4 parallel researchers, synthesize into RESEARCH.md |
217
- | `/declare:map-codebase` | Parallel codebase analysis → `.planning/codebase/` docs |
218
-
219
- ### Quality Loop
220
-
221
- | Command | What it does |
222
- |---------|--------------|
223
- | `/declare:verify [M-XX]` | Conversational UAT — validates deliverables, spawns debuggers on failure |
224
- | `/declare:audit [M-XX]` | Cross-reference actions against declarations, identify gaps |
225
- | `/declare:debug` | Systematic debugging with scientific method and checkpoint persistence |
226
-
227
- ### Navigation
228
-
229
- | Command | What it does |
230
- |---------|--------------|
231
- | `/declare:trace <node>` | Walk the why-chain from any node up to its declaration |
232
- | `/declare:visualize` | ASCII tree of the full DAG with status markers |
233
- | `/declare:prioritize [M-XX]` | Rank actions by dependency weight (unblocking power) |
234
- | `/declare:status` | Graph health, layer counts, integrity and alignment metrics |
235
- | `/declare:dashboard` | Live interactive DAG in the browser |
236
-
237
- ### Productivity
238
-
239
- | Command | What it does |
240
- |---------|--------------|
241
- | `/declare:quick` | Ad-hoc task with atomic commit, outside milestone structure |
242
- | `/declare:add-todo` | Capture an idea or task for later |
243
- | `/declare:check-todos` | List pending todos, route to milestone or quick task |
244
-
245
- ### Session Management
246
-
247
- | Command | What it does |
248
- |---------|--------------|
249
- | `/declare:progress` | Current position, recent work summary, route to next action |
250
- | `/declare:pause` | Snapshot work state to `.continue-here.md` for safe handoff |
251
- | `/declare:resume` | Restore full context from previous session |
252
-
253
- ### Lifecycle
134
+ ## CLI Commands
254
135
 
255
- | Command | What it does |
256
- |---------|--------------|
257
- | `/declare:new-project` | Deep context gathering, PROJECT.md + STATE.md creation |
258
- | `/declare:new-cycle` | Archive declarations, reset for next cycle |
259
- | `/declare:complete-milestone` | Snapshot graph, tag release, prepare next cycle |
260
-
261
- ### Maintenance
136
+ The dashboard is the primary interface. All operations are also available as slash commands in Claude Code:
262
137
 
263
138
  | Command | What it does |
264
139
  |---------|--------------|
265
- | `/declare:health` | Diagnose `.planning/` directory health, repair issues |
266
- | `/declare:settings` | Configure workflow toggles interactively |
267
- | `/declare:set-profile` | Switch model profile (quality / balanced / budget) |
268
- | `/declare:update` | Update to latest npm version with local-patch preservation |
269
- | `/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 |
270
149
  | `/declare:help` | Show all commands |
271
150
 
272
151
  ---
@@ -274,172 +153,22 @@ The **honor protocol** for a commitment you can't keep: acknowledge the break, i
274
153
  ## Project Structure
275
154
 
276
155
  ```
277
- FUTURE.md # Active declared futures
278
- MILESTONES.md # Active milestones
279
- FUTURE-ARCHIVE.md # Completed cycle declarations
280
-
281
156
  .planning/
282
- ├── PROJECT.md # Project context and goals
283
- ├── STATE.md # Current work state
284
- ├── config.json # Project settings
285
- ├── agent-state.json # Agent lifecycle state
286
- ├── server.port # Active server port (auto-managed)
157
+ ├── server.port # Active server port (auto-managed)
158
+ ├── config.json # Settings
159
+ ├── agent-state.json # Agent lifecycle state
287
160
  ├── milestones/
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
293
- └── codebase/ # Codebase analysis artifacts
161
+ └── M-XX-slug/
162
+ └── PLAN.md # Actions for this milestone
163
+ FUTURE.md # Declared futures
164
+ MILESTONES.md # Derived milestones
294
165
  ```
295
166
 
296
167
  ---
297
168
 
298
- ## Getting Started
299
-
300
- ### Install
301
-
302
- ```bash
303
- npx declare-cc@latest
304
- ```
305
-
306
- Or install globally:
307
-
308
- ```bash
309
- npm install -g declare-cc
310
- declare # Opens dashboard for current directory
311
- ```
312
-
313
- Requires Node.js 18+.
314
-
315
- ### Quick Start
316
-
317
- ```
318
- /declare:init # Scaffold the project
319
- /declare:future # Declare 3-5 futures
320
- /declare:milestones # Derive milestones backward
321
- /declare:dashboard # Open the live dashboard
322
- ```
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
-
326
- ### Recommended: Skip Permissions Mode
327
-
328
- Declare spawns agents and runs CLI tools frequently. For frictionless operation:
329
-
330
- ```bash
331
- claude --dangerously-skip-permissions
332
- ```
333
-
334
- <details>
335
- <summary><strong>Alternative: Granular Permissions</strong></summary>
336
-
337
- Add to `.claude/settings.json`:
338
-
339
- ```json
340
- {
341
- "permissions": {
342
- "allow": [
343
- "Bash(node:*)",
344
- "Bash(git add:*)",
345
- "Bash(git commit:*)",
346
- "Bash(git status:*)",
347
- "Bash(git log:*)",
348
- "Bash(git diff:*)"
349
- ]
350
- }
351
- }
352
- ```
353
-
354
- </details>
355
-
356
- ---
357
-
358
- ## Architecture
359
-
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
365
-
366
- When an action executes, the AI agent receives the full why-chain:
367
-
368
- ```
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
379
- ```
380
-
381
- The executor reads the codebase, implements changes, verifies them, and commits — all autonomously.
382
-
383
- ### Status Propagation
384
-
385
- The DAG maintains status consistency bottom-up:
386
-
387
- ```
388
- Actions → check produced files exist → mark DONE
389
-
390
- Milestones → all actions DONE → mark DONE
391
-
392
- Declarations → all milestones DONE → mark DONE
393
- ```
394
-
395
- ### Atomic Git Commits
396
-
397
- Every action gets its own commit:
398
-
399
- ```
400
- feat(M-01): create database schema
401
- feat(M-01): implement auth service
402
- feat(M-01): build API endpoints
403
- ```
404
-
405
- Git bisect finds the exact failing action. Each action is independently revertable.
406
-
407
- ### Zero Runtime Dependencies
408
-
409
- The entire CLI bundles to a single `dist/declare-tools.cjs` via esbuild. No `node_modules` at runtime.
410
-
411
- ---
412
-
413
- ## Fork Boundary
414
-
415
- 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.
416
-
417
- ### What's Carried Forward
418
-
419
- - **Agent orchestration** — Planner, executor, researcher, verifier agent patterns
420
- - **Slash command interface** — `.claude/commands/` directory, markdown meta-prompts
421
- - **esbuild bundling** — Single-file CJS distribution, zero runtime deps
422
- - **Markdown artifacts** — `.planning/` directory as source of truth
423
- - **Atomic git commits** — Every state change produces a traceable commit
424
- - **Context engineering** — Fresh context per agent, structured XML plans
425
-
426
- ### What's Replaced
427
-
428
- | GSD | Declare | Why |
429
- |-----|---------|-----|
430
- | Linear phases (1, 2, 3...) | Three-layer DAG (D → M → A) | Phases are past-derived sequencing; DAGs represent causal structure |
431
- | `ROADMAP.md` | `FUTURE.md` + `MILESTONES.md` | The present is given by the future you're living into |
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 |
434
- | Phase numbers | Milestone IDs (M-XX) | Milestones derive from declarations, not arbitrary ordering |
435
-
436
- ---
437
-
438
169
  ## License
439
170
 
440
- MIT License. See [LICENSE](LICENSE) for details.
441
-
442
- ---
171
+ MIT See [LICENSE](LICENSE).
443
172
 
444
173
  <div align="center">
445
174
 
@@ -1552,7 +1552,7 @@ var require_help = __commonJS({
1552
1552
  usage: "/declare:help"
1553
1553
  }
1554
1554
  ],
1555
- version: "1.0.1"
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.1",
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",