declare-cc 1.0.8 → 2.0.0

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.
Files changed (75) hide show
  1. package/README.md +153 -187
  2. package/dist/client/assets/index-BVuhr02G.css +1 -0
  3. package/dist/client/assets/index-DujGXAYw.js +9 -0
  4. package/dist/client/index.html +23 -0
  5. package/dist/index.js +17459 -0
  6. package/package.json +38 -45
  7. package/src/agents/prompts/00-research.md +90 -0
  8. package/src/agents/prompts/01-vision.md +38 -0
  9. package/src/agents/prompts/02-declarations.md +47 -0
  10. package/src/agents/prompts/03-milestones.md +43 -0
  11. package/src/agents/prompts/04-actions.md +90 -0
  12. package/src/agents/prompts/05-execution.md +63 -0
  13. package/src/agents/prompts/06-verification.md +104 -0
  14. package/LICENSE +0 -21
  15. package/agents/declare-codebase-mapper.md +0 -761
  16. package/agents/declare-debugger.md +0 -1198
  17. package/agents/declare-executor.md +0 -353
  18. package/agents/declare-integration-checker.md +0 -440
  19. package/agents/declare-plan-checker.md +0 -608
  20. package/agents/declare-planner.md +0 -1015
  21. package/agents/declare-research-synthesizer.md +0 -309
  22. package/agents/declare-researcher.md +0 -484
  23. package/agents/declare-roadmapper.md +0 -639
  24. package/agents/declare-verifier.md +0 -555
  25. package/bin/declare.js +0 -16
  26. package/bin/install.js +0 -1907
  27. package/commands/declare/actions.md +0 -113
  28. package/commands/declare/add-todo.md +0 -41
  29. package/commands/declare/audit.md +0 -76
  30. package/commands/declare/check-todos.md +0 -125
  31. package/commands/declare/complete-milestone.md +0 -215
  32. package/commands/declare/dashboard.md +0 -65
  33. package/commands/declare/debug.md +0 -162
  34. package/commands/declare/discuss.md +0 -65
  35. package/commands/declare/execute.md +0 -521
  36. package/commands/declare/future.md +0 -72
  37. package/commands/declare/health.md +0 -92
  38. package/commands/declare/help.md +0 -31
  39. package/commands/declare/init.md +0 -39
  40. package/commands/declare/map-codebase.md +0 -149
  41. package/commands/declare/milestones.md +0 -98
  42. package/commands/declare/new-cycle.md +0 -172
  43. package/commands/declare/new-project.md +0 -565
  44. package/commands/declare/pause.md +0 -138
  45. package/commands/declare/plan.md +0 -320
  46. package/commands/declare/prioritize.md +0 -65
  47. package/commands/declare/progress.md +0 -116
  48. package/commands/declare/quick.md +0 -119
  49. package/commands/declare/reapply-patches.md +0 -178
  50. package/commands/declare/research.md +0 -267
  51. package/commands/declare/resume.md +0 -146
  52. package/commands/declare/set-profile.md +0 -66
  53. package/commands/declare/settings.md +0 -119
  54. package/commands/declare/status.md +0 -65
  55. package/commands/declare/trace.md +0 -81
  56. package/commands/declare/update.md +0 -251
  57. package/commands/declare/verify.md +0 -65
  58. package/commands/declare/visualize.md +0 -74
  59. package/dist/declare-tools.cjs +0 -9439
  60. package/dist/public/app.js +0 -8331
  61. package/dist/public/index.html +0 -3939
  62. package/hooks/declare-activity.js +0 -106
  63. package/hooks/declare-check-update.js +0 -62
  64. package/hooks/declare-server.js +0 -116
  65. package/hooks/declare-statusline.js +0 -91
  66. package/scripts/build-hooks.js +0 -42
  67. package/scripts/release.js +0 -50
  68. package/templates/future.md +0 -4
  69. package/templates/milestones.md +0 -11
  70. package/workflows/actions.md +0 -89
  71. package/workflows/discuss.md +0 -476
  72. package/workflows/future.md +0 -185
  73. package/workflows/milestones.md +0 -87
  74. package/workflows/scope.md +0 -94
  75. package/workflows/verify.md +0 -504
