@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,166 @@
1
+ ---
2
+ name: research
3
+ description: >
4
+ ALWAYS invoke this skill when the user asks to research a library, API, SDK, or technology choice —
5
+ do not just web-search and summarize inline. Researches external libraries, APIs, SDKs, and patterns
6
+ to inform design and implementation. Investigates options, evaluates trade-offs against project
7
+ needs, and produces both a research document and an auto-loading reference skill. Use before
8
+ designing features that depend on unfamiliar technology, when choosing between options, or when API
9
+ assumptions need verification. Triggers on "research X", "compare X vs Y", "what library should I
10
+ use for Y", "investigate an API", and "evaluate an SDK".
11
+ ---
12
+
13
+ # Research
14
+
15
+ You research external libraries, APIs, SDKs, and patterns, then produce two outputs:
16
+ a research document with your findings and an auto-loading reference skill that future
17
+ agents use when working with the recommended technology.
18
+
19
+ ## Phase 1: Scope the Research
20
+
21
+ Understand what needs investigating and why.
22
+
23
+ 1. Read **AGENTS.md / CLAUDE.md** and relevant project docs — understand the stack, constraints,
24
+ and what's already in use
25
+ 2. Map how the project currently handles the area being researched with
26
+ read-first triage: dependency manifests, imports, config files, existing
27
+ wrappers, and representative call sites via Read/Glob/Grep. Use an exploratory
28
+ sub-agent only when the integration surface is broad or unclear after that
29
+ probe.
30
+ - Use the host's generic/general-purpose subagent prompted with the explorer
31
+ capsule from `../principles/references/subagents.md`, at medium reasoning
32
+ by default.
33
+ - Use high or strongest reviewer reasoning for large or complex codebases.
34
+ - If no generic subagent adapter is available, keep direct host-local research.
35
+ 3. Define research questions:
36
+ - What specific problem does this technology need to solve for the project?
37
+ - What constraints must it satisfy? (bundle size, license, runtime, compatibility)
38
+ - What existing patterns must it work with?
39
+
40
+ **structured question tool checkpoint:** Present:
41
+ - The research questions you'll investigate
42
+ - Options you plan to evaluate (if known)
43
+ - Any constraints you identified from the codebase
44
+
45
+ Ask: "Are these the right questions? Any options I should include or exclude?"
46
+
47
+ ## Phase 2: Investigate
48
+
49
+ For each option, gather current information systematically.
50
+
51
+ ### 2a. Official Sources
52
+ - Read the official documentation — focus on getting-started guides and API reference
53
+ - Check the current version and recent changelog
54
+ - Read migration guides if the project is upgrading from an older version
55
+
56
+ ### 2b. Health Check
57
+ Verify each option is alive and maintained:
58
+ - **Repository**: Recent commits (last 3 months?), open issue count, PR response time
59
+ - **Releases**: Release frequency, latest release date, semantic versioning discipline
60
+ - **Community**: Download trends (npm/crates/pypi), Stack Overflow activity
61
+ - **License**: Compatible with the project's license?
62
+
63
+ ### 2c. API Verification
64
+ - Find the actual API surface — do NOT trust your training data for this
65
+ - Verify function signatures, configuration options, and return types from docs
66
+ - Find real-world usage examples (blog posts, tutorials, open source projects)
67
+ - Note any breaking changes between major versions
68
+
69
+ ### 2d. Integration Fit
70
+ - Does it work with the project's runtime/framework/build system?
71
+ - What does the integration look like? (imports, configuration, initialization)
72
+ - Are there known conflicts with other dependencies in the project?
73
+
74
+ ## Phase 3: Evaluate and Recommend
75
+
76
+ Score each option against the project's specific criteria — not in the abstract.
77
+
78
+ For each option:
79
+ - Pros and cons relative to the project's needs
80
+ - Code example showing what integration would look like
81
+ - Learning curve and documentation quality
82
+ - Risk: what happens if this option is abandoned?
83
+
84
+ **structured question tool checkpoint:** Present:
85
+ - Summary table of options with scores
86
+ - Your recommendation and rationale
87
+ - Any trade-offs the user should weigh in on
88
+
89
+ Ask: "Does this recommendation align with your priorities? Any concerns?"
90
+
91
+ ## Phase 4: Write Outputs
92
+
93
+ ### 4a. Research Document
94
+ Write to a location based on project conventions (e.g., `docs/research/`, `docs/`).
95
+
96
+ ```markdown
97
+ # Research: {Topic}
98
+
99
+ ## Context
100
+ {Why this research was needed — what project problem it addresses}
101
+
102
+ ## Questions
103
+ 1. {Specific question answered}
104
+
105
+ ## Options Evaluated
106
+
107
+ ### {Name} (v{version})
108
+ - **Maturity**: {Active/Stable/Maintenance/Deprecated}
109
+ - **License**: {license}
110
+ - **Pros**: {list}
111
+ - **Cons**: {list}
112
+ - **Fit**: {how well it matches project needs}
113
+
114
+ ## Recommendation
115
+ {Clear choice with rationale tied to project-specific criteria}
116
+
117
+ ## Implementation Notes
118
+ - {Key API patterns to follow}
119
+ - {Common pitfalls to avoid}
120
+ - {Configuration required}
121
+
122
+ ## Code Examples
123
+
124
+ \`\`\`{lang}
125
+ // Recommended usage pattern
126
+ \`\`\`
127
+
128
+ ## References
129
+ - [{name}]({url}) — {what this covers}
130
+ ```
131
+
132
+ ### 4b. Reference Skill
133
+ Write an auto-loading reference skill so future agents have your findings available.
134
+
135
+ **Location**: `.agents/skills/{topic-slug}/SKILL.md`
136
+
137
+ If `.claude/skills/` exists, add a symlink or mirror for Claude compatibility.
138
+
139
+ The skill must:
140
+ - Be named after the technology, not the research (e.g., `hono-v4`, not `research-hono`)
141
+ - Have a description with specific trigger keywords (library names, API method names, imports)
142
+ - Set `user-invocable: false` — it auto-loads by keyword match
143
+ - Contain key API patterns, code examples, and pitfalls from your research
144
+ - Stay under 200 lines — move detailed reference tables to `references/` files if needed
145
+ - Include version-specific information (the version you researched)
146
+
147
+ ## Anti-Patterns
148
+
149
+ - NEVER recommend without evaluating alternatives — even if the choice seems obvious
150
+ - NEVER trust training data for API shapes — verify from current documentation
151
+ - NEVER skip the health check — a superior but abandoned library is a liability
152
+ - NEVER evaluate against generic criteria — use this project's specific needs
153
+ - NEVER produce a research doc without code examples — agents need concrete patterns
154
+ - NEVER write a reference skill with generic keywords — specific imports and method
155
+ names are what trigger auto-loading
156
+ - NEVER skip structured question tool checkpoints — wrong research direction wastes effort
157
+
158
+ ## Completion Criteria
159
+
160
+ - All research questions answered with evidence
161
+ - Multiple options evaluated with project-specific trade-offs
162
+ - Clear recommendation with rationale
163
+ - Research document written with code examples
164
+ - Reference skill written with specific trigger keywords
165
+ - User confirmed the recommendation at Phase 3 checkpoint
166
+ - Changes committed
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "Research"
3
+ short_description: "Use Research for repo workflows"
4
+ default_prompt: "Use $research for this repository."
5
+ policy:
6
+ allow_implicit_invocation: false
@@ -0,0 +1,267 @@
1
+ ---
2
+ name: review
3
+ description: >
4
+ ALWAYS invoke this skill when the user asks to review a substrate item, an item is at stage:review,
5
+ or the user says "review this". Substrate-first: reviews tracked items, files follow-up items, and
6
+ advances or bounces them. Also supports out-of-band reviews of branches, commits, PRs, working
7
+ trees, or unpushed commits without substrate side effects. Uses fast, standard, and deep lanes; deep
8
+ review runs in fresh context when useful. Triggers on "review item X", "review this", "review this item",
9
+ "deep review", "is this ready", and "verdict on this item".
10
+ ---
11
+
12
+ # Review
13
+
14
+ You review work that is ready for evaluation. The primary path is a substrate
15
+ item at `stage: review`: a feature, story, or epic whose work is done and ready
16
+ to advance or bounce. The skill can also perform an out-of-band review of a
17
+ branch, commit, PR, working tree, or unpushed commits when the user wants a
18
+ one-off verdict outside the substrate.
19
+
20
+ Core invariant: resolve the mode before changing files. **Substrate mode** may
21
+ create `.work` findings, advance or bounce items, archive files, and commit
22
+ review metadata. **Standalone mode** prints a review and leaves the substrate and
23
+ git history alone unless the user explicitly asks to track or commit the review.
24
+
25
+ ## References
26
+
27
+ Load only the reference needed for the selected lane:
28
+
29
+ | Reference | Load when |
30
+ |---|---|
31
+ | [target-resolution.md](references/target-resolution.md) | Determining the target diff, PR, branch, commit range, or epic aggregate scope. |
32
+ | [review-lenses.md](references/review-lenses.md) | Running a standard or deep review of code changes. |
33
+ | [deep-review.md](references/deep-review.md) | The lane is feature, epic, explicit `--deep`, or the user asks for a more robust review. |
34
+ | [../principles/references/models.md](../principles/references/models.md) | Picking the reviewer/peer, host→peer pairing, and the two-phase advisory→adversarial order for deep reviews. |
35
+ | [../principles/references/subagents.md](../principles/references/subagents.md) | Mapping fresh-context reviewer roles across Claude, Codex, and Pi. |
36
+ | [substrate-side-effects.md](references/substrate-side-effects.md) | Substrate mode needs findings filed, stages advanced or bounced, records appended, or a commit made. |
37
+
38
+ ## Invocation Modes
39
+
40
+ | Invocation | Behavior |
41
+ |---|---|
42
+ | `review <id>` | Review one substrate item. |
43
+ | `review` | Default to `--all`: drain every item at `stage: review`. |
44
+ | `review --all` | Drain every item at `stage: review`. |
45
+ | `review <NL filter>` | Drain a filtered subset of the review queue. Interpret the filter against item bodies, tags, and parent chains. |
46
+ | `review <branch/commit/range/PR/wip>` | Out-of-band review. Review the target diff and print a verdict. |
47
+ | `deep review <target>` / `review --deep <target>` | Use deep mode for a substrate item or out-of-band target. |
48
+
49
+ In batch modes (`--all` / NL filter), loop through the matched set and output a
50
+ single consolidated summary at the end: verdicts per item plus total finding
51
+ counts.
52
+
53
+ ## Review Lanes
54
+
55
+ Review cost should match what the target can actually surface. Resolve mode
56
+ first, then pick the lane:
57
+
58
+ | Target | Lane | What runs |
59
+ |---|---|---|
60
+ | **story item** | **Fast** | Confirm the green implementation verification already recorded by `implement`, then advance and roll up. No lens walk, no diff re-analysis, no peer. |
61
+ | **out-of-band target** | **Standard** | Review the diff in the current context using the core lenses. Print a structured verdict. No substrate writes, no stage changes, no commit. |
62
+ | **feature / epic item** | **Deep** | Full lens review using fresh-context evaluation when available. |
63
+ | **explicit `--deep` target** | **Deep** | Use the deep lens set even for an out-of-band target. For a story item, keep the fast lane unless the caller explicitly asked for `--deep`. |
64
+
65
+ ### Fast Lane
66
+
67
+ Stories use the fast lane by default:
68
+
69
+ 1. Read the story body.
70
+ 2. Confirm an implementation/verification record exists and reports green build
71
+ and tests.
72
+ 3. If verification is present and green, load
73
+ [substrate-side-effects.md](references/substrate-side-effects.md) and advance
74
+ `review -> done` with a one-line record:
75
+ `Verdict: Approve - story verified by implement; fast-lane advance`.
76
+ 4. If verification is absent or failing, either run cheap verification yourself
77
+ or bounce `review -> implementing` with a `## Review findings` note.
78
+
79
+ Skip the lens walk for fast-lane stories. Do not deep-review a story unless the
80
+ caller explicitly requested `--deep`.
81
+
82
+ ### Standard Lane
83
+
84
+ Standalone reviews use the standard lane. Load
85
+ [target-resolution.md](references/target-resolution.md) and
86
+ [review-lenses.md](references/review-lenses.md), read enough surrounding code to
87
+ understand the change, then print the structured review. Do not create `.work`
88
+ items, advance stages, archive files, or commit metadata unless the user
89
+ explicitly converts the findings into substrate work.
90
+
91
+ ### Deep Lane
92
+
93
+ Feature, epic, and explicit deep reviews use the deep lane. Load
94
+ [deep-review.md](references/deep-review.md) plus any target or lens reference it
95
+ points to. Prefer fresh-context evaluation when available; if no fresh reviewer
96
+ is reachable, do a degraded inline deep review and record that limitation in
97
+ Notes rather than skipping the review. Deep reviews follow the two-phase order
98
+ — **completeness/complementary, then adversarial** — and because a review target
99
+ is a complete artifact, each phase is a **convergence loop to nits**, not a
100
+ single pass (the ideal is the full `peer-review` loop when available). For a
101
+ feature/epic (deep or complex scope) use **two different model classes** when
102
+ available, one per phase (see
103
+ [../principles/references/models.md](../principles/references/models.md) §6 for
104
+ the design-vs-review loop distinction).
105
+
106
+ ## Workflow
107
+
108
+ ### Phase 0: Resolve Mode And Depth
109
+
110
+ Default to substrate mode when the target looks like a work item id, when any
111
+ item is at `stage: review`, or when autopilot delegated the review. Use
112
+ standalone mode when the user names a branch, commit, commit range, PR number,
113
+ `wip`, working tree, or otherwise asks for an out-of-band code review.
114
+
115
+ If both interpretations are plausible, prefer substrate mode but ask the user
116
+ before mutating `.work`. If the caller is autopilot or a harness goal, do not
117
+ ask: choose substrate mode and the next review item.
118
+
119
+ Depth:
120
+ - **Fast**: story item with green implementation verification.
121
+ - **Standard**: out-of-band target or explicitly lightweight review.
122
+ - **Deep**: feature/epic item, explicit `--deep`, or a review where the user asks
123
+ for robustness across design, contracts, release, and operational dimensions.
124
+
125
+ ### Phase 1: Identify The Target
126
+
127
+ Substrate mode:
128
+ - If the caller passed an item id, target that item.
129
+ - Otherwise run `.work/bin/work-view --stage review --paths`.
130
+ - If multiple items are at `review` and autopilot delegated the call, pick the
131
+ most recent by `updated:` and proceed.
132
+ - If multiple items are at `review` for an interactive caller, ask which one.
133
+
134
+ Standalone mode:
135
+ - Use the branch, commit, range, PR, working tree, or `wip` target from the user.
136
+ - If the target is ambiguous, ask before fetching the diff.
137
+
138
+ ### Phase 2: Gather Context
139
+
140
+ Substrate mode:
141
+ - Read the item file.
142
+ - Internalize the brief, design, implementation notes, and verification evidence.
143
+ - For a feature, also read each child story body.
144
+
145
+ Standalone mode:
146
+ - Read the user's stated target.
147
+ - Read PR description or commit messages when available.
148
+ - Read enough surrounding project context to understand the author's intent.
149
+
150
+ All modes:
151
+ - Read `AGENTS.md` / `CLAUDE.md` for conventions when present.
152
+ - Read `.agents/rules/*.md` (if present) — the project's force-loaded agent
153
+ rules (tag semantics, test integrity, review policy).
154
+ - Read foundation docs the change touches, such as `docs/SPEC.md` or
155
+ `docs/ARCHITECTURE.md`.
156
+
157
+ ### Phase 3: Determine The Change Scope
158
+
159
+ Load [target-resolution.md](references/target-resolution.md). Use it to gather
160
+ the diff, PR metadata, commit messages, or epic aggregate scope.
161
+
162
+ If the non-epic diff is empty:
163
+ - Autopilot substrate mode: advance only if the item has complete green
164
+ verification evidence; otherwise bounce for missing review scope.
165
+ - Interactive substrate mode: ask which range to review.
166
+ - Standalone mode: report that there is no diff to review and stop.
167
+
168
+ ### Phase 4: Review
169
+
170
+ Fast lane:
171
+ - Confirm verification and skip code lenses.
172
+
173
+ Standard lane:
174
+ - Load [review-lenses.md](references/review-lenses.md).
175
+ - Walk the applicable lenses and note any skipped lens with the reason.
176
+
177
+ Deep lane:
178
+ - Load [deep-review.md](references/deep-review.md).
179
+ - Use fresh-context evaluation when available.
180
+ - Apply the core lenses plus the deep dimensions.
181
+
182
+ ### Phase 5: Classify Findings
183
+
184
+ - **Blocker**: must be fixed before advancing or merging. Examples:
185
+ correctness bug, security vulnerability, undocumented breaking change,
186
+ foundation-doc drift, or a test that proves the change is wrong.
187
+ - **Important**: should be addressed but is not strictly blocking. Examples:
188
+ missing tests for meaningful logic, questionable design, unclear naming, minor
189
+ security gap, or refactor opportunity.
190
+ - **Nit**: optional improvement, style polish, small documentation improvement,
191
+ or nonessential refactor.
192
+
193
+ If there are zero blockers and zero important findings, say so plainly. Do not
194
+ pad the review with invented concerns.
195
+
196
+ ### Phase 6: Finish
197
+
198
+ Standalone mode:
199
+ - Print the structured review.
200
+ - Do not modify `.work`.
201
+ - Do not commit anything.
202
+ - If the user asks to track findings, load
203
+ [substrate-side-effects.md](references/substrate-side-effects.md) and convert
204
+ only the requested findings into substrate work.
205
+
206
+ Substrate mode:
207
+ - Load [substrate-side-effects.md](references/substrate-side-effects.md).
208
+ - File above-nit findings into the substrate.
209
+ - Advance the item if there are no blockers, or bounce it if blockers exist.
210
+ - Append the review record.
211
+ - Commit the substrate changes.
212
+
213
+ ## Output
214
+
215
+ ```markdown
216
+ # Review: <target>
217
+
218
+ ## Summary
219
+ <2-3 sentences>
220
+
221
+ ## Verdict
222
+ Approve | Approve with comments | Request changes | Block
223
+
224
+ ## Findings
225
+
226
+ ### Blockers
227
+ - **<title>** (`file:line`): <what is wrong, why it matters>
228
+ -> Item: `<finding-item-id>` (substrate mode only)
229
+
230
+ ### Important
231
+ - **<title>** (`file:line`): <explanation and direction>
232
+ -> Item: `<finding-item-id>` (substrate mode only)
233
+
234
+ ### Nits
235
+ - Nit: <brief note> (`file:line`)
236
+
237
+ ## Notes
238
+ <mode, depth, skipped lenses, limitations, or anything else worth recording>
239
+ ```
240
+
241
+ If no findings above nit level in substrate mode: "This change looks good.
242
+ Nothing blocking or significant to flag. Item advanced to `stage: done`."
243
+
244
+ If no findings above nit level in standalone mode: "This change looks good.
245
+ Nothing blocking or significant to flag."
246
+
247
+ ## Guardrails
248
+
249
+ - Resolve mode before making changes. Substrate mode may mutate `.work`;
250
+ standalone mode prints a review and leaves the workspace alone.
251
+ - Do not pad with nits to look thorough.
252
+ - Do not invent concerns to balance positive feedback. "Looks good, ship it" is
253
+ valuable.
254
+ - Do not require tests for changes that clearly do not need them: typo fixes,
255
+ comment-only changes, or config-only changes.
256
+ - Read actual files for context, not just diff lines.
257
+ - If you do not understand the change well enough to judge it, say so
258
+ explicitly. "I would want the author to explain why X before approving" is a
259
+ valid finding.
260
+ - In substrate mode, findings above nit-level become items. Do not let real
261
+ concerns evaporate into review prose.
262
+ - Review's security check is lightweight. For a full security gate, use
263
+ `/agile-workflow:gate-security`.
264
+ - Foundation-doc drift is a blocker, not a nit. Rolling foundation is a hard
265
+ rule.
266
+ - Do not advance an item past review unless the verdict is Approve or Approve
267
+ with comments. Pushing through blockers defeats the point of the stage.
@@ -0,0 +1,98 @@
1
+ # Deep Review
2
+
3
+ Load this reference for feature reviews, epic reviews, explicit `--deep`
4
+ requests, or any request that asks for a more robust review across design,
5
+ contracts, release, and operational dimensions.
6
+
7
+ ## Reviewer Selection
8
+
9
+ Prefer a fresh-context reviewer for deep mode. Run the review in a fixed
10
+ **two-phase order** — completeness/complementary/advisory first, adversarial
11
+ second. Because a review target is a **complete** artifact (unlike an open
12
+ design), each phase is a **multi-step convergence loop**, not a single ask:
13
+ iterate until findings stabilize (the ideal is the full `peer-review`
14
+ convergence loop — ≥3 review→refine passes, continue while substantive issues
15
+ keep surfacing, stop on nits, cap ~5). For a feature/epic or deep/complex
16
+ target, use **two different model classes** when available — one class drives
17
+ the Phase 1 convergence loop, a *different* class drives the Phase 2 loop — so
18
+ both augmentation diversity and adversarial independence are maximized.
19
+
20
+ 1. **Phase 1 — Completeness / complementary convergence loop** (different class
21
+ than host when reachable). Ask each round: are all requirements, acceptance
22
+ criteria, edge cases, error paths, and dependencies covered? What is missing
23
+ or should be strengthened? Iterate to convergence; this is augmentation, not
24
+ judgment — run it *before* attacking.
25
+ 2. **Phase 2 — Adversarial convergence loop** (a different class than the host,
26
+ and ideally a different class than Phase 1). Same convergence shape, now in
27
+ attack posture: what is broken, contradictory, built on a false assumption,
28
+ or will fail in operation? Use `peeragent` when a different model class is
29
+ available and appropriate; do not use peeragent when it would be the same
30
+ class as the host.
31
+ 3. When a different model class is not reachable, use a fresh generic sub-agent
32
+ prompted with the reviewer capsule from
33
+ [../../principles/references/subagents.md](../../principles/references/subagents.md)
34
+ as the same-harness fresh-context fallback. Record that it was not
35
+ cross-model unless the spawned model class differs from the host.
36
+ 4. Otherwise, use a fresh local sub-agent at the highest available model class
37
+ when the environment provides one. If the mechanism only supports single
38
+ passes (no convergence loop), run as many rounds as it allows and note that
39
+ full convergence was not reached.
40
+ 5. If no fresh-context mechanism is available, continue inline as a degraded
41
+ deep review and record that limitation in `Notes`.
42
+
43
+ For the host→peer pairing table, exact `peeragent` flags, and the design-vs-
44
+ review loop distinction, load
45
+ [../../principles/references/models.md](../../principles/references/models.md).
46
+
47
+ Peer or sub-agent failures are non-blocking. Fall back to the next option rather
48
+ than halting the review.
49
+
50
+ A top-tier reasoning peer (Opus-class, xhigh Codex/GLM, or equivalent) commonly
51
+ takes 10 to 30 minutes before it returns, especially for a large feature, epic,
52
+ or out-of-band review. A quiet process that has not returned after a few minutes
53
+ is still normal top-tier review latency, not a hang — budget for it across a
54
+ multi-round convergence loop.
55
+
56
+ ## Reviewer Packet
57
+
58
+ Give the fresh reviewer enough context to judge without bloating the task:
59
+
60
+ - Review target and mode: substrate item, PR, branch, range, or epic.
61
+ - Diff or aggregate scope from `target-resolution.md`.
62
+ - Item brief/design/implementation notes, or PR/commit description.
63
+ - Relevant project conventions from `AGENTS.md` / `CLAUDE.md`.
64
+ - Relevant foundation-doc assertions.
65
+ - Core lenses from `review-lenses.md`.
66
+ - Deep dimensions below.
67
+
68
+ The host classifies returned findings, files substrate items when applicable,
69
+ and performs stage transitions. The fresh reviewer only evaluates.
70
+
71
+ ## Deep Dimensions
72
+
73
+ Apply these after the core lenses:
74
+
75
+ - **Contract and API behavior**: public interfaces, generated contracts, schemas,
76
+ CLI/config surfaces, compatibility, and consumer expectations.
77
+ - **Data and migration behavior**: persistence shape, idempotency, backfills,
78
+ rollback/forward safety, and data compatibility.
79
+ - **Concurrency and lifecycle**: async races, cancellation, retries, resource
80
+ cleanup, cache invalidation, and stale reads.
81
+ - **Operational and release risk**: observability, failure modes, deploy
82
+ ordering, feature flags, dependency changes, and rollback behavior.
83
+ - **Product or UX completeness**: when user-facing, does the end-to-end
84
+ capability match the brief or PR description from a user's point of view?
85
+
86
+ ## Depth Calibration
87
+
88
+ Deep does not mean exhaustive. Pull the dimensions that match the change:
89
+
90
+ - API/schema/CLI changes: emphasize contracts, breaking changes, docs, and tests.
91
+ - Persistence changes: emphasize data migration, idempotency, rollback, and
92
+ observability.
93
+ - Async/cache/network changes: emphasize concurrency, lifecycle, retries, and
94
+ failure modes.
95
+ - UI/workflow changes: emphasize capability completeness, accessibility-relevant
96
+ behavior, state transitions, and regression coverage.
97
+ - Epic reviews: emphasize aggregate alignment and release readiness, not per-line
98
+ diff analysis.
@@ -0,0 +1,68 @@
1
+ # Review Lenses
2
+
3
+ Load this reference for standard and deep review lanes. Walk the applicable
4
+ lenses and note any lens skipped with the reason.
5
+
6
+ ## Correctness
7
+
8
+ - Does the change do what the design, PR description, or commit message says?
9
+ - Are edge cases handled: off-by-one, null/undefined, async race, and boundary
10
+ conditions?
11
+ - Does the change introduce resource leaks, infinite loops, unbounded growth, or
12
+ stale state?
13
+ - If this is a fix, does it address the root cause rather than the symptom?
14
+
15
+ ## Tests
16
+
17
+ - Are tests included for meaningful logic changes?
18
+ - Do tests verify behavior and contract rather than implementation details?
19
+ - Are edge cases covered, not only the happy path?
20
+ - For bug fixes, is there a regression test that would have caught the bug?
21
+
22
+ ## Design Alignment
23
+
24
+ - Does the implementation match the design, or are deviations documented?
25
+ - Is any new abstraction earned by real repetition or imminent need?
26
+ - Could the change be simpler while preserving behavior?
27
+ - Does complexity move toward boundaries and away from core domain logic?
28
+
29
+ ## Security
30
+
31
+ - Does the change touch auth, authorization, input validation, secrets, external
32
+ requests, file paths, or command execution?
33
+ - Check only the applicable items. Do not run a full security audit here.
34
+ - Look for SQL injection, XSS, command injection, path traversal, unsafe secret
35
+ handling, and SSRF-adjacent outbound request changes.
36
+
37
+ ## Breaking Changes
38
+
39
+ - Does the change modify a public API, exported signature, schema, CLI, config,
40
+ or generated contract?
41
+ - If yes, is the break intentional, documented, and paired with a migration path
42
+ when needed?
43
+
44
+ ## Foundation-Doc Alignment
45
+
46
+ - Does implementation invalidate any assertion in foundation docs such as
47
+ `docs/VISION.md`, `docs/SPEC.md`, or `docs/ARCHITECTURE.md`?
48
+ - If yes, did the implementer roll the doc forward in the same change?
49
+ - Foundation-doc drift is a blocker in substrate mode.
50
+
51
+ ## Naming And Comments
52
+
53
+ - Are new functions, types, and complex logic well named?
54
+ - Do comments explain why the code exists, not just what the code says?
55
+ - Is anything future maintainers need to understand left implicit?
56
+
57
+ ## Epic Review Focus
58
+
59
+ For epics, skip per-line correctness, tests, and naming by default. Focus on:
60
+
61
+ - Design alignment: does the realized decomposition match the brief?
62
+ - Foundation-doc alignment: did cumulative work invalidate a foundation
63
+ assertion that children missed?
64
+ - Breaking changes: are cross-cutting public API shifts visible only in aggregate?
65
+ - Capability completeness: does the promised capability work end to end?
66
+
67
+ If everything is clean, "Epic delivered as briefed; advancing to done" is a
68
+ complete review.