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.
- package/README.md +126 -27
- package/agents/declare-codebase-mapper.md +761 -0
- package/agents/declare-debugger.md +1198 -0
- package/agents/declare-plan-checker.md +608 -0
- package/agents/declare-planner.md +1015 -0
- package/agents/declare-research-synthesizer.md +309 -0
- package/agents/declare-researcher.md +484 -0
- package/commands/declare/actions.md +41 -20
- package/commands/declare/add-todo.md +41 -0
- package/commands/declare/audit.md +76 -0
- package/commands/declare/check-todos.md +125 -0
- package/commands/declare/complete-milestone.md +215 -0
- package/commands/declare/dashboard.md +76 -0
- package/commands/{gsd → declare}/debug.md +11 -11
- package/commands/declare/discuss.md +65 -0
- package/commands/declare/execute.md +518 -0
- package/commands/declare/health.md +92 -0
- package/commands/declare/help.md +31 -0
- package/commands/declare/init.md +36 -0
- package/commands/declare/map-codebase.md +149 -0
- package/commands/declare/milestones.md +7 -7
- package/commands/declare/new-milestone.md +172 -0
- package/commands/declare/new-project.md +565 -0
- package/commands/declare/pause.md +138 -0
- package/commands/declare/plan.md +236 -0
- package/commands/declare/prioritize.md +65 -0
- package/commands/declare/progress.md +116 -0
- package/commands/declare/quick.md +119 -0
- package/commands/declare/reapply-patches.md +178 -0
- package/commands/declare/research.md +267 -0
- package/commands/declare/resume.md +146 -0
- package/commands/declare/set-profile.md +66 -0
- package/commands/declare/settings.md +119 -0
- package/commands/declare/status.md +14 -11
- package/commands/declare/trace.md +81 -0
- package/commands/declare/update.md +251 -0
- package/commands/declare/verify.md +64 -0
- package/commands/declare/visualize.md +74 -0
- package/dist/declare-tools.cjs +1234 -3
- package/package.json +4 -2
- package/templates/future.md +4 -0
- package/templates/milestones.md +11 -0
- package/workflows/actions.md +89 -0
- package/workflows/discuss.md +476 -0
- package/workflows/future.md +185 -0
- package/workflows/milestones.md +87 -0
- package/workflows/verify.md +504 -0
- package/commands/gsd/add-phase.md +0 -39
- package/commands/gsd/add-todo.md +0 -42
- package/commands/gsd/audit-milestone.md +0 -42
- package/commands/gsd/check-todos.md +0 -41
- package/commands/gsd/cleanup.md +0 -18
- package/commands/gsd/complete-milestone.md +0 -136
- package/commands/gsd/discuss-phase.md +0 -87
- package/commands/gsd/execute-phase.md +0 -42
- package/commands/gsd/health.md +0 -22
- package/commands/gsd/help.md +0 -22
- package/commands/gsd/insert-phase.md +0 -33
- package/commands/gsd/join-discord.md +0 -18
- package/commands/gsd/list-phase-assumptions.md +0 -50
- package/commands/gsd/map-codebase.md +0 -71
- package/commands/gsd/new-milestone.md +0 -51
- package/commands/gsd/new-project.md +0 -42
- package/commands/gsd/new-project.md.bak +0 -1041
- package/commands/gsd/pause-work.md +0 -35
- package/commands/gsd/plan-milestone-gaps.md +0 -40
- package/commands/gsd/plan-phase.md +0 -44
- package/commands/gsd/progress.md +0 -24
- package/commands/gsd/quick.md +0 -40
- package/commands/gsd/reapply-patches.md +0 -110
- package/commands/gsd/remove-phase.md +0 -32
- package/commands/gsd/research-phase.md +0 -187
- package/commands/gsd/resume-work.md +0 -40
- package/commands/gsd/set-profile.md +0 -34
- package/commands/gsd/settings.md +0 -36
- package/commands/gsd/update.md +0 -37
- package/commands/gsd/verify-work.md +0 -39
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: declare:plan
|
|
3
|
+
description: Create detailed EXEC-PLAN files for milestone actions with planner/checker verification loop
|
|
4
|
+
argument-hint: "[M-XX] [--skip-research]"
|
|
5
|
+
agent: declare-planner
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Task
|
|
13
|
+
- WebFetch
|
|
14
|
+
- mcp__context7__*
|
|
15
|
+
---
|
|
16
|
+
<objective>
|
|
17
|
+
Create executable EXEC-PLAN files for all actions in a milestone with integrated verification.
|
|
18
|
+
|
|
19
|
+
**Default flow:** Load context → optional research check → spawn declare-planner → spawn declare-plan-checker → if issues spawn planner for revision (max 3 iterations) → commit
|
|
20
|
+
|
|
21
|
+
**Orchestrator role:** Parse arguments, validate milestone, load context, spawn declare-planner, verify with declare-plan-checker, iterate until pass or max iterations, present results.
|
|
22
|
+
</objective>
|
|
23
|
+
|
|
24
|
+
<context>
|
|
25
|
+
Milestone: $ARGUMENTS (matching pattern M-XX, e.g. M-01)
|
|
26
|
+
|
|
27
|
+
**Flags:**
|
|
28
|
+
- `--skip-research` — Skip research check, go straight to planning
|
|
29
|
+
</context>
|
|
30
|
+
|
|
31
|
+
<process>
|
|
32
|
+
|
|
33
|
+
**Step 1: Parse arguments.**
|
|
34
|
+
|
|
35
|
+
Extract milestone ID from `$ARGUMENTS` (pattern `M-XX`). If not provided or unrecognized, list available milestones:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node dist/declare-tools.cjs load-graph
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Parse the JSON output. Display a numbered list of milestones with their status and action counts. Ask the user which milestone to plan.
|
|
42
|
+
|
|
43
|
+
Check if `--skip-research` is present in `$ARGUMENTS`.
|
|
44
|
+
|
|
45
|
+
**Step 2: Load milestone data.**
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
node dist/declare-tools.cjs load-graph --milestone M-XX
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Parse the JSON output. Extract:
|
|
52
|
+
- `milestone`: milestone ID and title
|
|
53
|
+
- `declarations`: array of declaration IDs and statements
|
|
54
|
+
- `actions`: array of `{id, title, produces, dependsOn, status}`
|
|
55
|
+
- `milestoneFolderPath`: path to the milestone planning folder
|
|
56
|
+
- `researchPath`: path to RESEARCH.md if it exists
|
|
57
|
+
- `contextPath`: path to CONTEXT.md if it exists
|
|
58
|
+
|
|
59
|
+
If no actions found, display: "No actions found for M-XX. Run `/declare:actions M-XX` first to create the milestone plan." and exit.
|
|
60
|
+
|
|
61
|
+
If all actions already have EXEC-PLANs and status is not PENDING, display: "All actions for M-XX already have EXEC-PLANs. Use `/declare:execute M-XX` to run them." and exit.
|
|
62
|
+
|
|
63
|
+
**Step 3: Research check (unless --skip-research).**
|
|
64
|
+
|
|
65
|
+
If `researchPath` exists, display:
|
|
66
|
+
```
|
|
67
|
+
RESEARCH.md found at [researchPath]. Using existing research.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If `researchPath` does not exist, assess whether research is needed:
|
|
71
|
+
|
|
72
|
+
- If actions involve new external libraries, external APIs, or major architectural decisions → suggest research:
|
|
73
|
+
```
|
|
74
|
+
Research recommended for M-XX ([title]).
|
|
75
|
+
Actions involve: [brief reason, e.g., "new external service integration"].
|
|
76
|
+
Run `/declare:research M-XX` first, or pass --skip-research to plan without research.
|
|
77
|
+
```
|
|
78
|
+
Ask: "Proceed without research? (yes/no)" If no, exit.
|
|
79
|
+
|
|
80
|
+
- If actions are purely internal (refactoring, adding features to existing patterns, docs) → skip silently.
|
|
81
|
+
|
|
82
|
+
**Step 4: Load context files.**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cat [contextPath] 2>/dev/null # CONTEXT.md if exists
|
|
86
|
+
cat [researchPath] 2>/dev/null # RESEARCH.md if exists
|
|
87
|
+
cat .planning/MILESTONES.md # Full milestones for declaration context
|
|
88
|
+
cat .planning/FUTURE.md 2>/dev/null # Declarations source of truth
|
|
89
|
+
cat .planning/STATE.md 2>/dev/null # Current position and decisions
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Also read the milestone's PLAN.md (at `milestoneFolderPath/PLAN.md`) for action details.
|
|
93
|
+
|
|
94
|
+
**Step 5: Spawn declare-planner.**
|
|
95
|
+
|
|
96
|
+
Spawn a Task agent using `agents/declare-planner.md` with the following prompt:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
Plan milestone ${MILESTONE} actions.
|
|
100
|
+
|
|
101
|
+
Context loaded:
|
|
102
|
+
- Milestone: [milestone title]
|
|
103
|
+
- Declarations: [D-XX: statement, ...]
|
|
104
|
+
- Actions: [A-XX: title (produces: ..., dependsOn: [...])]
|
|
105
|
+
- Milestone folder: [milestoneFolderPath]
|
|
106
|
+
- CONTEXT.md: [contents or "not found"]
|
|
107
|
+
- RESEARCH.md: [contents or "not found"]
|
|
108
|
+
- MILESTONES.md: [relevant milestone section]
|
|
109
|
+
- FUTURE.md: [relevant declaration statements]
|
|
110
|
+
- STATE.md decisions: [relevant decisions]
|
|
111
|
+
|
|
112
|
+
For each action, create an EXEC-PLAN file at:
|
|
113
|
+
[milestoneFolderPath]/[action-id]-EXEC-PLAN.md
|
|
114
|
+
|
|
115
|
+
Follow all instructions in agents/declare-planner.md.
|
|
116
|
+
Return: PLANNING COMPLETE with wave structure and EXEC-PLANs created.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Wait for the planner to complete.
|
|
120
|
+
|
|
121
|
+
**Step 6: Spawn declare-plan-checker.**
|
|
122
|
+
|
|
123
|
+
After planner completes, spawn a Task agent using `agents/declare-plan-checker.md` with the following prompt:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Verify EXEC-PLAN files for milestone ${MILESTONE}.
|
|
127
|
+
|
|
128
|
+
Context:
|
|
129
|
+
- Milestone: [milestone title]
|
|
130
|
+
- Declarations: [D-XX: statement, ...]
|
|
131
|
+
- Milestone folder: [milestoneFolderPath]
|
|
132
|
+
- CONTEXT.md: [contents or "not found"]
|
|
133
|
+
- MILESTONES.md: [relevant milestone section]
|
|
134
|
+
|
|
135
|
+
EXEC-PLANs to verify:
|
|
136
|
+
[list of EXEC-PLAN file paths created by planner]
|
|
137
|
+
|
|
138
|
+
Follow all instructions in agents/declare-plan-checker.md.
|
|
139
|
+
Return: VERIFICATION PASSED or ISSUES FOUND with structured issues YAML.
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Wait for the checker to complete.
|
|
143
|
+
|
|
144
|
+
**Step 7: Evaluate checker result.**
|
|
145
|
+
|
|
146
|
+
Parse the checker's return.
|
|
147
|
+
|
|
148
|
+
If **VERIFICATION PASSED**: proceed to Step 9.
|
|
149
|
+
|
|
150
|
+
If **ISSUES FOUND**: proceed to Step 8 (revision loop).
|
|
151
|
+
|
|
152
|
+
**Step 8: Revision loop (max 3 iterations).**
|
|
153
|
+
|
|
154
|
+
Track revision count. If revision count >= 3, skip to Step 9 with a warning.
|
|
155
|
+
|
|
156
|
+
Spawn declare-planner again in revision mode:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Revise EXEC-PLAN files for milestone ${MILESTONE} based on checker feedback.
|
|
160
|
+
|
|
161
|
+
This is revision attempt [N] of 3.
|
|
162
|
+
|
|
163
|
+
Checker issues found:
|
|
164
|
+
[paste the structured issues YAML from checker]
|
|
165
|
+
|
|
166
|
+
Existing EXEC-PLANs:
|
|
167
|
+
[list of EXEC-PLAN file paths]
|
|
168
|
+
|
|
169
|
+
Context:
|
|
170
|
+
- Milestone folder: [milestoneFolderPath]
|
|
171
|
+
- CONTEXT.md: [contents or "not found"]
|
|
172
|
+
|
|
173
|
+
Follow revision_mode instructions in agents/declare-planner.md.
|
|
174
|
+
Make targeted fixes only — do not rewrite working plans.
|
|
175
|
+
Return: REVISION COMPLETE with changes made.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
After revision, re-run checker (Step 6). Increment revision count.
|
|
179
|
+
|
|
180
|
+
Repeat until VERIFICATION PASSED or revision count reaches 3.
|
|
181
|
+
|
|
182
|
+
**Step 9: Commit EXEC-PLANs.**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
node dist/declare-tools.cjs commit "docs(${MILESTONE}): create exec-plans for milestone actions" --files [space-separated list of EXEC-PLAN file paths]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Step 10: Present results.**
|
|
189
|
+
|
|
190
|
+
Display final summary:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
## Planning Complete: M-XX — [milestone title]
|
|
194
|
+
|
|
195
|
+
**Actions planned:** [N] action(s) in [M] wave(s)
|
|
196
|
+
**Checker:** [PASSED | PASSED after N revision(s) | Warning: max revisions reached]
|
|
197
|
+
|
|
198
|
+
### Wave Structure
|
|
199
|
+
|
|
200
|
+
| Wave | Actions | Autonomous |
|
|
201
|
+
| ---- | ------- | ---------- |
|
|
202
|
+
| 1 | A-01, A-02 | yes, yes |
|
|
203
|
+
| 2 | A-03 | no (has checkpoint) |
|
|
204
|
+
|
|
205
|
+
### EXEC-PLANs Created
|
|
206
|
+
|
|
207
|
+
| Action | Title | Tasks | Wave |
|
|
208
|
+
| ------ | ----- | ----- | ---- |
|
|
209
|
+
| A-01 | [title] | [N] | 1 |
|
|
210
|
+
| A-02 | [title] | [N] | 1 |
|
|
211
|
+
|
|
212
|
+
### Next Steps
|
|
213
|
+
|
|
214
|
+
Execute: `/declare:execute M-XX`
|
|
215
|
+
|
|
216
|
+
/clear first — fresh context window
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If max revisions reached with issues remaining, display blocker list prominently:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
### Remaining Issues (not resolved after 3 revisions)
|
|
223
|
+
|
|
224
|
+
[list issues with fix hints]
|
|
225
|
+
|
|
226
|
+
Consider reviewing EXEC-PLANs manually at: [milestoneFolderPath]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Error handling:**
|
|
230
|
+
|
|
231
|
+
- If `load-graph` returns an error, display it and exit.
|
|
232
|
+
- If planner fails to create EXEC-PLANs, display the error and suggest checking the milestone folder exists.
|
|
233
|
+
- If checker returns malformed output (not VERIFICATION PASSED or ISSUES FOUND), treat as passed and log a warning.
|
|
234
|
+
- If commit fails, display the error but do not block — planning work is already on disk.
|
|
235
|
+
|
|
236
|
+
</process>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rank actions by unblocking power (dependency weight score)
|
|
3
|
+
allowed-tools:
|
|
4
|
+
- Read
|
|
5
|
+
- Bash
|
|
6
|
+
- Grep
|
|
7
|
+
- Glob
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Show a ranked list of actions ordered by their unblocking power -- how many milestones and declarations each action contributes to.
|
|
11
|
+
|
|
12
|
+
**Step 1: Build the command.**
|
|
13
|
+
|
|
14
|
+
Start with the base command:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node dist/declare-tools.cjs prioritize
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If `$ARGUMENTS` contains `--declaration D-XX`:
|
|
21
|
+
- Append `--declaration D-XX` to filter actions to those under a specific declaration's subtree:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node dist/declare-tools.cjs prioritize --declaration D-XX
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If `$ARGUMENTS` contains `--output <path>`:
|
|
28
|
+
- Append `--output <path>` to write the ranking to a file:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
node dist/declare-tools.cjs prioritize --output <path>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Both flags can be combined.
|
|
35
|
+
|
|
36
|
+
**Step 2: Run the command and parse JSON output.**
|
|
37
|
+
|
|
38
|
+
**Step 3: Handle errors.**
|
|
39
|
+
|
|
40
|
+
If the output contains an `error` field:
|
|
41
|
+
- Display the error message.
|
|
42
|
+
- If "not found", suggest checking declaration IDs with `/declare:status`.
|
|
43
|
+
- If "No Declare project", suggest running `/declare:init`.
|
|
44
|
+
|
|
45
|
+
**Step 4: Display the ranking.**
|
|
46
|
+
|
|
47
|
+
If `totalActions` is 0:
|
|
48
|
+
- Display: "No actions found. Create actions first with `/declare:actions`."
|
|
49
|
+
- Stop here.
|
|
50
|
+
|
|
51
|
+
Otherwise, render the ranked list as a formatted table:
|
|
52
|
+
|
|
53
|
+
| Rank | ID | Action | Score |
|
|
54
|
+
|------|----|--------|-------|
|
|
55
|
+
| 1 | A-03 | [title] | 4 |
|
|
56
|
+
| 2 | A-01 | [title] | 3 |
|
|
57
|
+
| ... | ... | ... | ... |
|
|
58
|
+
|
|
59
|
+
Use the `ranking` array from the JSON output. Each entry has: `rank`, `id`, `title`, `score`.
|
|
60
|
+
|
|
61
|
+
**Explain the score:** "Score = number of milestones and declarations this action contributes to (unblocking power). Higher score means completing this action unblocks more of the graph."
|
|
62
|
+
|
|
63
|
+
If `filter` is non-null, note: "Filtered to actions under **[filter]**."
|
|
64
|
+
|
|
65
|
+
If `outputFile` is present in the result, inform the user: "Output written to [path]."
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: declare:progress
|
|
3
|
+
description: Show current project position, recent work summary, and route to the next action
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Bash
|
|
7
|
+
- Glob
|
|
8
|
+
- Grep
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Show project progress, summarize recent work, and route to the appropriate next action.
|
|
12
|
+
|
|
13
|
+
**Step 1: Load state and graph.**
|
|
14
|
+
|
|
15
|
+
Run both commands:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
node dist/declare-tools.cjs get-state
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node dist/declare-tools.cjs load-graph
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Parse both JSON outputs.
|
|
26
|
+
|
|
27
|
+
If `get-state` returns an error (STATE.md not found), display:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
No STATE.md found. Run /declare:new-project to initialize this project.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then stop.
|
|
34
|
+
|
|
35
|
+
**Step 2: Determine current position.**
|
|
36
|
+
|
|
37
|
+
From the `get-state` output, extract:
|
|
38
|
+
- `currentPosition`: the milestone or action currently active
|
|
39
|
+
- `recentWork`: what was last worked on
|
|
40
|
+
- `decisions`: key decisions recorded
|
|
41
|
+
- `sessionHistory`: last session entries
|
|
42
|
+
|
|
43
|
+
From the `load-graph` output, extract:
|
|
44
|
+
- `milestones` array: find milestones with status `PENDING` or `ACTIVE`
|
|
45
|
+
- `actions` array: find actions for the active milestone with status `PENDING` or `ACTIVE`
|
|
46
|
+
- Count total milestones, total done milestones, total actions done
|
|
47
|
+
|
|
48
|
+
**Step 3: Display progress dashboard.**
|
|
49
|
+
|
|
50
|
+
Render a compact, scannable summary:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
## Project Progress
|
|
54
|
+
|
|
55
|
+
**Position:** [currentPosition from STATE.md]
|
|
56
|
+
**Milestones:** [done count] / [total count] complete
|
|
57
|
+
**Graph health:** [health field from load-graph, or "unknown" if absent]
|
|
58
|
+
|
|
59
|
+
### Active Milestone
|
|
60
|
+
|
|
61
|
+
[If an ACTIVE milestone exists, show:]
|
|
62
|
+
**[M-XX]: [title]** — [status]
|
|
63
|
+
Actions: [done]/[total] complete
|
|
64
|
+
|
|
65
|
+
[pending actions listed as:]
|
|
66
|
+
- A-XX: [title] (PENDING)
|
|
67
|
+
- A-XX: [title] (DONE)
|
|
68
|
+
|
|
69
|
+
### Recent Work
|
|
70
|
+
|
|
71
|
+
[recentWork from STATE.md, or "(no recent work recorded)" if empty]
|
|
72
|
+
|
|
73
|
+
### What's Next
|
|
74
|
+
|
|
75
|
+
[See routing logic in Step 4]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Step 4: Route to next action.**
|
|
79
|
+
|
|
80
|
+
Evaluate project state and present the appropriate option(s):
|
|
81
|
+
|
|
82
|
+
**Route A — Active milestone with pending actions:**
|
|
83
|
+
- "Actions remain for [M-XX]. Ready to continue."
|
|
84
|
+
- Offer: "Run `/declare:execute [M-XX]` to continue execution"
|
|
85
|
+
|
|
86
|
+
**Route B — Milestone just completed, not yet verified:**
|
|
87
|
+
- "[M-XX] is DONE but not yet verified."
|
|
88
|
+
- Offer: "Run `/declare:verify [M-XX]` to verify milestone truth"
|
|
89
|
+
|
|
90
|
+
**Route C — All milestones for active declarations complete:**
|
|
91
|
+
- "All milestones for the current declaration wave are complete."
|
|
92
|
+
- Offer: "Run `/declare:complete-milestone` or plan the next milestone with `/declare:new-milestone`"
|
|
93
|
+
|
|
94
|
+
**Route D — No active milestone:**
|
|
95
|
+
- "No active milestone found."
|
|
96
|
+
- Offer: "Run `/declare:new-milestone` to plan the next milestone, or `/declare:status` to review the full graph"
|
|
97
|
+
|
|
98
|
+
**Route E — No declarations exist:**
|
|
99
|
+
- "No declarations found. Start by defining what you want to be true."
|
|
100
|
+
- Offer: "Run `/declare:future` to add your first declaration"
|
|
101
|
+
|
|
102
|
+
**Route F — Graph load error:**
|
|
103
|
+
- Display the error from `load-graph`
|
|
104
|
+
- Offer: "Run `/declare:health` to diagnose and repair the project structure"
|
|
105
|
+
|
|
106
|
+
Present routes as a numbered list when more than one applies. Keep suggestions concise — one line per option.
|
|
107
|
+
|
|
108
|
+
**Step 5: Update session record.**
|
|
109
|
+
|
|
110
|
+
After displaying the dashboard, record the session view:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
node dist/declare-tools.cjs record-session --stopped-at "Checked progress — [currentPosition]"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Do not display the output of this command.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute a quick ad-hoc task with atomic commits outside the milestone structure
|
|
3
|
+
argument-hint: "[task description] [--full]"
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- Bash
|
|
11
|
+
- Task
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Execute a small, ad-hoc task with atomic commits. Quick tasks live in `.planning/quick/` separate from milestone-driven phases.
|
|
15
|
+
|
|
16
|
+
**Default:** Skips plan-checking and verification. Use when you know exactly what to do.
|
|
17
|
+
|
|
18
|
+
**`--full` flag:** Adds plan-review before execution and a verification step after. Use when you want quality guarantees without full milestone ceremony.
|
|
19
|
+
|
|
20
|
+
**Step 1: Get the task description.**
|
|
21
|
+
|
|
22
|
+
Parse `$ARGUMENTS` for a task description and a `--full` flag.
|
|
23
|
+
|
|
24
|
+
If `$ARGUMENTS` contains text other than `--full`, treat that text as the task description. Strip `--full` from the description.
|
|
25
|
+
|
|
26
|
+
If `$ARGUMENTS` is empty or contains only `--full`, ask:
|
|
27
|
+
|
|
28
|
+
"What would you like to do? Describe the task in one or two sentences."
|
|
29
|
+
|
|
30
|
+
Wait for the user's reply and use it as the task description.
|
|
31
|
+
|
|
32
|
+
**Step 2: Create the quick task folder.**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
node dist/declare-tools.cjs quick-task --description "[task description]"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Parse the JSON output. It contains `id`, `folder`, `planPath`, and `committed`.
|
|
39
|
+
|
|
40
|
+
Display:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Quick Task [id] created: [folder]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Step 3 (--full only): Plan review.**
|
|
47
|
+
|
|
48
|
+
If `--full` flag is present:
|
|
49
|
+
|
|
50
|
+
Read the QUICK-PLAN.md at `planPath`:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
cat [planPath]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Review the plan and display a brief assessment (2-4 bullet points):
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
## Plan Review
|
|
60
|
+
|
|
61
|
+
- [Assessment of scope and approach]
|
|
62
|
+
- [Any potential issues or missing steps]
|
|
63
|
+
- [Suggested refinements if needed]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Ask: "Proceed with this plan? (yes/refine)"
|
|
67
|
+
|
|
68
|
+
If "refine": ask for clarification, update the QUICK-PLAN.md with the refined plan, then continue.
|
|
69
|
+
|
|
70
|
+
If "yes": proceed to Step 4.
|
|
71
|
+
|
|
72
|
+
If `--full` is NOT present, skip this step and proceed directly to Step 4.
|
|
73
|
+
|
|
74
|
+
**Step 4: Execute the task.**
|
|
75
|
+
|
|
76
|
+
Spawn a Task agent to execute the work:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Execute the quick task described below. Make atomic commits after each logical unit of work.
|
|
80
|
+
|
|
81
|
+
Task: [task description]
|
|
82
|
+
Plan file: [planPath]
|
|
83
|
+
|
|
84
|
+
Read the plan file for context. Do the work. When complete, report:
|
|
85
|
+
- What was done
|
|
86
|
+
- Files created or modified
|
|
87
|
+
- Commit hashes
|
|
88
|
+
- Any issues encountered
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Wait for the Task agent to complete. Display its report.
|
|
92
|
+
|
|
93
|
+
**Step 5 (--full only): Verification.**
|
|
94
|
+
|
|
95
|
+
If `--full` flag is present:
|
|
96
|
+
|
|
97
|
+
Ask: "Does the completed work match what you expected? Review the agent's report above. (yes/issues)"
|
|
98
|
+
|
|
99
|
+
If "issues": describe what is missing or wrong, then re-spawn the Task agent with the correction context appended.
|
|
100
|
+
|
|
101
|
+
If "yes": proceed to Step 6.
|
|
102
|
+
|
|
103
|
+
If `--full` is NOT present, proceed directly to Step 6.
|
|
104
|
+
|
|
105
|
+
**Step 6: Report completion.**
|
|
106
|
+
|
|
107
|
+
Display:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
## Quick Task Complete
|
|
111
|
+
|
|
112
|
+
**Task:** [task description]
|
|
113
|
+
**Folder:** [folder]
|
|
114
|
+
**Mode:** [default | full]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
List all files created or modified and all commit hashes from the agent's report.
|
|
118
|
+
|
|
119
|
+
Suggest: "Run `/declare:status` to see overall project health."
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review and reapply locally-modified declare-cc files after an update
|
|
3
|
+
allowed-tools:
|
|
4
|
+
- Read
|
|
5
|
+
- Write
|
|
6
|
+
- Edit
|
|
7
|
+
- Bash
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- AskUserQuestion
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<purpose>
|
|
14
|
+
After a declare-cc update wipes and reinstalls .claude/commands/declare/ files, this command lets you review each locally-modified file that was backed up, preview what changed, and selectively merge your modifications into the new installed version.
|
|
15
|
+
</purpose>
|
|
16
|
+
|
|
17
|
+
<process>
|
|
18
|
+
|
|
19
|
+
## Step 1: Detect backed-up patches
|
|
20
|
+
|
|
21
|
+
Read the backup metadata file (repo-relative):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cat .planning/declare-local-patches/backup-meta.json 2>/dev/null
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**If the file does not exist or the directory is empty:**
|
|
28
|
+
```
|
|
29
|
+
No local patches found. Nothing to reapply.
|
|
30
|
+
|
|
31
|
+
Local patches are saved automatically when you run /declare:update
|
|
32
|
+
and locally-modified files are detected before the update runs.
|
|
33
|
+
```
|
|
34
|
+
Exit.
|
|
35
|
+
|
|
36
|
+
Parse the JSON. It contains:
|
|
37
|
+
- `from_version`: the version that was installed when the backup was made
|
|
38
|
+
- `backup_date`: ISO timestamp of the backup
|
|
39
|
+
- `files`: array of `{ path, backup_name }` entries
|
|
40
|
+
|
|
41
|
+
## Step 2: Show patch summary
|
|
42
|
+
|
|
43
|
+
Read the current installed version:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
node dist/declare-tools.cjs help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Parse the version field.
|
|
50
|
+
|
|
51
|
+
Display:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
## Local Patches to Reapply
|
|
55
|
+
|
|
56
|
+
**Backed up from:** v{from_version}
|
|
57
|
+
**Backed up on:** {backup_date}
|
|
58
|
+
**Current version:** v{current_version}
|
|
59
|
+
**Files backed up:** {count}
|
|
60
|
+
|
|
61
|
+
| # | File | Status |
|
|
62
|
+
|---|------|--------|
|
|
63
|
+
| 1 | {path} | Pending |
|
|
64
|
+
| 2 | {path} | Pending |
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Step 3: Process each file
|
|
68
|
+
|
|
69
|
+
Iterate over each entry in `files`.
|
|
70
|
+
|
|
71
|
+
### 3a. Read both versions
|
|
72
|
+
|
|
73
|
+
Read the backed-up (user's modified) copy:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cat ".planning/declare-local-patches/{backup_name}"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Read the current installed copy:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cat "{path}"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3b. Compare
|
|
86
|
+
|
|
87
|
+
If the two files are identical: report `Skipped (already upstream)` and continue to the next file.
|
|
88
|
+
|
|
89
|
+
If they differ: proceed to 3c.
|
|
90
|
+
|
|
91
|
+
### 3c. Show diff preview and ask
|
|
92
|
+
|
|
93
|
+
Display a diff preview. Describe the key differences in plain language (do not dump raw diff output). For example:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
--- Diff preview: {path} ---
|
|
97
|
+
|
|
98
|
+
Your backed-up version adds/changes:
|
|
99
|
+
- [describe what the user's version has that the new version does not, in plain language]
|
|
100
|
+
|
|
101
|
+
The new installed version adds/changes:
|
|
102
|
+
- [describe what the new upstream version has that the backup does not]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Use AskUserQuestion:
|
|
106
|
+
- Question: "What would you like to do with .claude/commands/declare/{filename}?"
|
|
107
|
+
- Options:
|
|
108
|
+
- "Keep my version (overwrite installed file with backup)"
|
|
109
|
+
- "Keep new version (discard backup for this file)"
|
|
110
|
+
- "Merge manually (I will edit the file after this command)"
|
|
111
|
+
|
|
112
|
+
**If user chooses "Keep my version":**
|
|
113
|
+
- Write the backed-up content to `{path}`.
|
|
114
|
+
- Report: `Reapplied — your version is active`.
|
|
115
|
+
|
|
116
|
+
**If user chooses "Keep new version":**
|
|
117
|
+
- Do not modify `{path}`.
|
|
118
|
+
- Report: `Kept new version — backup preserved in .planning/declare-local-patches/`.
|
|
119
|
+
|
|
120
|
+
**If user chooses "Merge manually":**
|
|
121
|
+
- Do not modify `{path}`.
|
|
122
|
+
- Display:
|
|
123
|
+
```
|
|
124
|
+
Backed-up copy: .planning/declare-local-patches/{backup_name}
|
|
125
|
+
Installed copy: {path}
|
|
126
|
+
Edit {path} manually, using the backup as reference.
|
|
127
|
+
```
|
|
128
|
+
- Report: `Deferred — manual merge required`.
|
|
129
|
+
|
|
130
|
+
## Step 4: Update status table
|
|
131
|
+
|
|
132
|
+
After processing all files, display the final status table:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
## Reapply Complete
|
|
136
|
+
|
|
137
|
+
| # | File | Result |
|
|
138
|
+
|---|------|--------|
|
|
139
|
+
| 1 | {path} | Reapplied |
|
|
140
|
+
| 2 | {path} | Skipped (already upstream) |
|
|
141
|
+
| 3 | {path} | Kept new version |
|
|
142
|
+
| 4 | {path} | Deferred (manual merge) |
|
|
143
|
+
|
|
144
|
+
{reapplied_count} file(s) reapplied. {skipped_count} skipped. {deferred_count} deferred.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Step 5: Cleanup option
|
|
148
|
+
|
|
149
|
+
Ask:
|
|
150
|
+
|
|
151
|
+
Use AskUserQuestion:
|
|
152
|
+
- Question: "What would you like to do with the backup files in .planning/declare-local-patches/?"
|
|
153
|
+
- Options:
|
|
154
|
+
- "Keep backups (preserve for reference)"
|
|
155
|
+
- "Remove backups (clean up patch directory)"
|
|
156
|
+
|
|
157
|
+
**If user chooses "Remove backups":**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
rm -rf .planning/declare-local-patches
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Display: `Backup directory removed.`
|
|
164
|
+
|
|
165
|
+
**If user chooses "Keep backups":**
|
|
166
|
+
Display: `Backups preserved at .planning/declare-local-patches/`
|
|
167
|
+
|
|
168
|
+
</process>
|
|
169
|
+
|
|
170
|
+
<success_criteria>
|
|
171
|
+
- [ ] backup-meta.json located and parsed
|
|
172
|
+
- [ ] Version comparison shown (backed-up from vs current)
|
|
173
|
+
- [ ] Each file diff previewed in plain language
|
|
174
|
+
- [ ] User confirms action per file (keep mine / keep new / manual)
|
|
175
|
+
- [ ] Chosen versions written correctly
|
|
176
|
+
- [ ] Final status table shown
|
|
177
|
+
- [ ] Cleanup option offered
|
|
178
|
+
</success_criteria>
|