slash-do 1.7.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
@@ -212,6 +212,10 @@ Check every file against this checklist. The checklist is organized into tiers
212
212
  **Formatting & structural consistency**
213
213
  - If the PR adds content to an existing file (list items, sections, config entries), verify the new content matches the file's existing indentation, bullet style, heading levels, and structure — rendering inconsistencies are the most common Copilot review finding
214
214
 
215
+ **Dependent operation ordering**
216
+ - If a handler orchestrates multiple operations (primary write + side effects like rewards, uploads, notifications), trace the dependency graph — verify side effects only execute after the primary operation confirms success. Watch for `Promise.all` grouping operations that should be sequential because one depends on the other's outcome, and for resource allocation (file uploads, external API calls) happening before a gate operation (lock acquisition, uniqueness check, validation) that may reject the request
217
+ - If the PR handles file uploads or binary data, verify the server validates content independently of client-supplied metadata — check MIME type via magic bytes, size via buffer length, and content validity via actual parsing rather than trusting request headers or middleware-provided fields
218
+
215
219
  **Bulk vs single-item operation parity**
216
220
  - If the PR modifies a single-item CRUD operation (create, update, delete) to handle new fields or apply new logic, trace the corresponding bulk/batch operation for the same entity — it often has its own independent implementation that won't pick up the change. Verify both paths handle the same fields, apply the same validation, and preserve the same secondary data
217
221
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  **Trust boundaries & data exposure**
33
33
  - API responses returning full objects with sensitive fields — destructure and omit across ALL response paths (GET, PUT, POST, error, socket); comments/docs claiming data isn't exposed while the code path does expose it
34
- - Server trusting client-provided computed/derived values (scores, totals, correctness flags) when the server can recompute them — strip and recompute server-side; don't require clients to submit fields the server should own
34
+ - Server trusting client-provided computed/derived values (scores, totals, correctness flags, file metadata like MIME type and size) when the server can recompute or verify them — strip and recompute server-side; for file uploads, validate content type via magic bytes and size via actual buffer length rather than trusting client-supplied headers
35
35
  - New endpoints mounted under restricted paths (admin, internal) missing authorization verification — compare with sibling endpoints in the same route group to ensure the same access gate (role check, scope validation) is applied consistently
36
36
  - User-controlled objects merged via `Object.assign`/spread without sanitizing keys — `__proto__`, `constructor`, and `prototype` keys enable prototype pollution. Use `Object.create(null)` for the target, whitelist allowed keys, and use `hasOwnProperty` (not `in`) to check membership. Also verify the merge can't override reserved/internal fields the system depends on
37
37
 
@@ -45,7 +45,7 @@
45
45
  - State updates guarded by truthiness of the new value (`if (arr?.length)`) — prevents clearing state when the source legitimately returns empty. Distinguish "no response" from "empty response"
46
46
  - Periodic/scheduled operations with skip conditions (gates, precondition checks, "nothing to do" early exits) that don't advance timing state (lastRun, nextFireTime) on skip — null or stale lastRun causes immediate re-trigger in a tight loop. Record the skip as an execution or compute the next fire time from now, not from the missing lastRun
47
47
  - Mutation/trigger functions that return or propagate stale pre-mutation state — if a function activates, updates, or resets an entity, the returned value and any dependent scheduling/evaluation state (backoff timers, "last run" timestamps, status flags) must reflect the post-mutation state, not a snapshot read before the mutation
48
- - Fire-and-forget or async writes where the in-memory object is not updated (response returns stale data) or is updated unconditionally regardless of write success (response claims state that was never persisted) — update in-memory state conditionally on write outcome, or document the tradeoff explicitly. Also applies to responses and business-logic decisions (threshold triggers, status transitions) derived from pre-transaction reads — concurrent writers all read the same stale value, so thresholds may be crossed without triggering the transition. Compute from post-write state or use conditional expressions that evaluate the stored value. For monotonic counters (sequence numbers, cursors) that must stay in lockstep with append-only storage, advancing before the write risks the counter running ahead on failure; not advancing after a partial write risks reuse — reserve the range before writing and commit only on success
48
+ - Fire-and-forget or async writes where the in-memory object is not updated (response returns stale data) or is updated unconditionally regardless of write success (response claims state that was never persisted) — update in-memory state conditionally on write outcome, or document the tradeoff explicitly. Also applies to responses and business-logic decisions (threshold triggers, status transitions) derived from pre-transaction reads — concurrent writers all read the same stale value, so thresholds may be crossed without triggering the transition. Compute from post-write state or use conditional expressions that evaluate the stored value. For monotonic counters (sequence numbers, cursors) that must stay in lockstep with append-only storage, advancing before the write risks the counter running ahead on failure; not advancing after a partial write risks reuse — reserve the range before writing and commit only on success. Also check for dependent side effects (rewards, notifications, secondary uploads, resource allocation) executing in parallel with or before the primary write they depend on — if the primary write fails or is rejected (lock contention, dedup, validation), the side effects are irrecoverable (orphaned uploads, unearned rewards, phantom notifications). Gate side effects on confirmed primary write success
49
49
  - Error/early-exit paths that return status metadata (pagination flags, truncation indicators, hasMore, completion markers) or emit events (WebSocket, SSE, pub/sub) with default/initial values instead of reflecting actual accumulated state — downstream consumers make incorrect decisions (e.g., treating a failed sync as successful because the completion event was emitted unconditionally). Set metadata flags and event payloads based on actual outcome, not just the final request's exit path. Also check paired lifecycle events (started/completed/failed): if a function emits a "started" event, every exit path — including early returns and no-op branches — must emit the corresponding "completed" or "failed" event, or clients waiting for completion will hang or show stale state
