declare-cc 0.1.0 → 0.3.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 (77) hide show
  1. package/README.md +126 -27
  2. package/agents/declare-codebase-mapper.md +761 -0
  3. package/agents/declare-debugger.md +1198 -0
  4. package/agents/declare-plan-checker.md +608 -0
  5. package/agents/declare-planner.md +1015 -0
  6. package/agents/declare-research-synthesizer.md +309 -0
  7. package/agents/declare-researcher.md +484 -0
  8. package/commands/declare/actions.md +41 -20
  9. package/commands/declare/add-todo.md +41 -0
  10. package/commands/declare/audit.md +76 -0
  11. package/commands/declare/check-todos.md +125 -0
  12. package/commands/declare/complete-milestone.md +215 -0
  13. package/commands/declare/dashboard.md +76 -0
  14. package/commands/{gsd → declare}/debug.md +11 -11
  15. package/commands/declare/discuss.md +65 -0
  16. package/commands/declare/execute.md +518 -0
  17. package/commands/declare/health.md +92 -0
  18. package/commands/declare/help.md +31 -0
  19. package/commands/declare/init.md +36 -0
  20. package/commands/declare/map-codebase.md +149 -0
  21. package/commands/declare/milestones.md +7 -7
  22. package/commands/declare/new-milestone.md +172 -0
  23. package/commands/declare/new-project.md +565 -0
  24. package/commands/declare/pause.md +138 -0
  25. package/commands/declare/plan.md +236 -0
  26. package/commands/declare/prioritize.md +65 -0
  27. package/commands/declare/progress.md +116 -0
  28. package/commands/declare/quick.md +119 -0
  29. package/commands/declare/reapply-patches.md +178 -0
  30. package/commands/declare/research.md +267 -0
  31. package/commands/declare/resume.md +146 -0
  32. package/commands/declare/set-profile.md +66 -0
  33. package/commands/declare/settings.md +119 -0
  34. package/commands/declare/status.md +14 -11
  35. package/commands/declare/trace.md +81 -0
  36. package/commands/declare/update.md +251 -0
  37. package/commands/declare/verify.md +64 -0
  38. package/commands/declare/visualize.md +74 -0
  39. package/dist/declare-tools.cjs +1234 -3
  40. package/package.json +4 -2
  41. package/templates/future.md +4 -0
  42. package/templates/milestones.md +11 -0
  43. package/workflows/actions.md +89 -0
  44. package/workflows/discuss.md +476 -0
  45. package/workflows/future.md +185 -0
  46. package/workflows/milestones.md +87 -0
  47. package/workflows/verify.md +504 -0
  48. package/commands/gsd/add-phase.md +0 -39
  49. package/commands/gsd/add-todo.md +0 -42
  50. package/commands/gsd/audit-milestone.md +0 -42
  51. package/commands/gsd/check-todos.md +0 -41
  52. package/commands/gsd/cleanup.md +0 -18
  53. package/commands/gsd/complete-milestone.md +0 -136
  54. package/commands/gsd/discuss-phase.md +0 -87
  55. package/commands/gsd/execute-phase.md +0 -42
  56. package/commands/gsd/health.md +0 -22
  57. package/commands/gsd/help.md +0 -22
  58. package/commands/gsd/insert-phase.md +0 -33
  59. package/commands/gsd/join-discord.md +0 -18
  60. package/commands/gsd/list-phase-assumptions.md +0 -50
  61. package/commands/gsd/map-codebase.md +0 -71
  62. package/commands/gsd/new-milestone.md +0 -51
  63. package/commands/gsd/new-project.md +0 -42
  64. package/commands/gsd/new-project.md.bak +0 -1041
  65. package/commands/gsd/pause-work.md +0 -35
  66. package/commands/gsd/plan-milestone-gaps.md +0 -40
  67. package/commands/gsd/plan-phase.md +0 -44
  68. package/commands/gsd/progress.md +0 -24
  69. package/commands/gsd/quick.md +0 -40
  70. package/commands/gsd/reapply-patches.md +0 -110
  71. package/commands/gsd/remove-phase.md +0 -32
  72. package/commands/gsd/research-phase.md +0 -187
  73. package/commands/gsd/resume-work.md +0 -40
  74. package/commands/gsd/set-profile.md +0 -34
  75. package/commands/gsd/settings.md +0 -36
  76. package/commands/gsd/update.md +0 -37
  77. package/commands/gsd/verify-work.md +0 -39
@@ -0,0 +1,149 @@
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>
@@ -15,7 +15,7 @@ Derive milestones by working backward from declared futures.
15
15
  **Step 1: Load current graph state.**
16
16
 
17
17
  ```bash
18
- node /Users/guilherme/Projects/get-shit-done/dist/declare-tools.cjs load-graph
18
+ node dist/declare-tools.cjs load-graph
19
19
  ```
20
20
 
21
21
  Parse the JSON output. If the output contains an `error` field, tell the user to run `/declare:init` first and stop.
@@ -33,7 +33,7 @@ Note all declarations and milestones from the graph -- the workflow needs full c
33
33
 
34
34
  Read and follow the full workflow instructions:
35
35
 
36
- @/Users/guilherme/Projects/get-shit-done/workflows/milestones.md
36
+ @workflows/milestones.md
37
37
 
38
38
  Pass the loaded graph state into the workflow so it knows about existing declarations and milestones.
39
39
 
@@ -50,15 +50,15 @@ Which of these milestones should we create for D-XX?
50
50
  - [ ] Milestone C -- because [reason]
51
51
  ```
52
52
 
53
- **Step 5: Persist each accepted milestone.**
53
+ **Step 5: Persist all accepted milestones in one batch call.**
54
54
 
55
- For each checked milestone:
55
+ Build a JSON array of the checked milestones, then create them all at once:
56
56
 
57
57
  ```bash
58
- node /Users/guilherme/Projects/get-shit-done/dist/declare-tools.cjs add-milestone --title "Milestone Title" --realizes "D-XX"
58
+ node dist/declare-tools.cjs add-milestones --json '[{"title":"Milestone A","realizes":"D-XX"},{"title":"Milestone B","realizes":"D-XX"}]'
59
59
  ```
60
60
 
61
- Parse the JSON output to confirm the milestone was created and note its assigned ID.
61
+ This creates all milestones and makes a single git commit. Parse the JSON output it returns `{ milestones: [{ id, title, realizes, status }], committed, hash }`.
62
62
 
63
63
  **Step 6: Inconsistency flagging.**
64
64
 
@@ -74,7 +74,7 @@ After all declarations processed:
74
74
 
75
75
  1. Reload the graph to get final counts:
76
76
  ```bash
77
- node /Users/guilherme/Projects/get-shit-done/dist/declare-tools.cjs load-graph
77
+ node dist/declare-tools.cjs load-graph
78
78
  ```
79
79
 
80
80
  2. Show summary: declarations processed, milestones derived.
@@ -0,0 +1,172 @@
1
+ ---
2
+ description: Start a new Declare milestone cycle — archive declarations, 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