@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,716 @@
1
+ # ARCHITECTURE: agile-workflow
2
+
3
+ How the substrate is laid out, how items move through it, how skills compose,
4
+ how autopilot drains queues respecting dependencies, how gates produce items,
5
+ and how the rules-file-as-agent-interface keeps it all navigable.
6
+
7
+ ## Substrate layout
8
+
9
+ The substrate lives in `.work/` at the project root. Four tiers, two utility
10
+ files:
11
+
12
+ ```
13
+ .work/
14
+ ├── active/ in-flight, scoped, advancing through stages
15
+ │ ├── epics/<id>.md
16
+ │ ├── features/<id>.md
17
+ │ └── stories/<id>.md
18
+ ├── backlog/ parked, unscoped, awaiting promotion
19
+ │ └── <id>.md flat — no kind subdirectories
20
+ ├── releases/ shipped bundles, one folder per version
21
+ │ └── <version>/
22
+ │ ├── <release-id>.md the release item itself
23
+ │ └── <id>.md items bound to this release
24
+ ├── archive/ done items not bound to any release
25
+ │ └── <id>.md
26
+ ├── bin/ git-tracked, not-gitignored installed entrypoint
27
+ │ └── work-view prebuilt binary where supported; bash fallback otherwise
28
+ └── CONVENTIONS.md project-specific overrides
29
+ ```
30
+
31
+ Items live as files. Their location encodes their tier; their frontmatter
32
+ encodes everything else. Moving a file between tiers IS the operation that
33
+ transitions the item.
34
+
35
+ ## Item lifecycle
36
+
37
+ An item flows through tiers as work progresses on it.
38
+
39
+ ```
40
+ ┌──────────────┐
41
+ │ creation │
42
+ └──────┬───────┘
43
+
44
+ ┌──────────────────────┼────────────────────────┐
45
+ │ │ │
46
+ ▼ ▼ ▼
47
+ /park /scope (small/med) /scope (large)
48
+ │ │ │
49
+ ▼ ▼ ▼
50
+ backlog/<id>.md active/<kind>/<id>.md active/<kind>/<id>.md
51
+ + foundation docs roll
52
+
53
+
54
+ /design | /refactor-design | /perf-design
55
+ (routed by tags)
56
+
57
+
58
+ stage: drafting → implementing
59
+ (design written into body; child stories spawned)
60
+
61
+
62
+ /implement-orchestrator (default; scope-driven,
63
+ cross-feature waves) or /implement (inline alternative)
64
+
65
+
66
+ stage: review
67
+
68
+
69
+ /review (advance to done)
70
+
71
+ ┌─────────────────┼─────────────────┐
72
+ ▼ ▼ ▼
73
+ /release-deploy no binding no binding,
74
+ binds to release superseded
75
+ │ │ │
76
+ ▼ ▼ ▼
77
+ releases/<v>/<id> archive/<id> archive/<id>
78
+ ```
79
+
80
+ ### Item creation entry points
81
+
82
+ 1. **`/park`** — captures an unscoped backlog note mid-conversation as a flat
83
+ backlog file. It may be a quick idea, a richer context note, or a
84
+ roadmap-style multi-arc thought; it preserves supplied context without
85
+ proactively designing or binding the work. Used when something surfaces
86
+ that shouldn't derail the current thread.
87
+ 2. **`/scope` on a backlog item** — promotes an existing backlog idea to
88
+ active, decides its kind (epic/feature/story), and writes the kind-file
89
+ with full frontmatter including any declared dependencies.
90
+ 3. **`/scope` on a fresh request** — when a new direction arrives directly
91
+ to active without parking first. If scope is large enough to change the
92
+ project's vision/spec/architecture, scope rolls foundation docs forward
93
+ as part of the operation.
94
+
95
+ ### Stage advancement
96
+
97
+ Stages advance only when work completes; they are never pre-populated.
98
+
99
+ | Kind | drafting | implementing | review | done |
100
+ |---|---|---|---|---|
101
+ | epic | initial state when scoped | once children are designed and started | once all children are at review/done | once all children are at done |
102
+ | feature | initial state when scoped | once design is written into body and acceptance criteria clear | once code lands and tests pass | once user-facing review approves |
103
+ | story | optional initial state | initial state more often (skips drafting) | once code lands | once user/code-review approves |
104
+ | release | initial state when cut | once gates begin running (`stage: quality-gate`) | n/a | n/a — terminal stage is `released` |
105
+
106
+ The PostToolUse hook auto-bumps `updated:` whenever an item file is edited;
107
+ skills only need to advance `stage:` explicitly.
108
+
109
+ ## Dependency graph
110
+
111
+ Items declare ordering via `depends_on: [<id>, ...]`. This is **sequencing**,
112
+ distinct from `parent` (which is **hierarchy**).
113
+
114
+ ### Rules
115
+
116
+ - An item is **ready** when it is in the active tier, its `stage` is
117
+ `drafting`, `implementing`, or `review`, AND every `depends_on` entry is
118
+ terminal (`stage: done`/`released`, or resident in `releases/`/`archive/`).
119
+ - Dependencies must form a DAG. Cycles are invalid; skills that produce
120
+ items must validate no cycle is introduced before writing.
121
+ - Cross-tier dependencies are allowed (a feature can depend on an epic;
122
+ a story can depend on a feature in another epic).
123
+ - Dependencies on archived or released items count as `done` — those tiers
124
+ are terminal-done.
125
+
126
+ ### When skills declare dependencies
127
+
128
+ | Skill | Declares dependencies between |
129
+ |---|---|
130
+ | `scope` | The new item and any items the user mentions as prerequisites |
131
+ | `epic-design` | Child features of the epic being decomposed (some sequential, some parallel) |
132
+ | `feature-design` / `refactor-design` / `perf-design` | Child stories of the feature being designed (some sequential, some parallel) |
133
+ | `implement-orchestrator` | Read existing dependencies; do not modify; respect when fanning out |
134
+ | `epicize` | Epics where one's output feeds another |
135
+ | `convert` | Inferred from source: workflow `ROADMAP.md` phase order → epic-level deps; ad-hoc gets no inferred deps |
136
+ | `bold-refactor` | Child features of a refactor epic when order matters |
137
+
138
+ ### Cycle prevention
139
+
140
+ Every skill that adds a `depends_on` entry runs a quick reachability check
141
+ via `work-view --blocking <id>` before writing. If adding the entry would
142
+ create a cycle (target reaches back to the source), the skill reports the
143
+ cycle and asks the user to resolve.
144
+
145
+ ## Tier transitions
146
+
147
+ | From | To | Trigger | Mechanism |
148
+ |---|---|---|---|
149
+ | (none) | backlog | `/park` | New file in `.work/backlog/<id>.md` |
150
+ | backlog | active | `/scope` | `git mv` to `.work/active/<kind>/<id>.md`; frontmatter populated |
151
+ | (none) | active | `/scope` (skipping backlog) | New file in `.work/active/<kind>/<id>.md` |
152
+ | active | releases | `/release-deploy` shipping | bound bodies collapse into one `.work/releases/<version>/release-<version>.md` summary; the bodies are `git rm`'d (recoverable via the per-item `git ref`). Legacy `retain-bodies` mode `git mv`s each `<id>.md` instead |
153
+ | active | archive | item reaches `done` without `release_binding` | stripped to a bodyless stub at `.work/archive/<id>.md` (frontmatter + `# Title` + `git_ref` + `archived_atop`, the immutable release baseline a later release late-binds against); body pruned. Legacy `retain-bodies` mode `git mv`s the full body |
154
+ | backlog | (deleted) | user discards via `/scope` rejection | `git rm` (history retained) |
155
+
156
+ Active and backlog transitions are `git mv` so history is preserved by path. Terminal transitions
157
+ (`delete-refs`, the default) prune bodies to refs — a bodyless archive stub or a single release
158
+ summary — and git history retains the full content. Either way the substrate's audit trail IS the
159
+ git log.
160
+
161
+ ## AGENTS.md substrate section
162
+
163
+ `convert` writes a **slim** agile-workflow section into the selected AGENTS
164
+ target in every bootstrapped project. It is dense pointers — substrate
165
+ orientation, `work-view` query patterns, grep-able pointers to the canonical
166
+ rules file `.agents/rules/agile-workflow.md` and the `patterns` skill, and a
167
+ MANDATORY "read `.agents/rules/*.md` before designing/implementing/reviewing"
168
+ read-directive. Every line is something the agent greps or runs as a literal
169
+ command, not narrative prose. The dense behavioral rules (tag semantics, test
170
+ integrity, advisory review, entry points) do not live here — they live in
171
+ `.agents/rules/agile-workflow.md`, which the hook force-loads (see Hook scripts)
172
+ and the design/implement/review skills read in their grounding phase. The
173
+ read-directive is the graceful-degradation guarantee: AGENTS always loads, so
174
+ even when the hook does not fire (no substrate, untrusted hook, non-coding
175
+ session) the agent is told where the rules live.
176
+
177
+ Navigation reference content:
178
+
179
+ ````markdown
180
+ ---
181
+ description: Agile-workflow substrate navigation rules
182
+ paths: ['.work/**', 'docs/**']
183
+ ---
184
+
185
+ # Agile-Workflow Substrate Navigation
186
+
187
+ ## Folder structure
188
+ .work/active/{epics,features,stories}/ in-flight, scoped
189
+ .work/backlog/ parked, unscoped
190
+ .work/releases/<version>/ shipped bundles
191
+ .work/archive/ done items not bound to a release
192
+
193
+ ## Item kinds
194
+ epic multi-feature arc; has children parent of features
195
+ feature design + implementation unit parent of stories
196
+ story single-session unit leaf or has tasks
197
+ task checklist line in parent body not its own file
198
+ release version bundle in releases/ binds items via release_binding
199
+
200
+ ## Stages
201
+ epic drafting → implementing → review → done
202
+ feature drafting → implementing → review → done
203
+ story implementing → review → done (often skips drafting)
204
+ task [ ] → [x]
205
+ release planned → quality-gate → released
206
+
207
+ ## Frontmatter
208
+ id, kind, stage, tags[], parent, depends_on[], release_binding,
209
+ gate_origin, research_refs[], research_origin, created, updated
210
+
211
+ `research_refs` and `research_origin` are optional linkage fields that connect
212
+ `.work/` items to `.research/` artifacts (mirroring `gate_origin`). Missing →
213
+ `[]` / `null`, no validation warning. Query via `--research-refs <slug>` and
214
+ `--research-origin <slug>`. See `plugins/agentic-research/docs/HANDOFF.md` for
215
+ the cross-tier contract; the emission and commissioning arrows that populate these
216
+ fields are implemented (live) in the `agentic-research` plugin.
217
+
218
+ ## Querying with work-view (primary tool)
219
+
220
+ `.work/bin/work-view` is the canonical query tool — use it instead of
221
+ hand-grepping frontmatter. Filters compose with AND semantics; combine
222
+ freely. Run `--help` for the authoritative flag list.
223
+
224
+ ### Filters
225
+ --stage <stage> drafting | implementing | review | done | released
226
+ --tag <tag> repeatable; AND across tags
227
+ --kind <kind> epic | feature | story | release
228
+ --parent <id> direct children of given item
229
+ --release <version> items with release_binding: <version>
230
+ --gate <name> items produced by gate <name>
231
+ --ready active-tier drafting/implementing/review, all depends_on terminal
232
+ --blocked active-tier drafting/implementing/review, >=1 non-terminal dep
233
+ --blocking <id> items that depend on <id>
234
+
235
+ ### Output modes
236
+ (default tabular) columns: ID KIND STAGE TAGS PARENT
237
+ --paths one file path per line (pipe-friendly)
238
+ --cat full item bodies, separated by ---
239
+ --count match count only
240
+
241
+ ### Common queries
242
+
243
+ # Items ready to work right now
244
+ .work/bin/work-view --ready
245
+
246
+ # Items awaiting an agent review pass
247
+ .work/bin/work-view --stage review
248
+
249
+ # All children of an epic
250
+ .work/bin/work-view --parent <epic-id>
251
+
252
+ # Children of an epic that are still blocked
253
+ .work/bin/work-view --parent <epic-id> --blocked
254
+
255
+ # Read full bodies of every item bound to a release
256
+ .work/bin/work-view --release v1.2.0 --cat
257
+
258
+ # Security-tagged items currently implementing
259
+ .work/bin/work-view --stage implementing --tag security
260
+
261
+ # Items that would unblock if <id> finishes
262
+ .work/bin/work-view --blocking <id>
263
+
264
+ # Pipe paths into another tool
265
+ .work/bin/work-view --ready --paths | xargs grep -l 'TODO'
266
+
267
+ ## Fallback: raw substrate access
268
+
269
+ When work-view doesn't fit (e.g. searching item bodies, not frontmatter):
270
+
271
+ # Search inside item bodies
272
+ grep -rn '<phrase>' .work/active/
273
+
274
+ # Item history
275
+ git log -p -- .work/active/features/<id>.md
276
+
277
+ # Recent substrate changes
278
+ git log --since='1 day ago' -- .work/
279
+
280
+ ## Session start checklist
281
+ 1. cat .work/CONVENTIONS.md project-specific overrides
282
+ 2. .work/bin/work-view --stage review items awaiting an agent review pass
283
+ 3. .work/bin/work-view --ready items ready to work
284
+ 4. Identify your work: explicit user ask, or pick the next ready item
285
+
286
+ ## Stage transition discipline
287
+ - Update `stage:` and let PostToolUse hook auto-bump `updated:`
288
+ - Commit after each stage transition (one commit per item per transition)
289
+ - Do not pre-populate stages; advance only as work completes
290
+
291
+ ## Foundation docs (rolling-forward principle)
292
+ docs/ holds standing context: VISION.md, SPEC.md, ARCHITECTURE.md, etc.
293
+ - Foundation docs describe the system's current state or intended future state
294
+ - Never add "previously this was…" or "note: in v1.2 we…"
295
+ - When implementation changes a foundation-doc assertion, update the doc
296
+ - Git history is the audit trail; the doc carries the active truth
297
+ ````
298
+
299
+ The agent loads this automatically when working in `.work/` or `docs/`. The
300
+ `paths:` glob keeps it out of the way when working elsewhere.
301
+
302
+ ## Design family routing
303
+
304
+ Four skills share the design slot, routed by item kind first, then tags:
305
+
306
+ | Skill | Triggered by | Cognitive shape |
307
+ |---|---|---|
308
+ | `epic-design` | epic at `stage: drafting` | Epic decomposition: capability-arc identification, child-feature spawning with `depends_on` chains, decomposition pre-mortem. Writes the realized decomposition into the epic body |
309
+ | `feature-design` | feature at `stage: drafting`, no specialized tag | Greenfield feature design: vision absorption, codebase mapping, unit decomposition, pre-mortem, test design |
310
+ | `refactor-design` | feature with `tags: [refactor]` at `stage: drafting` | Refactor planning: code-smell scan, before/after step shape, risk + rollback per step, cost-benefit framing |
311
+ | `perf-design` | feature with `tags: [perf]` at `stage: drafting` | Perf design: bottleneck identification, measurement strategy, hot-path analysis |
312
+
313
+ Each writes its output into the item's body and advances stage to
314
+ `implementing`. `epic-design` spawns child features at `stage: drafting` (which
315
+ the feature-level family then picks up); the feature-level skills spawn child
316
+ stories at `stage: implementing` with declared dependencies.
317
+
318
+ The model picks the right skill from kind + tags. SKILL.md `description:`
319
+ fields cross-reference each other so the agent doesn't pick the wrong one.
320
+ New design specializations (e.g., `security-design`) join the family by
321
+ adding a tag and a skill — no architectural change.
322
+
323
+ ## Autopilot algorithm
324
+
325
+ Autopilot is the queue policy for autonomous substrate goals. The preferred
326
+ shape is a harness goal statement that names the skill and scope:
327
+
328
+ ```text
329
+ Use agile-workflow autopilot to drain <epic-id>
330
+ Use agile-workflow autopilot to drain --all
331
+ ```
332
+
333
+ Direct skill invocation remains supported: `/agile-workflow:autopilot
334
+ <epic-id>` drains one epic, and `/agile-workflow:autopilot --all` drains all of
335
+ `.work/active/`. In both cases, autopilot does not create `/loop` schedules or
336
+ maintain a progress file; harness goal/continuation owns long-running
337
+ persistence and `.work/active/` is the resume point.
338
+
339
+ ### Pre-flight: align on strategic questions first
340
+
341
+ **Before kicking off autopilot, run `epic-design --only-questions` over the
342
+ epics you're about to drain.** This is the single highest-leverage step in
343
+ the agile-workflow loop and should generally always be done.
344
+
345
+ ```bash
346
+ # Per-epic — align on one epic before autopilot picks it up
347
+ /agile-workflow:epic-design --only-questions <epic-id>
348
+
349
+ # Cover the whole active queue at once — recommended before a --all autopilot goal
350
+ /agile-workflow:epic-design --only-questions --all
351
+ ```
352
+
353
+ What the pass does (see `epic-design` SKILL Phase 4.7): for each epic at
354
+ `stage: drafting`, it grounds in foundation docs + codebase, surfaces the
355
+ 2–5 directional product / architecture / scope questions specific to that
356
+ epic, asks the user via `AskUserQuestion`, and writes the answers under
357
+ `## Design decisions` in the epic body. It does NOT decompose into child
358
+ features and does NOT advance stage — that's left to the real design pass.
359
+
360
+ Why it matters:
361
+
362
+ - **Autopilot inherits the answers.** When `epic-design` (full pass) runs
363
+ later under autopilot, it reads the already-captured `## Design decisions`
364
+ and skips Phase 4.7 — no autonomous judgment on directional choices,
365
+ because they're already locked in by the user.
366
+ - **Cheap up front, expensive later.** Five minutes of interactive Q&A on
367
+ the whole drafting queue prevents autopilot from committing to a wrong
368
+ architectural direction across multiple features before the user notices.
369
+ - **One human checkpoint instead of N.** A single `--only-questions --all`
370
+ pass answers every strategic question across the queue in one sitting,
371
+ rather than autopilot pausing per-epic mid-run (or worse, not pausing and
372
+ guessing).
373
+
374
+ `--only-questions` mode refuses to run under autopilot itself — it's
375
+ explicitly a pre-autopilot, human-in-the-loop step. The right invocation
376
+ shape is: `--only-questions --all` first, review the captured decisions,
377
+ then start an autopilot goal for `--all` (or `<epic-id>`).
378
+
379
+ ### Queue selection algorithm
380
+
381
+ ```
382
+ 1. Collect candidate items:
383
+ - if epic-scoped: items with parent == <epic-id>, transitively
384
+ (include grandchildren via parent chain)
385
+ - if --all: all items in .work/active/
386
+ 2. Filter to stage in {drafting, implementing, review}
387
+ 3. For each candidate, check depends_on:
388
+ - all deps must be at stage: done (or in releases/archive)
389
+ - candidates with unmet deps are filtered out
390
+ 4. Sort the remaining candidates by:
391
+ - depends_on count ascending (less-blocked items first)
392
+ - created ascending (FIFO tie-break)
393
+ 5. Pop the first item.
394
+ 6. Work it:
395
+ - if drafting → invoke /design (or /refactor-design / /perf-design by tag)
396
+ - if implementing → invoke /implement-orchestrator with the autopilot
397
+ scope (the picked item is an anchor; the orchestrator drains the whole
398
+ in-scope implementing band as one batch, cross-feature is fine).
399
+ /implement is reserved for the inline small-delivery case.
400
+ - if review → invoke /review (autonomous: produces verdict, advances
401
+ review→done or sends back to implementing)
402
+ 7. Advance stage on completion. Commit.
403
+ 8. Goto 1 unless stop condition.
404
+ ```
405
+
406
+ ### Stop conditions
407
+
408
+ - Empty queue (all candidates exhausted)
409
+ - User invokes a halt command or sends a manual prompt
410
+ - A skill reports a blocker that can't be resolved autonomously
411
+
412
+ ### Harness goal continuation
413
+
414
+ Autopilot does not own continuation mechanics. Claude/Codex harness goal
415
+ features keep the run alive across compaction and continuation turns. If a run
416
+ resumes, the agent re-reads `.work/active/` and applies the same queue selection
417
+ algorithm. There is no `--resume`, no watchdog `/loop`, and no `PROGRESS.md`.
418
+
419
+ ### Refactor cadence during --all mode
420
+
421
+ Every N items completed (default N=5), autopilot delegates a conservative
422
+ discovery pass to `refactor-design` over recently touched files. That skill
423
+ classifies pure refactors vs behavior-changing work and emits the appropriate
424
+ items. The next queue rebuild picks them up naturally.
425
+
426
+ The refactor cadence is conservative: never invokes `bold-refactor` (that's
427
+ user-only). Only scopes incremental refactor features.
428
+
429
+ ## Hook script behavior
430
+
431
+ ### `hooks/scripts/prompt-context.py`
432
+
433
+ **Activation gate:** exits 0 if no `.work/CONVENTIONS.md` exists in the hook
434
+ `cwd` or any ancestor.
435
+
436
+ **SessionStart / PostCompact effect:** updates prompt-context state under the
437
+ host-provided plugin data directory (`PLUGIN_DATA` / `CLAUDE_PLUGIN_DATA`),
438
+ falling back to `XDG_STATE_HOME`, `~/.local/state`, or the system temp directory
439
+ only when no plugin data directory is available. `SessionStart` resets the
440
+ per-session epoch and seen-set; `PostCompact` bumps the epoch. Prompt-time
441
+ principles capsules fire at most once per session, and once again after
442
+ resume/compaction. These events do not inject queue context and do not dirty the
443
+ project worktree. Where the host supports hook-specific context, they emit the
444
+ `.agents/rules/` block (below) directly as the primary rules firing. Codex
445
+ `PostCompact` is side-effect-only because Codex rejects `hookSpecificOutput` on
446
+ that event; Codex rules context flows through `SessionStart` with `source:
447
+ compact`.
448
+
449
+ **`.agents/rules/` rules loader:** the script force-loads every
450
+ `<root>/.agents/rules/*.md` file (sorted, concatenated under a
451
+ `## Project Rules (.agents/rules/)` heading) into agent context, so producers
452
+ (`convert` writes `.agents/rules/agile-workflow.md`; `gate-patterns` writes
453
+ `.agents/rules/patterns.md`; the user adds their own) reach the agent reliably
454
+ in both Claude Code and Codex. It is content-agnostic — it injects whatever
455
+ `*.md` files exist. **SessionStart and host-supported PostCompact context output
456
+ emit unconditionally** (mirroring the legacy `.claude/rules/` force-load, and
457
+ guaranteeing re-injection after compaction even with no user prompt). Codex uses
458
+ `SessionStart` with `source: compact` instead of emitting context from
459
+ `PostCompact`. Per-epoch + SHA-256 content-hash dedup means rules load exactly
460
+ once per `(epoch, content)`. `.work/CONVENTIONS.md` may set
461
+ `rules_context: on|off` (default on) and `rules_context_max_bytes: <int>`
462
+ (default 12000); the byte cap truncates with a notice while hashing the
463
+ untruncated content so any edit re-injects.
464
+
465
+ **UserPromptSubmit effect:** principles capsules emit only for actionable
466
+ workflow prompts: queue operations, stage movement, explicit agile-workflow
467
+ verbs, or a known item id. Explainer prompts and idle chat stay silent. The hook
468
+ does not inject `.agents/rules/*.md` or queue snapshots at prompt time.
469
+
470
+ When it fires, the script returns JSON `hookSpecificOutput.additionalContext`
471
+ containing any principles capsules that have not already fired in the current
472
+ session epoch:
473
+
474
+ ```
475
+ ## Agile Workflow Principles
476
+ Code-design capsule:
477
+ - Ports & Adapters: keep domain logic independent of DB/filesystem/HTTP/time/randomness.
478
+ - Single Source of Truth: define growing variant sets once; derive downstream behavior.
479
+ ...
480
+ ```
481
+
482
+ Implementation: deterministic Python over `.work/` and `.work/bin/work-view`.
483
+ No LLM.
484
+
485
+ ### `hooks/scripts/substrate-maintainer.py`
486
+
487
+ **Activation gate:** exits 0 if the modified path doesn't match a markdown item
488
+ under `.work/active/`, `.work/backlog/`, `.work/releases/`, or `.work/archive/`.
489
+
490
+ **Effect:** for active/backlog item edits, replaces the `updated:` line in
491
+ frontmatter with today's date in local time. It then validates cheap substrate
492
+ invariants for the touched item(s): required frontmatter, valid kind/stage,
493
+ filename/id match, duplicate id conflicts involving the touched item, existing
494
+ parents and dependencies, and `depends_on` cycles reachable from the touched
495
+ item. Issues are returned as `hookSpecificOutput.additionalContext` so the next
496
+ model turn sees them.
497
+
498
+ This is a deterministic command hook — no LLM.
499
+
500
+ ### Pi hook parity adapter
501
+
502
+ Pi does not load `hooks/hooks.json`, so the Pi package reaches parity through
503
+ `extensions/agile-workflow.ts`. The extension maps Pi lifecycle events to the
504
+ same Python scripts instead of maintaining a TypeScript copy of the rules:
505
+
506
+ - `before_agent_start` appends the `.agents/rules/*.md` block via the synthetic
507
+ `PiBeforeAgentStart` prompt-context path, then asks the same script for any
508
+ prompt-gated principles capsule and injects that capsule as a visible Pi
509
+ message (`customType: agile-workflow-principles`).
510
+ - `session_start` and `session_compact` call the prompt-context script for the
511
+ same epoch/self-heal side effects Claude/Codex hooks get.
512
+ - `tool_result` for mutating tools calls `substrate-maintainer.py`, so `updated:`
513
+ bumps and cheap validation come from the same implementation in all channels.
514
+
515
+ The parity posture is: one substrate model, one generated rules source, one pair
516
+ of deterministic hook scripts, with each host only adapting event names and UI
517
+ plumbing. `scripts/tests/channel-parity.test.sh` guards that wiring.
518
+
519
+ ## Gate orchestration
520
+
521
+ `/release-deploy` orchestrates the gate sequence after items are bound to
522
+ a release. Default order: **security → tests → cruft → docs → patterns**.
523
+ Override via `gates_for_release` in `.work/CONVENTIONS.md`.
524
+
525
+ ### Gate-as-item-producer pattern
526
+
527
+ Each gate scans the bundle of items at `release_binding: <current-version>`
528
+ and produces new items rather than emitting a pass/fail report:
529
+
530
+ | Gate | What it scans | What it produces |
531
+ |---|---|---|
532
+ | `gate-security` | Bound items' code changes against security checklist | Items with `gate_origin: security`, tagged `[security]`, `release_binding` set |
533
+ | `gate-tests` | Coverage of bound items' acceptance criteria | Items with `gate_origin: tests`, tagged `[testing]` for gaps |
534
+ | `gate-cruft` | Dead code introduced or revealed by the bundle | Items with `gate_origin: cruft`, tagged `[cleanup]` |
535
+ | `gate-docs` | Foundation-doc alignment with the bundle's behavior changes | Items with `gate_origin: docs`, tagged `[documentation]` — enforces rolling-foundation |
536
+ | `gate-patterns` | Reusable patterns that emerged in the bundle | Detailed pattern-skill files in `.agents/skills/patterns/` (single source of truth) with optional Claude mirror, the generated hook-loaded `.agents/rules/patterns.md` digest (slug+one-liner index pointing back at the skill, with banner + source hash), plus a tracking item with `gate_origin: patterns` |
537
+
538
+ For gates that emit findings as items, placement flows through
539
+ `gate_finding_routing` in `.work/CONVENTIONS.md` after the gate normalizes its
540
+ local vocabulary. The default routing is `critical`/`high` -> active story at
541
+ `stage: implementing`, `medium` -> active story at `stage: drafting`, `low` ->
542
+ `.work/backlog/`, and `info` -> `skip`. Gate-specific definitions remain local
543
+ to each gate: security uses severity, tests uses priority, and
544
+ docs/cruft/refactor use confidence.
545
+
546
+ ### Release readiness
547
+
548
+ A release is ready to ship when **all items with
549
+ `release_binding: <current-version>` are at `stage: done`**. Gate-produced
550
+ items count as part of this set. The release file's `stage` advances
551
+ `planned → quality-gate → released` accordingly.
552
+
553
+ ### Idempotent re-runs
554
+
555
+ `/release-deploy` is idempotent. It doesn't duplicate items it's already
556
+ produced (skills check `gate_origin` and existing IDs before creating).
557
+ Re-running advances the release stage if the readiness condition flipped.
558
+
559
+ ## AGENTS.md generation
560
+
561
+ `convert` and `epicize` both ensure the selected AGENTS target has the
562
+ agile-workflow section. The target can be `AGENTS.md`, `.agents/AGENTS.md`, or
563
+ `.claude/AGENTS.md`; root `AGENTS.md` is preferred and should exist as a
564
+ symlink/shim when the canonical content lives under `.agents/` or `.claude/`.
565
+ Format:
566
+
567
+ ```markdown
568
+ <!-- agile-workflow:start -->
569
+ ## Agile-Workflow Substrate
570
+
571
+ Work tracked in `.work/` as markdown items with YAML frontmatter
572
+ (`kind, stage, tags, parent, depends_on, release_binding, research_refs, research_origin`).
573
+ Layout: `.work/active/{epics,features,stories}/`, `.work/backlog/`,
574
+ `.work/releases/<version>/`, `.work/archive/`.
575
+
576
+ **Primary query tool:** `.work/bin/work-view` filters by stage, tag, kind,
577
+ parent, and dependency. Common patterns:
578
+ - `work-view --ready` — items ready to work (deps satisfied)
579
+ - `work-view --stage review` — items awaiting review
580
+ - `work-view --parent <id>` / `--blocking <id>` — hierarchy / sequencing
581
+ - `work-view --help` for the full flag set
582
+
583
+ Foundation docs in `docs/` describe the system's current state or intended
584
+ future state, never the past; git history is the audit trail. The substrate
585
+ itself is durable memory: record decisions, blockers, implementation
586
+ discoveries, and review findings in item bodies instead of depending on chat
587
+ history.
588
+
589
+ Reusable code patterns live in `.agents/skills/patterns/` (load the `patterns`
590
+ skill for detail). Project agent rules live in `.agents/rules/*.md`
591
+ (plugin-managed rules in `.agents/rules/agile-workflow.md`); do not maintain
592
+ `.claude/rules/*.md` as a source of truth.
593
+
594
+ **Before designing, implementing, or reviewing, read `.agents/rules/*.md`** —
595
+ the project's force-loaded agent rules (tag semantics, test integrity, review
596
+ policy). The agile-workflow hook auto-loads these at session start and after
597
+ compaction; read them directly when working without the hook.
598
+ <!-- agile-workflow:end -->
599
+ ```
600
+
601
+ The dense behavioral rules referenced by the read-directive live in
602
+ `.agents/rules/agile-workflow.md` (between `<!-- agile-workflow:rules:start/end -->`
603
+ markers), which `convert` writes and verifies BEFORE slimming the managed AGENTS
604
+ section, so the overwrite can never drop rule content. The broad entry points
605
+ (`/agile-workflow:ideate`, `/agile-workflow:epicize`, autopilot goals such as
606
+ "Use agile-workflow autopilot to drain --all", `/agile-workflow:release-deploy`)
607
+ live there alongside tag semantics, test integrity, and advisory-review rules.
608
+
609
+ ### Idempotency rules
610
+
611
+ - `convert --update` re-runs the section between markers, leaves the rest
612
+ of the selected AGENTS target alone
613
+ - If markers are missing, `convert` appends the section with markers
614
+ - If the rest of `AGENTS.md` has user edits, those are preserved
615
+ - If the user manually edits inside the markers, `convert --update` warns
616
+ before overwriting (interactive confirm)
617
+ - `CLAUDE.md`, `.claude/CLAUDE.md`, and `.agents/CLAUDE.md` are maintained only
618
+ as compatibility symlinks to the selected AGENTS target. If symlinks are
619
+ unavailable, each becomes a short shim that points Claude Code at `AGENTS.md`.
620
+ - Legacy `.claude/rules/*.md` content migrates via `convert`'s content-integrity
621
+ gate during bootstrap or sync: each Markdown-aware block routes to its
622
+ canonical home (structural patterns → `.agents/skills/patterns/`, rule prose →
623
+ `.agents/rules/<name>.md`), every block is verified to have landed, then the
624
+ legacy path is replaced with a shim. It is never maintained as a parallel rules
625
+ file.
626
+
627
+ ## Skill catalog
628
+
629
+ All skills with their roles, invocability, and triggers.
630
+
631
+ ### Delegation posture
632
+
633
+ Agile-workflow ships skills, hooks, the Pi `/aw` extension, and substrate tools;
634
+ it does **not** ship custom subagent definitions for Pi, Claude Code, or Codex.
635
+ When a skill needs breadth, isolation, fresh-context review, scanner work, or
636
+ parallel write ownership, it prompts the host's existing generic/general-purpose
637
+ subagent mechanism with a structured task brief. The shared prompt postures live
638
+ in `skills/principles/references/subagents.md`.
639
+
640
+ A same-harness delegated run is fresh-context by default. It counts as
641
+ cross-model only when the host explicitly spawns the subagent with a different
642
+ model class; otherwise use `peeragent` only when a cross-harness different model
643
+ class is needed and allowed.
644
+
645
+ ### Bootstrap (user-invocable only)
646
+
647
+ | Skill | Role | Trigger |
648
+ |---|---|---|
649
+ | `ideate` | Foundation-docs workshop. Produces VISION.md, SPEC.md, ARCHITECTURE.md, optionally PRINCIPLES.md / MIGRATION.md. No substrate dependency. | User-invoked |
650
+ | `convert` | Bootstraps `.work/` substrate. Reads existing project shape, writes AGENTS.md section, creates CLAUDE.md compatibility symlink/shim, writes CONVENTIONS.md, installs the git-tracked `work-view` entrypoint via `install-work-view.sh` as a backstop to session hook self-heal (prebuilt binary on supported platforms, Bash fallback only otherwise), seeds initial items. Idempotent via `--update`. | User-invoked, depends on ideate having run |
651
+ | `epicize` | Reads foundation docs. Produces multiple epics in `.work/active/epics/` at `stage: drafting`, with declared dependencies. | User-invoked, depends on convert having run |
652
+
653
+ ### Capture & promotion (model-invocable)
654
+
655
+ | Skill | Role | Trigger |
656
+ |---|---|---|
657
+ | `park` | Capture an unscoped idea, context note, or roadmap-style thought into `.work/backlog/`. Minimal frontmatter; body sized to the supplied context. | "park this", "remind me about X", "add to backlog" |
658
+ | `scope` | Promote backlog item or fresh request to `.work/active/`. Sizes as epic/feature/story. If large, rolls foundation docs forward. Declares dependencies. | "scope this", "promote this", "let's track this" |
659
+ | `fix` | Park-and-implement quick bug as a story. Single-stride: creates story at `stage: implementing`, writes fix, advances to review. | "fix bug X", "fix the typo in", "fix this issue" |
660
+ | `groom` | Backlog-hygiene sweep over `.work/backlog/`. Classifies items DONE/SUPERSEDED/DUPLICATE/STALE/MERGEABLE/VALID via mechanical signals (`work-view --stale`, missing-field, cites-done-work) + a grounded semantic pass; writes a triage report. Propose-not-prune: dispositions are operator-confirmed and route through terminal-tier retention; never auto-prunes. Not a release gate. Opt-in; staleness face inert unless `backlog_staleness_days` is set. | "groom the backlog", "backlog hygiene", "find stale/dead/duplicate items" |
661
+
662
+ ### Design family (model-invocable, kind- and tag-routed)
663
+
664
+ | Skill | Role | Trigger |
665
+ |---|---|---|
666
+ | `epic-design` | Epic decomposition. Spawns child features with declared `depends_on`, writes realized decomposition into epic body, advances stage. | epic at `stage: drafting` |
667
+ | `feature-design` | Greenfield feature design. Writes design into feature body, advances stage. Spawns child stories with declared deps. | feature at `stage: drafting`, no specialized tag |
668
+ | `refactor-design` | Refactor planning. Code-smell scan, before/after steps, risk + rollback per step. | feature with `tags: [refactor]` at `stage: drafting` |
669
+ | `perf-design` | Perf design. Bottleneck identification, measurement strategy, hot-path analysis. | feature with `tags: [perf]` at `stage: drafting` |
670
+
671
+ ### Production (model-invocable)
672
+
673
+ | Skill | Role | Trigger |
674
+ |---|---|---|
675
+ | `implement-orchestrator` | Default. Orchestrates implementation sub-agents over a scope (feature, epic, --all, or explicit list). Builds a unified `depends_on` graph across the scope (cross-feature is fine), chooses bundles/waves/write-scope isolation, and advances every parent feature whose children all reach `review`. | item(s) at `stage: implementing` |
676
+ | `implement` | Inline alternative. Read item body, write code, run build+tests, advance stage. | small / focused work where sub-agent fan-out wouldn't pay off, or user asks to implement inline |
677
+
678
+ ### Review & delivery (mixed invocability)
679
+
680
+ | Skill | Invocability | Role | Trigger |
681
+ |---|---|---|---|
682
+ | `review` | model-invocable | Code review of changes for an item. Triages findings into items with proper tags. Advances to done if approved. | item at `stage: review` |
683
+ | `board` | user-invocable | Launch the live localhost substrate board through `work-view board`. Opens a browser after binding when a desktop session is available; prints the URL in headless sessions. | User-invoked when the user wants to inspect active work visually |
684
+ | `release-deploy` | user-invocable | Bind items to release, run gates, ship, archive. Idempotent. | User-invoked when ready to cut a version |
685
+ | `bold-refactor` | user-invocable | Multi-feature architectural refactor. Scopes a refactor epic with child features. Aggressive — only on user request. | User-invoked |
686
+ | `autopilot` | model- and user-invocable | Goal-backed queue runner. Drains an epic or all active work using the harness goal/continuation feature. | Goal text like "Use agile-workflow autopilot to drain <epic>" or direct `/agile-workflow:autopilot --all` |
687
+
688
+ ### Gates (model-invocable, fire during release flow)
689
+
690
+ | Skill | Role |
691
+ |---|---|
692
+ | `gate-security` | Security scan over bound items; produces items with `gate_origin: security` |
693
+ | `gate-tests` | Test-coverage scan; produces gap items with `gate_origin: tests` |
694
+ | `gate-cruft` | Dead-code scan; produces cleanup items with `gate_origin: cruft` |
695
+ | `gate-docs` | Foundation-doc alignment; enforces rolling-foundation; produces doc-update items |
696
+ | `gate-patterns` | Pattern extraction; writes pattern skills (`.agents/skills/patterns/`), the generated `.agents/rules/patterns.md` digest, + tracking item with `gate_origin: patterns` |
697
+
698
+ All five fire during `release-deploy`'s `quality-gate` stage in the order
699
+ configured in `CONVENTIONS.md` (default: security → tests → cruft → docs
700
+ → patterns).
701
+
702
+ ### Reference / one-shot (carried from workflow)
703
+
704
+ | Skill | Role | Notes |
705
+ |---|---|---|
706
+ | `principles` | Loads code-design + substrate-execution principles | Code-design (Ports & Adapters, SSOT, Generated Contracts, Fail Fast) carried from workflow; substrate-execution (item-IS-the-work, rolling-foundation, late-binding) added |
707
+ | `research` | Investigate libraries/APIs | Carried; produces research docs in `docs/research/` (separate from `.work/`) |
708
+ | `refactor-conventions-creator` | Create project-specific refactor conventions skill | Carried |
709
+
710
+ (`repo-eval` and `tool-evaluator` were originally carried here. `repo-eval` now lives in the standalone `code-audit` plugin as the supported report-only scorecard, while `tool-evaluator` was extracted to `nates-toolkit` and renamed `agent-reflection`.)
711
+
712
+ ---
713
+
714
+ This is the architecture. Skills compose; substrate persists; navigation is
715
+ grep-fast; autopilot drains respecting dependencies; gates produce items;
716
+ foundation docs roll forward.