50
50
  - Missing `await` on async operations in error/cleanup paths — fire-and-forget cleanup (e.g., aborting a failed operation, rolling back partial state) that must complete before the function returns or the caller proceeds
51
51
  - `Promise.all` without error handling — partial load with unhandled rejection. Wrap with fallback/error state. For `Promise.allSettled`, verify rejected entries are logged with rejection reasons before mapping to fallback values — silently substituting defaults makes partial failures invisible in production
@@ -55,7 +55,7 @@
55
55
  **Error handling** _[applies when: code has try/catch, .catch, error responses, or external calls]_
56
56
  - Service functions throwing generic `Error` for client-caused conditions — bubbles as 500 instead of 400/404. Use typed error classes with explicit status codes; ensure consistent error responses across similar endpoints — when multiple endpoints make the same access-control decision (e.g., "resource exists but caller lacks access"), they must return the same HTTP status (typically 404 to avoid leaking existence). Include expected concurrency/conditional failures (transaction cancellations, optimistic lock conflicts) — catch and translate to 409/retry rather than letting them surface as 500
57
57
  - Swallowed errors (empty `.catch(() => {})`), handlers that replace detailed failure info with generic messages, and error/catch handlers that exit cleanly (`exit 0`, `return`) without any user-visible output — surface a notification, propagate original context, and make failures look like failures. Includes external service wrappers that return `null`/empty for all non-success responses — collapsing configuration errors (missing API key), auth failures (403), rate limits (429), and server errors (5xx) into a single "not found" return masks outages and misconfiguration as normal "no match" results. Distinguish retriable from non-retriable failures and surface infrastructure errors loudly
58
- - Caller/callee disagreement on success/decision semantics — a function that resolves with `{ success: false }` while callers use `.catch()` for error handling means failures are treated as successes. Verify that the contract between producer and consumer is consistent: if callers branch on rejection, the function must reject on failure; if callers branch on a status field, the function must never reject. This extends beyond success/failure to any evaluation result — if a gate/check function returns `{ shouldRun: false }` on errors while the runtime treats errors as fail-open (run anyway), the API surface and runtime disagree on skip semantics. Also check EventEmitter async handlers — `async` callbacks on `'close'`/`'error'` events create unhandled rejections because EventEmitter doesn't await handler promises; wrap in try/catch
58
+ - Caller/callee disagreement on success/decision semantics — a function that resolves with `{ success: false }` while callers use `.catch()` for error handling means failures are treated as successes. Verify that the contract between producer and consumer is consistent: if callers branch on rejection, the function must reject on failure; if callers branch on a status field, the function must never reject. This extends beyond success/failure to any evaluation result — if a gate/check function returns `{ shouldRun: false }` on errors while the runtime treats errors as fail-open (run anyway), the API surface and runtime disagree on skip semantics. Also covers argument shape contracts — passing a wrapped object (`{ items: [...] }`) when the callee expects a bare array (or vice versa), or supplying arguments at the wrong parameter position, causes silent no-ops or partial processing; verify argument shapes match by reading the callee's signature, not assuming from naming conventions. Also check EventEmitter async handlers — `async` callbacks on `'close'`/`'error'` events create unhandled rejections because EventEmitter doesn't await handler promises; wrap in try/catch
59
59
  - Destructive operations in retry/cleanup paths assumed to succeed without their own error handling — if cleanup fails, retry logic crashes instead of reporting the intended failure
60
60
  - External service calls without configurable timeouts — a hung downstream service blocks the caller indefinitely
61
61
  - Missing fallback behavior when downstream services are unavailable (see also: retry without backoff in "Sync & replication")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slash-do",
3
- "version": "1.7.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",