slash-do 1.8.0 → 1.9.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.
@@ -56,7 +56,7 @@ When compacting during this workflow, always preserve:
56
56
  - All CRITICAL/HIGH findings with file:line references
57
57
  - The current phase number and what phases remain
58
58
  - All PR numbers and URLs created so far
59
- - `BUILD_CMD`, `TEST_CMD`, `PROJECT_TYPE`, `WORKTREE_DIR` values
59
+ - `BUILD_CMD`, `TEST_CMD`, `PROJECT_TYPE`, `WORKTREE_DIR`, `REPO_DIR` values
60
60
  - `VCS_HOST`, `CLI_TOOL`, `DEFAULT_BRANCH`, `CURRENT_BRANCH`
61
61
  - `PLATFORMS` (list of supported platforms: iOS, macOS, etc.)
62
62
  - `DEPLOYMENT_TARGETS` (minimum OS versions per platform)
@@ -154,6 +154,7 @@ If the project has a `Makefile` or `fastlane/Fastfile`, check for custom build/t
154
154
  Record as `BUILD_CMD` and `TEST_CMD`.
155
155
 
156
156
  ### 0d: State Snapshot
157
+ - Record `REPO_DIR` via `git rev-parse --show-toplevel`
157
158
  - Record `CURRENT_BRANCH` via `git rev-parse --abbrev-ref HEAD`
158
159
  - Record `DEFAULT_BRANCH` via `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'` (or `glab` equivalent)
159
160
  - Record `IS_DIRTY` via `git status --porcelain`
@@ -567,12 +568,36 @@ Before creating PRs, run a deep code review on all remediation changes to catch
567
568
  question: "Code review complete. {N} issues found and fixed. {list}. All {PLATFORMS} platforms build and test successfully. Proceed to PR creation?",
568
569
  options: [
569
570
  { label: "Proceed", description: "Create per-category PRs" },
571
+ { label: "Commit directly", description: "Merge worktree changes into {CURRENT_BRANCH} — no PRs, no review loops" },
570
572
  { label: "Show diff", description: "Show the full diff for manual review before proceeding" },
571
573
  { label: "Abort", description: "Stop here — I'll review manually" }
572
574
  ]
573
575
  }])
574
576
  ```
575
577
  5. If "Show diff" selected, print the diff and re-ask. If "Abort", stop and print the worktree path.
578
+ 6. If "Commit directly" selected:
579
+ - All remediation and review fixes are already committed incrementally in the worktree branch `better-swift/{DATE}`. If any uncommitted changes remain, stage and commit them now:
580
+ ```bash
581
+ cd {WORKTREE_DIR}
582
+ git diff --quiet && git diff --cached --quiet || {
583
+ git add <list of remaining changed files>
584
+ git commit -m "fix: better-swift audit remediation — remaining changes"
585
+ }
586
+ ```
587
+ - Return to the main repo checkout, merge the worktree branch, and clean up on success:
588
+ ```bash
589
+ cd {REPO_DIR}
590
+ git checkout {CURRENT_BRANCH}
591
+ if git merge better-swift/{DATE}; then
592
+ git worktree remove {WORKTREE_DIR}
593
+ git branch -D better-swift/{DATE}
594
+ else
595
+ echo "Merge conflict — resolve in {REPO_DIR}, then run:"
596
+ echo " git worktree remove {WORKTREE_DIR}"
597
+ echo " git branch -D better-swift/{DATE}"
598
+ fi
599
+ ```
600
+ - Restore stash if needed (`git stash pop`), update PLAN.md, print final summary, then **stop** — this completes the workflow (Phases 5, 6, and 7 are skipped entirely since no PRs or category branches were created)
576
601
 
577
602
  ## Phase 4c: Test Enhancement
578
603
 
@@ -56,7 +56,7 @@ When compacting during this workflow, always preserve:
56
56
  - All CRITICAL/HIGH findings with file:line references
57
57
  - The current phase number and what phases remain
58
58
  - All PR numbers and URLs created so far
59
- - `BUILD_CMD`, `TEST_CMD`, `PROJECT_TYPE`, `WORKTREE_DIR` values
59
+ - `BUILD_CMD`, `TEST_CMD`, `PROJECT_TYPE`, `WORKTREE_DIR`, `REPO_DIR` values
60
60
  - `VCS_HOST`, `CLI_TOOL`, `DEFAULT_BRANCH`, `CURRENT_BRANCH`
61
61
  - `PHASE_4C_START_SHA` (needed for FILE_OWNER_MAP update in Phase 4c.3)
62
62
  - `VACUOUS_TESTS_FIXED`, `WEAK_TESTS_STRENGTHENED`, `NEW_TEST_CASES`, `NEW_TEST_FILES`
@@ -96,6 +96,7 @@ Derive build and test commands from the project type:
96
96
  Record as `BUILD_CMD` and `TEST_CMD`.
97
97
 
98
98
  ### 0d: State Snapshot
99
+ - Record `REPO_DIR` via `git rev-parse --show-toplevel`
99
100
  - Record `CURRENT_BRANCH` via `git rev-parse --abbrev-ref HEAD`
100
101
  - Record `DEFAULT_BRANCH` via `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'` (or `glab` equivalent)
