declare-cc 1.0.1 → 1.0.4
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 +73 -344
- package/dist/declare-tools.cjs +45 -34
- package/package.json +1 -1
- package/scripts/release.js +1 -1
package/README.md
CHANGED
|
@@ -7,102 +7,83 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/declare-cc)
|
|
8
8
|
[](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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
20
|
+
```bash
|
|
21
|
+
npm install --save-dev declare-cc
|
|
22
|
+
```
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
Add a script to `package.json`:
|
|
34
25
|
|
|
35
|
-
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"scripts": {
|
|
29
|
+
"plan": "dcl"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
Run it:
|
|
38
35
|
|
|
39
|
-
```
|
|
40
|
-
|
|
36
|
+
```bash
|
|
37
|
+
npm run plan
|
|
41
38
|
```
|
|
42
39
|
|
|
43
|
-
|
|
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
|
-
|
|
42
|
+
Or run directly:
|
|
46
43
|
|
|
47
|
-
```
|
|
48
|
-
|
|
44
|
+
```bash
|
|
45
|
+
npx dcl
|
|
49
46
|
```
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
Requires Node.js 18+.
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
---
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
## What This Is
|
|
56
53
|
|
|
57
|
-
|
|
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
|
-
|
|
58
|
+
---
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
## How It Works
|
|
66
61
|
|
|
67
|
-
|
|
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
|
-
|
|
66
|
+
Create declarations directly in the dashboard — present-tense statements about your project's future. Not goals, not wishes.
|
|
74
67
|
|
|
75
|
-
|
|
68
|
+
### 2. Derive Milestones
|
|
76
69
|
|
|
77
|
-
**
|
|
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
|
-
###
|
|
72
|
+
### 3. Plan Actions
|
|
80
73
|
|
|
81
|
-
|
|
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
|
-
|
|
76
|
+
### 4. Review & Approve
|
|
84
77
|
|
|
85
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
138
|
-
| **Needs Approval** | Has unapproved items
|
|
139
|
-
| **Ready to Execute** | All
|
|
140
|
-
| **In Execution** |
|
|
141
|
-
| **Done** | Completed
|
|
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
|
|
152
|
-
| **A** | Approve
|
|
153
|
-
| **E** | Edit
|
|
120
|
+
| **P** | Plan (derive milestones/actions) |
|
|
121
|
+
| **A** | Approve |
|
|
122
|
+
| **E** | Edit / Execute |
|
|
154
123
|
| **D** | Delete |
|
|
155
|
-
| **Arrow
|
|
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
|
-
| **
|
|
160
|
-
|
|
161
|
-
### Activity Panel
|
|
126
|
+
| **C** | Command bar |
|
|
162
127
|
|
|
163
|
-
|
|
128
|
+
### Server Discovery
|
|
164
129
|
|
|
165
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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:
|
|
266
|
-
| `/declare:
|
|
267
|
-
| `/declare:
|
|
268
|
-
| `/declare:
|
|
269
|
-
| `/declare:
|
|
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
|
-
├──
|
|
283
|
-
├──
|
|
284
|
-
├──
|
|
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
|
-
│
|
|
289
|
-
│
|
|
290
|
-
|
|
291
|
-
|
|
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
|
|
441
|
-
|
|
442
|
-
---
|
|
171
|
+
MIT — See [LICENSE](LICENSE).
|
|
443
172
|
|
|
444
173
|
<div align="center">
|
|
445
174
|
|
package/dist/declare-tools.cjs
CHANGED
|
@@ -1552,7 +1552,7 @@ var require_help = __commonJS({
|
|
|
1552
1552
|
usage: "/declare:help"
|
|
1553
1553
|
}
|
|
1554
1554
|
],
|
|
1555
|
-
version: "1.0.
|
|
1555
|
+
version: "1.0.4"
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
1558
|
module2.exports = { runHelp: runHelp2 };
|
|
@@ -8905,13 +8905,17 @@ data: ${JSON.stringify({ reason: "delete", nodeId: id })}
|
|
|
8905
8905
|
});
|
|
8906
8906
|
}
|
|
8907
8907
|
async function startServer(cwd, port) {
|
|
8908
|
-
const preferredPort = port || parseInt(process.env.PORT || "", 10) ||
|
|
8909
|
-
const
|
|
8910
|
-
const server = createServer(cwd,
|
|
8911
|
-
await new Promise((resolve) => {
|
|
8912
|
-
server.listen(
|
|
8908
|
+
const preferredPort = port || parseInt(process.env.PORT || "", 10) || 0;
|
|
8909
|
+
const listenPort = preferredPort === 0 ? 0 : await findFreePort(preferredPort);
|
|
8910
|
+
const server = createServer(cwd, listenPort);
|
|
8911
|
+
const resolvedPort = await new Promise((resolve) => {
|
|
8912
|
+
server.listen(listenPort, "127.0.0.1", () => {
|
|
8913
|
+
const assigned = (
|
|
8914
|
+
/** @type {import('net').AddressInfo} */
|
|
8915
|
+
server.address().port
|
|
8916
|
+
);
|
|
8913
8917
|
watchPlanning(cwd);
|
|
8914
|
-
resolve(
|
|
8918
|
+
resolve(assigned);
|
|
8915
8919
|
});
|
|
8916
8920
|
});
|
|
8917
8921
|
const portFilePath = require("path").join(cwd, ".planning", "server.port");
|
|
@@ -8941,7 +8945,6 @@ data: ${JSON.stringify({ reason: "delete", nodeId: id })}
|
|
|
8941
8945
|
var require_serve = __commonJS({
|
|
8942
8946
|
"src/commands/serve.js"(exports2, module2) {
|
|
8943
8947
|
"use strict";
|
|
8944
|
-
var { spawn } = require("child_process");
|
|
8945
8948
|
var { startServer } = require_server();
|
|
8946
8949
|
function parsePortFlag(args) {
|
|
8947
8950
|
const idx = args.indexOf("--port");
|
|
@@ -8950,13 +8953,8 @@ var require_serve = __commonJS({
|
|
|
8950
8953
|
return Number.isNaN(value) ? void 0 : value;
|
|
8951
8954
|
}
|
|
8952
8955
|
async function runServe2(cwd, args) {
|
|
8953
|
-
const port = parsePortFlag(args)
|
|
8956
|
+
const port = parsePortFlag(args);
|
|
8954
8957
|
const { server, port: resolvedPort, url } = await startServer(cwd, port);
|
|
8955
|
-
const noOpen = args.includes("--no-open") || process.env.DECLARE_NO_OPEN;
|
|
8956
|
-
if (!noOpen) {
|
|
8957
|
-
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
8958
|
-
spawn(opener, [url], { stdio: "ignore", detached: true }).unref();
|
|
8959
|
-
}
|
|
8960
8958
|
process.on("SIGINT", () => {
|
|
8961
8959
|
server.close(() => process.exit(0));
|
|
8962
8960
|
});
|
|
@@ -8991,12 +8989,17 @@ var require_open = __commonJS({
|
|
|
8991
8989
|
});
|
|
8992
8990
|
});
|
|
8993
8991
|
}
|
|
8994
|
-
async function
|
|
8992
|
+
async function waitForPortFile(portFile, maxAttempts = 30, intervalMs = 200) {
|
|
8995
8993
|
for (let i = 0; i < maxAttempts; i++) {
|
|
8996
|
-
|
|
8994
|
+
try {
|
|
8995
|
+
const content = fs.readFileSync(portFile, "utf8").trim();
|
|
8996
|
+
const port = parseInt(content, 10);
|
|
8997
|
+
if (!isNaN(port) && port > 0) return port;
|
|
8998
|
+
} catch (_) {
|
|
8999
|
+
}
|
|
8997
9000
|
await new Promise((r) => setTimeout(r, intervalMs));
|
|
8998
9001
|
}
|
|
8999
|
-
return
|
|
9002
|
+
return null;
|
|
9000
9003
|
}
|
|
9001
9004
|
async function runOpen2(cwd, args) {
|
|
9002
9005
|
const planningDir = path.join(cwd, ".planning");
|
|
@@ -9008,25 +9011,33 @@ var require_open = __commonJS({
|
|
|
9008
9011
|
}
|
|
9009
9012
|
}
|
|
9010
9013
|
const portFile = path.join(cwd, ".planning", "server.port");
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
console.error("[declare] Warning: server may not be ready yet");
|
|
9014
|
+
if (fs.existsSync(portFile)) {
|
|
9015
|
+
const existingPort = parseInt(fs.readFileSync(portFile, "utf8").trim(), 10);
|
|
9016
|
+
if (!isNaN(existingPort) && existingPort > 0) {
|
|
9017
|
+
const isRunning = await checkServer(existingPort);
|
|
9018
|
+
if (isRunning) {
|
|
9019
|
+
console.log(`Dashboard: http://localhost:${existingPort}`);
|
|
9020
|
+
return;
|
|
9021
|
+
}
|
|
9022
|
+
try {
|
|
9023
|
+
fs.unlinkSync(portFile);
|
|
9024
|
+
} catch (_) {
|
|
9025
|
+
}
|
|
9024
9026
|
}
|
|
9025
9027
|
}
|
|
9026
|
-
const
|
|
9027
|
-
const
|
|
9028
|
-
|
|
9029
|
-
|
|
9028
|
+
const bundlePath = path.resolve(__dirname, "declare-tools.cjs");
|
|
9029
|
+
const child = spawn(process.execPath, [bundlePath, "serve"], {
|
|
9030
|
+
cwd,
|
|
9031
|
+
detached: true,
|
|
9032
|
+
stdio: "ignore"
|
|
9033
|
+
});
|
|
9034
|
+
child.unref();
|
|
9035
|
+
const port = await waitForPortFile(portFile);
|
|
9036
|
+
if (!port) {
|
|
9037
|
+
console.error("[declare] Server failed to start (no port file after 6s)");
|
|
9038
|
+
process.exit(1);
|
|
9039
|
+
}
|
|
9040
|
+
console.log(`Dashboard: http://localhost:${port}`);
|
|
9030
9041
|
}
|
|
9031
9042
|
module2.exports = { runOpen: runOpen2 };
|
|
9032
9043
|
}
|
package/package.json
CHANGED
package/scripts/release.js
CHANGED
|
@@ -40,7 +40,7 @@ run('npm run build');
|
|
|
40
40
|
// 3. Commit + tag
|
|
41
41
|
run(`git add package.json package-lock.json dist/`);
|
|
42
42
|
run(`git commit -m "chore: bump version to ${version}"`);
|
|
43
|
-
run(`git tag v${version}`);
|
|
43
|
+
run(`git tag -f v${version}`);
|
|
44
44
|
|
|
45
45
|
console.log(`
|
|
46
46
|
Done. To publish:
|