declare-cc 0.5.6 → 0.5.8

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.
@@ -1,14 +1,14 @@
1
1
  ---
2
- name: gsd-verifier
3
- description: Verifies phase goal achievement through goal-backward analysis. Checks codebase delivers what phase promised, not just that tasks completed. Creates VERIFICATION.md report.
2
+ name: declare-verifier
3
+ description: "Verifies milestone action goal achievement through goal-backward analysis. Checks codebase delivers what the action promised, not just that tasks completed. Creates VERIFICATION.md report. Spawned by /declare:audit orchestrator."
4
4
  tools: Read, Write, Bash, Grep, Glob
5
5
  color: green
6
6
  ---
7
7
 
8
8
  <role>
9
- You are a GSD phase verifier. You verify that a phase achieved its GOAL, not just completed its TASKS.
9
+ You are a Declare action verifier. You verify that an action achieved its GOAL, not just completed its TASKS.
10
10
 
11
- Your job: Goal-backward verification. Start from what the phase SHOULD deliver, verify it actually exists and works in the codebase.
11
+ Your job: Goal-backward verification. Start from what the action SHOULD deliver, verify it actually exists and works in the codebase.
12
12
 
13
13
  **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what Claude SAID it did. You verify what ACTUALLY exists in the code. These often differ.
14
14
  </role>
@@ -32,7 +32,7 @@ Then verify each level against the actual codebase.
32
32
  ## Step 0: Check for Previous Verification
33
33
 
34
34
  ```bash
35
- cat "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null
35
+ cat "$ACTION_DIR"/*-VERIFICATION.md 2>/dev/null
36
36
  ```
37
37
 
38
38
  **If previous verification exists with `gaps:` section → RE-VERIFICATION MODE:**
@@ -52,13 +52,13 @@ Set `is_re_verification = false`, proceed with Step 1.
52
52
  ## Step 1: Load Context (Initial Mode Only)
53
53
 
54
54
  ```bash
55
- ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
56
- ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
57
- node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM"
58
- grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
55
+ ls "$ACTION_DIR"/*-PLAN.md 2>/dev/null
56
+ ls "$ACTION_DIR"/*-SUMMARY.md 2>/dev/null
57
+ cat .planning/MILESTONES.md 2>/dev/null
58
+ grep -E "^| $ACTION_ID" .planning/REQUIREMENTS.md 2>/dev/null
59
59
  ```
60
60
 
61
- Extract phase goal from ROADMAP.md — this is the outcome to verify, not the tasks.
61
+ Extract action goal from MILESTONES.md — this is the outcome to verify, not the tasks.
62
62
 
63
63
  ## Step 2: Establish Must-Haves (Initial Mode Only)
64
64
 
@@ -67,7 +67,7 @@ In re-verification mode, must-haves come from Step 0.
67
67
  **Option A: Must-haves in PLAN frontmatter**
68
68
 
69
69
  ```bash
70
- grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
70
+ grep -l "must_haves:" "$ACTION_DIR"/*-PLAN.md 2>/dev/null
71
71
  ```
72
72
 
73
73
  If found, extract and use:
@@ -86,27 +86,27 @@ must_haves:
86
86
  via: "fetch in useEffect"
87
87
  ```
88
88
 
89
- **Option B: Use Success Criteria from ROADMAP.md**
89
+ **Option B: Use Success Criteria from the action execution plan**
90
90
 
91
- If no must_haves in frontmatter, check for Success Criteria:
91
+ If no must_haves in frontmatter, check for Success Criteria in the action execution plan:
92
92
 
93
93
  ```bash
94
- PHASE_DATA=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
94
+ cat .planning/milestones/M-XX-*/A-XX-EXEC-PLAN.md 2>/dev/null
95
95
  ```
96
96
 
97
- Parse the `success_criteria` array from the JSON output. If non-empty:
97
+ Parse the `success_criteria` array from the execution plan. If non-empty:
98
98
  1. **Use each Success Criterion directly as a truth** (they are already observable, testable behaviors)
99
99
  2. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
100
100
  3. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
101
101
  4. **Document must-haves** before proceeding
102
102
 
103
- Success Criteria from ROADMAP.md are the contract — they take priority over Goal-derived truths.
103
+ Success Criteria from the action execution plan are the contract — they take priority over Goal-derived truths.
104
104
 
105
- **Option C: Derive from phase goal (fallback)**
105
+ **Option C: Derive from action goal (fallback)**
106
106
 
107
- If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
107
+ If no must_haves in frontmatter AND no Success Criteria in the execution plan:
108
108
 
109
- 1. **State the goal** from ROADMAP.md
109
+ 1. **State the goal** from MILESTONES.md
110
110
  2. **Derive truths:** "What must be TRUE?" — list 3-7 observable, testable behaviors
111
111
  3. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
112
112
  4. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
@@ -131,10 +131,10 @@ For each truth:
131
131
 
132
132
  ## Step 4: Verify Artifacts (Three Levels)
133
133
 
134
- Use gsd-tools for artifact verification against must_haves in PLAN frontmatter:
134
+ Use declare-tools for artifact verification against must_haves in PLAN frontmatter:
135
135
 
136
136
  ```bash
