@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,191 @@
1
+ # Model Selection & Decision Matrix
2
+
3
+ > The concrete model-layer companion to the **model-agnostic** dispatch and
4
+ > cross-model policy in `principles/SKILL.md` (Parts IV & VIII) and the
5
+ > "different model class" decision points across the plugin. In-skill prose is
6
+ > deliberately written in capability/role terms; **this file is where those
7
+ > capabilities map to actual models and `peeragent` flags.** Load it whenever a
8
+ > skill says "pick the reviewer", "choose a peer", "set the scanner tier", or
9
+ > "use a different model class".
10
+
11
+ Model generations move fast — the *families and classes* below are the durable
12
+ abstraction; specific version numbers (e.g. Opus 4.x, GPT-5.x-Codex, Gemini 3.5,
13
+ GLM-5.2) are the current resolution of each class as of writing. Always resolve
14
+ the concrete model against current sources when the choice is load-bearing.
15
+
16
+ ## Contents
17
+
18
+ 1. [Capability axes (the decision vocabulary)](#1-capability-axes-the-decision-vocabulary)
19
+ 2. [Model-family cards](#2-model-family-cards)
20
+ 3. [Role → capability → model](#3-role--capability--model)
21
+ 4. [Host → cross-class peer pairing](#4-host--cross-class-peer-pairing)
22
+ 5. [Multi-class review for deep/complex work](#5-multi-class-review-for-deepcomplex-work)
23
+ 6. [Two-phase design review: advisory then adversarial](#6-two-phase-design-review-advisory-then-adversarial)
24
+ 7. [peeragent invocation cheatsheet](#7-peeragent-invocation-cheatsheet)
25
+ 8. [Fallbacks when no peer is reachable](#8-fallbacks-when-no-peer-is-reachable)
26
+
27
+ ---
28
+
29
+ ## 1. Capability axes (the decision vocabulary)
30
+
31
+ Pick by **what the role needs**, then resolve to a class. These axes are what
32
+ the in-skill prose names; this is what they mean.
33
+
34
+ - **Blind-spot diversity** — different training produces different errors. The
35
+ entire value of a cross-model peer is independent blind spots, *not* a more
36
+ authoritative answer. Two models that share training add little over one.
37
+ - **Reasoning depth** — multi-step deduction, proof-like correctness, holding a
38
+ large logical structure. Raised by high/xhigh effort tiers; strongest in
39
+ Opus-class, GPT-5.x-Codex at xhigh, GLM-5.2 at xhigh.
40
+ - **Long-horizon agentic stamina** — sustained self-correcting multi-step tool
41
+ use over many turns / long autonomous runs. Strongest in Codex, GLM-5.2
42
+ (built for up-to-8h agentic runs), and Opus-class.
43
+ - **Context window** — how much the model can hold at once. GLM-5.2 (1M),
44
+ Opus-class (1M), Gemini 3.5 (2M, Deep Think), Sonnet-class (1M beta).
45
+ - **Latency budget** — wall-clock cost. Top-tier reasoning peers (Opus-class,
46
+ xhigh Codex/GLM) commonly take **10–30 minutes** for large reviews and may be
47
+ quiet for most of it. Budget for it; do not treat a long quiet period as a hang.
48
+ - **Write fidelity** — code-writing accuracy and instruction-following for
49
+ production edits. The property that earns a model a *worker* role.
50
+
51
+ ## 2. Model-family cards
52
+
53
+ **Claude (Anthropic)** — `--agent claude`
54
+ - Tiers: `opus` (deepest reasoning + agentic, 1M context; slowest), `sonnet`
55
+ (strong coding + speed; 1M beta), `haiku` (fast, near-frontier, cheap).
56
+ - Effort: `high | xhigh` (default `xhigh`).
57
+ - Best roles: `opus` → deep reviewer / adversarial peer / highest-tier worker;
58
+ `sonnet` → primary worker / scout; `haiku` → leaf tasks, cheap fan-out.
59
+
60
+ **Codex (OpenAI)** — `--agent codex`
61
+ - Current class: GPT-5.x-Codex (model auto-selected; no `--model` flag).
62
+ - Effort: `medium | high | xhigh` (default `high`).
63
+ - Strengths: top-tier long-horizon agentic coding, multi-step tool use.
64
+ - Best roles: cross-class peer from a Claude/Gemini/GLM host; highest-tier
65
+ worker for long agentic write paths.
66
+
67
+ **Gemini (Google)** — `--agent gemini`
68
+ - Model: `gemini-3.5` (2M context, Deep Think mode).
69
+ - Effort: ignored.
70
+ - Best roles: cross-class peer; large-context review where 2M context matters.
71
+
72
+ **Z.AI GLM 5.2** — `--agent zai`
73
+ - Model: `glm-5.2` only (MoE 744B / 40B-active; stable 1M context; DeepSeek
74
+ Sparse Attention; built for long-horizon agentic engineering, ~8h runs).
75
+ - Effort: `medium | high | xhigh` (default `high`).
76
+ - Best roles: cross-class peer (distinct training lineage → distinct blind
77
+ spots); long-horizon agentic worker; highest-tier reviewer at `xhigh`.
78
+ - Note: the peeragent `zai` adapter runs GLM 5.2 **through Pi**, and needs a
79
+ current peeragent build (`zai` agent). Older cached builds only list
80
+ `codex|claude|gemini`.
81
+
82
+ ## 3. Role → capability → model
83
+
84
+ | Role | Needs (capability) | Primary models |
85
+ |---|---|---|
86
+ | Primary worker | write fidelity, agentic stamina | Sonnet-class / Codex high / GLM-5.2 high |
87
+ | Scanner/scout (deep read-only fan-out) | domain inspection, evidence, scoped artifacts | Haiku / Sonnet medium / Sonnet for volume; Opus/Codex xhigh/GLM xhigh for subtle gates |
88
+ | Deep reviewer | reasoning depth, fresh context | Opus-class xhigh / Codex xhigh / GLM-5.2 xhigh |
89
+ | Advisory peer (Phase 1) | blind-spot diversity, augmentation | a **different class** than the host |
90
+ | Adversarial peer (Phase 2) | blind-spot diversity, attack posture | a **different class** than host + than Phase 1 |
91
+
92
+ ## 4. Host → cross-class peer pairing
93
+
94
+ The rule: the peer must be a **different model class** than the host, or it is
95
+ not cross-model evidence (fall back to a fresh same-class sub-agent instead).
96
+ For each host, several valid peer classes exist — pick by **maximum blind-spot
97
+ diversity**, and for deep work use **two distinct peer classes** (§5).
98
+
99
+ | Host class | Valid peer classes (any different class) |
100
+ |---|---|
101
+ | Claude | codex · gemini · zai |
102
+ | Codex | claude (opus) · gemini · zai |
103
+ | Gemini | claude (opus) · codex · zai |
104
+ | Z.AI GLM | claude (opus) · codex · gemini |
105
+
106
+ When the natural pair is unavailable, fall through to the next class; never
107
+ peer with the same class as the host.
108
+
109
+ ## 5. Multi-class review for deep/complex work
110
+
111
+ For **deep or complex work** — architectural design points, large/risky
112
+ features or epics, the final autopilot completion review, whole-repo scans — a
113
+ single peer is the floor, not the ceiling. **If two different model classes are
114
+ available, use both.** Different training lineages have different blind spots;
115
+ two independent peers catch more than one, and their disagreements are
116
+ themselves signal (re-read both before deciding).
117
+
118
+ Concretely: pair the two peers across the two review phases in §6 — one class
119
+ runs the **advisory** pass, a *different* class runs the **adversarial** pass.
120
+ That realizes the 2-class rule through the phase ordering and maximizes both
121
+ augmentation diversity and adversarial independence. For routine/small work a
122
+ single peer (or none) remains correct — this escalation is for deep/complex
123
+ scope only.
124
+
125
+ ## 6. Two-phase design review: advisory then adversarial
126
+
127
+ Designs and reviews are both evaluated in a fixed **two-phase order** —
128
+ **completeness/complementary/advisory first, adversarial second.** Never reverse
129
+ the phases and never skip Phase 1 to jump straight to attack: a design or review
130
+ reviewed only adversarially gets torn apart before anyone checks whether it is
131
+ complete. The two phases have **different loop shapes depending on whether the
132
+ artifact is a design (open) or a review (complete)**:
133
+
134
+ **Phase 1 — Completeness / Complementary / Advisory.** Augmentation, not
135
+ judgment. Ask what is missing, what alternatives strengthen it, and what
136
+ questions/risks should be weighed.
137
+ - *Design (open artifact, before decisions lock)*: **a single pass.** You don't
138
+ iterate an open design to convergence. The host chooses and records rationale.
139
+ This is the default autopilot design-time peer ask.
140
+ - *Review (complete artifact — feature/epic/out-of-band review)*: **a multi-step
141
+ convergence loop**, not a single ask — the artifact is complete, so iterate
142
+ until findings stabilize. The ideal is the full `peer-review` convergence loop
143
+ (≥3 review→refine passes, continue while substantive issues surface, stop on
144
+ nits, cap ~5); run that loop in the advisory/complementary posture when
145
+ `peer-review` is available. When only a single peer pass is available, run as
146
+ many rounds as the mechanism allows and say it did not reach full convergence.
147
+
148
+ **Phase 2 — Adversarial (after Phase 1 converges or, for designs, completes).**
149
+ Attack posture. Ask a **different** reviewer (ideally a different class than
150
+ Phase 1, per the 2-class rule in §5) what is broken, contradictory, built on a
151
+ false assumption, or will fail in operation. For reviews this is the same
152
+ `peer-review`-style convergence loop applied in the attack posture; for designs
153
+ it is a focused adversarial pass. Verify concrete claims against code/foundation
154
+ docs before accepting or rejecting.
155
+
156
+ Record both phases in the item body under `## Other agent review`, labeling each
157
+ finding's phase, the reviewer class, and (for reviews) how far the convergence
158
+ loop ran (converged on nits / hit cap / single pass only). Peer failures in
159
+ either phase are non-blocking (fall back to a fresh same-class sub-agent); the
160
+ final autopilot completion review must still clear through at least one
161
+ cross-class pass.
162
+
163
+ ## 7. peeragent invocation cheatsheet
164
+
165
+ Resolve the wrapper before calling — never assume `peeragent` is on `PATH`
166
+ (`PEERAGENT_BIN` → bundled `bin/peeragent` → bare `peeragent`). Run in the
167
+ host harness's outside-sandbox mode; never `--full-access` for review.
168
+
169
+ | Target | Flags |
170
+ |---|---|
171
+ | Claude Opus | `--agent claude --model opus --effort xhigh` |
172
+ | Claude Sonnet | `--agent claude --model sonnet --effort high` |
173
+ | Claude Haiku | `--agent claude --model haiku` |
174
+ | Codex | `--agent codex --effort xhigh` (model auto-selected) |
175
+ | Gemini | `--agent gemini` (effort ignored) |
176
+ | Z.AI GLM 5.2 | `--agent zai --effort xhigh` (model fixed glm-5.2) |
177
+
178
+ Always tell the reviewer **not** to recurse back through peeragent's own
179
+ `peer`/`peer-review` skills or the wrapper — the reviewer is the endpoint.
180
+
181
+ ## 8. Fallbacks when no peer is reachable
182
+
183
+ When peeragent is unavailable, fails, would be same-class, or the needed class
184
+ isn't reachable: spawn a **fresh max-effort generic sub-agent** at the highest
185
+ class available to the host and prompt it with the review or scanner posture from
186
+ [subagents.md](subagents.md). Give it **only** the artifact + the lens catalog —
187
+ deliberately not the host's own reasoning — so context isolation buys as much
188
+ independence as possible. Label the pass by the model actually selected at spawn
189
+ time: cross-model only if it is a different model class from the caller;
190
+ otherwise same-class / same-harness fresh-context. Independence is degraded but
191
+ not absent.
@@ -0,0 +1,158 @@
1
+ # Dynamic Subagent Dispatch
2
+
3
+ Agile-workflow does **not** ship custom subagent definitions for Pi, Claude Code,
4
+ or Codex. The skills are portable; delegation happens by prompting the host's
5
+ existing generic/general-purpose subagent mechanism with a structured brief that
6
+ is tailored to the current item, gate, review, or scan.
7
+
8
+ Do not assume named agile-workflow roles such as `designer`, `implementor`,
9
+ `reviewer`, `scanner`, or Codex `aw-*` templates exist. Treat design,
10
+ implementation, review, scanner, and exploration as **prompt postures**, not
11
+ installed agent names.
12
+
13
+ ## Host adapters
14
+
15
+ | Need | Pi | Claude Code | Codex | If unavailable |
16
+ |---|---|---|---|---|
17
+ | Generic delegated worker | `general-purpose` subagent | host generic/task subagent | host generic/task subagent | Do the bounded work inline |
18
+ | Read-only exploration | generic subagent prompted as read-only explorer, or an existing host Explore role if already present | generic/read-only subagent if present | generic/read-only subagent if present | Direct Read/Grep/Glob |
19
+ | Deep scanner/audit | generic subagent prompted with a scanner brief | generic/task subagent prompted with scanner brief | generic/task subagent prompted with scanner brief | Inline scan; record reduced isolation |
20
+ | Fresh-context review | generic subagent prompted as reviewer | generic/task subagent prompted as reviewer | generic/task subagent prompted as reviewer | Inline only for small/low-risk work; otherwise block or ask |
21
+ | Implementation bundle | generic subagent prompted as implementer, with explicit write ownership | generic/task subagent prompted as implementer | generic/task subagent prompted as implementer | Host implements inline |
22
+
23
+ For Pi, discover available model identifiers before a load-bearing cross-model
24
+ spawn and pass the chosen `model`/thinking level explicitly. For other hosts,
25
+ use their current model-selection surface. Label a delegated pass as
26
+ **cross-model** only when the spawned model is a different model class from the
27
+ caller; otherwise label it **same-harness fresh-context**.
28
+
29
+ ## Dispatch rule
30
+
31
+ Use a subagent only when it buys breadth, isolation, independent judgment, or
32
+ parallel write ownership. Before spawning, do a local scope-size probe and name
33
+ the unknowns that remain. If you cannot name a distinct unknown or independent
34
+ write bundle, read directly instead.
35
+
36
+ When you do spawn, record the prompt posture in notes or the item body, e.g.
37
+ `general-purpose subagent prompted as scanner`, not a nonexistent installed role.
38
+
39
+ ## Structured brief skeleton
40
+
41
+ Build the prompt dynamically from the actual task. Keep the structure; fill only
42
+ sections that matter.
43
+
44
+ ```markdown
45
+ # Agile-workflow delegated task
46
+
47
+ ## Posture
48
+ Act as a <designer | implementer | reviewer | scanner | explorer> for this
49
+ single delegated task. You are a generic subagent prompted into this posture, not
50
+ an installed agile-workflow role.
51
+
52
+ ## Mission
53
+ <One paragraph: item id/path or release/gate/scope, the decision or work needed,
54
+ and why delegation is useful.>
55
+
56
+ ## Inputs
57
+ - Repo root: `<path>`
58
+ - Work item(s): `<id/path>`
59
+ - Stage / release / gate: `<value>`
60
+ - Relevant docs: `<docs/VISION.md, SPEC.md, ARCHITECTURE.md, AGENTS.md, .agents/rules/*.md>`
61
+ - Scope files or ownership: `<paths, globs, or changed-file list>`
62
+ - Prior findings / duplicate-skip list: `<ids or file:line keys>`
63
+
64
+ ## Boundaries
65
+ - Allowed writes: `<none | .work item bodies only | explicit files/globs | report path>`
66
+ - Forbidden writes: `<source code, unrelated items, generated files, etc.>`
67
+ - Do not spawn nested subagents or call peeragent; you are the delegated endpoint.
68
+ - Stay within the named scope. If the scope is wrong, report that instead of expanding silently.
69
+
70
+ ## Grounding steps
71
+ 1. Read the item/body/release brief and relevant foundation docs.
72
+ 2. Read project instructions and `.agents/rules/*.md` when present.
73
+ 3. Inspect only the files needed to satisfy the mission.
74
+ 4. Verify concrete claims with file:line evidence before returning findings.
75
+
76
+ ## Output contract
77
+ Return exactly:
78
+ - Summary: `<2-5 bullets>`
79
+ - Evidence: `<file:line citations or commands run>`
80
+ - Result: `<design notes | patch summary | review verdict | findings list | map>`
81
+ - Follow-ups/blockers: `<only if needed>`
82
+ ```
83
+
84
+ ## Posture-specific capsules
85
+
86
+ Add one capsule to the skeleton.
87
+
88
+ ### Designer
89
+
90
+ Use for drafting `.work` items. The subagent may write only caller-authorized
91
+ `.work` design artifacts. It should ground in foundation docs, capture decisions,
92
+ spawn or propose child items only if explicitly authorized, and advance stage
93
+ only if the caller's skill brief grants that transition.
94
+
95
+ Required output additions:
96
+ - `Design decisions` with alternatives considered.
97
+ - `Child work` as exact item files to create or a proposal, depending on write authorization.
98
+ - `Stage transition` only when authorized.
99
+
100
+ ### Implementer
101
+
102
+ Use for a settled implementation bundle. Give exact item ids, ownership paths,
103
+ acceptance criteria, and verification commands. The subagent owns only the
104
+ specified write scope. It must update the item with implementation notes and run
105
+ or report the bounded verification.
106
+
107
+ Required output additions:
108
+ - `Files changed`.
109
+ - `Verification` with commands and outcomes.
110
+ - `Stage transition/readiness` based on the caller's contract.
111
+
112
+ ### Reviewer
113
+
114
+ Use when fresh context is the point. Give the artifact, diff range or item path,
115
+ review depth, and whether the reviewer may write `.work` metadata. The reviewer
116
+ should not implement fixes. It may approve, bounce, or list findings only when
117
+ the caller's brief grants that authority.
118
+
119
+ Required output additions:
120
+ - `Verdict` (`ready`, `needs fixes`, or `blocked`) when authorized.
121
+ - `Findings` with severity, evidence, and required fix.
122
+ - `Accepted limitations` when the review is same-harness rather than cross-model.
123
+
124
+ ### Scanner
125
+
126
+ Use for release gates, bug domains, deep-code-scan waves, e2e audits,
127
+ perf-scout lenses, and other evidence-generation briefs. The scanner is
128
+ source-read-only unless the caller authorizes a report or finding files. It is
129
+ not a code-search-only explorer and not a fixer.
130
+
131
+ Required output additions:
132
+ - `Scope audited`.
133
+ - `Findings` in the exact schema the caller provides, each with file:line evidence.
134
+ - `Skipped duplicates` from the provided duplicate-skip list.
135
+ - `No findings` explicitly when nothing survives verification.
136
+
137
+ ### Explorer
138
+
139
+ Use only to locate code and map ownership/call-sites. The explorer returns a map
140
+ and suggested files to read next; it does not design, review, scan for findings,
141
+ or implement.
142
+
143
+ Required output additions:
144
+ - `Map` of relevant files/symbols.
145
+ - `Why these files matter`.
146
+ - `Unknowns remaining`.
147
+
148
+ ## Prompt quality checks
149
+
150
+ Before spawning, verify the brief contains:
151
+
152
+ - A named posture and mission.
153
+ - The exact scope and allowed writes.
154
+ - The relevant `.work` item or release/gate context.
155
+ - Grounding docs and rules to read.
156
+ - A concrete output schema.
157
+ - A no-recursion/no-peeragent endpoint rule.
158
+ - Model/effort choice sized to risk and scope.
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: prose-author
3
+ description: >
4
+ ALWAYS invoke this skill when picking up a feature tagged [prose] at stage:drafting — a
5
+ no-code-surface deliverable (docs, conventions, rules, research prose, copy, config-as-prose) whose
6
+ design and implementation collapse into a single inline authoring act. Confirms the brief is a
7
+ sufficient spec, fleshes the feature body inline if needed, and advances drafting to implementing
8
+ WITHOUT exploratory sub-agents, a pre-mortem, or a structured question tool design gate. The no-code authoring lane:
9
+ the design-family routing layer forks [prose] work here the way it forks [refactor]/[perf] to
10
+ refactor-design/perf-design — but this lane authors, it does not design. Collapses to one inline
11
+ stride for the common case; large multi-section prose can still flow through drafting to
12
+ implementing to review as real draft/write/revise steps. Misroutes anything with a real code surface
13
+ back to feature-design. Pairs with implement's no-coordination inline path.
14
+ ---
15
+
16
+ # Prose-Author
17
+
18
+ You handle a feature tagged `[prose]` at `stage: drafting` — work whose
19
+ deliverable is **prose with no real code surface** (documentation, an AGENTS.md
20
+ / convention / rule edit, a research write-up, marketing copy, a changelog, or a
21
+ config file that carries no logic). For this class of work the design pass and
22
+ the implementation collapse into a single inline authoring act: there is no
23
+ interface to pin, no architecture to choose, no integration seam to map. The
24
+ brief *is* the design.
25
+
26
+ This is the **no-code authoring lane** — not a design step. The design-family
27
+ routing layer (the "am I the right skill" fork that `feature-design` owns)
28
+ forks `[prose]` work to this lane the way it forks `[refactor]`/`[perf]` to
29
+ `refactor-design`/`perf-design`:
30
+ - `epic-design` — `kind: epic`
31
+ - `feature-design` — `kind: feature`, no specialized tag
32
+ - `refactor-design` — `kind: feature` with `tags: [refactor]`
33
+ - `perf-design` — `kind: feature` with `tags: [perf]`
34
+ - `prose-author` (this lane) — `kind: feature` with `tags: [prose]`
35
+
36
+ Where `feature-design` runs exploratory sub-agents, a pre-mortem, and an
37
+ `structured question tool` design gate to leave `drafting`, `prose-author` does none of
38
+ that — for prose that ceremony has no payoff, because there is no code surface
39
+ to design against. It still advances `drafting → implementing` at the same seam,
40
+ so the stage machine and `autopilot` are unchanged; the lane just authors the
41
+ brief directly instead of designing.
42
+
43
+ **Collapse by default, graduate when the prose is large.** The common case is a
44
+ single inline authoring stride (`drafting → implementing` here, then inline
45
+ `implement` to `review`). But the lane does not *force* a one-shot: a large
46
+ multi-section deliverable (a long spec, a multi-part guide) can use the shared
47
+ `drafting → implementing → review` stages as real **draft → write → revise**
48
+ steps — an `## Outline` in `drafting`, the writing in `implementing`, a
49
+ coherence/tightening pass at `review`. These are the same advisory stages every
50
+ item has (no new vocabulary, no parallel pipeline) — prose just gets to skip the
51
+ *ceremony*, not the *stages*. Reach for the staged rhythm only when the
52
+ deliverable's size earns it; most prose does not.
53
+
54
+ ## The [prose] black-box test (misroute check)
55
+
56
+ `[prose]` is a **work-nature** tag, not a domain tag. Apply the test before
57
+ acting: **does this feature have a real code surface or a genuine design
58
+ ambiguity?** A real code surface means a caller-visible interface, types to pin,
59
+ an integration seam, an error path, or an architectural choice between
60
+ approaches. If YES, the item is misrouted — it wants `feature-design`'s design
61
+ pass, not this lane.
62
+
63
+ Mirror of the `[refactor]` black-box discipline: when the test fails, don't
64
+ muscle through. Strip `prose` from the item's `tags`, append a one-line note
65
+ ("Misrouted to prose-author; the work has a real code surface — retagged for
66
+ feature-design"), commit (`prose-author misroute: <id> retagged for
67
+ feature-design`), and return **without advancing the stage**. The caller
68
+ (autopilot or human) reroutes on the next pass.
69
+
70
+ Domain ≠ nature. A documentation *feature* that ships a docs-site generator has
71
+ a code surface → `feature-design`. A rule rewrite, an AGENTS.md edit, a research
72
+ brief, or release notes → `prose`.
73
+
74
+ **Config-with-no-logic criterion:** a config file is `[prose]` only when nothing
75
+ parses it as schema — e.g. a docs-site config (MkDocs, Docusaurus YAML),
76
+ `.editorconfig`, `.prettierrc`. A config with a typed or programmatic consumer
77
+ (env files read by a typed loader, OpenAPI specs consumed by a code-generator,
78
+ database migration configs, CI pipeline definitions) has an integration seam and
79
+ real failure paths → NOT `[prose]`; route through `feature-design`.
80
+
81
+ ## Trigger
82
+
83
+ The agent picks this lane for a feature at `stage: drafting` with
84
+ `tags: [prose, ...]` and no `[refactor]`/`[perf]` tag. Common phrases:
85
+ - "author the docs feature", "this is just prose — advance it"
86
+ - "write up the <convention / rule / copy> feature"
87
+
88
+ ## Invocation modes
89
+
90
+ | Invocation | Behavior |
91
+ |---|---|
92
+ | `<feature-id>` (default) | Confirm the brief, flesh the body inline if needed, advance `drafting → implementing`. |
93
+ | `<feature-id> --only-questions` | Question-only pass — surface any genuine ambiguity, capture under `## Design decisions`, do NOT advance. Mirrors feature-design's mode; interactive-only. Most prose items surface zero questions. |
94
+
95
+ ## Workflow
96
+
97
+ ### Phase 1: Read the feature item
98
+
99
+ Read `.work/active/features/<id>.md`. Confirm `kind: feature`, `stage:
100
+ drafting`, and `tags` includes `prose`. If `tags` also includes `refactor` or
101
+ `perf`, that specialized tag wins — log a misroute note and return without
102
+ advancing.
103
+
104
+ ### Phase 2: Apply the black-box test
105
+
106
+ Run the `[prose]` black-box test above. If the item has a real code surface or a
107
+ genuine architectural ambiguity, misroute it back to feature-design per the
108
+ procedure above and return.
109
+
110
+ ### Phase 3: Ground yourself (light)
111
+
112
+ Read only what the prose itself must stay consistent with — the parent epic body
113
+ if `parent` is set, the foundation docs (`docs/VISION.md`, `docs/SPEC.md`,
114
+ `docs/ARCHITECTURE.md`) and `AGENTS.md` / `CLAUDE.md` when the deliverable
115
+ touches conventions or project-facing claims, and any sibling doc the feature
116
+ revises. One pass, skim. **Do NOT** spawn exploratory sub-agents — there is no code
117
+ surface to map.
118
+
119
+ ### Phase 4: Confirm the brief is a sufficient spec
120
+
121
+ The brief from `scope` is usually the whole spec for prose work. Read it and
122
+ decide:
123
+ - **Sufficient as-is** — the deliverable, its target path, and what "done" means
124
+ are clear. Proceed to Phase 5.
125
+ - **Needs fleshing** — the brief leaves the shape of the prose open (which
126
+ sections, which file, what claims). Flesh it **inline in the body** as a short
127
+ `## Outline` (target path + section list + acceptance criteria), then proceed.
128
+ This is authoring, not a design pass — keep it to what the writer needs. For a
129
+ large multi-section deliverable the `## Outline` is also the structural draft
130
+ step that lets the writing and a later revise pass run as distinct strides
131
+ (see "Collapse by default, graduate when the prose is large" above).
132
+
133
+ Do NOT run a pre-mortem and do NOT open a `structured question tool` design gate. If a
134
+ genuine directional ambiguity exists (rare for prose), that is the signal the
135
+ item wanted `feature-design` — reconsider the Phase 2 misroute test. The one
136
+ exception: under `--only-questions`, capture the ambiguity and stop.
137
+
138
+ ### Phase 5: Advance stage and commit
139
+
140
+ 1. Edit the feature frontmatter: `stage: drafting → implementing`. The
141
+ PostToolUse hook bumps `updated:`.
142
+ 2. Commit:
143
+ ```bash
144
+ git add .work/active/features/<id>.md
145
+ git commit -m "prose-author: <feature-id>"
146
+ ```
147
+
148
+ Child stories are almost never warranted for prose — a single inline authoring
149
+ stride covers it. Spawn one only if the deliverable genuinely splits into
150
+ independent documents with separate acceptance (the feature-design Phase 7
151
+ "when to spawn stories" rule applies, but the bar is rarely met here).
152
+
153
+ ## Handoff
154
+
155
+ The feature is now at `stage: implementing` with no code-surface design debt.
156
+ The matching implement path is **inline** `/agile-workflow:implement`: prose work
157
+ qualifies for the inline lane on **no-coordination** grounds regardless of size —
158
+ a 600-line convention rewrite is one authoring stride, not an orchestrated
159
+ fan-out. Do not route prose features to `/agile-workflow:implement-orchestrator`
160
+ (agent-spawning + worktrees) just because they exceed a line count; the
161
+ orchestrator's value is parallel coordination, which prose work does not need.
162
+
163
+ For a large deliverable, the inline `implement` is the **write** stride and
164
+ `review` is a genuine **revise/coherence** pass — not a rubber stamp. For the
165
+ common small case, implement is the one stride that finishes the work and review
166
+ is light.
167
+
168
+ ## Output
169
+
170
+ In conversation:
171
+ - **Advanced**: `<feature-id>` → `stage: implementing` (or **misrouted**: retagged for feature-design)
172
+ - **Brief**: sufficient as-is, or fleshed with a `## Outline`
173
+ - **Next**: `/agile-workflow:implement <feature-id>` (inline — not the orchestrator)
174
+
175
+ ## Guardrails
176
+
177
+ - `[prose]` is work-nature, not domain. Verify no real code surface every time —
178
+ the Phase 2 misroute test is the load-bearing check.
179
+ - No exploratory sub-agents, no pre-mortem, no design `structured question tool` gate. If you
180
+ reach for any of them, the item probably wanted `feature-design` — misroute it.
181
+ - Never advance past `implementing` — that's `implement` / `review`'s job.
182
+ - The brief / outline lives in the feature body. NEVER create
183
+ `docs/designs/<name>.md` — agile-workflow uses item-IS-the-work.
184
+ - Prose features implement **inline**, never via the orchestrator. Flag the
185
+ no-coordination property so the implement step takes the lean path.