@nklisch/pi-agile-workflow 0.15.3

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 (203) hide show
  1. package/.claude-plugin/plugin.json +10 -0
  2. package/.codex-plugin/plugin.json +28 -0
  3. package/CHANGELOG.md +591 -0
  4. package/README.md +107 -0
  5. package/docs/ARCHITECTURE.md +716 -0
  6. package/docs/MIGRATION.md +419 -0
  7. package/docs/PRINCIPLES.md +464 -0
  8. package/docs/ROADMAP.md +95 -0
  9. package/docs/SPEC.md +855 -0
  10. package/docs/VISION.md +106 -0
  11. package/extensions/agile-workflow.test.ts +419 -0
  12. package/extensions/agile-workflow.ts +467 -0
  13. package/hooks/hooks.json +52 -0
  14. package/hooks/scripts/prompt-context.py +628 -0
  15. package/hooks/scripts/substrate-maintainer.py +359 -0
  16. package/hooks/scripts/test_prompt_context.py +757 -0
  17. package/package.json +30 -0
  18. package/scripts/install-work-view.sh +165 -0
  19. package/scripts/tests/agent-metadata.test.sh +75 -0
  20. package/scripts/tests/bump-version.test.sh +552 -0
  21. package/scripts/tests/channel-parity.test.sh +117 -0
  22. package/scripts/tests/convert-content-integrity.test.sh +246 -0
  23. package/scripts/tests/convert-install-routing.test.sh +159 -0
  24. package/scripts/tests/install-work-view.test.sh +411 -0
  25. package/scripts/tests/pi-package-metadata.test.sh +119 -0
  26. package/scripts/tests/work-board-shim.test.sh +239 -0
  27. package/scripts/tests/work-view-dist-version.test.sh +105 -0
  28. package/scripts/work-board.sh +64 -0
  29. package/scripts/work-view.sh +423 -0
  30. package/skills/autopilot/SKILL.md +330 -0
  31. package/skills/autopilot/agents/openai.yaml +6 -0
  32. package/skills/board/SKILL.md +62 -0
  33. package/skills/board/agents/openai.yaml +6 -0
  34. package/skills/bold-refactor/SKILL.md +244 -0
  35. package/skills/bold-refactor/agents/openai.yaml +6 -0
  36. package/skills/bug-scan/SKILL.md +378 -0
  37. package/skills/bug-scan/agents/openai.yaml +6 -0
  38. package/skills/bug-scan/references/async-promises.md +119 -0
  39. package/skills/bug-scan/references/concurrency-races.md +148 -0
  40. package/skills/bug-scan/references/data-layer.md +167 -0
  41. package/skills/bug-scan/references/error-handling.md +197 -0
  42. package/skills/bug-scan/references/gate-item-template.md +94 -0
  43. package/skills/bug-scan/references/language-footguns.md +219 -0
  44. package/skills/bug-scan/references/parked-item-template.md +103 -0
  45. package/skills/bug-scan/references/report-template.md +115 -0
  46. package/skills/bug-scan/references/resource-leaks.md +199 -0
  47. package/skills/bug-scan/references/state-closures.md +148 -0
  48. package/skills/bug-scan/references/time-numbers.md +158 -0
  49. package/skills/convert/SKILL.md +1463 -0
  50. package/skills/convert/agents/openai.yaml +6 -0
  51. package/skills/convert/references/legacy-overlap-migration.md +179 -0
  52. package/skills/deep-code-scan/SKILL.md +378 -0
  53. package/skills/deep-code-scan/agents/openai.yaml +6 -0
  54. package/skills/deep-code-scan/references/artifact-ledger.md +148 -0
  55. package/skills/deep-code-scan/references/consolidation.md +91 -0
  56. package/skills/deep-code-scan/references/decomposition.md +127 -0
  57. package/skills/deep-code-scan/references/item-templates.md +263 -0
  58. package/skills/deep-code-scan/references/lane-catalog.md +129 -0
  59. package/skills/deep-code-scan/references/review-gauntlet.md +108 -0
  60. package/skills/deep-code-scan/references/scanner-brief.md +152 -0
  61. package/skills/e2e-test-design/SKILL.md +517 -0
  62. package/skills/e2e-test-design/references/anti-tautology.md +261 -0
  63. package/skills/e2e-test-design/references/service-mocks.md +234 -0
  64. package/skills/e2e-test-design/references/test-taxonomy.md +211 -0
  65. package/skills/epic-design/SKILL.md +476 -0
  66. package/skills/epicize/SKILL.md +210 -0
  67. package/skills/epicize/agents/openai.yaml +6 -0
  68. package/skills/feature-design/SKILL.md +472 -0
  69. package/skills/fix/SKILL.md +173 -0
  70. package/skills/gate-cruft/SKILL.md +258 -0
  71. package/skills/gate-docs/SKILL.md +278 -0
  72. package/skills/gate-patterns/SKILL.md +389 -0
  73. package/skills/gate-refactor/SKILL.md +408 -0
  74. package/skills/gate-security/SKILL.md +275 -0
  75. package/skills/gate-tests/SKILL.md +367 -0
  76. package/skills/groom/SKILL.md +162 -0
  77. package/skills/groom/agents/openai.yaml +6 -0
  78. package/skills/ideate/SKILL.md +185 -0
  79. package/skills/ideate/agents/openai.yaml +6 -0
  80. package/skills/implement/SKILL.md +288 -0
  81. package/skills/implement-orchestrator/SKILL.md +604 -0
  82. package/skills/park/SKILL.md +111 -0
  83. package/skills/perf-design/SKILL.md +427 -0
  84. package/skills/perf-scout/SKILL.md +404 -0
  85. package/skills/perf-scout/agents/openai.yaml +6 -0
  86. package/skills/perf-scout/references/algorithmic-and-data-structures.md +126 -0
  87. package/skills/perf-scout/references/approximation-and-precomputation.md +136 -0
  88. package/skills/perf-scout/references/caching-and-memoization.md +123 -0
  89. package/skills/perf-scout/references/compiler-runtime-and-language.md +136 -0
  90. package/skills/perf-scout/references/database-and-storage-internals.md +144 -0
  91. package/skills/perf-scout/references/distributed-systems.md +150 -0
  92. package/skills/perf-scout/references/game-engine-and-realtime.md +136 -0
  93. package/skills/perf-scout/references/gpu-and-accelerators.md +130 -0
  94. package/skills/perf-scout/references/idea-ranking.md +75 -0
  95. package/skills/perf-scout/references/io-and-batching.md +135 -0
  96. package/skills/perf-scout/references/memory-and-data-locality.md +137 -0
  97. package/skills/perf-scout/references/parallelism-and-vectorization.md +126 -0
  98. package/skills/perf-scout/references/parked-item-template.md +117 -0
  99. package/skills/perf-scout/references/peer-review-pass.md +150 -0
  100. package/skills/perf-scout/references/report-template.md +148 -0
  101. package/skills/principles/SKILL.md +678 -0
  102. package/skills/principles/references/models.md +191 -0
  103. package/skills/principles/references/subagents.md +158 -0
  104. package/skills/prose-author/SKILL.md +185 -0
  105. package/skills/refactor-conventions-creator/SKILL.md +359 -0
  106. package/skills/refactor-conventions-creator/agents/openai.yaml +6 -0
  107. package/skills/refactor-conventions-creator/references/common-structures.md +91 -0
  108. package/skills/refactor-conventions-creator/references/common-styles.md +90 -0
  109. package/skills/refactor-design/SKILL.md +384 -0
  110. package/skills/release-deploy/SKILL.md +667 -0
  111. package/skills/release-deploy/agents/openai.yaml +6 -0
  112. package/skills/research/SKILL.md +166 -0
  113. package/skills/research/agents/openai.yaml +6 -0
  114. package/skills/review/SKILL.md +267 -0
  115. package/skills/review/references/deep-review.md +98 -0
  116. package/skills/review/references/review-lenses.md +68 -0
  117. package/skills/review/references/substrate-side-effects.md +161 -0
  118. package/skills/review/references/target-resolution.md +52 -0
  119. package/skills/scope/SKILL.md +486 -0
  120. package/work-view/Cargo.lock +486 -0
  121. package/work-view/Cargo.toml +9 -0
  122. package/work-view/crates/cli/.work-view-version +1 -0
  123. package/work-view/crates/cli/Cargo.toml +18 -0
  124. package/work-view/crates/cli/src/actionable.rs +500 -0
  125. package/work-view/crates/cli/src/args.rs +792 -0
  126. package/work-view/crates/cli/src/board/assets/board.css +855 -0
  127. package/work-view/crates/cli/src/board/assets/board.js +259 -0
  128. package/work-view/crates/cli/src/board/assets/card.js +139 -0
  129. package/work-view/crates/cli/src/board/assets/components.css +290 -0
  130. package/work-view/crates/cli/src/board/assets/dependency.js +1193 -0
  131. package/work-view/crates/cli/src/board/assets/detail.js +256 -0
  132. package/work-view/crates/cli/src/board/assets/filters.js +389 -0
  133. package/work-view/crates/cli/src/board/assets/index.html +77 -0
  134. package/work-view/crates/cli/src/board/assets/kanban.js +231 -0
  135. package/work-view/crates/cli/src/board/assets/markdown.js +260 -0
  136. package/work-view/crates/cli/src/board/assets/motion.css +131 -0
  137. package/work-view/crates/cli/src/board/assets/state.js +245 -0
  138. package/work-view/crates/cli/src/board/assets/table.js +304 -0
  139. package/work-view/crates/cli/src/board/assets/tokens.css +602 -0
  140. package/work-view/crates/cli/src/board/assets/views.js +41 -0
  141. package/work-view/crates/cli/src/board/assets.rs +162 -0
  142. package/work-view/crates/cli/src/board/feed.rs +204 -0
  143. package/work-view/crates/cli/src/board/mod.rs +246 -0
  144. package/work-view/crates/cli/src/board/open.rs +144 -0
  145. package/work-view/crates/cli/src/board/server.rs +407 -0
  146. package/work-view/crates/cli/src/main.rs +195 -0
  147. package/work-view/crates/cli/src/render.rs +354 -0
  148. package/work-view/crates/cli/src/scope.rs +157 -0
  149. package/work-view/crates/cli/src/stale.rs +581 -0
  150. package/work-view/crates/cli/tests/board-js/dependency-table.test.mjs +64 -0
  151. package/work-view/crates/cli/tests/board-js/expanded-browsing.test.mjs +79 -0
  152. package/work-view/crates/cli/tests/board-js/harness-smoke.test.mjs +11 -0
  153. package/work-view/crates/cli/tests/board-js/harness.mjs +437 -0
  154. package/work-view/crates/cli/tests/board-js/kanban-detail.test.mjs +75 -0
  155. package/work-view/crates/cli/tests/board-js/markdown-filter.test.mjs +60 -0
  156. package/work-view/crates/cli/tests/fixtures/golden/.work/CONVENTIONS.md +3 -0
  157. package/work-view/crates/cli/tests/fixtures/golden/.work/active/epics/epic-alpha.md +16 -0
  158. package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-a.md +16 -0
  159. package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-b.md +16 -0
  160. package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-alpha-1.md +16 -0
  161. package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-research-1.md +19 -0
  162. package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-done.md +16 -0
  163. package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-shipped.md +18 -0
  164. package/work-view/crates/cli/tests/fixtures/golden/.work/backlog/idea-backlog.md +7 -0
  165. package/work-view/crates/cli/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
  166. package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/CONVENTIONS.md +6 -0
  167. package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-dep-done.md +17 -0
  168. package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-design-ready.md +17 -0
  169. package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-impl-ready.md +17 -0
  170. package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/stories/story-review-ready.md +17 -0
  171. package/work-view/crates/cli/tests/fixtures/with-malformed/.work/CONVENTIONS.md +4 -0
  172. package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/epics/malformed-no-closing-fence.md +8 -0
  173. package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/features/good-item.md +16 -0
  174. package/work-view/crates/cli/tests/integration.rs +2833 -0
  175. package/work-view/crates/core/Cargo.toml +13 -0
  176. package/work-view/crates/core/src/error.rs +61 -0
  177. package/work-view/crates/core/src/filter.rs +804 -0
  178. package/work-view/crates/core/src/graph.rs +324 -0
  179. package/work-view/crates/core/src/index.rs +590 -0
  180. package/work-view/crates/core/src/lib.rs +54 -0
  181. package/work-view/crates/core/src/model.rs +202 -0
  182. package/work-view/crates/core/src/parse.rs +494 -0
  183. package/work-view/crates/core/tests/fixtures/golden/.work/CONVENTIONS.md +15 -0
  184. package/work-view/crates/core/tests/fixtures/golden/.work/active/epics/epic-core.md +16 -0
  185. package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-parser.md +16 -0
  186. package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-query.md +16 -0
  187. package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/malformed-no-id.md +15 -0
  188. package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-parse-unit.md +16 -0
  189. package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-security-gate.md +16 -0
  190. package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-old.md +16 -0
  191. package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-parser.md +17 -0
  192. package/work-view/crates/core/tests/fixtures/golden/.work/backlog/idea-future-board.md +7 -0
  193. package/work-view/crates/core/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
  194. package/work-view/crates/core/tests/fixtures/precedence/.work/CONVENTIONS.md +10 -0
  195. package/work-view/crates/core/tests/fixtures/precedence/.work/archive/dup-item.md +18 -0
  196. package/work-view/crates/core/tests/fixtures/precedence/.work/releases/v2.0/dup-item.md +18 -0
  197. package/work-view/crates/core/tests/integration.rs +541 -0
  198. package/work-view/dist/.gitattributes +1 -0
  199. package/work-view/dist/README.md +42 -0
  200. package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
  201. package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
  202. package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
  203. package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
