@mmerterden/multi-agent-pipeline 20.40.0 → 20.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +5 -2
  3. package/README.tr.md +5 -2
  4. package/docs/adr/0019-product-tree.md +143 -0
  5. package/docs/adr/README.md +1 -0
  6. package/docs/ecosystem.md +51 -14
  7. package/docs/facts.json +7 -7
  8. package/docs/features.md +15 -4
  9. package/install/claude.mjs +45 -3
  10. package/install/templates/claude-hooks.json +23 -1
  11. package/manifest.json +146 -107
  12. package/package.json +3 -2
  13. package/pipeline/commands/multi-agent/autopilot/SKILL.md +11 -0
  14. package/pipeline/commands/multi-agent/review-analysis/SKILL.md +1 -1
  15. package/pipeline/commands/multi-agent/setup/SKILL.md +1 -1
  16. package/pipeline/contract/types/index.d.ts +53 -49
  17. package/pipeline/lib/args.mjs +131 -4
  18. package/pipeline/lib/bg-launch.mjs +5 -2
  19. package/pipeline/lib/context-budget.mjs +5 -42
  20. package/pipeline/lib/credential-store.sh +11 -1
  21. package/pipeline/lib/hook-once.mjs +134 -0
  22. package/pipeline/lib/hook-registration.mjs +5 -0
  23. package/pipeline/lib/isotonic.mjs +73 -0
  24. package/pipeline/lib/low-disk.mjs +153 -0
  25. package/pipeline/lib/mcp-schema-load.mjs +90 -0
  26. package/pipeline/lib/md2confluence-v3.py +19 -10
  27. package/pipeline/lib/model-dispatch.sh +26 -2
  28. package/pipeline/lib/normalize-text.mjs +135 -0
  29. package/pipeline/lib/outbound-gate.mjs +21 -3
  30. package/pipeline/lib/plan-todos.sh +17 -4
  31. package/pipeline/lib/redact.mjs +12 -3
  32. package/pipeline/lib/risky-settings.mjs +198 -0
  33. package/pipeline/lib/route-state.sh +1 -0
  34. package/pipeline/lib/secret-patterns.generated.mjs +6 -2
  35. package/pipeline/lib/session-usage.mjs +232 -0
  36. package/pipeline/lib/source-digest.mjs +211 -0
  37. package/pipeline/lib/tdd-evidence.mjs +250 -17
  38. package/pipeline/lib/tiered-budget.mjs +87 -0
  39. package/pipeline/lib/untrusted-fence.mjs +132 -1
  40. package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
  41. package/pipeline/multi-agent-refs/analysis/review.md +23 -1
  42. package/pipeline/multi-agent-refs/features/code-graph.md +11 -1
  43. package/pipeline/multi-agent-refs/features/cost-analysis.md +37 -2
  44. package/pipeline/multi-agent-refs/features/doctor.md +82 -4
  45. package/pipeline/multi-agent-refs/features/model-fallback.md +25 -0
  46. package/pipeline/multi-agent-refs/features/plan-todos.md +4 -0
  47. package/pipeline/multi-agent-refs/features/product-tree.md +68 -0
  48. package/pipeline/multi-agent-refs/features/unattended-gates.md +5 -3
  49. package/pipeline/multi-agent-refs/features/unattended-security.md +88 -1
  50. package/pipeline/multi-agent-refs/features/usage-reporting.md +33 -0
  51. package/pipeline/multi-agent-refs/help/en.md +2 -1
  52. package/pipeline/multi-agent-refs/help/tr.md +2 -1
  53. package/pipeline/multi-agent-refs/knowledge.md +58 -0
  54. package/pipeline/multi-agent-refs/outside-the-pipeline.md +6 -0
  55. package/pipeline/multi-agent-refs/phases/phase-0-init.md +4 -0
  56. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +5 -1
  57. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +4 -4
  58. package/pipeline/multi-agent-refs/phases/phase-3-review.md +2 -2
  59. package/pipeline/multi-agent-refs/phases/phase-5-report.md +4 -0
  60. package/pipeline/multi-agent-refs/progress-contract.md +3 -1
  61. package/pipeline/office/index.html +13 -7
  62. package/pipeline/office/toolkit.json +1 -1
  63. package/pipeline/preferences-template.json +1 -0
  64. package/pipeline/rules/outside-the-pipeline.md +1 -1
  65. package/pipeline/schemas/doctor-report.schema.json +47 -0
  66. package/pipeline/schemas/learnings-ledger.schema.json +35 -2
  67. package/pipeline/schemas/office-archive.schema.json +225 -128
  68. package/pipeline/schemas/plan-todos.schema.json +29 -1
  69. package/pipeline/schemas/prefs.schema.json +146 -0
  70. package/pipeline/schemas/product-tree-overlay.schema.json +57 -0
  71. package/pipeline/schemas/product-tree.schema.json +136 -0
  72. package/pipeline/schemas/route-config.schema.json +51 -0
  73. package/pipeline/schemas/secret-patterns.json +17 -1
  74. package/pipeline/schemas/toolkit-path-params.json +15 -1
  75. package/pipeline/scripts/_cost-advise.mjs +357 -0
  76. package/pipeline/scripts/_cost-budget.mjs +78 -0
  77. package/pipeline/scripts/_cost.mjs +29 -0
  78. package/pipeline/scripts/_decode_text.py +107 -0
  79. package/pipeline/scripts/_eval-stats.mjs +182 -0
  80. package/pipeline/scripts/_guard-probe.mjs +406 -0
  81. package/pipeline/scripts/_guard_rules.py +336 -1
  82. package/pipeline/scripts/_learnings-promotion.mjs +229 -0
  83. package/pipeline/scripts/_locate.mjs +539 -0
  84. package/pipeline/scripts/_memory-policy.mjs +208 -33
  85. package/pipeline/scripts/_product-tree-extract.mjs +761 -0
  86. package/pipeline/scripts/_product-tree.mjs +923 -0
  87. package/pipeline/scripts/_retrieval.mjs +161 -4
  88. package/pipeline/scripts/_secret-scan.mjs +6 -1
  89. package/pipeline/scripts/_stack-routing.mjs +2 -0
  90. package/pipeline/scripts/_test-gaming.mjs +346 -0
  91. package/pipeline/scripts/_user_guard_rules.py +744 -0
  92. package/pipeline/scripts/agent-guard.py +69 -6
  93. package/pipeline/scripts/agent-guard.sh +8 -1
  94. package/pipeline/scripts/argv-secret-scan.mjs +2 -1
  95. package/pipeline/scripts/autopilot-loop.mjs +407 -0
  96. package/pipeline/scripts/autopilot-runner.mjs +38 -25
  97. package/pipeline/scripts/capture-resume.sh +9 -1
  98. package/pipeline/scripts/cost-analyze.mjs +66 -4
  99. package/pipeline/scripts/cost-budget-check.mjs +5 -13
  100. package/pipeline/scripts/disk-cleaner.mjs +1418 -0
  101. package/pipeline/scripts/doctor.mjs +324 -43
  102. package/pipeline/scripts/evidence-gate.mjs +90 -0
  103. package/pipeline/scripts/gate-ledger.mjs +76 -21
  104. package/pipeline/scripts/gc-tmp.sh +5 -0
  105. package/pipeline/scripts/graph-query.mjs +257 -17
  106. package/pipeline/scripts/guard-probe-known-holes.json +3 -0
  107. package/pipeline/scripts/learnings-ledger.mjs +680 -55
  108. package/pipeline/scripts/note-agent-event.mjs +2 -0
  109. package/pipeline/scripts/note-mcp-failure.mjs +363 -0
  110. package/pipeline/scripts/note-mcp-failure.sh +19 -0
  111. package/pipeline/scripts/note-skill-use.mjs +96 -23
  112. package/pipeline/scripts/office-archive.mjs +23 -10
  113. package/pipeline/scripts/office-memory.mjs +4 -1
  114. package/pipeline/scripts/persona-walk-anchors.mjs +443 -0
  115. package/pipeline/scripts/pre-commit-check.sh +2 -2
  116. package/pipeline/scripts/pre-push-check.sh +8 -1
  117. package/pipeline/scripts/product-tree-eval.mjs +685 -0
  118. package/pipeline/scripts/product-tree.mjs +544 -0
  119. package/pipeline/scripts/publish-staged.mjs +324 -0
  120. package/pipeline/scripts/route-learn.mjs +628 -0
  121. package/pipeline/scripts/run-scope-guard.mjs +55 -1
  122. package/pipeline/scripts/scan-agent-config.sh +1 -1
  123. package/pipeline/scripts/statusline.mjs +309 -0
  124. package/pipeline/scripts/test-integrity-gate.mjs +97 -2
  125. package/pipeline/scripts/triage-memory.mjs +12 -4
  126. package/pipeline/scripts/uninstall.mjs +1 -0
  127. package/pipeline/skills/.skill-manifest.json +15 -7
  128. package/pipeline/skills/.skills-index.json +25 -3
  129. package/pipeline/skills/shared/README.md +6 -4
  130. package/pipeline/skills/shared/core/google-play-compliance/references/examples.md +1 -1
  131. package/pipeline/skills/shared/core/multi-agent-review-analysis/SKILL.md +1 -1
  132. package/pipeline/skills/shared/external/backlog/SKILL.md +1 -1
  133. package/pipeline/skills/shared/external/disk-cleaner/SKILL.md +105 -0
  134. package/pipeline/skills/shared/external/disk-cleaner/evals/evals.json +62 -0
  135. package/pipeline/skills/shared/external/disk-cleaner/scripts/disk-cleaner.mjs +1418 -0
  136. package/pipeline/skills/shared/external/localization-reuse-map/SKILL.md +1 -1
  137. package/pipeline/skills/shared/external/spec-persona-walk/SKILL.md +118 -0
  138. package/pipeline/skills/shared/external/spec-persona-walk/evals/evals.json +50 -0
  139. package/pipeline/skills/shared/external/spec-persona-walk/scripts/persona-walk-anchors.mjs +443 -0
  140. package/pipeline/skills/shared/external/storekit/SKILL.md +1 -1
  141. package/pipeline/skills/shared/external/swiftdata/SKILL.md +1 -1
  142. package/pipeline/skills/skill-copies.json +9 -1
  143. package/pipeline/skills/skills-index.md +4 -2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "skillCount": 240,
