@iceinvein/agent-skills 0.23.8 → 0.23.12

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 (123) hide show
  1. package/package.json +1 -1
  2. package/skills/index.json +3 -3
  3. package/skills/magpie/README.md +1 -1
  4. package/skills/magpie/SKILL.md +22 -21
  5. package/skills/magpie/bin/magpie.ts +63 -2
  6. package/skills/magpie/evals/README.md +22 -8
  7. package/skills/magpie/evals/bare-invocation-goes-local/case.yaml +4 -0
  8. package/skills/magpie/evals/bare-invocation-goes-local/fixture.sh +159 -0
  9. package/skills/magpie/evals/bare-invocation-goes-local/graders/branch-was-reachable.md +5 -0
  10. package/skills/magpie/evals/bare-invocation-goes-local/graders/never-went-to-a-pr.md +7 -0
  11. package/skills/magpie/evals/bare-invocation-goes-local/graders/setup-ran-local.md +6 -0
  12. package/skills/magpie/evals/bare-invocation-goes-local/prompt.md +11 -0
  13. package/skills/magpie/evals/baselines/claude-opus-5-5.json +27 -3
  14. package/skills/magpie/evals/quality/README.md +74 -1
  15. package/skills/magpie/evals/quality/__tests__/probe-specialist.test.ts +498 -0
  16. package/skills/magpie/evals/quality/__tests__/replay-full.test.ts +9 -0
  17. package/skills/magpie/evals/quality/probe-specialist.ts +672 -0
  18. package/skills/magpie/evals/quality/replay-full.ts +6 -2
  19. package/skills/magpie/evals/rules.json +8 -0
  20. package/skills/magpie/fixtures/fake-gh-with-lockfile.sh +37 -2
  21. package/skills/magpie/fixtures/fake-gh.sh +49 -2
  22. package/skills/magpie/references/critic.md +20 -4
  23. package/skills/magpie/references/proof.md +99 -0
  24. package/skills/magpie/references/scout.md +6 -1
  25. package/skills/magpie/references/specialists.md +15 -9
  26. package/skills/magpie/scripts/__tests__/cleanup-cmd.test.ts +103 -7
  27. package/skills/magpie/scripts/__tests__/cli.test.ts +69 -0
  28. package/skills/magpie/scripts/__tests__/critic-cmd.test.ts +46 -0
  29. package/skills/magpie/scripts/__tests__/critic.test.ts +11 -1
  30. package/skills/magpie/scripts/__tests__/dedupe-cmd.test.ts +20 -1
  31. package/skills/magpie/scripts/__tests__/git-diff.test.ts +23 -4
  32. package/skills/magpie/scripts/__tests__/handoff-cmd.test.ts +68 -0
  33. package/skills/magpie/scripts/__tests__/history.test.ts +204 -0
  34. package/skills/magpie/scripts/__tests__/impact-cmd.test.ts +477 -0
  35. package/skills/magpie/scripts/__tests__/impact-render.test.ts +365 -0
  36. package/skills/magpie/scripts/__tests__/impact.test.ts +915 -0
  37. package/skills/magpie/scripts/__tests__/incremental.test.ts +59 -8
  38. package/skills/magpie/scripts/__tests__/pipeline-e2e.test.ts +1 -1
  39. package/skills/magpie/scripts/__tests__/post-cmd.test.ts +58 -0
  40. package/skills/magpie/scripts/__tests__/pr-activity.test.ts +281 -0
  41. package/skills/magpie/scripts/__tests__/preview-cmd.test.ts +4 -4
  42. package/skills/magpie/scripts/__tests__/previous-findings.test.ts +267 -0
  43. package/skills/magpie/scripts/__tests__/proof-cmd.test.ts +260 -0
  44. package/skills/magpie/scripts/__tests__/proof.test.ts +219 -0
  45. package/skills/magpie/scripts/__tests__/refresh.test.ts +71 -0
  46. package/skills/magpie/scripts/__tests__/render-annotation.test.ts +34 -0
  47. package/skills/magpie/scripts/__tests__/render-findings.test.ts +75 -0
  48. package/skills/magpie/scripts/__tests__/render-progress.test.ts +9 -0
  49. package/skills/magpie/scripts/__tests__/setup-cmd.test.ts +376 -1
  50. package/skills/magpie/scripts/__tests__/shard-coverage.test.ts +79 -0
  51. package/skills/magpie/scripts/__tests__/skill-lint.test.ts +47 -2
  52. package/skills/magpie/scripts/__tests__/status-cmd.test.ts +20 -8
  53. package/skills/magpie/scripts/__tests__/types.test.ts +46 -0
  54. package/skills/magpie/scripts/cleanup-cmd.ts +88 -0
  55. package/skills/magpie/scripts/critic-cmd.ts +2 -0
  56. package/skills/magpie/scripts/critic.ts +4 -0
  57. package/skills/magpie/scripts/dedupe-cmd.ts +4 -0
  58. package/skills/magpie/scripts/evidence-filter.ts +10 -0
  59. package/skills/magpie/scripts/git-diff.ts +50 -19
  60. package/skills/magpie/scripts/handoff-cmd.ts +42 -3
  61. package/skills/magpie/scripts/history.ts +137 -0
  62. package/skills/magpie/scripts/impact-cmd.ts +202 -0
  63. package/skills/magpie/scripts/impact-render.ts +158 -0
  64. package/skills/magpie/scripts/impact.ts +622 -0
  65. package/skills/magpie/scripts/incremental.ts +44 -5
  66. package/skills/magpie/scripts/labels-cmd.ts +7 -3
  67. package/skills/magpie/scripts/post-cmd.ts +46 -0
  68. package/skills/magpie/scripts/pr-activity.ts +243 -0
  69. package/skills/magpie/scripts/preview-cmd.ts +3 -0
  70. package/skills/magpie/scripts/previous-findings.ts +181 -0
  71. package/skills/magpie/scripts/proof-cmd.ts +226 -0
  72. package/skills/magpie/scripts/proof.ts +150 -0
  73. package/skills/magpie/scripts/refresh.ts +11 -0
  74. package/skills/magpie/scripts/render-annotation.ts +17 -0
  75. package/skills/magpie/scripts/render-cmd.ts +12 -0
  76. package/skills/magpie/scripts/render-findings.ts +37 -1
  77. package/skills/magpie/scripts/render-progress.ts +3 -0
  78. package/skills/magpie/scripts/setup-cmd.ts +142 -11
  79. package/skills/magpie/scripts/shard-coverage.ts +53 -0
  80. package/skills/magpie/scripts/status-cmd.ts +2 -0
  81. package/skills/magpie/scripts/types.ts +39 -0
  82. package/skills/magpie/skill.json +1 -1
  83. package/skills/magpie/templates/styles.css +30 -0
  84. package/skills/sluice/SKILL.md +13 -0
  85. package/skills/sluice/evals/README.md +5 -2
  86. package/skills/sluice/evals/deep-plan-checks-the-intent/case.yaml +4 -0
  87. package/skills/sluice/evals/deep-plan-checks-the-intent/fixture.sh +124 -0
  88. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/announces-deep-channel.md +12 -0
  89. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/checker-dispatched.md +12 -0
  90. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/no-source-edit.md +11 -0
  91. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/no-source-write.md +11 -0
  92. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/signoff-reports-the-check.md +16 -0
  93. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/sluice-fired.md +5 -0
  94. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/spec-has-an-intent-map.md +19 -0
  95. package/skills/sluice/evals/deep-plan-checks-the-intent/graders/stopped-for-signoff.md +8 -0
  96. package/skills/sluice/evals/deep-plan-checks-the-intent/prompt.md +20 -0
  97. package/skills/sluice/evals/deep-plan-checks-the-plan/case.yaml +4 -0
  98. package/skills/sluice/evals/deep-plan-checks-the-plan/fixture.sh +178 -0
  99. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/announces-deep-channel.md +12 -0
  100. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/every-decision-built.md +15 -0
  101. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/no-source-edit.md +11 -0
  102. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/no-source-write.md +11 -0
  103. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/plan-checker-dispatched.md +11 -0
  104. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/plan-cites-the-spec.md +7 -0
  105. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/sluice-fired.md +5 -0
  106. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/stops-at-preflight.md +14 -0
  107. package/skills/sluice/evals/deep-plan-checks-the-plan/graders/validate-ran.md +9 -0
  108. package/skills/sluice/evals/deep-plan-checks-the-plan/prompt.md +12 -0
  109. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/case.yaml +4 -0
  110. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/fixture.sh +125 -0
  111. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/announces-deep-channel.md +12 -0
  112. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/context-cites-the-prior-spec.md +6 -0
  113. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/design-follows-the-prior-spec.md +21 -0
  114. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/design-written-to-docs.md +5 -0
  115. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/no-source-edit.md +11 -0
  116. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/no-source-write.md +11 -0
  117. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/graders/sluice-fired.md +5 -0
  118. package/skills/sluice/evals/deep-plan-reads-the-prior-spec/prompt.md +17 -0
  119. package/skills/sluice/evals/rules.json +24 -0
  120. package/skills/sluice/references/deep-channel.md +145 -8
  121. package/skills/sluice/scripts/plan.sh +115 -4
  122. package/skills/sluice/scripts/status.sh +32 -13
  123. package/skills/sluice/skill.json +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iceinvein/agent-skills",