@@ -1,31 +0,0 @@
1
- ---
2
- description: Show available Declare commands
3
- allowed-tools:
4
- - Read
5
- - Bash
6
- ---
7
-
8
- Show the Declare command reference.
9
-
10
- **Step 1: Run the help tool.**
11
-
12
- ```bash
13
- node dist/declare-tools.cjs help
14
- ```
15
-
16
- Parse the JSON output.
17
-
18
- **Step 2: Format the help display.**
19
-
20
- Display a clean command reference:
21
-
22
- **Header:** "Declare -- Future-first project planning"
23
-
24
- **Brief description:** Declare lets you define what you want to be true about the future, then builds a causal graph of milestones and actions to get there. It validates structural integrity and tracks progress through the graph.
25
-
26
- **Available Commands:** For each command in the JSON output, display:
27
- - Command name (bold)
28
- - Description
29
- - Usage example
30
-
31
- **Version:** Show the version number at the bottom.
@@ -1,39 +0,0 @@
1
- ---
2
- description: Initialize Declare project with future declarations and graph structure
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- ---
10
-
11
- Initialize a Declare project in the current working directory.
12
-
13
- **Step 1: Run the init tool.**
14
-
15
- ```bash
16
- node dist/declare-tools.cjs init $ARGUMENTS
17
- ```
18
-
19
- Parse the JSON output. It will contain:
20
- - `initialized`: whether initialization succeeded
21
- - `created`: list of files that were created
22
- - `existing`: list of files that already existed
23
- - `committed`: whether a git commit was made
24
-
25
- **Step 2: Handle existing files.**
26
-
27
- If the `existing` array is non-empty, present the existing files to the user and ask which ones they want to keep vs replace. For each file they want to replace:
28
- 1. Delete the existing file
29
- 2. Re-run `node dist/declare-tools.cjs init` to recreate it
30
-
31
- **Step 3: Report results.**
32
-
33
- Show the user a brief summary of what was created (file name + one-line purpose). If a commit was made, mention the hash.
34
-
35
- Then immediately prompt the user to start declaring:
36
-
37
- > **Ready. Run `/declare:future` to declare what's true when this project succeeds.**
38
-
39
- Do not suggest editing files manually or running `/declare:status`. The next step is always `/declare:future`.
@@ -1,149 +0,0 @@
1
- ---
2
- name: declare:map-codebase
3
- description: Analyze codebase with parallel mapper agents to produce .planning/codebase/ documents
4
- argument-hint: "[optional: specific area to map, e.g., 'api' or 'auth']"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Glob
9
- - Grep
10
- - Write
11
- - Task
12
- ---
13
-
14
- <objective>
15
- Analyze existing codebase using parallel declare-codebase-mapper agents to produce structured codebase documents.
16
-
17
- Each mapper agent explores a focus area and **writes documents directly** to `.planning/codebase/`. The orchestrator only receives confirmations, keeping context usage minimal.
18
-
19
- Output: .planning/codebase/ folder with 7 structured documents about the codebase state.
20
- </objective>
21
-
22
- <context>
23
- Focus area: $ARGUMENTS (optional - if provided, tells agents to focus on specific subsystem)
24
-
25
- **Load project state if exists:**
26
- Check for .planning/STATE.md - loads context if project already initialized
27
-
28
- **This command can run:**
29
- - Before /declare:init (brownfield codebases) - creates codebase map first
30
- - After /declare:init (greenfield codebases) - updates codebase map as code evolves
31
- - Anytime to refresh codebase understanding
32
- </context>
33
-
34
- <when_to_use>
35
- **Use map-codebase for:**
36
- - Brownfield projects before initialization (understand existing code first)
37
- - Refreshing codebase map after significant changes
38
- - Onboarding to an unfamiliar codebase
39
- - Before major refactoring (understand current state)
40
- - When STATE.md references outdated codebase info
41
-
42
- **Skip map-codebase for:**
43
- - Greenfield projects with no code yet (nothing to map)
44
- - Trivial codebases (<5 files)
45
- </when_to_use>
46
-
47
- <process>
48
-
49
- ## Step 1: Check existing map
50
-
51
- ```bash
52
- ls .planning/codebase/ 2>/dev/null
53
- ```
54
-
55
- If `.planning/codebase/` already exists and contains documents, ask the user:
56
- - **Refresh** — re-run all 4 agents and overwrite existing documents
57
- - **Update** — re-run only specific focus areas (ask which ones)
58
- - **Skip** — use existing map as-is and proceed
59
-
60
- If directory doesn't exist or is empty, proceed directly to Step 2.
61
-
62
- ## Step 2: Create directory structure
63
-
64
- ```bash
65
- mkdir -p .planning/codebase
66
- ```
67
-
68
- ## Step 3: Secret scan
69
-
70
- Before spawning agents, verify no secrets are in scope:
71
-
72
- ```bash
73
- # Check for .env files in working directory
74
- ls .env* 2>/dev/null && echo "WARNING: .env files present - agents will note existence only, never read contents"
75
- ```
76
-
77
- Remind yourself: agents must never read `.env`, credentials, keys, or any file listed in `<forbidden_files>` within the mapper agent definition.
78
-
79
- ## Step 4: Spawn 4 parallel mapper agents
80
-
81
- Spawn all four agents simultaneously using the Task tool:
82
-
83
- ```
84
- Agent 1: declare-codebase-mapper
85
- Focus: tech
86
- Task: Analyze technology stack and external integrations. Write STACK.md and INTEGRATIONS.md to .planning/codebase/
87
-
88
- Agent 2: declare-codebase-mapper
89
- Focus: arch
90
- Task: Analyze architecture and file structure. Write ARCHITECTURE.md and STRUCTURE.md to .planning/codebase/
91
-
92
- Agent 3: declare-codebase-mapper
93
- Focus: quality
94
- Task: Analyze coding conventions and testing patterns. Write CONVENTIONS.md and TESTING.md to .planning/codebase/
95
-
96
- Agent 4: declare-codebase-mapper
97
- Focus: concerns
98
- Task: Identify technical debt and issues. Write CONCERNS.md to .planning/codebase/
99
- ```
100
-
101
- Wait for all 4 agents to complete. Collect only their confirmation messages (NOT document contents).
102
-
103
- ## Step 5: Verify output
104
-
105
- ```bash
106
- wc -l .planning/codebase/*.md 2>/dev/null
107
- ```
108
-
109
- Confirm all 7 documents exist:
110
- - `.planning/codebase/STACK.md`
111
- - `.planning/codebase/INTEGRATIONS.md`
112
- - `.planning/codebase/ARCHITECTURE.md`
113
- - `.planning/codebase/STRUCTURE.md`
114
- - `.planning/codebase/CONVENTIONS.md`
115
- - `.planning/codebase/TESTING.md`
116
- - `.planning/codebase/CONCERNS.md`
117
-
118
- If any document is missing, re-spawn the relevant agent for that focus area.
119
-
120
- ## Step 6: Commit codebase map
121
-
122
- ```bash
123
- git add .planning/codebase/
124
- git commit -m "docs: add codebase map (.planning/codebase/)"
125
- ```
126
-
127
- If git is not initialized, skip this step and note it.
128
-
129
- ## Step 7: Report and next steps
130
-
131
- Report a summary of what was mapped:
132
- - Documents created and their line counts
133
- - Key findings surfaced (from agent confirmations only — do NOT read document contents)
134
-
135
- Offer next steps based on context:
136
- - If no .planning/STATE.md: suggest `/declare:init` to initialize project planning
137
- - If .planning/STATE.md exists: suggest `/declare:plan-phase` to plan next work using the map
138
- - If significant concerns were found: highlight that CONCERNS.md has issues worth reviewing before planning
139
-
140
- </process>
141
-
142
- <success_criteria>
143
- - [ ] .planning/codebase/ directory created
144
- - [ ] All 7 codebase documents written by mapper agents
145
- - [ ] Documents follow template structure
146
- - [ ] Parallel agents completed without errors
147
- - [ ] Codebase map committed to git
148
- - [ ] User knows next steps
149
- </success_criteria>
@@ -1,98 +0,0 @@
1
- ---
2
- description: Derive milestones backward from declared futures
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- - AskUserQuestion
10
- argument-hint: "[D-XX]"
11
- ---
12
-
13
- Derive milestones by working backward from declared futures.
14
-
15
- **Step 1: Load current graph state.**
16
-
17
- ```bash
18
- node dist/declare-tools.cjs load-graph
19
- ```
20
-
21
- Parse the JSON output. If the output contains an `error` field, tell the user to run `/declare:init` first and stop.
22
-
23
- If no declarations exist in the graph, tell the user to run `/declare:future` first and stop.
24
-
25
- Note all declarations and milestones from the graph -- the workflow needs full context.
26
-
27
- **Step 2: Scope review (first-time derivation only).**
28
-
29
- Skip this step if `$ARGUMENTS` contains a specific declaration ID (e.g., `D-01`) — targeted re-derivation skips scope review.
30
-
31
- Otherwise, check if any milestones already exist in the graph. If milestones already exist, this is a re-derivation — skip scope review and proceed to Step 3.
32
-
33
- If this is the first time deriving milestones (no milestones in the graph yet), run the scope review workflow before deriving anything:
34
-
35
- @workflows/scope.md
36
-
37
- Pass all declarations from the loaded graph into the scope workflow. After the scope is confirmed, continue to Step 3.
38
-
39
- **Step 3: Determine derivation scope.**
40
-
41
- - If `$ARGUMENTS` contains a declaration ID (e.g., `D-01`), derive only for that specific declaration.
42
- - Otherwise, derive for all declarations that have no milestones yet (declarations with empty milestones arrays in the graph).
43
-
44
- **Step 4: Follow the milestone derivation workflow.**
45
-
46
- Read and follow the full workflow instructions:
47
-
48
- @workflows/milestones.md
49
-
50
- Pass the loaded graph state into the workflow so it knows about existing declarations and milestones.
51
-
52
- **Step 5: Per-declaration milestone confirmation with checkboxes.**
53
-
54
- After the workflow proposes milestones for a declaration, present them using AskUserQuestion with multi-select checkboxes:
55
-
56
- ```
57
- Use AskUserQuestion to present proposed milestones as a checklist. The user checks which milestones to accept. Format:
58
-
59
- Which of these milestones should we create for D-XX?
60
- - [ ] Milestone A -- because [reason]
61
- - [ ] Milestone B -- because [reason]
62
- - [ ] Milestone C -- because [reason]
63
- ```
64
-
65
- **Step 6: Persist all accepted milestones in one batch call.**
66
-
67
- Build a JSON array of the checked milestones, then create them all at once:
68
-
69
- ```bash
70
- node dist/declare-tools.cjs add-milestones --json '[{"title":"Milestone A","realizes":"D-XX"},{"title":"Milestone B","realizes":"D-XX"}]'
71
- ```
72
-
73
- This creates all milestones and makes a single git commit. Parse the JSON output — it returns `{ milestones: [{ id, title, realizes, status }], committed, hash }`.
74
-
75
- **Step 7: Inconsistency flagging.**
76
-
77
- If milestones already exist for a declaration being processed (re-derivation case):
78
- - Show existing milestones for that declaration
79
- - Ask the user if they still align with the declaration
80
- - Offer to keep, re-derive, or adjust
81
- - Do NOT auto-reconcile -- the user decides what to update
82
-
83
- **Step 8: Show summary and suggest next step.**
84
-
85
- After all declarations processed:
86
-
87
- 1. Reload the graph to get final counts:
88
- ```bash
89
- node dist/declare-tools.cjs load-graph
90
- ```
91
-
92
- 2. Start the dashboard if not already running (dashboard updates live when files change):
93
- ```bash
94
- curl -sf http://localhost:3847/api/graph -o /dev/null || (node dist/declare-tools.cjs serve --port 3847 > /tmp/declare-dashboard.log 2>&1 & sleep 1 && open http://localhost:3847 2>/dev/null || true)
95
- ```
96
-
97
- 3. Show summary: declarations processed, milestones derived.
98
- 4. Suggest: "Milestones are live in the dashboard → http://localhost:3847 — Run `/declare:actions` to derive action plans."
@@ -1,172 +0,0 @@
1
- ---
2
- description: Start a new Declare cycle — archive current declarations to FUTURE-ARCHIVE.md, reset FUTURE.md and MILESTONES.md, preserve PROJECT.md and STATE.md
3
- allowed-tools:
4
- - Read
5
- - Write
6
- - Bash
7
- - Glob
8
- - Grep
9
- - AskUserQuestion
10
- argument-hint: "[milestone focus, e.g., 'v1.1 Web Dashboard']"
11
- ---
12
-
13
- Start a new Declare milestone cycle. Archives the current declarations to FUTURE-ARCHIVE.md, resets FUTURE.md and MILESTONES.md for fresh declarations, and preserves project memory in PROJECT.md and STATE.md.
14
-
15
- **Step 0: Determine milestone focus.**
16
-
17
- Parse `$ARGUMENTS` for a milestone name or focus description.
18
-
19
- If `$ARGUMENTS` is empty or contains no useful text, ask: "What's the focus of this next milestone? (e.g., 'v1.1 Web Dashboard', 'v2.0 Collaborative Features')"
20
-
21
- **Step 1: Load project context.**
22
-
23
- Read the current project state:
24
-
25
- ```bash
26
- cat .planning/PROJECT.md
27
- cat .planning/STATE.md
28
- cat .planning/FUTURE.md
29
- cat .planning/MILESTONES.md
30
- ```
31
-
32
- If `.planning/PROJECT.md` does not exist, tell the user to run `/declare:init` first and stop.
33
-
34
- Present a summary of what was in the current milestone:
35
-
36
- ```
37
- ## Current Milestone Summary
38
-
39
- **Declarations ([N] total):**
40
- - D-01: [statement snippet]
41
- - D-02: [statement snippet]
42
-
43
- **Milestones ([N] total):**
44
- - M-XX: [title] ([status])
45
- - M-YY: [title] ([status])
46
-
47
- **About to start:** [milestone focus from Step 0]
48
- ```
49
-
50
- **Step 2: Archive previous declarations to FUTURE-ARCHIVE.md.**
51
-
52
- Read `.planning/FUTURE.md` to get all current declarations.
53
-
54
- Append the current declarations to `.planning/FUTURE-ARCHIVE.md` (create if it does not exist), with a versioned header:
55
-
56
- ```markdown
57
- ---
58
-
59
- ## Archived: [previous milestone version or "v[N]"] — [today's date]
60
-
61
- **Milestone focus:** [previous milestone focus, if known from PROJECT.md or STATE.md]
62
-
63
- [Full content of current FUTURE.md — all declarations as-is]
64
- ```
65
-
66
- After appending, verify the archive was written:
67
-
68
- ```bash
69
- cat .planning/FUTURE-ARCHIVE.md | tail -20
70
- ```
71
-
72
- Report: "Archived [N] declarations to .planning/FUTURE-ARCHIVE.md"
73
-
74
- **Step 3: Reset FUTURE.md.**
75
-
76
- Overwrite `.planning/FUTURE.md` with an empty template:
77
-
78
- ```markdown
79
- # Future: [project name from PROJECT.md]
80
-
81
- <!-- Declarations for [new milestone focus] will be added here. -->
82
- <!-- Run /declare:future to declare the new milestone's futures. -->
83
- ```
84
-
85
- Extract the project name from `.planning/PROJECT.md` (look for the `# Future:` or `# Project:` heading, or use the directory name as fallback).
86
-
87
- **Step 4: Reset MILESTONES.md.**
88
-
89
- Overwrite `.planning/MILESTONES.md` with an empty table:
90
-
91
- ```markdown
92
- # Milestones: [project name]
93
-
94
- ## Milestones
95
-
96
- | ID | Title | Status | Realizes | Plan |
97
- |----|-------|--------|----------|------|
98
- ```
99
-
100
- This table is empty — new milestones will be derived from the new declarations via `/declare:milestones`.
101
-
102
- **Step 5: Update STATE.md session.**
103
-
104
- Read `.planning/STATE.md` and update the session fields. Preserve all existing content (project context, decisions, todos) — only update:
105
-
106
- - `Last session`: today's date
107
- - `Stopped at`: "Started [new milestone focus] — awaiting new declarations"
108
- - If there is a `## Current Position` or `## Status` section, update it to reflect the new cycle beginning
109
-
110
- Write the updated STATE.md back.
111
-
112
- Example update (preserve all other sections unchanged):
113
-
114
- ```markdown
115
- ## Session Continuity
116
-
117
- Last session: [today]
118
- Stopped at: Started [new milestone focus] — awaiting new declarations via /declare:future
119
- ```
120
-
121
- **Step 6: Commit reset.**
122
-
123
- Stage and commit the reset files:
124
-
125
- ```bash
126
- git add .planning/FUTURE.md .planning/MILESTONES.md .planning/FUTURE-ARCHIVE.md .planning/STATE.md
127
- git commit -m "chore: start new milestone cycle -- [new milestone focus]
128
-
129
- - FUTURE-ARCHIVE.md: archived [N] declarations from previous cycle
130
- - FUTURE.md: reset for new declarations
131
- - MILESTONES.md: reset for new milestones
132
- - STATE.md: updated session
133
- "
134
- ```
135
-
136
- **Step 7: Show next steps.**
137
-
138
- ```
139
- ## New Milestone Cycle Started
140
-
141
- **Focus:** [new milestone focus]
142
-
143
- **What was preserved:**
144
- - .planning/PROJECT.md (project memory, validated requirements, decisions)
145
- - .planning/STATE.md (session continuity, todos, blockers)
146
-
147
- **What was reset:**
148
- - .planning/FUTURE.md (empty — ready for new declarations)
149
- - .planning/MILESTONES.md (empty — ready for derived milestones)
150
- - .planning/FUTURE-ARCHIVE.md (archived [N] previous declarations)
151
-
152
- ---
153
-
154
- **Next step:** Declare the futures for this milestone.
155
-
156
- Run /declare:future
157
- ```
158
-
159
- **Error handling:**
160
-
161
- - If `.planning/FUTURE.md` is already empty or has no declarations, warn: "FUTURE.md appears to be empty — nothing to archive. Continue to reset MILESTONES.md? (yes/no)"
162
- - If `.planning/MILESTONES.md` still has PENDING or ACTIVE milestones, warn: "Warning: [N] milestones are not yet complete. Run /declare:complete-milestone first to archive the current version, then run /declare:new-milestone."
163
- - If git commit fails, display the error and instruct the user to commit manually.
164
-
165
- **Key patterns:**
166
-
167
- - PROJECT.md and STATE.md are project memory — they persist across milestone cycles and are NEVER reset.
168
- - FUTURE.md and MILESTONES.md are milestone-scoped — they reset every cycle.
169
- - FUTURE-ARCHIVE.md is append-only — previous declarations are never deleted, only archived.
170
- - This command does NOT create new declarations — it resets the slate for /declare:future.
171
- - Scope of the next milestone is set by asking "What's the focus?" not by writing declarations yet.
172
- - After this command: /declare:future -> /declare:milestones -> /declare:actions -> /declare:execute