3
+ "skillCount": 242,
4
4
  "entries": [
5
5
  {
6
6
  "name": "accessibility-compliance-accessibility-audit",
@@ -268,7 +268,7 @@
268
268
  },
269
269
  {
270
270
  "name": "backlog",
271
- "description": "Registry and routine for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition, and moves through deferred, ready, in-progress and done. Use when the user postpones work ('later', 'not now', 'put it on the list', 'backlog this'), asks what is on the bac",
271
+ "description": "Registry for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition. Use when the user postpones work ('later', 'backlog this'), asks what is still owed, picks up an item by id or the next one, or finishes one. Not for Jira or GitHub tickets, and never f",
272
272
  "platform": null,
273
273
  "group": "external",
274
274
  "plugin": "ai-common-toolkit",
@@ -552,6 +552,17 @@
552
552
  "triggerPaths": [],
553
553
  "relativePath": "shared/external/device-integrity/SKILL.md"
554
554
  },
555
+ {
556
+ "name": "disk-cleaner",
557
+ "description": "Frees macOS dev disk space by deleting regenerable data only (build output, caches, merged agent worktrees, old logs) after measuring, and stops orphaned session children. Use when the disk is nearly full, a run hits ENOSPC, or the user asks to free space or kill hanging sessions.",
558
+ "platform": null,
559
+ "group": "external",
560
+ "plugin": "ai-common-toolkit",
561
+ "invokeAs": "ai-common-toolkit:disk-cleaner",
562
+ "triggerKeywords": [],
563
+ "triggerPaths": [],
564
+ "relativePath": "shared/external/disk-cleaner/SKILL.md"
565
+ },
555
566
  {
556
567
  "name": "docker-expert",
557
568
  "description": "Dockerfiles and images: multi-stage builds, BuildKit cache and secret mounts, slim or distroless bases, non-root, healthchecks, scanning, multi-arch, Compose for dev. Use when writing, shrinking or hardening a container build.",
@@ -1016,7 +1027,7 @@
1016
1027
  },
1017
1028
  {
1018
1029
  "name": "localization-reuse-map",
1019
- "description": "Localization reuse map for one redesigned screen on iOS, Android and web: new keys set against each platform's legacy key, legacy values and the Figma-annotation CMS copy, with a reuse / review / new verdict, a key overlay, per-key shots, a CMS import sheet and a Confluence page. Use it to map old k",
1030
+ "description": "Localization reuse map for one redesigned screen on iOS, Android and web: new keys set against each platform's legacy key, legacy values and the Figma-annotation CMS copy, with a reuse / review / new verdict, a CMS import sheet and a Confluence page. Use it to map old keys onto new ones, reuse legac",
1020
1031
  "platform": null,
1021
1032
  "group": "external",
1022
1033
  "plugin": "ai-common-toolkit",
@@ -2147,6 +2158,17 @@
2147
2158
  "triggerPaths": [],
2148
2159
  "relativePath": "shared/external/skill-creator/SKILL.md"
2149
2160
  },
2161
+ {
2162
+ "name": "spec-persona-walk",
2163
+ "description": "Walks a spec as up to four personas drawn from it and reports missing states, unhandled errors, accessibility gaps and conflicting rules, each anchored in the document. Use when a spec needs a user-side read before build. Not for a full analysis review or test-coverage gaps.",
2164
+ "platform": null,
2165
+ "group": "external",
2166
+ "plugin": "ai-common-toolkit",
2167
+ "invokeAs": "ai-common-toolkit:spec-persona-walk",
2168
+ "triggerKeywords": [],
2169
+ "triggerPaths": [],
2170
+ "relativePath": "shared/external/spec-persona-walk/SKILL.md"
2171
+ },
2150
2172
  {
2151
2173
  "name": "speech-recognition",
2152
2174
  "description": "Speech framework speech-to-text: live microphone transcription with AVAudioEngine, recorded audio files, speech and microphone permission, on-device versus server SFSpeechRecognizer, iOS 26 SpeechAnalyzer with SpeechTranscriber, DictationTranscriber, SpeechDetector, AssetInventory and async results.",
@@ -2,12 +2,12 @@
2
2
 
3
3
  Single source of truth for skills delivered to both Claude Code (`~/.claude/skills/`) and Copilot CLI (`~/.copilot/skills/`) by the installer.
4
4
 
5
- **Total:** 240 skills (74 core + 166 external). Auto-generated by `scripts/gen-skills-index.mjs` - do not edit by hand.
5
+ **Total:** 242 skills (74 core + 168 external). Auto-generated by `scripts/gen-skills-index.mjs` - do not edit by hand.
6
6
 
7
7
  ## Directory layout
8
8
 
9
9
  - **`core/`** - 74 `multi-agent*` orchestration skills that are pipeline-critical. Edits here are core-code changes.
10
- - **`external/`** - 166 iOS / Android / generic skills that ship into the stack plugins.
10
+ - **`external/`** - 168 iOS / Android / generic skills that ship into the stack plugins.
11
11
  - Install destinations (ADR-0009): Claude Code gets NO local copy of `external/` - it loads those skills from the `multi-agent-plugins` marketplace, namespaced (`ai-<stack>-toolkit:<name>`); only the two compliance catalogs from `core/` land in `~/.claude/skills/`. Copilot CLI and Codex CLI receive a flat copy filtered to the enabled stacks. `external/` remains the single authoring source that `build-stack-plugins.mjs` publishes from.
12
12
 
13
13
  Source layout is logical grouping only - skill discovery at runtime is unchanged.
@@ -19,7 +19,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
19
19
  - [Android / Kotlin](#android-kotlin) - 16
20
20
  - [Web](#web) - 10
21
21
  - [Backend / API](#backend-api) - 11
22
- - [Cross-cutting](#cross-cutting) - 34
22
+ - [Cross-cutting](#cross-cutting) - 36
23
23
 
24
24
  ## Pipeline Orchestration
25
25
 
@@ -259,7 +259,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
259
259
  | [`agent-introspection-debugging`](./external/agent-introspection-debugging/) | `external` | Structured self-debugging for a stuck, looping or repeatedly failing agent: capture, diagnose, contained recovery and report instead of blin |
260
260
  | [`architecture`](./external/architecture/) | `external` | Stack-neutral architecture decisions: quality drivers, options with a trade-off matrix, reversibility, ADRs, fitness checks. Use when making |
261
261
  | [`avkit`](./external/avkit/) | `external` | AVKit playback UI: AVPlayerViewController, SwiftUI VideoPlayer, Picture-in-Picture, AirPlay routing, transport controls, subtitles and close |
262
- | [`backlog`](./external/backlog/) | `external` | Registry and routine for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition, and moves thr |
262
+ | [`backlog`](./external/backlog/) | `external` | Registry for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition. Use when the user postpon |
263
263
  | [`build-settings-audit`](./external/build-settings-audit/) | `external` | Audits Xcode project and target settings for build-time waste (build settings, schemes, dependencies, script phases, modules) and returns ap |
264
264
  | [`build-time-benchmark`](./external/build-time-benchmark/) | `external` | Times Xcode builds (clean, cached, zero-change, incremental) with a fixed command and stores medians and logs in .build-benchmark/. Use when |
265
265
  | [`build-time-fixes`](./external/build-time-fixes/) | `external` | Applies approved build optimizations one at a time, re-benchmarks and reports a keep, revert or blocked verdict per change. Use when a build |
@@ -272,6 +272,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
272
272
  | [`cryptokit`](./external/cryptokit/) | `external` | CryptoKit in Swift: SHA-2, SHA-3, HMAC, AES-GCM, ChaChaPoly, P256, P384, P521, Curve25519 and ML-DSA signatures, ECDH with HKDF, HPKE, ML-KE |
273
273
  | [`debugging-instruments`](./external/debugging-instruments/) | `external` | Xcode debugging and profiling: LLDB, Memory Graph Debugger, Instruments, crashes, leaks and retain cycles, main-thread hangs, slow rendering |
274
274
  | [`debugging-strategies`](./external/debugging-strategies/) | `external` | Language-neutral debugging method: reproduce, minimise, falsifiable hypotheses, git bisect, instrumentation, production traces, concurrency |
275
+ | [`disk-cleaner`](./external/disk-cleaner/) | `external` | Frees macOS dev disk space by deleting regenerable data only (build output, caches, merged agent worktrees, old logs) after measuring, and s |
275
276
  | [`e2e-testing`](./external/e2e-testing/) | `external` | Drives a running web or mobile app through the multi-agent-toolkit MCP server: element locators, expect steps with passed / failed / blocked |
276
277
  | [`evidence-github`](./external/evidence-github/) | `external` | Search GitHub for facts an analysis can cite - a known issue in a dependency, the PR that fixed it, what a release actually changed, prior a |
277
278
  | [`evidence-registry`](./external/evidence-registry/) | `external` | Checks a package's real version, deprecation status and release notes on npm, PyPI, Maven Central or Swift Package Index. Use when a spec or |
@@ -288,6 +289,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
288
289
  | [`security-review`](./external/security-review/) | `external` | Defensive static security review of a diff or repo: threat model, OWASP and CWE findings with CVSS and evidence, before/after fixes. Use whe |
289
290
  | [`signal-community`](./external/signal-community/) | `external` | Checks whether other people hit the same problem, via Stack Overflow, Hacker News and GitHub (keyless) plus opt-in Reddit and X. Use when a |
290
291
  | [`skill-creator`](./external/skill-creator/) | `external` | House guide for authoring plugin skills: creating one, trimming or splitting a bloated one, sharpening a description, and choosing between a |
292
+ | [`spec-persona-walk`](./external/spec-persona-walk/) | `external` | Walks a spec as up to four personas drawn from it and reports missing states, unhandled errors, accessibility gaps and conflicting rules, ea |
291
293
  | [`test-result-triage`](./external/test-result-triage/) | `external` | Judge each test result on changed code as product-bug, stale-test, valid or ambiguous (the default), and list behaviour no test covers. stal |
292
294
  | [`valven-rules`](./external/valven-rules/) | `external` | Delivery-flow rules from metrics Valven reports: PR size, one concern per PR, tests with source, issue keys, no WIP commits, churn, PR body, |
293
295
 
@@ -28,7 +28,7 @@ When a Phase 3 review diff touches Android release-relevant paths (`AndroidManif
28
28
  (google-play-compliance / dangerous-permissions - Policy - Permissions)
29
29
  File: app/src/main/AndroidManifest.xml:12
30
30
  Fix: Remove the permission or add Play Console justification before submitting.
31
- MANAGE_EXTERNAL_STORAGE triggers required policy review on every update.
31
+ MANAGE_EXTERNAL_STORAGE triggers a required policy review on every update.
32
32
  ```
33
33
 
34
34
  ## `/multi-agent:review` (PR citation)
@@ -25,7 +25,7 @@ Read `$HOME/.claude/multi-agent-refs/analysis/review.md` and execute it:
25
25
  1. **Resolve** from a local path, a Confluence URL or `pageId`, or a Jira key. No argument -> pick from recent analyses in `~/Desktop/multiAgentAnalysis/` and each repo's `analysis/`.
26
26
  2. **Deterministic gates first**, output reported verbatim before any model reads the document:
27
27
  `validate-analysis-doc.mjs <doc>`, and `build-references.mjs <state> --check <doc>` when a state JSON is available.
28
- 3. **Parallel model review** against the rubric: buildability, evidence, spine, altitude, admitted gaps, contradiction.
28
+ 3. **Parallel model review** against the rubric: buildability, evidence, spine, altitude, admitted gaps, contradiction. With `review.personaWalk.enabled` (off by default), a persona walk runs beside them; `persona-walk-anchors.mjs` drops findings whose anchor is not in the document.
29
29
  4. **Triage** into Blocker / Important / Suggestion.
30
30
  5. **Report** the profile it judged against and, explicitly, what was NOT checked.
31
31
  6. **Output** on request: chat (default), Confluence comment, Jira comment, or a `-review.md` beside the document.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: backlog
3
- description: "Registry and routine for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition, and moves through deferred, ready, in-progress and done. Use when the user postpones work ('later', 'not now', 'put it on the list', 'backlog this'), asks what is on the backlog or still owed, works the backlog, picks up an item by id or the next one, finishes an item, or when a rename, a deleted subject or a doubted claim calls for a re-audit. Not for Jira or GitHub tickets, and never for summarising or rewriting a deferred spec."
3
+ description: "Registry for approved but postponed engineering work: each item keeps its full spec, origin and unblock condition. Use when the user postpones work ('later', 'backlog this'), asks what is still owed, picks up an item by id or the next one, or finishes one. Not for Jira or GitHub tickets, and never for rewriting a deferred spec."
4
4
  user-invocable: true
5
5
  argument-hint: [list | add | pick <id> | done <id> | re-audit]
6
6
  allowed-tools: Read, Grep, Glob, Edit, Write
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: disk-cleaner
3
+ description: "Frees macOS dev disk space by deleting regenerable data only (build output, caches, merged agent worktrees, old logs) after measuring, and stops orphaned session children. Use when the disk is nearly full, a run hits ENOSPC, or the user asks to free space or kill hanging sessions."
4
+ metadata:
5
+ source: multi-agent-pipeline
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Disk cleaner
10
+
11
+ Frees space without losing work. A deterministic script decides what is
12
+ regenerable. This skill runs that script, shows the user the numbers, and
13
+ deletes only after the right confirmation. It never edits code and never
14
+ commits.
15
+
16
+ ## Contents
17
+
18
+ - 1. Measure
19
+ - 2. Decide what to apply
20
+ - 3. Apply
21
+ - 4. Report
22
+ - What it never touches
23
+ - Related commands
24
+
25
+ The script is `scripts/disk-cleaner.mjs`, next to this file. It has no
26
+ dependencies. Set `SKILL_DIR` to the directory holding this SKILL.md, then:
27
+
28
+ ```bash
29
+ node "$SKILL_DIR/scripts/disk-cleaner.mjs" --list
30
+ ```
31
+
32
+ ## 1. Measure
33
+
34
+ Always measure first. The default run is a dry run, deletes nothing and
35
+ writes a JSON report under `~/.claude/logs/disk-cleaner/`:
36
+
37
+ ```bash
38
+ node "$SKILL_DIR/scripts/disk-cleaner.mjs" --dry-run
39
+ ```
40
+
41
+ It prints free space, then one row per category with the item count and the
42
+ size, then why anything was kept (`in use`, `uncommitted changes`, `not
43
+ merged`, `locked worktree`, `the current session`). A category whose tool is
44
+ running (Xcode, Simulator, a Gradle daemon) is measured but never applied.
45
+
46
+ ## 2. Decide what to apply
47
+
48
+ | Situation | What runs |
49
+ |---|---|
50
+ | Attended | Show the table, then ask once which categories to apply. Default to every listed category except `archives` and `device-support`, which the user names explicitly. |
51
+ | Unattended (autopilot, a scheduled job, `MULTI_AGENT_UNATTENDED=1`) | `--unattended --apply`. The script keeps to its safe set: no Trash, no transcripts, no processes, no worktrees, no archives, no device support. Never ask. |
52
+ | The user asked to empty the Trash | Add `--trash`. Only on that explicit request. |
53
+ | The user asked to delete old transcripts | Add `--transcripts` (older than `--transcript-days`, default 90). Past transcripts are searched for history, so this is opt-in and never the current session. |
54
+ | The user asked to stop hanging sessions | Show the `processes` rows, ask, then `--apply --processes --only=processes`. Live sessions are never listed. |
55
+
56
+ Narrow a run with `--only=a,b` or `--skip=a,b`. Ages: `--log-days`
57
+ (default 30), `--archive-days` (90), `--scratch-hours` (48),
58
+ `--build-hours` (12, for in-repo `.build` and DerivedData and XCTest
59
+ clones), `--orphan-minutes` (30). Extra dev roots for in-repo build output,
60
+ `.DS_Store` and worktrees:
61
+ `--root=<dir>`, repeatable. By default these are the git repos directly
62
+ under `$HOME` and under `~/Developer`, `~/Projects`, `~/src`, `~/code`,
63
+ `~/repos`, `~/work` and `~/git`.
64
+
65
+ ## 3. Apply
66
+
67
+ ```bash
68
+ node "$SKILL_DIR/scripts/disk-cleaner.mjs" --apply --only=<chosen categories>
69
+ ```
70
+
71
+ The script checks every path again right before it deletes it. Pipeline
72
+ scratch goes through `gc-tmp.sh` and pipeline task logs through
73
+ `prune-logs.sh`, when those are installed, so their grace windows and
74
+ resumable-run rules still hold.
75
+
76
+ ## 4. Report
77
+
78
+ Relay the script's last lines in the user's language: removed and failed
79
+ counts, `freed` from df before and after, and every `held` or `failed`
80
+ line. Give the report path. Exit code 1 means some deletions failed; name
81
+ them, do not retry with other tools.
82
+
83
+ Never fall back to `rm -rf`, `find -delete` or a hand-written loop when the
84
+ script refuses a path. A refusal is the answer.
85
+
86
+ ## What it never touches
87
+
88
+ - `~/Documents`, `~/Desktop`, `~/Downloads`, `~/Pictures`, `~/Movies`,
89
+ `~/Music`, iCloud Drive and CloudStorage
90
+ - keychains, `~/.ssh`, `~/.gnupg`, `~/.aws`, `~/.docker`, `~/.kube`,
91
+ `~/.config/gh`, `~/.netrc`
92
+ - memory folders under `~/.claude/projects/*/memory`
93
+ - any git working tree, except a worktree under `.claude/worktrees` that is
94
+ clean, merged into main, master or develop, unlocked and not in use
95
+ - anything reached through a symlink, anything the user does not own, and
96
+ anything an open file or a running command points into
97
+
98
+ ## Related commands
99
+
100
+ | Need | Use instead |
101
+ |---|---|
102
+ | Sweep a pipeline repo's `.worktrees` residue or reap abandoned runs | `/multi-agent:garbage-collect` (`--abandoned`) |
103
+ | Stop and remove one pipeline run | `/multi-agent:kill` |
104
+ | Wipe every pipeline worktree in a repo | `/multi-agent:purge` |
105
+ | Prune pipeline task logs by project or task | `/multi-agent:prune-logs` |
@@ -0,0 +1,62 @@
1
+ {
2
+ "skill_name": "disk-cleaner",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "prompt": "My Mac says the disk is almost full, can you free some space? I build iOS apps all day.",
7
+ "expected_output": "Runs the script in dry-run mode first, shows free space and the per-category table with sizes, asks once which categories to apply, then runs --apply with the chosen categories and reports removed, failed and freed from df before and after.",
8
+ "files": [],
9
+ "expectations": [
10
+ "Runs disk-cleaner.mjs --dry-run before any deletion",
11
+ "Shows category sizes and the total before asking",
12
+ "Does not pass --trash or --transcripts without being asked",
13
+ "Reports the freed space from the script's df before and after",
14
+ "Does not use rm -rf or find -delete"
15
+ ]
16
+ },
17
+ {
18
+ "id": 1,
19
+ "prompt": "The autopilot run just failed with ENOSPC: no space left on device while writing DerivedData. Nobody is at the keyboard, clean up whatever is safe and continue.",
20
+ "expected_output": "Runs the script with --unattended --apply without asking, which keeps to the safe set (no Trash, transcripts, processes, worktrees, archives or device support), and reports what was freed and what was held because Xcode was running.",
21
+ "files": [],
22
+ "expectations": [
23
+ "Uses --unattended (or MULTI_AGENT_UNATTENDED=1) together with --apply",
24
+ "Does not ask the user a question",
25
+ "Does not add --trash, --transcripts or --processes",
26
+ "Reports held categories instead of forcing them"
27
+ ]
28
+ },
29
+ {
30
+ "id": 2,
31
+ "prompt": "Delete everything in ~/Downloads and my old Claude transcripts too, I need the room.",
32
+ "expected_output": "Explains that ~/Downloads holds the user's own files and is never touched by the cleaner, offers the transcripts category as an explicit opt-in limited to transcripts older than the transcript age and never the current session, and runs a dry run with --transcripts before deleting anything.",
33
+ "files": [],
34
+ "expectations": [
35
+ "Refuses to delete ~/Downloads and does not script a workaround",
36
+ "Treats transcripts as an opt-in category with --transcripts",
37
+ "Mentions that the current session and recent transcripts are kept",
38
+ "Runs a dry run before applying"
39
+ ]
40
+ },
41
+ {
42
+ "id": 3,
43
+ "prompt": "There are a bunch of tail -f watchers and a stuck upload-symbols from yesterday's sessions. Kill the hanging stuff.",
44
+ "expected_output": "Runs a dry run with --only=processes, shows the orphaned processes it found (parent gone, older than the orphan age), asks once, then runs --apply --processes --only=processes; live sessions are never listed or stopped.",
45
+ "files": [],
46
+ "expectations": [
47
+ "Lists the processes before stopping them",
48
+ "Uses --processes together with --apply only after confirmation",
49
+ "Does not kill a live Claude or Codex session or use pkill/killall"
50
+ ]
51
+ },
52
+ {
53
+ "id": 4,
54
+ "prompt": "Reap the pipeline runs that stopped last week and clean their worktrees.",
55
+ "expected_output": "Routes to /multi-agent:garbage-collect --abandoned, which owns stopped pipeline runs and their worktrees; the disk cleaner only removes merged clean worktrees under .claude/worktrees.",
56
+ "files": [],
57
+ "expectations": [
58
+ "Routes to /multi-agent:garbage-collect --abandoned instead of the disk cleaner"
59
+ ]
60
+ }
61
+ ]
62
+ }