3
- "version": "0.23.8",
3
+ "version": "0.23.12",
4
4
  "description": "Install agent skills into AI coding tools",
5
5
  "author": "iceinvein",
6
6
  "license": "MIT",
package/skills/index.json CHANGED
@@ -227,7 +227,7 @@
227
227
  "name": "magpie",
228
228
  "description": "Interactive PR review pipeline. Runs five parallel specialist subagents (security, bugs, performance, code-smells, architecture) plus a once-per-PR checks pass that finds tests and controls able to pass without proving their purpose, drops findings whose quoted evidence is not in the code, dedupes, runs critic subagents that re-check each finding against the worktree and set its risk label, peer-reviews via codex exec (falling back to a Claude second opinion when codex is unavailable), and serves an interactive HTML report for selecting or dismissing findings to post via gh, recording the outcome per finding as labels. Bundles a Bun CLI put on PATH by the skill's postinstall step under a bunx install, or by the plugin's bin/ under a Claude Code plugin install. Use when the user asks to review a GitHub pull request. Local mode (setup --local) runs the same pipeline on the current branch's diff from its merge base, uncommitted and untracked work included, against the caller's live tree, with no server or posting, and hands the ranked findings back in the terminal for an implementing or orchestrating agent to address. Splits oversized diffs into budgeted shards and rebuilds the diff from the local clone when gh pr diff refuses it.",
229
229
  "type": "prompt",
230
- "version": "0.14.5"
230
+ "version": "0.16.0"
231
231
  },