101
102
  - Record `IS_DIRTY` via `git status --porcelain`
@@ -375,12 +376,36 @@ Before creating PRs, run a deep code review on all remediation changes to catch
375
376
  question: "Code review complete. {N} issues found and fixed. {list}. Proceed to PR creation?",
376
377
  options: [
377
378
  { label: "Proceed", description: "Create per-category PRs" },
379
+ { label: "Commit directly", description: "Merge worktree changes into {CURRENT_BRANCH} — no PRs, no review loops" },
378
380
  { label: "Show diff", description: "Show the full diff for manual review before proceeding" },
379
381
  { label: "Abort", description: "Stop here — I'll review manually" }
380
382
  ]
381
383
  }])
382
384
  ```
383
385
  5. If "Show diff" selected, print the diff and re-ask. If "Abort", stop and print the worktree path.
386
+ 6. If "Commit directly" selected:
387
+ - All remediation and review fixes are already committed incrementally in the worktree branch `better/{DATE}`. If any uncommitted changes remain, stage and commit them now:
388
+ ```bash
389
+ cd {WORKTREE_DIR}
390
+ git diff --quiet && git diff --cached --quiet || {
391
+ git add <list of remaining changed files>
392
+ git commit -m "fix: better audit remediation — remaining changes"
393
+ }
394
+ ```
395
+ - Return to the main repo checkout, merge the worktree branch, and clean up on success:
396
+ ```bash
397
+ cd {REPO_DIR}
398
+ git checkout {CURRENT_BRANCH}
399
+ if git merge better/{DATE}; then
400
+ git worktree remove {WORKTREE_DIR}
401
+ git branch -D better/{DATE}
402
+ else
403
+ echo "Merge conflict — resolve in {REPO_DIR}, then run:"
404
+ echo " git worktree remove {WORKTREE_DIR}"
405
+ echo " git branch -D better/{DATE}"
406
+ fi
407
+ ```
408
+ - Restore stash if needed (`git stash pop`), update PLAN.md, print final summary, then **stop** — this completes the workflow (Phases 5, 6, and 7 are skipped entirely since no PRs or category branches were created)
384
409
 
385
410
  ## Phase 4c: Test Enhancement
386
411
 
@@ -1,212 +1,181 @@
1
1
  ---
2
- description: Review and clean up PLAN.md, extract docs from completed work
2
+ description: Automated audit/triage of PLAN.md — archive completed items to DONE.md, suggest new work, keep PLAN.md lean
3
3
  ---
4
4
 
5
5
  # Replan Command
6
6
 
7
- You are tasked with reviewing and updating the PLAN.md file to keep it clean, current, and action-oriented.
7
+ Automatically audit PLAN.md against the codebase, prune completed/stale items, archive what's done, suggest new work, and leave PLAN.md lean and actionable.
8
8
 
9
- **This is an interactive process.** Do NOT assume items are still pending or still relevant. Verify with the user.
9
+ **Philosophy:** PLAN.md should be short enough to paste into a prompt. Completed items belong in a done log, not cluttering the active plan.
10
10
 
11
11
  ## Boundary Rule: PLAN.md vs GOALS.md
12
12
 
13
13
  **PLAN.md is tactical. GOALS.md is strategic.**
14
14
 
15
- PLAN.md answers: *What are we building next? What's the backlog? What's done?*
15
+ PLAN.md answers: *What are we building next? What's the backlog?*
16
16
  GOALS.md answers: *Why does this project exist? What does success look like? What will we never do?*
17
17
 
18
- **PLAN.md owns:**
19
- - Checkbox task lists (`- [ ] Add feature X`)
20
- - Implementation details, subtasks, and technical steps
21
- - Known issues and testing gaps
22
- - Prioritized next-action lists
23
- - Completed work archive
24
- - Documentation index
25
-
26
- **PLAN.md must NOT duplicate:**
18
+ **PLAN.md must NOT contain:**
27
19
  - Mission statements, core tenets, or non-goals (those belong in GOALS.md)
28
- - Milestone definitions written as outcome prose (GOALS.md territory)
29
-
30
- **Cross-reference:** PLAN.md should link to GOALS.md for strategic context, and GOALS.md should link back to PLAN.md for tactical details.
31
-
32
- ## Your Responsibilities
20
+ - Completed items (those belong in `DONE.md`)
21
+ - Detailed documentation (those belong in `docs/`)
33
22
 
34
- ### 1. Gather Evidence
23
+ ## Phase 1: Automated Evidence Gathering
35
24
 
36
- Before touching PLAN.md, gather signals about what's actually happened since the plan was last updated. Run these in parallel:
25
+ Launch these agents in parallel no user interaction needed yet.
37
26
 
38
- **Agent 1: Git History**
39
- ```bash
40
- git log --oneline -30
41
- ```
42
- Look for commits that may have completed items listed in PLAN.md.
27
+ **Agent 1: Git History Analysis**
28
+ - `git log --oneline -50` — identify commits that completed plan items
29
+ - `git log --since="2 weeks ago" --oneline` — surface recent work not yet reflected in the plan
30
+ - Cross-reference commit messages against pending PLAN.md items to auto-detect completions
43
31
 
44
- **Agent 2: Codebase Scan**
45
- Search for evidence that "pending" items may already be implemented:
46
- - Grep for function names, component names, or feature keywords mentioned in pending items
32
+ **Agent 2: Codebase Verification**
33
+ - For each pending item in PLAN.md, grep for function names, component names, or feature keywords
47
34
  - Check test files for coverage of features listed as untested
48
35
  - Look at recently modified files for signs of completed work
36
+ - Build a confidence score per item: `confirmed-done`, `likely-done`, `still-pending`, `stale`
49
37
 
50
- **Agent 3: GOALS.md Boundary Check**
38
+ **Agent 3: Opportunity Scanner**
39
+ - Scan for TODOs, FIXMEs, HACKs in the codebase that aren't in PLAN.md
40
+ - Look for test coverage gaps (files with no corresponding test)
41
+ - Check for outdated dependencies (`npm outdated`, `cargo outdated`, etc. as appropriate)
42
+ - Review GOALS.md (if it exists) for strategic goals not yet represented in the plan
43
+ - Identify code quality opportunities (large files, complex functions, missing error handling)
44
+ - Formulate 1-3 suggested new items to propose to the user
45
+
46
+ **Agent 4: GOALS.md Boundary Check**
51
47
  If `GOALS.md` exists:
52
- - Read it and check for checkbox task lists or implementation details that leaked in
48
+ - Check for checkbox task lists or implementation details that leaked in
53
49
  - Note any items that should be absorbed into PLAN.md
54
50
 
55
- ### 2. Interactive Item Review
56
-
57
- **This is the most important step. Do NOT skip it.**
51
+ ## Phase 2: Auto-Triage (No User Input)
58
52
 
59
- Walk through PLAN.md with the user, section by section. For each section that has pending items, present your findings and ask the user to confirm status.
53
+ Using agent results, automatically classify every PLAN.md item:
60
54
 
61
- **For each group of related pending items**, use `AskUserQuestion` to verify. Batch related items together (don't ask one-by-one for 20 items). For example:
55
+ | Status | Criteria | Action |
56
+ |--------|----------|--------|
57
+ | `confirmed-done` | Git commit + code exists + tests pass | Move to DONE.md |
58
+ | `likely-done` | Strong evidence but not 100% certain | Present to user for confirmation |
59
+ | `stale` | No commits, no code, no recent discussion; item is >30 days old with zero progress | Flag for removal |
60
+ | `still-pending` | No evidence of completion | Keep in PLAN.md |
62
61
 
63
- ```
64
- I found these items still marked as pending under "Testing Gaps":
65
- - [ ] Server route unit tests
66
- - [ ] Aggregate calculation tests
67
- - [ ] Visual regression tests for charts
62
+ ## Phase 3: Single Interactive Checkpoint
68
63
 
