slash-do 2.6.0 → 2.7.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.
@@ -230,6 +230,7 @@ Each agent should:
230
230
  - **Infeasible** (300+ lines or requires deep domain expertise): keep the dependency
231
231
  5. Check if the package has known vulnerabilities: `npm audit`, `cargo audit`, `pip-audit`, etc.
232
232
  6. Check last publish date and maintenance status
233
+ 7. Check for **consolidation opportunities**: does this package overlap in purpose with another dependency in the project? (e.g., two state managers, two HTTP clients, two date libraries, two test runners). If so, flag which kept dependency could absorb this one's usage
233
234
 
234
235
  Report format:
235
236
  ```
@@ -240,16 +241,39 @@ Report format:
240
241
  - Replacement complexity: {Trivial|Moderate|Complex|Infeasible}
241
242
  - Maintenance: {last publish date, open issues, known CVEs}
242
243
  - Recommendation: **REMOVE** / **KEEP** / **EVALUATE**
244
+ - Consolidation target: {kept dependency that covers the same purpose, if any — e.g., "redux" for zustand, "dayjs" for moment}
243
245
  - Replacement sketch: {brief description of how to replace, if REMOVE}
244
246
  ```
245
247
 
246
248
  Wait for all agents to complete before proceeding.
247
249
 
250
+ ### 1d: Transitive Dependency Check
251
+
252
+ Before planning replacements, check whether any REMOVE candidate is also a transitive dependency of a package we are keeping. Removing a direct dependency that remains in the lock file as a transitive dep of a kept package provides zero supply chain benefit — the code is still downloaded, installed, and executable.
253
+
254
+ For each REMOVE candidate:
255
+
256
+ 1. Check if it appears as a transitive dependency of any Tier 1 or kept Tier 2 package:
257
+ - **Node.js (npm)**: `npm ls {package}` — check the output for dependents *other than the project root*. Since REMOVE candidates are direct dependencies, they always appear at the top level; the signal is whether a kept dependency *also* depends on them (shown as a nested entry under that kept package's tree)
258
+ - **Node.js (yarn)**: `yarn why {package}` — check if any kept dependency requires it
259
+ - **Node.js (pnpm)**: `pnpm why {package}` — same check
260
+ - **Rust**: `cargo tree -i {package}` — check if a kept crate depends on it
261
+ - **Python**: use a reverse dependency tree, e.g. `pipdeptree -r -p {package}` or `uv pip tree --invert | grep {package}`, and check whether any kept package depends on it (record the full chain)
262
+ - **Go**: `go mod graph | grep {package}` — check if a kept module requires it
263
+ - **Ruby**: `bundle why {gem}` — shows the dependency chain explaining why the gem is in the bundle; check if any kept gem appears in the chain
264
+ 2. If the package IS a transitive dependency of a kept package, determine the **removal motivation**:
265
+ - **Supply chain only** — the package was flagged purely for attack surface reduction (e.g., small/unmaintained utility). Downgrade to **KEEP (transitive)** because removing the direct entry doesn't remove the code from the lock file or the runtime.
266
+ - **Consolidation** — the package overlaps in purpose with another kept dependency and removal unifies the codebase around one solution (e.g., zustand→redux, moment→dayjs, lodash→native utils). Keep the **REMOVE** recommendation — the value is in eliminating redundant usage from *our* code, not in shrinking the lock file. Record the consolidation target (e.g., "consolidate state management into redux").
267
+ - Record the dependency chain in either case, root-to-leaf (e.g., `@react-three/fiber → tunnel-rat → zustand`)
268
+ 3. Exception: if the direct dependency pulls a **different major version** than the transitive one, removal still eliminates that version from the dependency tree. In this case, keep the REMOVE recommendation but note the version difference.
269
+
270
+ Update `DEPENDENCY_MAP` with transitive check results before proceeding to Phase 2.
271
+
248
272
 
249
273
  ## Phase 2: Replacement Plan
250
274
 
251
275
  1. Read the existing `PLAN.md` (create if it doesn't exist)
252
- 2. Filter to only REMOVE recommendations from Phase 1c
276
+ 2. Filter to only REMOVE recommendations from Phase 1c/1d (exclude any downgraded to KEEP (transitive) in Phase 1d)
253
277
  3. For EVALUATE recommendations: **Default mode** — treat as KEEP (conservative). **Heavy mode** — treat as REMOVE (aggressive). **Interactive mode** — present to user via `AskUserQuestion` for each. If both `--interactive` and `--heavy` are set, still prompt for each EVALUATE item (interactive takes precedence), but present REMOVE as the default suggestion
254
278
  4. Group removable dependencies by replacement strategy:
255
279
  - **Native replacement**: built-in API replaces the library (e.g., `crypto.randomUUID()`)
@@ -269,6 +293,16 @@ Estimated replacement code: ~{lines} lines across {files} new/modified files.
269
293
  |---------|------|---------------|------------|-------------|------------|------|
270
294
  | ... | ... | ... | ... | ... | ... | ... |
271
295
 
296
+ ### Dependencies to Remove — Consolidation (transitive dep of kept package, but redundant with another kept dep)
297
+ | Package | Tier | Consolidation Target | Transitive Via |
298
+ |---------|------|---------------------|----------------|
299
+ | ... | ... | ... | ... |
300
+
301
+ ### Dependencies Kept — Transitive (would remain in lock file, no consolidation value)
302
+ | Package | Tier | Kept Via (dependency chain) |
303
+ |---------|------|-----------------------------|
304
+ | ... | ... | ... |
305
+
272
306
  ### Dependencies Kept (with rationale)
273
307
  | Package | Tier | Reason Kept |
274
308
  |---------|------|-------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slash-do",
3
- "version": "2.6.0",
3
+ "version": "2.7.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",