232
232
  {
233
233
  "name": "migrate",
@@ -293,9 +293,9 @@
293
293
  },
294
294
  {
295
295
  "name": "sluice",
296
- "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so a statusline segment, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Claude Code only; stands down where the superpowers pipeline governs the repo.",
296
+ "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so a statusline segment, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Claude Code only; stands down where the superpowers pipeline governs the repo.",
297
297
  "type": "prompt",
298
- "version": "0.27.0"
298
+ "version": "0.28.2"
299
299
  },
300
300
  {
301
301
  "name": "temporal-coupling-detector",
@@ -35,7 +35,7 @@ If you cloned this repo and want to run from source, you can also invoke `./inst
35
35
 
36
36
  Inside Claude Code, ask: "Review PR 1234" (or paste a PR URL). The agent reads SKILL.md and walks the pipeline; the CLI runs as `magpie setup`, `magpie serve`, etc.
37
37
 
38
- An implementing or orchestrating agent can also ask for a review of its own branch before a PR exists: local mode (`magpie setup <run-dir> --local [--base <ref>]`) reviews the merge base to working tree diff in place and hands the ranked findings back as terminal text via `magpie handoff`, with no server, report or posting.
38
+ An implementing or orchestrating agent can also ask for a review of its own branch before a PR exists: local mode (`magpie setup <run-dir> --local [--base <ref>]`) reviews the merge base to working tree diff in place and hands the ranked findings back as terminal text via `magpie handoff`, with no server, report or posting. `/magpie` with no arguments runs local mode; pass a PR number or URL to review a PR.
39
39
 
40
40
  ## Development
41
41
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: magpie
3
3
  description: Use when the user asks to review a GitHub pull request (a PR number, PR URL, or "review this PR"), or to self-review the current branch diff before a PR exists, typically requested by an implementing or orchestrating agent, with findings handed back in the terminal. Interactive PR review pipeline; five parallel specialist subagents, dedupe, critic, codex/Claude peer review, and an interactive HTML report for posting selected findings via gh. Follow the stage walkthrough in this skill; the description is not the procedure.
4
- argument-hint: "[<pr#>|<pr-url>|local] [--base <ref>] [--intent-file <path>]"
4
+ argument-hint: "[<pr#>|<pr-url>|local (default)] [--base <ref>] [--intent-file <path>]"
5
5
  ---
6
6
 
7
7
  # Magpie
@@ -16,7 +16,7 @@ Stop reading and follow these steps in order. Do not skip stages. Use the exact
16
16
 
17
17
  ### 0. Identify the PR
18
18
 
19
- A request with no PR that asks to review the current branch, the working tree, or work in progress, or arguments starting `local` (any `--base` or `--intent-file` after it go to setup), is local mode: follow "Local mode" below in place of this step and stages 1 and 2, then run stages 3 to 7 as written, taking `TARGET` from Local mode.
19
+ A bare invocation (no arguments and no PR named), a request with no PR that asks to review the current branch, the working tree, or work in progress, or arguments starting `local` or `--` (any `--base` or `--intent-file` go to setup), is local mode: follow "Local mode" below in place of this step and stages 1 and 2, then run stages 3 to 7b as written, taking `TARGET` from Local mode.
20
20
 
21
21
  Parse the user's request for a PR number, URL, or "this PR" (current branch). If ambiguous, ask one clarifying terminal question. Capture the PR number into `$PR_NUMBER` and the repo path into `$REPO` (default: the current working directory).
22
22
 
@@ -54,14 +54,12 @@ Setup then splits the filtered diff into shards, writing `$RUN_DIR/shards/manife
54
54
  and, when more than one shard results, `$RUN_DIR/shards/shard-<n>.patch`. `diff.patch`
55
55
  itself is never modified: shards are views over it. Re-split with a different budget
56
56
  using `magpie shard "$RUN_DIR" --budget <lines> --max-files <n>` (defaults: 6000 patch
57
- lines, 80 files). Re-splitting invalidates every existing
58
- `findings/<focus>.shard-<n>.json`, since a shard id then names a different file set:
59
- delete those files first, or stage 4's resume rule counts a pair as covered that
60
- nothing reviewed.
57
+ lines, 80 files). Delete every `findings/<focus>.shard-<n>.json` before re-splitting:
58
+ shard ids then name different files, and stage 4's resume rule would trust them.
61
59
 