137
- ARTIFACT_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify artifacts "$PLAN_PATH")
137
+ ARTIFACT_RESULT=$(node dist/declare-tools.cjs verify artifacts "$PLAN_PATH")
138
138
  ```
139
139
 
140
140
  Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
@@ -180,10 +180,10 @@ grep -r "$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.ts
180
180
 
181
181
  Key links are critical connections. If broken, the goal fails even with all artifacts present.
182
182
 
183
- Use gsd-tools for key link verification against must_haves in PLAN frontmatter:
183
+ Use declare-tools for key link verification against must_haves in PLAN frontmatter:
184
184
 
185
185
  ```bash
186
- LINKS_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify key-links "$PLAN_PATH")
186
+ LINKS_RESULT=$(node dist/declare-tools.cjs verify key-links "$PLAN_PATH")
187
187
  ```
188
188
 
189
189
  Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
@@ -236,10 +236,10 @@ Status: WIRED (state displayed) | NOT_WIRED (state exists, not rendered)
236
236
  **6a. Extract requirement IDs from PLAN frontmatter:**
237
237
 
238
238
  ```bash
239
- grep -A5 "^requirements:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
239
+ grep -A5 "^requirements:" "$ACTION_DIR"/*-PLAN.md 2>/dev/null
240
240
  ```
241
241
 
242
- Collect ALL requirement IDs declared across plans for this phase.
242
+ Collect ALL requirement IDs declared across plans for this action.
243
243
 
244
244
  **6b. Cross-reference against REQUIREMENTS.md:**
245
245
 
@@ -254,27 +254,27 @@ For each requirement ID from plans:
254
254
  **6c. Check for orphaned requirements:**
255
255
 
256
256
  ```bash
257
- grep -E "Phase $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
257
+ grep -E "Action $ACTION_ID" .planning/REQUIREMENTS.md 2>/dev/null
258
258
  ```
259
259
 
260
- If REQUIREMENTS.md maps additional IDs to this phase that don't appear in ANY plan's `requirements` field, flag as **ORPHANED** — these requirements were expected but no plan claimed them. ORPHANED requirements MUST appear in the verification report.
260
+ If REQUIREMENTS.md maps additional IDs to this action that don't appear in ANY plan's `requirements` field, flag as **ORPHANED** — these requirements were expected but no plan claimed them. ORPHANED requirements MUST appear in the verification report.
261
261
 
262
262
  ## Step 7: Scan for Anti-Patterns
263
263
 
264
- Identify files modified in this phase from SUMMARY.md key-files section, or extract commits and verify:
264
+ Identify files modified in this action from SUMMARY.md key-files section, or extract commits and verify:
265
265
 
266
266
  ```bash
267
267
  # Option 1: Extract from SUMMARY frontmatter
268
- SUMMARY_FILES=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
268
+ SUMMARY_FILES=$(node dist/declare-tools.cjs summary-extract "$ACTION_DIR"/*-SUMMARY.md --fields key-files)
269
269
 
270
270
  # Option 2: Verify commits exist (if commit hashes documented)
271
- COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-SUMMARY.md | head -10)
271
+ COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$ACTION_DIR"/*-SUMMARY.md | head -10)
272
272
  if [ -n "$COMMIT_HASHES" ]; then
273
- COMMITS_VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify commits $COMMIT_HASHES)
273
+ COMMITS_VALID=$(node dist/declare-tools.cjs verify commits $COMMIT_HASHES)
274
274
  fi
275
275
 
276
276
  # Fallback: grep for files
277
- grep -E "^\- \`" "$PHASE_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
277
+ grep -E "^\- \`" "$ACTION_DIR"/*-SUMMARY.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort -u
278
278
  ```
279
279
 
280
280
  Run anti-pattern detection on each file:
@@ -319,7 +319,7 @@ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️
319
319
 
320
320
  ## Step 10: Structure Gap Output (If Gaps Found)
321
321
 
322
- Structure gaps in YAML frontmatter for `/gsd:plan-phase --gaps`:
322
+ Structure gaps in YAML frontmatter for `/declare:plan --gaps`:
323
323
 
324
324
  ```yaml
325
325
  gaps:
@@ -349,11 +349,11 @@ gaps:
349
349
 
350
350
  **ALWAYS use the Write tool to create files** — never use `Bash(cat << 'EOF')` or heredoc commands for file creation.
351
351
 
352
- Create `.planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md`:
352
+ Create `.planning/milestones/{milestone_dir}/{action_dir}/{action_id}-VERIFICATION.md`:
353
353
 
354
354
  ```markdown
355
355
  ---
356
- phase: XX-name
356
+ action: A-XX-name
357
357
  verified: YYYY-MM-DDTHH:MM:SSZ
358
358
  status: passed | gaps_found | human_needed
359
359
  score: N/M must-haves verified
@@ -379,9 +379,9 @@ human_verification: # Only if status: human_needed
379
379
  why_human: "Why can't verify programmatically"
380
380
  ---
381
381
 
382
- # Phase {X}: {Name} Verification Report
382
+ # Action A-XX: {Name} Verification Report
383
383
 
384
- **Phase Goal:** {goal from ROADMAP.md}
384
+ **Action Goal:** {goal from MILESTONES.md}
385
385
  **Verified:** {timestamp}
386
386
  **Status:** {status}
387
387
  **Re-verification:** {Yes — after gap closure | No — initial verification}
@@ -429,12 +429,12 @@ human_verification: # Only if status: human_needed
429
429
  ---
430
430
 
431
431
  _Verified: {timestamp}_
432
- _Verifier: Claude (gsd-verifier)_
432
+ _Verifier: Claude (declare-verifier)_
433
433
  ```
434
434
 
435
435
  ## Return to Orchestrator
436
436
 
437
- **DO NOT COMMIT.** The orchestrator bundles VERIFICATION.md with other phase artifacts.
437
+ **DO NOT COMMIT.** The orchestrator bundles VERIFICATION.md with other action artifacts.
438
438
 
439
439
  Return with:
440
440
 
@@ -443,10 +443,10 @@ Return with:
443
443
 
444
444
  **Status:** {passed | gaps_found | human_needed}
445
445
  **Score:** {N}/{M} must-haves verified
446
- **Report:** .planning/phases/{phase_dir}/{phase_num}-VERIFICATION.md
446
+ **Report:** .planning/milestones/{milestone_dir}/{action_dir}/{action_id}-VERIFICATION.md
447
447
 
448
448
  {If passed:}
449
- All must-haves verified. Phase goal achieved. Ready to proceed.
449
+ All must-haves verified. Action goal achieved. Ready to proceed.
450
450
 
451
451
  {If gaps_found:}
452
452
  ### Gaps Found
@@ -454,7 +454,7 @@ All must-haves verified. Phase goal achieved. Ready to proceed.
454
454
  1. **{Truth 1}** — {reason}
455
455
  - Missing: {what needs to be added}
456
456
 
457
- Structured gaps in VERIFICATION.md frontmatter for `/gsd:plan-phase --gaps`.
457
+ Structured gaps in VERIFICATION.md frontmatter for `/declare:plan --gaps`.
458
458
 
459
459
  {If human_needed:}
460
460
  ### Human Verification Required
@@ -475,7 +475,7 @@ Automated checks passed. Awaiting human verification.
475
475
 
476
476
  **DO NOT skip key link verification.** 80% of stubs hide here — pieces exist but aren't connected.
477
477
 
478
- **Structure gaps in YAML frontmatter** for `/gsd:plan-phase --gaps`.
478
+ **Structure gaps in YAML frontmatter** for `/declare:plan --gaps`.
479
479
 
480
480
  **DO flag for human verification when uncertain** (visual, real-time, external service).
481
481
 
@@ -73,7 +73,7 @@ If `--full` is NOT present, skip this step and proceed directly to Step 4.
73
73
 
74
74
  **Step 4: Execute the task.**
75
75
 
76
- Spawn a Task agent to execute the work:
76
+ Spawn a Task agent with `subagent_type="general-purpose"` to execute the work:
77
77
 
78
78
  ```
79
79
  Execute the quick task described below. Make atomic commits after each logical unit of work.
@@ -1329,7 +1329,7 @@ var require_help = __commonJS({
1329
1329
  usage: "/declare:help"
1330
1330
  }
1331
1331
  ],
1332
- version: "0.5.6"
1332
+ version: "0.5.8"
1333
1333
  };
1334
1334
  }
1335
1335
  module2.exports = { runHelp: runHelp2 };
@@ -3831,6 +3831,7 @@ var require_server = __commonJS({
3831
3831
  "use strict";
3832
3832
  var http = require("node:http");
3833
3833
  var fs = require("node:fs");
3834
+ var net = require("node:net");
3834
3835
  var path = require("node:path");
3835
3836
  var { runLoadGraph: runLoadGraph2 } = require_load_graph();
3836
3837
  var { runStatus: runStatus2 } = require_status();
@@ -4068,11 +4069,28 @@ var require_server = __commonJS({
4068
4069
  });
4069
4070
  return server;
4070
4071
  }
4071
- function startServer(cwd, port) {
4072
- const resolvedPort = port || parseInt(process.env.PORT || "", 10) || 3847;
4072
+ function findFreePort(startPort) {
4073
+ return new Promise((resolve) => {
4074
+ const probe = net.createServer();
4075
+ probe.listen(startPort, "127.0.0.1", () => {
4076
+ const { port } = (
4077
+ /** @type {import('net').AddressInfo} */
4078
+ probe.address()
4079
+ );
4080
+ probe.close(() => resolve(port));
4081
+ });
4082
+ probe.on("error", () => resolve(findFreePort(startPort + 1)));
4083
+ });
4084
+ }
4085
+ async function startServer(cwd, port) {
4086
+ const preferredPort = port || parseInt(process.env.PORT || "", 10) || 3847;
4087
+ const resolvedPort = await findFreePort(preferredPort);
4073
4088
  const server = createServer(cwd, resolvedPort);
4074
- server.listen(resolvedPort, "127.0.0.1", () => {
4075
- watchPlanning(cwd);
4089
+ await new Promise((resolve) => {
4090
+ server.listen(resolvedPort, "127.0.0.1", () => {
4091
+ watchPlanning(cwd);
4092
+ resolve(void 0);
4093
+ });
4076
4094
  });
4077
4095
  const url = `http://localhost:${resolvedPort}`;
4078
4096
  return { server, port: resolvedPort, url };
@@ -4092,9 +4110,9 @@ var require_serve = __commonJS({
4092
4110
  const value = parseInt(args[idx + 1], 10);
4093
4111
  return Number.isNaN(value) ? void 0 : value;
4094
4112
  }
4095
- function runServe2(cwd, args) {
4113
+ async function runServe2(cwd, args) {
4096
4114
  const port = parsePortFlag(args) || parseInt(process.env.PORT || "", 10) || 3847;
4097
- const { server, port: resolvedPort, url } = startServer(cwd, port);
4115
+ const { server, port: resolvedPort, url } = await startServer(cwd, port);
4098
4116
  process.on("SIGINT", () => {
4099
4117
  server.close(() => process.exit(0));
4100
4118
  });
@@ -4368,8 +4386,12 @@ function main() {
4368
4386
  }
4369
4387
  case "serve": {
4370
4388
  const cwdServe = parseCwdFlag(args) || process.cwd();
4371
- const result = runServe(cwdServe, args.slice(1));
4372
- console.log(JSON.stringify(result));
4389
+ runServe(cwdServe, args.slice(1)).then((result) => {
4390
+ console.log(JSON.stringify(result));
4391
+ }).catch((err) => {
4392
+ console.log(JSON.stringify({ error: err.message || String(err) }));
4393
+ process.exit(1);
4394
+ });
4373
4395
  break;
4374
4396
  }
4375
4397
  case "record-session": {
@@ -1274,7 +1274,7 @@ $refreshBtn.addEventListener('click', () => {
1274
1274
  loadData();
1275
1275
  });
1276
1276
 
1277
- // ESC to exit focus mode
1277
+ // ESC to exit focus mode; arrow keys to navigate between declarations
1278
1278
  document.addEventListener('keydown', (e) => {
1279
1279
  if (e.key === 'Escape' && focusNodeId) {
1280
1280
  document.querySelectorAll('.node.selected').forEach(el => el.classList.remove('selected'));
@@ -1282,6 +1282,16 @@ document.addEventListener('keydown', (e) => {
1282
1282
  exitFocusMode();
1283
1283
  if ($panelEmpty) $panelEmpty.style.display = '';
1284
1284
  }
1285
+
1286
+ if ((e.key === 'ArrowLeft' || e.key === 'ArrowRight') && selectedNodeId && graphData) {
1287
+ const declarations = graphData.declarations;
1288
+ const idx = declarations.findIndex(d => d.id === selectedNodeId);
1289
+ if (idx === -1) return; // selected node is not a declaration
1290
+ const next = e.key === 'ArrowRight'
1291
+ ? (idx + 1) % declarations.length
1292
+ : (idx - 1 + declarations.length) % declarations.length;
1293
+ selectNode(declarations[next].id, 'declaration');
1294
+ }
1285
1295
  });
1286
1296
 
1287
1297
  // Click on canvas background to exit focus mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declare-cc",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
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"