69
- Git history shows commits for "add server route tests" on Feb 15.
70
- I also found test files at packages/server/test/routes/.
64
+ Present ONE consolidated summary to the user. Keep it tight:
71
65
 
72
- Which of these are actually done?
66
+ ```
67
+ AskUserQuestion([{
68
+ question: "Replan audit complete. Here's what I found:\n\n**Auto-archiving to DONE.md** ({N} items):\n{list of confirmed-done items}\n\n**Likely done — confirm?** ({M} items):\n{list with evidence}\n\n**Flagged as stale** ({S} items):\n{list with last-activity dates}\n\n**New suggestions** ({P} items):\n{numbered list of proposed new items with rationale}\n\nHow should I proceed?",
69
+ multiSelect: true,
70
+ options: [
71
+ { label: "Archive confirmed-done", description: "Move {N} confirmed items to DONE.md" },
72
+ { label: "Archive likely-done too", description: "Also move {M} likely-done items to DONE.md" },
73
+ { label: "Remove stale items", description: "Delete {S} stale items from PLAN.md" },
74
+ { label: "Add suggested items", description: "Add {P} new items to PLAN.md" }
75
+ ]
76
+ }])
73
77
  ```
74
78
 
75
- **How to batch the review:**
76
- - Group items by section (Next Up, Remaining Work, Future, etc.)
77
- - Present each group with any evidence you found (git commits, files that exist, grep matches)
78
- - Ask the user to confirm: which are done, which are still needed, which should be removed or rephrased
79
- - Use multiSelect questions when asking about multiple items (let the user check off what's done)
80
- - If a section has no evidence of changes, still ask briefly: "These items under [section] — still accurate, or any updates?"
79
+ **Exclusive options** (present only if the user asks, as a separate follow-up):
80
+ - "Show me the details" print full evidence, then re-ask the above
81
+ - "Just clean up formatting" only reformat PLAN.md, skip all archive/remove/add actions
81
82
 
82
- **For known issues**, ask whether they're still reproducible or have been fixed.
83
+ If the user selects "Show me the details" as a response, print the full evidence and re-ask.
83
84
 
84
- **For "Next Actions" / priority ordering**, ask if the priorities still reflect the user's current thinking.
85
+ For suggested new items: if the user selects "Add suggested items", present each suggestion individually so they can accept, reject, or modify each one.
85
86
 
86
- ### 3. Extract Documentation from Completed Work
87
+ ## Phase 4: Archive to DONE.md
87
88
 
88
- For each completed item with substantial documentation:
89
- - Determine the appropriate docs location (create docs/ directory if needed)
90
- - Extract the detailed documentation sections
91
- - Move them to appropriate docs files with proper formatting
92
- - Follow existing documentation patterns if they exist
89
+ `DONE.md` lives at project root. It's the append-only log of completed work.
93
90
 
94
- **Common docs files to consider:**
95
- - `docs/ARCHITECTURE.md` - System design, data flow, architecture
96
- - `docs/API.md` - API endpoints, schemas, events
97
- - `docs/TROUBLESHOOTING.md` - Common issues and solutions
98
- - `docs/features/*.md` - Individual feature documentation
99
- - `README.md` - User-facing documentation
91
+ ### Format
100
92
 
101
- ### 4. Clean Up PLAN.md
93
+ ```markdown
94
+ # Done Log
102
95
 
103
- Using the verified information from the interactive review:
104
- - Mark confirmed-completed items as [x] and move to archive
105
- - Remove items the user confirmed are no longer relevant
106
- - Update wording for items the user rephrased
107
- - Replace detailed documentation with brief summaries + doc links
108
- - Remove redundant or outdated information
96
+ Completed items archived from PLAN.md. For release notes, see `.changelogs/`.
109
97
 
110
- **Example transformation:**
111
- ```markdown
112
- Before:
113
- - [x] Feature X: Authentication System
98
+ ## 2026-03-16
99
+
100
+ - Implemented feature X — added auth middleware and JWT validation
101
+ - Fixed bug Y null check on user profile load
102
+ - Refactored Z — extracted shared utilities from monolithic handler
114
103
 
115
- ### Architecture
116
- - **Auth Service**: Core authentication logic
117
- - **JWT Tokens**: Token generation and validation
118
- [... 50 more lines of detailed docs ...]
104
+ ## 2026-03-10
119
105
 
120
- After:
121
- - [x] Feature X: Authentication System - JWT-based auth with session management. See [Authentication](./docs/features/authentication.md)
106
+ - Added CI pipeline for staging deploys
107
+ - Test coverage for API routes
122
108
  ```
123
109
 
124
- ### 5. Update Documentation Index
125
- - Ensure PLAN.md references all relevant docs files
126
- - Add any new docs files you created
127
- - Verify all links are correct
128
- - Add a Documentation section if it doesn't exist
110
+ ### Rules
129
111
 
130
- ### 6. Rewrite Next Actions
112
+ - Group by date (newest first)
113
+ - One line per item — concise description of what was done, not the original checkbox text
114
+ - If the completed item had substantial documentation (>20 lines), extract it to `docs/` and add a link: `- Feature X — see [docs/features/x.md](./docs/features/x.md)`
115
+ - Do NOT duplicate changelog entries — DONE.md captures plan-item completion, changelogs capture release-level changes
131
116
 
132
- Based on the interactive review, rebuild the "Next Actions" section:
133
- - Ask the user: "Based on what's left, what are your top 3-5 priorities right now?"
134
- - Present a suggested ordering based on what you learned, but let the user override
135
- - Make action items specific and actionable
117
+ ## Phase 5: Rebuild PLAN.md
136
118
 
137
- ### 7. Absorb GOALS.md Violations
119
+ Rewrite PLAN.md to be lean and actionable:
138
120
 
139
- If you found checkbox items or tactical details in GOALS.md during step 1:
140
- - Show the user what you found
141
- - Offer to move them into the appropriate PLAN.md section
142
- - Update GOALS.md to remove the tactical items (replace with outcome prose or remove entirely)
121
+ ### Target Structure
143
122
 
144
- ### 8. Commit Your Changes
145
- After reorganizing (if in a git repository):
146
- - Commit changes with a clear message like:
147
- ```
148
- docs: reorganize PLAN.md and extract completed work to docs
123
+ ```markdown
124
+ # Development Plan
149
125
 
150
- - Moved completed feature docs to docs/features/
151
- - Updated PLAN.md to focus on next actions
152
- - Added Next Actions section
153
- ```
126
+ For project mission and milestones, see [GOALS.md](./GOALS.md).
127
+ For completed work, see [DONE.md](./DONE.md).
154
128
 
155
- ## Guidelines
129
+ ## Next Up
156
130
 
157
- - **Verify, don't assume**: The whole point of this command is to sync PLAN.md with reality. Never mark items as done or still-pending without checking.
158
- - **Be thorough**: Read all completed items and assess documentation value
159
- - **Be surgical**: Only move substantial documentation (>20 lines), keep brief summaries in PLAN
160
- - **Be organized**: Group related content in docs files with clear headings
161
- - **Be consistent**: Match the style and format of existing docs files
162
- - **Be helpful**: Make it easy to find information by adding clear references
163
- - **Respect boundaries**: Tactical items in PLAN.md, strategic items in GOALS.md
164
- - **Batch intelligently**: Don't ask 20 individual questions — group related items and ask about sections at a time. Aim for 3-6 interactive checkpoints, not 20.
131
+ 1. **Item A**: Brief actionable description
132
+ 2. **Item B**: Brief actionable description
133
+ 3. **Item C**: Brief actionable description
165
134
 
166
- ## Example Output Structure
135
+ ## Backlog
167
136
 
168
- After running `/replan`, the PLAN.md should have:
169
- ```markdown
170
- # Project Name - Development Plan
137
+ - [ ] Item D: Description
138
+ - [ ] Item E: Description
171
139
 
172
- The tactical backlog. For mission and milestones, see [GOALS.md](./GOALS.md).
140
+ ## Future / Ideas
173
141
 
174
- ## Documentation
175
- - [Architecture Overview](./docs/ARCHITECTURE.md)
176
- - [API Reference](./docs/API.md)
142
+ - Item F: One-line description
143
+ - Item G: One-line description
144
+ ```
177
145
 
178
- ## Next Up
179
- - [ ] Feature C: Brief description with subtasks
146
+ ### Guidelines
180
147
 
181
- ## Remaining Work
182
- ### Known Issues
183
- - ...
184
- ### Testing Gaps
185
- - [ ] ...
148
+ - **"Next Up" is ordered** — numbered list, max 5 items, these are the immediate priorities
149
+ - **"Backlog" is unordered** — checkbox items that are planned but not prioritized
150
+ - **"Future / Ideas" has no checkboxes** — these are possibilities, not commitments
151
+ - **No completed items** — they're in DONE.md
152
+ - **No detailed docs** — link to `docs/` files instead
153
+ - **No section if it's empty** — don't include "Backlog" with zero items
186
154
 
187
- ## Future (v2.0+)
188
- - [ ] Feature D: Brief description of planned work
155
+ ## Phase 6: Absorb GOALS.md Violations
189
156
 
190
- ## Next Actions
157
+ If tactical items (checkboxes, implementation details) were found in GOALS.md:
158
+ - Move them into the appropriate PLAN.md section
159
+ - Update GOALS.md to remove tactical content
191
160
 
192
- 1. **Task 1**: Brief description of what needs to be done
193
- 2. **Task 2**: Brief description of next task
194
- 3. **Task 3**: Brief description of another task
161
+ ## Phase 7: Commit
195
162
 
196
- ## Completed Work (Archive)
197
- <details>
198
- <summary>v0.x Features</summary>
199
- - [x] Feature A - See [Feature A Docs](./docs/features/feature-a.md)
200
- - [x] Feature B - See [Feature B Docs](./docs/features/feature-b.md)
201
- </details>
163
+ Stage and commit all files modified during this replan:
164
+ ```bash
165
+ git add PLAN.md
166
+ # Stage optional files only if they exist and were modified
167
+ git add DONE.md 2>/dev/null || true
168
+ git add GOALS.md 2>/dev/null || true
169
+ git add docs/ 2>/dev/null || true
170
+ git commit -m "docs: replan — archive {N} completed items, update priorities"
202
171
  ```
203
172
 
173
+ Do NOT push unless explicitly asked.
174
+
204
175
  ## Notes
205
176
 
206
- - Don't delete information - move it to appropriate docs files
207
- - Keep related information consolidated in single docs files
208
- - Create feature-specific docs in docs/features/ for complex systems
209
- - Preserve all historical information but organize it better
210
- - If no PLAN.md exists, inform the user rather than creating one
211
- - Adapt to the existing structure and conventions of the project
212
- - If GOALS.md has task lists that belong in PLAN.md, migrate them
177
+ - If no PLAN.md exists, inform the user and offer to create one from codebase analysis
178
+ - The opportunity scanner suggestion is the key differentiator — every replan should surface at least one new idea
179
+ - DONE.md is append-only never delete entries from it
180
+ - Keep PLAN.md under ~50 lines whenever possible — it should be scannable in seconds
181
+ - Adapt to existing project structure and conventions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slash-do",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Curated slash commands for AI coding assistants — Claude Code, OpenCode, Gemini CLI, and Codex",
5
5
  "author": "Adam Eivy <adam@eivy.com>",
6
6
  "license": "MIT",