62
- When a prior run exists for the same PR (active or archived under `~/.magpie/`), setup writes `$RUN_DIR/incremental.json` with `{previousRunId, previousSha, currentSha, sameSha}`. The post stage surfaces this as a "Incremental review since `<sha>`" trailer on the summary comment.
60
+ Setup writes `pr-activity.json` (checks, review threads, comments) and, on a re-review, `incremental.json` and `previous-findings.json` (last run's posted findings, whether their quoted code changed, and its dismissals).
63
61
 
64
- Setup also runs a deterministic test-coverage check: when the diff contains zero test or spec files anywhere, each non-test source file with `>= 10` added code lines gets a `domain: "tests"` finding in `$RUN_DIR/findings/tests.json`. That domain flows through dedupe/critic/peer-review like the LLM findings; no subagent is dispatched for it.
62
+ Setup also runs a deterministic test-coverage check: when the diff contains zero test or spec files anywhere, each non-test source file with `>= 10` added code lines gets a `domain: "tests"` finding in `$RUN_DIR/findings/tests.json`, reviewed downstream like the rest; no subagent is dispatched for it.
65
63
 
66
64
  ### 2. Serve
67
65
 
@@ -71,9 +69,9 @@ Start the HTML server in the background using the Bash tool with `run_in_backgro
71
69
  magpie serve "$RUN_DIR"
72
70
  ```
73
71
 
74
- Read `$RUN_DIR/state/server-info` for the URL; the server writes it asynchronously, so if it is missing, wait a moment and re-read (it appears within ~1s). Print to the user: "Open <url> in your browser to follow along."
72
+ Read `$RUN_DIR/state/server-info` for the URL (written within ~1s; re-read if missing). Print to the user: "Open <url> in your browser to follow along."
75
73
 
76
- The server shuts down after 30 idle minutes (an open report tab keeps it up) and deletes `state/server-info`. Nothing in the pipeline depends on it: re-run `magpie serve "$RUN_DIR"` to bring the report back.
74
+ The server stops after 30 idle minutes (an open report tab keeps it up); nothing depends on it, so re-run `magpie serve "$RUN_DIR"` to bring the report back.
77
75
 
78
76
  Render the first progress paint:
79
77
 
@@ -96,9 +94,11 @@ Append `{stage: context, status: done}` and re-render progress. If the scout wro
96
94
  Read `references/specialists.md` now, before dispatching anything: it holds the five focus blocks and the output contract every specialist prompt is built from. Assemble prompts from that file verbatim; written from memory they drift off the JSON contract, and `magpie dedupe` drops findings it cannot parse.
97
95
 
98
96
  Append `{stage: specialists, status: running}` to `$RUN_DIR/log.jsonl` and re-render
99
- progress, so the served page shows the stage as active rather than "Paused". Then read
97
+ progress. Then read
100
98
  `$RUN_DIR/shards/manifest.json`.
101
99
 
100
+ Run `magpie history "$RUN_DIR"` once; any output is part 6 of every specialist prompt.
101
+
102
102
  **One shard, zero shards, or no manifest** (a diff filtered down to nothing, e.g. a
103
103
  lockfile-only PR, yields `shards: []` in an otherwise normal manifest; a run predating
104
104
  this feature has no manifest at all): dispatch the five specialists in a single message,
@@ -118,14 +118,11 @@ many small files is split by the 80-file cap, so a larger `--budget` alone chang
118
118
  nothing); or review only the highest-risk shards, which means appending
119
119
  `{stage: shard-coverage, status: partial, reviewed: [<ids>], skipped: [<ids>]}` to
120
120
  `$RUN_DIR/log.jsonl` and telling the user in the terminal which shards go unreviewed.
121
- That log entry is the only record of the gap: the report has no unreviewed marker.
122
- Wait for the answer. This is the only interactive gate in the pipeline before the
123
- report, and it exists so that neither the cost nor a coverage gap is ever silent.
121
+ The report, summary comment and handoff name the skipped shards from that entry.
122
+ Wait for the answer; neither cost nor a coverage gap is ever silent.
124
123
 
125
124
  Dispatch by wave, one shard per wave, the five focuses in parallel within a wave,
126
- re-rendering progress between waves. That holds in-flight agents at five and makes a
127
- crash cheap to resume: only the `(focus, shard)` pairs whose findings file is missing
128
- need re-dispatching.
125
+ re-rendering progress between waves. That holds in-flight agents at five.
129
126
 
130
127
  After each subagent returns, append
131
128
  `{stage: specialist, focus: <focus>, shard: <n>, status: done, findings: <count>}` to
@@ -204,13 +201,17 @@ If codex returns non-zero on a batch, do not abort: record `{stage: peer-review,
204
201
 
205
202
  **Apply the verdicts (both paths).** Parse the merged verdicts and apply the `update` / `add` entries (an empty array means no change). A peer `fields.severity` (or `finding.severity` on an `add`) is ignored: severity is derived from `risk.impact`. Mint each `add`'s `id` as above before merging, since the peer contract does not carry ids. Then write `findings.final.json`. Re-render progress.
206
203
 
204
+ ### 7b. Proof
205
+
206
+ Append `{stage: proof, status: running}` and re-render progress. `magpie proof-prompt "$RUN_DIR"` fills `references/proof.md` for up to 8 serious findings, printing `<prompt path>\t<output path>` each. On a PR run with any printed, first install `$WORKTREE`'s dependencies once with the repo's frozen-lockfile command (`npm ci`, `uv sync --frozen`, ...); on failure log `{stage: proof-deps, status: skipped, error}` and go on. Dispatch the prompts as stage 6 does its batches, then `magpie proof-apply "$RUN_DIR"`: it drops disproved findings to `proof-dropped.json`, marks the rest and logs `done`. On a non-zero exit, delete only the `proof-<id>.json` files or leftovers stderr names, then re-dispatch or re-apply.
207
+
207
208
  ### 8. Report
208
209
 
209
210
  ```
210
211
  magpie render "$RUN_DIR" findings