@@ -0,0 +1,150 @@
1
+ # Cross-Model Peer Pass — Perf-Scout
2
+
3
+ > The mechanics of Phase 5. This is the skill's headline value: a **different
4
+ > model class** has different blind spots, so it's the single best source of the
5
+ > angles your scouts collectively missed — and a sharp pruner of ideas that don't
6
+ > hold up. Run it by default; only skip on `--no-peer` (and say what's being lost).
7
+
8
+ ## Why a different model, not just another pass
9
+
10
+ Your scouts share your model's training and habits, so they tend to miss the same
11
+ things. The value of peeragent here is **independent blind spots**, not a more
12
+ authoritative answer. A Codex/Gemini reviewer will flag generic ideas you rated
13
+ too highly and propose strategies your lenses didn't reach. That asymmetry is the
14
+ whole point — their misses are your catches and vice versa.
15
+
16
+ This mirrors the global rule: *don't use peeragent when the peer would be the same
17
+ model class as the host.* If the only available peer is the same class as you, the
18
+ fallback sub-agent (below) is the better choice precisely because a fresh,
19
+ context-isolated agent still gives *some* independence.
20
+
21
+ ## Step 1: Pick the reviewer
22
+
23
+ **Preferred — different model class via peeragent.** The whole value is blind-spot
24
+ diversity, so pick the peer that **maximizes training difference from the host**,
25
+ not a "better" model. Resolve the concrete host→peer pairing (Claude host →
26
+ codex/gemini/zai; Codex host → claude opus/gemini/zai; Gemini host → claude opus/
27
+ codex/zai; GLM host → claude opus/codex/gemini) and the exact `--agent/--model/
28
+ --effort` flags from [../../principles/references/models.md](../../principles/references/models.md)
29
+ §4 and §7 — keep the matrix in one place rather than duplicating it here.
30
+
31
+ Resolve the wrapper before calling; never assume `peeragent` is on `PATH`:
32
+
33
+ 1. If `PEERAGENT_BIN` names an executable, use it.
34
+ 2. Otherwise resolve the peeragent plugin's bundled wrapper (`bin/peeragent`
35
+ under the peeragent plugin/checkout location).
36
+ 3. Use bare `peeragent` only if a bundled path can't be found and
37
+ `command -v peeragent` succeeds. If a bare call fails with `command not
38
+ found`, retry once with the bundled path before giving up.
39
+
40
+ Run the wrapper in the host harness's outside-sandbox command mode so the peer
41
+ CLI inherits normal network/auth/process env. Do **not** pass `--full-access` —
42
+ review never needs it.
43
+
44
+ When the target is a top-tier reasoning peer (Opus-class, xhigh Codex/GLM),
45
+ budget real wall time. Large deck reviews commonly take 10 to 30 minutes, and
46
+ the wrapper may be quiet for most of that time. Do not treat "no response after a
47
+ few minutes" as a hang, and do not switch to the fallback unless the process
48
+ exits, reports failure, or exceeds a timeout chosen for top-tier review work.
49
+
50
+ **This pass is the adversarial phase.** For a deep or complex deck, precede it
51
+ with a **completeness/advisory** pass from a *second* different class if
52
+ available — does the deck miss whole lenses or high-leverage angles before you
53
+ start pruning? That realizes the 2-class rule (advisory class A, adversarial
54
+ class B). See the two-phase ordering in
55
+ [../../principles/references/models.md](../../principles/references/models.md) §6.
56
+
57
+ **Fallback — fresh max-effort sub-agent.** Use this when peeragent is
58
+ unavailable, the wrapper returns `failed`/`blocked`, or the only peer would be the
59
+ same model class. Spawn one in-harness agent at the strongest reviewer setting
60
+ and give it **only** the codebase, the lens catalog (`references/`), and the idea
61
+ deck — deliberately NOT your scouts' reasoning or notes — so it reviews with
62
+ independent context.
63
+ Context isolation is what buys independence when model diversity isn't available.
64
+ Frame it explicitly as an adversarial gap-finder (same three asks below).
65
+
66
+ State in the report which reviewer ran (peer class + effort, or "fallback
67
+ sub-agent — peeragent unavailable") so the cross-model value is transparent.
68
+
69
+ ## Step 2: Ask for three things
70
+
71
+ Write the aggregated, ranked idea deck to a temp file and pass it via
72
+ `--prompt-file` (the deck is large). Ask the reviewer — without leading it toward
73
+ your conclusions — for exactly these, in this order of importance:
74
+
75
+ 1. **Gaps (most valuable).** High-leverage performance angles, strategies, or
76
+ whole *lenses* this deck missed. "What would a specialist from a demanding
77
+ domain (a database engine, a game engine, an HPC/HFT shop, a GPU programmer)
78
+ notice here that isn't on this deck?" This is why a different model is worth
79
+ the call.
80
+ 2. **Weak ideas to prune.** Which candidates are implausible, generic, wrong about
81
+ the code, or not worth a measurement — and why. Verify against the actual
82
+ files; don't take the reviewer's word blindly.
83
+ 3. **New candidates.** Concrete new ideas in the same hypothesis framing (title,
84
+ borrowed-from, location, the idea, why it might help, validate-by). Same
85
+ honesty bar: speculative, with a validation path, never asserted as real.
86
+
87
+ Always include the **no-recursion instruction**: tell the reviewer not to call
88
+ peeragent's own `peer`/`peer-review` skills or the `peeragent` wrapper to delegate
89
+ back out — it may use its own harness's internal sub-agents, but recursive
90
+ peeragent delegation loops host→reviewer→host and burns budget. The reviewer is
91
+ the endpoint.
92
+
93
+ A serviceable prompt shape:
94
+
95
+ > You are an independent performance reviewer with a different perspective from
96
+ > the agent that produced this. Attached is a deck of *candidate* (speculative,
97
+ > unvalidated) performance ideas for the repo at `<cwd>`, organized by strategy
98
+ > lens. The files referenced are in this same repo — read them directly.
99
+ >
100
+ > Give me the good, the bad, and the ugly:
101
+ > 1. GAPS — what high-leverage angles, strategies, or whole categories did this
102
+ > deck miss? What would a specialist from databases / game engines / HPC / GPU
103
+ > / distributed systems spot here that isn't listed?
104
+ > 2. WEAK IDEAS — which listed ideas are implausible, generic, wrong about the
105
+ > code, or not worth measuring, and why?
106
+ > 3. NEW CANDIDATES — concrete additional ideas: title, what domain it's borrowed
107
+ > from, file:line, the transform, why it *might* help, and how to validate.
108
+ >
109
+ > These are hypotheses, not proven wins — keep that framing; never assert a
110
+ > speedup is real. Cite file:line. Review this directly — do NOT call the
111
+ > peeragent peer/peer-review skills or wrapper to hand it off again; use your own
112
+ > harness's sub-agents if you need help.
113
+
114
+ ## Step 3: Integrate honestly
115
+
116
+ Read the response through the same lens as `/peer-review`'s honest-evaluation
117
+ step — accept concrete, verifiable points; push back on taste-dressed-as-fact and
118
+ on claims that misread the code (verify first).
119
+
120
+ - **Prune** ideas you agree are weak. Don't silently delete them — mark them
121
+ `pruned by peer: <reason>` so the report shows what the cross-model pass
122
+ removed. (A pruned generic idea is a real win: it sharpens the deck.)
123
+ - **Add** accepted gap/new ideas, tagged `source: peer-<agent>` (or
124
+ `source: peer-fallback`). Re-run them through Phase 4 ranking so they tier
125
+ alongside the rest.
126
+ - **Fan out one more scout** if the peer named a missed *lens* with real signal —
127
+ spawn that single Phase-3 scout, then re-aggregate and re-rank. This is the one
128
+ case where the peer pass triggers more generation.
129
+
130
+ ## Step 4: One pass, usually
131
+
132
+ Unlike `/peer-review`'s 3-5 convergence loop, idea generation isn't a converging
133
+ artifact — a deck doesn't "stabilize," it just accumulates. One strong pass is
134
+ usually right. Loop a second time only if the peer opened a genuinely new
135
+ high-value direction (e.g. a missed lens that produced Investigate-first ideas)
136
+ and you want that direction reviewed too. Never pad passes.
137
+
138
+ ## Step 5: Record it for the report
139
+
140
+ Capture, for the report's "Cross-model peer pass" section and the user summary:
141
+ - Which reviewer ran (agent + effort, or fallback) — be honest if the fallback
142
+ was used.
143
+ - Count pruned + the gist of why.
144
+ - Count added + how many landed in Investigate-first (the headline: "the peer
145
+ surfaced N angles we missed, M of them top-tier").
146
+ - Whether a follow-up scout was fanned out for a missed lens.
147
+
148
+ If the peer pass could not run at all (no peer, fallback also failed), say so
149
+ plainly in the report — a deck without an independent pass is weaker, and the user
150
+ should know.
@@ -0,0 +1,148 @@
1
+ # Perf-Scout Report Template
2
+
3
+ > Used by `perf-scout` to write `perf-scout-report.md` at the repo root. Fill the
4
+ > placeholders; drop sections with zero entries. The whole document describes
5
+ > *candidate ideas* — unvalidated hypotheses. Keep that framing throughout; never
6
+ > phrase an idea as a realized improvement.
7
+
8
+ ```markdown
9
+ # Perf-Scout Report
10
+
11
+ **Generated**: <ISO-date>
12
+ **Scope**: <"whole repo" OR path/NL scope>
13
+ **Files considered**: <N>
14
+ **Workload shape**: <request-service / batch-pipeline / realtime-sim / library-kernel / mixed>
15
+
16
+ > ⚠️ Everything below is a **candidate optimization** — a speculative, unvalidated
17
+ > hypothesis borrowed from another domain's playbook. Nothing here has been
18
+ > measured. Validate before acting, usually via `/agile-workflow:perf-design`.
19
+
20
+ ## Stack & shape profile
21
+
22
+ - Languages / runtimes: <list>
23
+ - Workload shape: <dominant shape(s) and why>
24
+ - Hot-ish regions (guessed, not profiled): <list>
25
+ - Already present (not re-proposed): <caches / pools / SIMD / indexes / etc.>
26
+
27
+ ## Lens opportunity density
28
+
29
+ > Opportunity signal (how much plausible headroom each lens found), NOT a code
30
+ > quality grade. High = lots to investigate here; low = little obvious headroom.
31
+
32
+ | Lens | Relevance | Opportunity (0-10) | Ideas (Investigate / Worth-a-look / Long-shot) |
33
+ |---|---|---|---|
34
+ | Algorithmic & data structures | most | X/10 | 2 / 1 / 0 |
35
+ | Memory & data locality | relevant | X/10 | 1 / 2 / 1 |
36
+ | Parallelism & vectorization | relevant | X/10 | 0 / 1 / 2 |
37
+ | GPU & accelerators | skip | — | — |
38
+ | Caching & memoization | most | X/10 | 1 / 1 / 0 |
39
+ | I/O & batching | most | X/10 | 2 / 0 / 1 |
40
+ | Distributed systems | relevant | X/10 | 0 / 1 / 1 |
41
+ | Game-engine & realtime | skip | — | — |
42
+ | Database & storage internals | relevant | X/10 | 1 / 0 / 1 |
43
+ | Compiler, runtime & language | relevant | X/10 | 0 / 2 / 1 |
44
+ | Approximation & precomputation | relevant | X/10 | 1 / 0 / 0 |
45
+
46
+ ## Top 5 to investigate first
47
+
48
+ > The strongest bets, spread across domains. One line each.
49
+
50
+ 1. **<title>** — `<file:line>` · borrowed from <domain> · <lens> · <Leverage>/<Applicability>/<Cost>
51
+ 2. ...
52
+ 3. ...
53
+ 4. ...
54
+ 5. ...
55
+
56
+ ## Cross-model peer pass
57
+
58
+ - **Reviewer**: <peer agent + effort, e.g. "codex --effort xhigh"> OR <"fallback sub-agent (peeragent unavailable)"> OR <"not run (--no-peer)">
59
+ - **Pruned**: <n> weak/generic ideas removed — <one-line gist of why>
60
+ - **Added**: <n> new ideas surfaced by the peer (<m> landed Investigate-first)
61
+ - **Follow-up scout**: <lens fanned out for a missed lens, or "none">
62
+
63
+ > The value of this pass is the angles a single model missed. If it didn't run,
64
+ > this deck has no independent check — treat it as weaker.
65
+
66
+ ## Ideas by priority
67
+
68
+ ### Investigate-first (<n>)
69
+
70
+ #### <title>
71
+ - **Lens**: <lens> · **Borrowed from**: <domain>
72
+ - **Location**: `<file:line>`
73
+ - **Leverage / Applicability / Cost**: <High|Med|Low> / <Likely|Plausible|Speculative> / <Low|Med|High>
74
+ - **The idea**: <2-4 sentences: the specific transform and the technique it borrows.>
75
+ - **Why it might help**: <speculative mechanism — "might", never "will".>
76
+ - **Validate by**: <metric / benchmark / "profile via perf-design">
77
+ - **Risk**: <one line>
78
+ - **Source**: <scout | peer-codex | peer-fallback>
79
+ - **Parked**: `perf-scout-<slug>` *(or `not parked: --no-park` / `not parked: no substrate` / `duplicate of perf-scout-<slug>`)*
80
+ - *Also surfaced by*: <other lens, if duplicate>
81
+
82
+ <repeat for each Investigate-first idea>
83
+
84
+ ### Worth-a-look (<n>)
85
+
86
+ <same shape>
87
+
88
+ ### Long-shot (<n>)
89
+
90
+ > Long-shots are listed here but **not parked to the backlog by default** (they'd
91
+ > add speculative noise). Re-run with `--park-all` to park them too.
92
+
93
+ <same shape — may be compressed to one-liners if many>
94
+
95
+ ### Pruned by peer (<n>)
96
+
97
+ > Ideas the cross-model pass flagged as weak/generic/wrong. Listed for
98
+ > transparency; not parked.
99
+
100
+ - **<title>** — `<file:line>` — pruned: <reason>
101
+
102
+ ## Lenses skipped
103
+
104
+ | Lens | Why |
105
+ |---|---|
106
+ | <lens> | <e.g. "no realtime/per-frame loop", "single-process, no distribution"> |
107
+
108
+ ## Backlog parking summary
109
+
110
+ | Metric | Count |
111
+ |---|---|
112
+ | Ideas parked this run | <n> |
113
+ | Duplicates skipped (already in backlog) | <n> |
114
+ | Opt-out (`--no-park`) | true / false |
115
+ | Substrate present | true / false |
116
+
117
+ > Parked ideas live at `.work/backlog/perf-scout-*.md` with `idea_origin: scout`.
118
+ > Promote any to tracked work via `/agile-workflow:scope <id>`, or hand to
119
+ > `/agile-workflow:perf-design` to measure. Find them all with:
120
+ > `grep -l '^idea_origin: scout$' .work/backlog/*.md`.
121
+
122
+ ## Scout gaps
123
+
124
+ > Any scout that errored or returned inconclusive results. Re-run that lens alone
125
+ > with `--lenses <lens>` if you want.
126
+
127
+ - <lens>: <what went wrong, or "—" if all clean>
128
+
129
+ ## Next steps
130
+
131
+ - Hand a top idea to `/agile-workflow:perf-design <id>` to profile and confirm
132
+ (the only place a hypothesis becomes a measured win).
133
+ - `/agile-workflow:scope` to promote ideas into tracked work.
134
+ - Re-scout a single lens with `--lenses <lens>` to dig deeper.
135
+ ```
136
+
137
+ ## Rules
138
+
139
+ - Always include the ⚠️ unvalidated banner up top and keep speculative phrasing
140
+ throughout. The report's credibility comes from being honest that it's a
141
+ brainstorm, not an audit.
142
+ - Show the lens table even when rows are skipped — empty rows signal coverage.
143
+ - Group ideas by priority tier, then by lens within each tier.
144
+ - Sort within a tier by `file:line` for diff-friendliness.
145
+ - Don't list the same idea under multiple tiers — pick its tier and cross-link
146
+ duplicates with "Also surfaced by".
147
+ - Always include the cross-model peer section, even if it just says the pass
148
+ didn't run and why — that absence is information.