211
212
  ```
212
213
 
213
- The report shows the top 10 recommended (`must-fix`/`should-fix`, highest score first) and folds the rest. `--top <n>` is not saved (the stage 9 re-render and `magpie serve`'s auto-refresh show 10 again), so use it only when nothing will re-render.
214
+ The report shows the top 10 recommended (`must-fix`/`should-fix`, highest score first) and folds the rest. `--top <n>` is not saved, so use it only when nothing will re-render.
214
215
 
215
216
  Append `{stage: report, status: done}` to `$RUN_DIR/log.jsonl` and re-render progress (the render CLI does not log this itself, and `magpie status` needs the `done` entry to resume past `report`).
216
217
 
@@ -294,9 +295,9 @@ The JSON output tells you `lastCompleted` and `next`. Resume from `next`:
294
295
  - Local run at `next: cleanup`: if the caller has not been sent the findings, re-run `magpie handoff` first (it only reads files).
295
296
  - If a specialist focus has no findings file but its sibling stages are done,
296
297
  re-dispatch only that focus. On a sharded run the unit is the `(focus, shard)` pair:
297
- read `shards/manifest.json`, and re-dispatch only the pairs with no
298
- `findings/<focus>.shard-<n>.json`. Never re-shard mid-run without deleting those
299
- files first (stage 1): the check would otherwise trust ids that moved.
298
+ re-dispatch only the pairs with no `findings/<focus>.shard-<n>.json`, skipping
299
+ shards a `shard-coverage: partial` entry skipped. Never re-shard mid-run without
300
+ deleting those files first (stage 1): shard ids move.
300
301
  - Non-null `error` means the run stopped on a failed stage. Report which stage to the user and confirm before re-running it.
301
302
 
302
303
  The original server is gone. Restart it with `magpie serve "$RUN_DIR"` (step 2) before re-rendering, so the user gets a live URL again.
@@ -13,6 +13,8 @@ Subcommands:
13
13
  (default origin/HEAD), committed and uncommitted
14
14
  target <run-dir> Print the directory findings are anchored against
15
15
  handoff <run-dir> Print local review findings as a ranked list
16
+ history <run-dir> Print what is already on the PR (open threads, comments,
17
+ dismissals, failing checks) for the specialist prompts
16
18
  serve <run-dir-or-id> Start the HTML server (accepts active or archived run id)
17
19
  dedupe <run-dir> Merge specialist findings into deduped set
18
20
  critic-prompt <run-dir> [--batch-size N]
@@ -20,13 +22,20 @@ Subcommands:
20
22
  critic-apply <run-dir> [--design-cap N]
21
23
  Apply critic verdicts, write findings.kept.json (no cap on
22
24
  code-smells + architecture keeps unless --design-cap is given)
25
+ proof-prompt <run-dir> Write one proof prompt per serious finding, print prompt and
26
+ output paths
27
+ proof-apply <run-dir> Fold proof results into findings.final.json, drop the disproved
23
28
  shard <run-dir> [--budget N] [--max-files N]
24
- Re-split diff.patch into budgeted shards
29
+ Re-split diff.patch into budgeted shards (and the
30
+ impact map's per-shard files, when impact.json exists)
31
+ impact <run-dir> Write impact.json and impact*.md: what outside the diff
32
+ the change touches
25
33
  render <run-dir> <page> [--top N]
26
34
  Render progress.html or findings.html (findings recommends
27
35
  the top N, default 10, and folds the rest)
28
36
  labels <run-dir> Write labels.json (posted, dismissed, ignored per finding)
29
- cleanup <run-dir> Remove worktree, stop server, write labels, archive run
37
+ cleanup <run-dir> Remove worktree, stop server, write labels, archive run,
38
+ delete saved refs of closed PRs
30
39
  status <run-dir> Print highest completed stage
31
40
  open [id] Open findings.html in your browser (defaults to latest run)
32
41
  post <run-dir> --ids a,b Post the given finding ids via gh (rich body + optional summary)
@@ -244,6 +253,24 @@ const HANDLERS: Record<string, Handler> = {
244
253
  const { runCriticApply } = await import('../scripts/critic-cmd.ts')
245
254
  return runCriticApply(runDir, designCap !== undefined ? { designCap } : {})
246
255
  },
256
+ 'proof-prompt': async (args) => {
257
+ const runDir = args[0]
258
+ if (!runDir) {
259
+ process.stderr.write('proof-prompt: missing <run-dir>\n')
260
+ return 2
261
+ }
262
+ const { runProofPrompt } = await import('../scripts/proof-cmd.ts')
263
+ return runProofPrompt(runDir)
264
+ },
265
+ 'proof-apply': async (args) => {
266
+ const runDir = args[0]
267
+ if (!runDir) {
268
+ process.stderr.write('proof-apply: missing <run-dir>\n')
269
+ return 2
270
+ }
271
+ const { runProofApply } = await import('../scripts/proof-cmd.ts')
272
+ return runProofApply(runDir)
273
+ },
247
274
  shard: async (args) => {
248
275
  const runDir = args[0]
249
276
  if (!runDir) {
@@ -283,8 +310,25 @@ const HANDLERS: Record<string, Handler> = {
283
310
  process.stdout.write(
284
311
  `${manifest.shards.length} shard(s), ${manifest.totalFiles} files, ${manifest.totalLines} patch lines\n`,
285
312
  )
313
+ // The impact map's per-shard files name shard ids, which the re-split just renumbered.
314
+ // runImpact reports its own outcome; the split itself has already succeeded.
315
+ const { existsSync } = await import('node:fs')
316
+ const { join } = await import('node:path')
317
+ if (existsSync(join(runDir, 'impact.json'))) {
318
+ const { runImpact } = await import('../scripts/impact-cmd.ts')
319
+ await runImpact(runDir)
320
+ }
286
321
  return 0
287
322
  },
323
+ impact: async (args) => {
324
+ const runDir = args[0]
325
+ if (!runDir || runDir.startsWith('-')) {
326
+ process.stderr.write('impact: missing <run-dir>\n')
327
+ return 2
328
+ }
329
+ const { runImpact } = await import('../scripts/impact-cmd.ts')
330
+ return runImpact(runDir)
331
+ },
288
332
  render: async (args) => {
289
333
  const runDir = args[0]
290
334
  const page = args[1]
@@ -306,6 +350,22 @@ const HANDLERS: Record<string, Handler> = {
306
350
  const { runRender } = await import('../scripts/render-cmd.ts')
307
351
  return runRender(runDir, page, topN !== undefined ? { topN } : {})
308
352
  },
353
+ history: async (args) => {
354
+ const runDir = args[0]
355
+ if (!runDir || runDir.startsWith('-')) {
356
+ process.stderr.write('history: missing <run-dir>\n')
357
+ return 2
358
+ }
359
+ const { readHistory, renderHistory } = await import('../scripts/history.ts')
360
+ try {
361
+ const text = renderHistory(await readHistory(runDir))
362
+ if (text !== '') process.stdout.write(`${text}\n`)
363
+ } catch (err) {
364
+ process.stderr.write(`history: ${err instanceof Error ? err.message : String(err)}\n`)
365
+ return 1
366
+ }
367
+ return 0
368
+ },
309
369
  labels: async (args) => {
310
370
  const runDir = args[0]
311
371
  if (!runDir) {
@@ -335,6 +395,7 @@ const HANDLERS: Record<string, Handler> = {
335
395
  runDir,
336
396
  repoPath,
337
397
  gitBin: process.env.MAGPIE_GIT_BIN || 'git',
398
+ ghBin: process.env.MAGPIE_GH_BIN || 'gh',
338
399
  killGraceMs,
339
400
  })
340
401
  },
@@ -1,7 +1,7 @@
1
1
  # magpie evals
2
2
 
3
- Six cases for `claude plugin eval`. Every one starts mid-pipeline, because the
4
- decisions this skill owns are the ones between the CLI calls: `scripts/__tests__/`
3
+ Seven cases for `claude plugin eval`. Each starts at a decision rather than at
4
+ the top of a run, most of them mid-pipeline, because the decisions this skill owns are the ones between the CLI calls: `scripts/__tests__/`
5
5
  already pins what `magpie setup`, `dedupe`, `shard`, `post` and `status` compute.
6
6
  What no unit test can reach is whether the agent stops where the walkthrough says
7
7
  stop, falls back where it says fall back, and keeps its hands off the things it
@@ -15,6 +15,7 @@ must not touch.
15
15
  | `post-folds-selection-events` | The user typed `post` after re-ticking | Folds `state/events` last-event-wins, posts `bugs-1,perf-1` only |
16
16
  | `resume-finds-active-run` | A fresh review ask on a PR with a live run | Checks `--list-runs` first, never calls `setup`, surfaces the interrupted run |
17
17
  | `local-mode-hands-back` | A local run resumed after peer review | Runs `handoff` then `cleanup`, replies with both finding titles, never serves, renders, posts or calls `gh` |
18
+ | `bare-invocation-goes-local` | A bare `/magpie` on a branch with an open PR | Runs `setup --local`, never `--pr`, never calls `gh` |
18
19
 
19
20
  ## Running
20
21
 
@@ -59,8 +60,8 @@ bun run eval:fresh accept skills/magpie <result.json>
59
60
 
60
61
  `rules.json` maps each rule the skill states to the cases that pin it, or says
61
62
  why none does; `diff` reads it to name rules at risk or ready to expire. What
62
- each verdict means is in `skills/sluice/evals/README.md`. No baseline has been
63
- accepted yet.
63
+ each verdict means is in `skills/sluice/evals/README.md`. The accepted baseline
64
+ is `baselines/claude-opus-5-5.json`.
64
65
 
65
66
  ## How the fixtures fake the pipeline
66
67
 
@@ -121,6 +122,16 @@ reported as pass/fail indicators, because they can never pass without the
121
122
  plugin. They are there to tell you whether a score came from magpie or from the
122
123
  model's own habits.
123
124
 
125
+ `bare-invocation-goes-local` has no such grader. Its prompt is `/magpie`, which
126
+ the child expands as a slash command, so the skill loads without a `Skill` call
127
+ and the trace does not record the load. `setup-ran-local` stands in for it: only
128
+ SKILL.md tells the agent to run `magpie setup --local`.
129
+
130
+ That case needs git in the child for the branch slug, and the xcrun shim at
131
+ `/usr/bin/git` fails in the sandbox, so its fixture puts a `git` wrapper on the
132
+ shims path that execs `/Library/Developer/CommandLineTools/usr/bin/git`. On a
133
+ machine without the Command Line Tools, point the wrapper at that machine's git.
134
+
124
135
  **Every `llm` grader carries `focus: last_message`.** Without it the judge is
125
136
  handed a window of the whole trace, and in a case that reads a 40,000-line diff
126
137
  the handback falls outside that window: the shard-gate rubric voted FAIL nine
@@ -175,7 +186,10 @@ Its default effort is `medium` where Claude Opus 5's is `high`, so a rubric that
175
186
  starts failing there is worth reading as a real behavioural difference before
176
187
  it is loosened.
177
188
 
178
- Not yet known: no case has been run with the no-plugin baseline arm, so the
179
- ablation delta is unmeasured, and no case other than the shard gate has been
180
- repeated within one invocation, so the per-case variance is only bounded by
181
- those two clean passes.
189
+ The current baseline (skill 0.15.0, CLI 2.1.306, 2026-10-21) ran every case
190
+ three times in both arms on Claude Opus 5.5, USD 10.31 and nine and a half
191
+ minutes at `-j 3`. Every case scored 1.00 with the plugin on all three runs
192
+ except `local-mode-hands-back`, which scored 0.80 once: the judge failed
193
+ `reply-lists-both-findings` 3/3 on that run, and its trace was not kept. Without
194
+ the plugin the cases score 0.40 to 0.78, so each one measures the skill rather
195
+ than the model's habits.
@@ -0,0 +1,4 @@
1
+ schema_version: "1.1"
2
+ name: bare-invocation-goes-local
3
+ context:
4
+ scaffold_script: fixture.sh
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env bash
2
+ # A bare /magpie on a feature branch that already has an open PR. With no PR
3
+ # named, the walkthrough routes to local mode, so the open PR is a lure: the
4
+ # gh fake answers `gh pr view` with it, and the case passes only if gh is never
5
+ # asked.
6
+ #
7
+ # The branch is an orphan history (it was imported, not branched from main), so
8
+ # no base has a merge base with it and the real `setup --local` fails in
9
+ # localBranchDiff. The walkthrough stops on a failed setup, which keeps the case
10
+ # to the routing decision: nothing past setup is dispatched or graded.
11
+ set -euo pipefail
12
+
13
+ BRANCH="feat/tenant-settings-cache"
14
+ CALLS="$PWD/.magpie-calls.log"
15
+ REPO="$PWD"
16
+
17
+ mkdir -p "$HOME/shims" "$HOME/tmp"
18
+ : > "$CALLS"
19
+
20
+ cat > "$HOME/shim-config" <<EOF
21
+ CALLS="$CALLS"
22
+ REPO="$REPO"
23
+ EOF
24
+
25
+ # The real magpie and gh are outside the eval sandbox and cannot be executed
26
+ # from inside it, so the child gets fakes rather than exit 126.
27
+ cat > "$HOME/.zshenv" <<'RC'
28
+ export PATH="$HOME/shims:/usr/bin:/bin:/usr/sbin:/sbin"
29
+ export TMPDIR="$HOME/tmp"
30
+ RC
31
+
32
+ # /usr/bin/git is the xcrun shim, which cannot write its cache in the sandbox,
33
+ # and local mode needs git for the branch slug. The Command Line Tools binary
34
+ # runs when called by full path (skills/sluice/evals/README.md has the details).
35
+ cat > "$HOME/shims/git" <<'SHIM'
36
+ #!/bin/sh
37
+ exec /Library/Developer/CommandLineTools/usr/bin/git "$@"
38
+ SHIM
39
+ chmod +x "$HOME/shims/git"
40
+
41
+ # setup --local makes the checks scripts/local-diff.ts makes, with the same
42
+ # messages, and writes what setup-cmd.ts writes for a local run when they pass.
43
+ # The PR path is not faked: reaching it fails the case.
44
+ cat > "$HOME/shims/magpie" <<'SHIM'
45
+ #!/usr/bin/env bash
46
+ . "$HOME/shim-config"
47
+ echo "magpie $*" >> "$CALLS"
48
+ case "${1:-}" in
49
+ --list-runs) ;;
50
+ setup)
51
+ shift
52
+ run_dir="$1"; shift
53
+ local_mode=0 base="origin/HEAD" repo="$PWD"
54
+ while [ $# -gt 0 ]; do
55
+ case "$1" in
56
+ --local) local_mode=1 ;;
57
+ --base) base="$2"; shift ;;
58
+ --repo) repo="$2"; shift ;;
59
+ --intent-file) shift ;;
60
+ esac
61
+ shift
62
+ done
63
+ if [ "$local_mode" = 0 ]; then
64
+ echo "fake magpie: PR setup is not faked" >&2
65
+ exit 64
66
+ fi
67
+ mkdir -p "$run_dir/findings"
68
+ if ! git -C "$repo" rev-parse --verify -q "$base^{commit}" > /dev/null; then
69
+ echo "{\"stage\":\"local-diff\",\"status\":\"error\",\"error\":\"cannot resolve base ref $base to a commit\"}" >> "$run_dir/log.jsonl"
70
+ echo "magpie: cannot resolve base ref $base to a commit" >&2
71
+ exit 4
72
+ fi
73
+ if ! merge_base=$(git -C "$repo" merge-base "$base" HEAD); then
74
+ echo "{\"stage\":\"local-diff\",\"status\":\"error\",\"error\":\"no merge base between $base and HEAD: \"}" >> "$run_dir/log.jsonl"
75
+ echo "magpie: no merge base between $base and HEAD: " >&2
76
+ exit 4
77
+ fi
78
+ head=$(git -C "$repo" rev-parse HEAD)
79
+ branch=$(git -C "$repo" symbolic-ref --short -q HEAD || true)
80
+ git -C "$repo" diff --no-color --no-ext-diff "$merge_base" > "$run_dir/diff.patch"
81
+ printf '{ "mode": "local", "root": "%s" }\n' "$repo" > "$run_dir/target.json"
82
+ git -C "$repo" log --format=%H%x1f%s%x1f%b%x1e "$merge_base..HEAD" |
83
+ python3 -c '
84
+ import json, sys
85
+ branch, base, merge_base, head = sys.argv[1:]
86
+ commits = []
87
+ for record in sys.stdin.read().split("\x1e"):
88
+ if record.strip():
89
+ oid, headline, body = record.strip("\n").split("\x1f")
90
+ commits.append({"oid": oid, "headline": headline, "body": body.strip()})
91
+ print(json.dumps({"branch": branch or None, "baseRef": base, "mergeBase": merge_base, "head": head,
92
+ "dirty": False, "author": "Asha Platform", "commits": commits, "intentFile": None}, indent=2))
93
+ ' "$branch" "$base" "$merge_base" "$head" > "$run_dir/local.json"
94
+ echo '[]' > "$run_dir/findings/tests.json"
95
+ printf '%s\n' '{"stage":"preflight","status":"done","missingOptional":["codex"]}' '{"stage":"setup","status":"done"}' > "$run_dir/log.jsonl"
96
+ echo "magpie: codex not found; peer review will use a Claude subagent"
97
+ echo "setup done: $run_dir"
98
+ ;;
99
+ target)
100
+ python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["root"])' "${2}/target.json"
101
+ ;;
102
+ *) echo "fake magpie: unsupported subcommand: $*" >&2; exit 64 ;;
103
+ esac
104
+ SHIM
105
+ chmod +x "$HOME/shims/magpie"
106
+
107
+ cat > "$HOME/shims/gh" <<'SHIM'
108
+ #!/usr/bin/env bash
109
+ . "$HOME/shim-config"
110
+ echo "gh $*" >> "$CALLS"
111
+ if [ "${1:-} ${2:-}" = "pr view" ] || [ "${1:-} ${2:-}" = "pr list" ]; then
112
+ echo '{"number":1337,"title":"feat: cache tenant settings","headRefName":"feat/tenant-settings-cache","state":"OPEN"}'
113
+ exit 0
114
+ fi
115
+ echo "fake gh: no request was made" >&2
116
+ exit 1
117
+ SHIM
118
+ chmod +x "$HOME/shims/gh"
119
+
120
+ export GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_GLOBAL=/dev/null
121
+ git init -q -b main .
122
+ git config commit.gpgsign false
123
+ printf '.magpie-calls.log\n' >> .git/info/exclude
124
+ export GIT_AUTHOR_NAME="Asha Platform" GIT_AUTHOR_EMAIL="asha@example.com"
125
+ export GIT_COMMITTER_NAME="Asha Platform" GIT_COMMITTER_EMAIL="asha@example.com"
126
+ mkdir -p src/settings
127
+
128
+ cat > src/settings/cache.ts <<'TS'
129
+ const store = new Map<string, Settings>()
130
+
131
+ export function clear() {
132
+ store.clear()
133
+ }
134
+ TS
135
+
136
+ git add src
137
+ git commit -q -m "feat: tenant settings store"
138
+ git update-ref refs/remotes/origin/main HEAD
139
+ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
140
+ git checkout -q --orphan "$BRANCH"
141
+
142
+ cat > src/settings/cache.ts <<'TS'
143
+ const store = new Map<string, Settings>()
144
+
145
+ export function put(tenantId: string, settings: Settings) {
146
+ store.set(tenantId, settings)
147
+ }
148
+
149
+ export function get(tenantId: string): Settings | undefined {
150
+ return store.get(tenantId)
151
+ }
152
+
153
+ export function clear() {
154
+ store.clear()
155
+ }
156
+ TS
157
+
158
+ git add src
159
+ git commit -q -m "feat: cache tenant settings in the request path"
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: regex
3
+ pattern: 'export function put\(tenantId'
4
+ target: { source: file, path: src/settings/cache.ts }
5
+ ---
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: regex
3
+ pattern: 'magpie setup .*--pr|(^|\n)gh '
4
+ match: not_contains
5
+ target: { source: file, path: .magpie-calls.log }
6
+ weight: 2
7
+ ---
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: regex
3
+ pattern: '(^|\n)magpie setup \S+ (\S+ )*--local'
4
+ target: { source: file, path: .magpie-calls.log }
5
+ weight: 3
6
+ ---
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: bare-invocation-goes-local
3
+ description: A bare /magpie on a branch that already has an open PR reviews the branch in local mode. It never looks the PR up or sets up a PR run.
4
+ tags: [magpie, local, routing, scaffold]
5
+ max_turns: 15
6
+ timeout_seconds: 600
7
+ allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Task]
8
+ expected_outcome: Runs magpie setup with --local against the workspace, never --pr, and never calls gh. The branch shares no history with any base, so setup fails and the run stops there, surfacing the error.
9
+ ---
10
+
11
+ /magpie
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "model": "claude-opus-5-5",
3
3
  "judgeModel": "claude-opus-5-5",
4
- "claudeVersion": "2.1.300",
5
- "skillVersion": "0.13.0",
6
- "date": "2026-10-15T14:11:31.564Z",
4
+ "claudeVersion": "2.1.306",
5
+ "skillVersion": "0.15.0",
6
+ "date": "2026-10-21T16:36:32.144Z",
7
7
  "cases": {
8
+ "bare-invocation-goes-local": {
9
+ "with": [
10
+ 1,
11
+ 1,
12
+ 1
13
+ ],
14
+ "without": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ]
19
+ },
8
20
  "codex-missing-falls-back": {
9
21
  "with": [
10
22
  1,
@@ -17,6 +29,18 @@
17
29
  0.5
18
30
  ]
19
31
  },
32
+ "local-mode-hands-back": {
33
+ "with": [
34
+ 1,
35
+ 1,
36
+ 0.8
37
+ ],
38
+ "without": [
39
+ 0.4,
40
+ 0.4,
41
+ 0.4
42
+ ]
43
+ },
20
44
  "post-folds-selection-events": {
21
45
  "with": [
22
46
  1,