@nklisch/pi-agile-workflow 0.15.3 → 0.16.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 (41) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/docs/ARCHITECTURE.md +117 -65
  5. package/docs/PRINCIPLES.md +84 -18
  6. package/docs/SPEC.md +70 -2
  7. package/docs/VISION.md +33 -12
  8. package/hooks/scripts/prompt-context.py +7 -1
  9. package/hooks/scripts/test_prompt_context.py +16 -0
  10. package/package.json +1 -1
  11. package/scripts/tests/convert-content-integrity.test.sh +4 -4
  12. package/scripts/tests/convert-review-weight.test.sh +61 -0
  13. package/scripts/work-view.sh +1 -1
  14. package/skills/autopilot/SKILL.md +138 -91
  15. package/skills/convert/SKILL.md +55 -11
  16. package/skills/epic-design/SKILL.md +37 -70
  17. package/skills/feature-design/SKILL.md +52 -68
  18. package/skills/fix/SKILL.md +52 -34
  19. package/skills/gate-cruft/SKILL.md +69 -24
  20. package/skills/gate-docs/SKILL.md +12 -5
  21. package/skills/gate-patterns/SKILL.md +7 -3
  22. package/skills/gate-refactor/SKILL.md +18 -6
  23. package/skills/gate-security/SKILL.md +16 -7
  24. package/skills/gate-tests/SKILL.md +86 -71
  25. package/skills/implement/SKILL.md +79 -58
  26. package/skills/implement-orchestrator/SKILL.md +274 -587
  27. package/skills/perf-design/SKILL.md +11 -12
  28. package/skills/principles/SKILL.md +175 -379
  29. package/skills/principles/references/advisory-review.md +76 -0
  30. package/skills/principles/references/code-design.md +164 -0
  31. package/skills/principles/references/models.md +42 -63
  32. package/skills/prose-author/SKILL.md +9 -4
  33. package/skills/refactor-design/SKILL.md +26 -17
  34. package/skills/review/SKILL.md +169 -64
  35. package/skills/review/references/substrate-side-effects.md +17 -10
  36. package/skills/scope/SKILL.md +20 -7
  37. package/work-view/crates/cli/.work-view-version +1 -1
  38. package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
  39. package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
  40. package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
  41. package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
@@ -447,6 +447,9 @@ Run an interactive interview via structured question tool. Six questions, in ord
447
447
  leak to future agents. Offer `retain-bodies` only for projects that deliberately keep full terminal
448
448
  bodies on disk (same `archived_atop`/late-binding semantics, bodies just not pruned).
449
449
 
450
+ Review weight is deliberately not another interview question. Bootstrap writes the balanced default
451
+ in Phase 5; callers can change the project convention later or override it per invocation.
452
+
450
453
  ### Phase 4: Create substrate skeleton
451
454
 
452
455
  ```bash
@@ -467,11 +470,23 @@ environment, locate the plugin source via the active skill/plugin path or manife
467
470
 
468
471
  ### Phase 5: Write CONVENTIONS.md
469
472
 
470
- Write `.work/CONVENTIONS.md` from the interview answers, following the format in SPEC.md. The
471
- `## Terminal-tier retention` section is **value-only** — write the bare `delete-refs`/`retain-bodies`
472
- value the user chose, not the merged prose (the prose lives in SPEC.md, never duplicated per project).
473
- This bare-value form is exactly what a later sync classifies as `match`, so a freshly bootstrapped
474
- repo never self-reports terminal-retention drift.
473
+ Write `.work/CONVENTIONS.md` from the interview answers, following the format in SPEC.md. Also add
474
+ this non-interactive project default:
475
+
476
+ ```markdown
477
+ ## Review weight
478
+ review_weight: standard
479
+ ```
480
+
481
+ Allowed values are `none | light | standard | thorough | maximum`. The setting is optional: when it
482
+ is absent, review and autopilot resolve it to `standard`. Keep the level semantics and selection
483
+ policy in `principles/SKILL.md` Part IV and `review/SKILL.md`; do not duplicate their review matrix or
484
+ model guidance here.
485
+
486
+ The `## Terminal-tier retention` section is **value-only** — write the bare
487
+ `delete-refs`/`retain-bodies` value the user chose, not the merged prose (the prose lives in SPEC.md,
488
+ never duplicated per project). This bare-value form is exactly what a later sync classifies as
489
+ `match`, so a freshly bootstrapped repo never self-reports terminal-retention drift.
475
490
 
476
491
  ### Phase 6: Write the canonical AGENTS.md section
477
492
 
@@ -613,6 +628,22 @@ must already exist at their new home or the dense content is lost.
613
628
  All other tags are project-specific (see `.work/CONVENTIONS.md`) and do not
614
629
  affect skill routing.
615
630
 
631
+ ### Engineering posture
632
+
633
+ Prefer short, clear code and context-appropriate rigor over speculative
634
+ generality. Not every project needs exhaustive invariants, edge handling,
635
+ firm determinism, or universal coverage. Test important interfaces, complex
636
+ units, and regressions learned from bugs—not every line. When touching an
637
+ area, eliminate unnecessary code, tests, checks, abstractions, and
638
+ compatibility paths; leave it simpler. Ask before removing meaningful
639
+ behavior, guarantees, validation, compatibility, or safety.
640
+
641
+ Release-bound items define a gate's focus, not a hard scan boundary. Gates
642
+ may follow concrete evidence into adjacent dependencies, shared
643
+ infrastructure, or system-wide mechanisms. Bind release-relevant findings;
644
+ route merely ambient discoveries to the unbound backlog so a scan does not
645
+ silently expand a release.
646
+
616
647
  ### Test integrity
617
648
 
618
649
  When running, writing, or modifying tests:
@@ -628,6 +659,11 @@ must already exist at their new home or the dense content is lost.
628
659
  green again, if a parked production bug is small enough for a single
629
660
  stride, pick it up immediately as `/agile-workflow:scope` → design →
630
661
  implement. Larger bugs stay in backlog for prioritization.
662
+ - **Tests must earn their upkeep.** Prefer tests at stable interfaces,
663
+ regression tests for real bugs, and unit tests for genuinely complex
664
+ units. Do not add tests merely to cover every line or surface; remove
665
+ duplicate, tautological, implementation-bound, or obsolete tests when
666
+ they add less confidence than maintenance cost.
631
667
  - **NEVER game a test to make it pass.** A failing test that documents
632
668
  *why* it fails — an inline comment naming the bug, a `skip` linked to a
633
669
  backlog id, an `xfail` with a reason — is more honest than a green test
@@ -639,8 +675,11 @@ must already exist at their new home or the dense content is lost.
639
675
  override agile-workflow defaults. When peeragent is available with a different
640
676
  model class, large/risky autopilot design decisions may use one advisory pass;
641
677
  small/low-risk work skips it. Autopilot also runs a final peer-review loop
642
- before reporting completion and fixes or files accepted findings first.
643
- Same-model peers fall back to local sub-agents instead. Claude Opus peeragent
678
+ before reporting completion. Reviewer findings are proposals: the receiving
679
+ orchestrator verifies them against repository context and actual risk. Only
680
+ credible material current-cycle risks block; park valid lower-priority
681
+ findings in the unbound backlog and continue. Same-model peers fall back to
682
+ local sub-agents instead. Claude Opus peeragent
644
683
  calls can take 10 to 30 minutes on large reviews; no return after a few minutes
645
684
  is not evidence that the call has hung.
646
685
 
@@ -655,7 +694,7 @@ must already exist at their new home or the dense content is lost.
655
694
  this managed-section overwrite — content verification, NOT just a non-empty +
656
695
  end-marker check): confirm `.agents/rules/agile-workflow.md` exists AND that the
657
696
  dense rule content the slim removes from AGENTS actually landed there — each
658
- section is present (`### Tag semantics`, `### Test integrity`, the
697
+ section is present (`### Tag semantics`, `### Engineering posture`, `### Test integrity`, the
659
698
  advisory-review paragraph, and Broad entry points), or recompute per the Phase
660
699
  1.8 provenance check. Only when the content is verified present do you write or
661
700
  refresh the slim AGENTS section (Phase 6), overwriting the managed AGENTS block.
@@ -1047,6 +1086,10 @@ path list), plus deeper checks:
1047
1086
  - `.claude/rules/patterns.md` state (legacy content vs AGENTS shim)
1048
1087
  - `.work/CONVENTIONS.md` load-bearing tag entries (see below). The rest of
1049
1088
  CONVENTIONS is user-owned and untouched.
1089
+ - `.work/CONVENTIONS.md` `review_weight` — preserve any existing value unchanged; review validates
1090
+ the five-value boundary when it consumes the setting. Absence is also valid and resolves to
1091
+ `standard`, so sync neither inserts the default into older projects nor asks a migration question.
1092
+ The allowed values and canonical policy are in Phase 5.
1050
1093
  - `.work/CONVENTIONS.md` **Terminal-tier retention** state (the merged convention — see
1051
1094
  "Terminal-tier retention drift" below). The per-project CONVENTIONS template is **value-only** (a
1052
1095
  `## Terminal-tier retention` heading + a bare `delete-refs`/`retain-bodies` value); the merged
@@ -1337,9 +1380,10 @@ These are NEVER touched in sync mode:
1337
1380
  user confirmation, are: (a) load-bearing tag entries (`refactor`, `perf`) when they match a known
1338
1381
  prior plugin default verbatim, and (b) the `## Terminal-tier retention` convention when it is
1339
1382
  `missing`/`partial`/a bespoke `## Done-item archival` overlap (add / reconcile / converge). A bare
1340
- `delete-refs`/`retain-bodies` value is `match` and is left untouched. Everything
1341
- else in CONVENTIONS release mapping, project tags, slug conventions, gate config, any user
1342
- proseis untouched.
1383
+ `delete-refs`/`retain-bodies` value is `match` and is left untouched. `review_weight` is optional
1384
+ and is never added, reset, or rewritten by sync; preserve an existing value byte-for-byte, while
1385
+ absence continues to mean `standard`. Everything else in CONVENTIONS release mapping, project
1386
+ tags, slug conventions, gate config, any user prose — is untouched.
1343
1387
  - Everything under `.work/active/`, `.work/backlog/`, `.work/releases/`,
1344
1388
  `.work/archive/`
1345
1389
  - User-authored rule references under `.agents/skills/refactor-conventions/`.
@@ -125,9 +125,9 @@ Instead:
125
125
 
126
126
  ### Phase 2: Ground yourself
127
127
 
128
- The principles skill auto-loads — both code-design (Ports & Adapters, SSOT,
129
- Generated Contracts, Fail Fast) and substrate-execution (Item-IS-the-Work,
130
- Rolling-Foundation, Late-Binding) are active.
128
+ The principles skill auto-loads — code-design includes proportional rigor, code
129
+ economy, useful tests, and leaving touched areas simpler; substrate-execution
130
+ includes Item-IS-the-Work, Rolling-Foundation, and Late-Binding.
131
131
 
132
132
  Read:
133
133
  1. `docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md` — foundation that
@@ -207,6 +207,17 @@ Aim for 2-6 child features per epic. Fewer than 2 means the epic was probably
207
207
  sized as a feature; flag the user. More than 6 means you're slicing too thin;
208
208
  collapse.
209
209
 
210
+ ### Phase 4.4: Identify simplification arcs
211
+
212
+ For each area the epic touches, ask what capabilities, code, tests, checks,
213
+ abstractions, compatibility paths, or whole subsystems the new direction can
214
+ make unnecessary. Prefer feature arcs that replace and remove over arcs that
215
+ only layer on more machinery. Fold cohesive elimination into the owning feature
216
+ brief or create an explicit `[refactor]`/`[cleanup]` child feature when it needs
217
+ independent design and review. Park unrelated cleanup. Any arc that removes
218
+ behavior or meaningful guarantees becomes a high-level design decision for user
219
+ confirmation, not an assumed refactor.
220
+
210
221
  ### Phase 4.5: Identify cross-feature dependencies
211
222
 
212
223
  For each candidate feature, ask:
@@ -248,76 +259,25 @@ decomposition. Child briefs note "mockups pending — see parent epic" so
248
259
 
249
260
  Skip this phase entirely if `ux-ui-design` is not installed.
250
261
 
251
- ### Phase 4.7: Surface high-level design ambiguities
252
-
253
- Read the epic and the candidate decomposition you've sketched, and derive
254
- specific, concrete high-level design questions about *this* epic's actual
255
- work. These are the directional choices that, if locked in now, will keep
256
- every child feature's later design pass aligned. Examples of the *shape* of
257
- question to surface (the actual content must come from the epic):
258
-
259
- - "For this epic's auth surface, do we use OAuth via the existing provider,
260
- or roll a local session model?"
261
- - "Should the new sync engine push from server to client, pull from client
262
- on-demand, or both?"
263
- - "Are we committing to multi-tenant data isolation in this epic, or is
264
- single-tenant acceptable for v1?"
265
- - "Does the import pipeline need to handle CSV and Parquet, or just CSV?"
266
-
267
- These are product/architecture/scope questions specific to the epic in
268
- front of you — not generic prompts about boundaries, naming, or sizing.
269
- Skip anything you can answer from the epic body, foundation docs, or
270
- codebase. Skip anything that's safely a downstream feature-design call
271
- (function signatures, exact file paths, per-unit test approach).
272
-
273
- Aim for the smallest set of questions that meaningfully resolve direction
274
- — typically 2-5. Zero is fine if the epic body and foundation docs already
275
- pin every directional choice.
276
-
277
- **Cross-model advisory review under autopilot.** If this skill is running as a
278
- delegation from active autopilot, the epic has large/risky architectural
279
- decisions, and the body does not already contain useful `## Design decisions`
280
- from a prior `--only-questions` pass, apply the cross-model advisory review
281
- policy from `principles/SKILL.md` before resolving the questions yourself.
282
-
283
- Use one focused `peer` pass only when a different model class is available.
284
- Ask for missing questions, risks, ambiguous constraints, and alternatives for
285
- this epic's decomposition — not for a final verdict. Do not run the multi-pass
286
- `peer-review` loop during routine autopilot design. If peeragent is
287
- unavailable, the peer would use the same model class, or the invocation fails,
288
- continue with host judgment and note that the advisory pass was skipped.
289
- If the peeragent target is Claude Opus, allow 10 to 30 minutes for a large
290
- review; no return after a few minutes is not evidence that it has hung.
291
-
292
- Summarize the useful output under `## Other agent review` in the epic body and
293
- fold accepted questions/risks into the decisions you log. Do not paste the peer
294
- transcript into the item.
295
-
296
- If this skill is running **as a delegation from an active autopilot run or
297
- harness goal**, resolve each question with judgment (prioritize: consistent
298
- with foundation docs > simpler option > defers irreversible decisions) and log
299
- under `## Design decisions` in the epic body:
300
-
301
- ```markdown
302
- ## Design decisions
303
- - **<question>**: <choice> — <one-line rationale>
304
- ```
262
+ ### Phase 4.7: Resolve high-level design decisions
305
263
 
306
- In every other invocation including direct user invocation under harness
307
- auto mode (`permissions.defaultMode: "auto"`) ask the user via
308
- `structured question tool` before locking in, then write the answers under `## Design
309
- decisions` in the epic body. Harness-level "work without pausing" reminders
310
- do **not** suppress these checkpoints. See `principles/SKILL.md` Part III
311
- for the full caller-awareness rule.
264
+ Identify the epic-specific product, architecture, scope, and decomposition
265
+ decisions that must align its child features. Ignore points settled by the epic,
266
+ foundation docs, code, or an existing `## Design decisions` section, and leave
267
+ function signatures, file paths, and unit-level tests to feature design. Zero
268
+ open decisions is valid.
312
269
 
313
- The child feature briefs you write in Phase 6 should reference the relevant
314
- design decisions so each feature's later design pass inherits the locked-in
315
- direction.
270
+ Apply `principles/SKILL.md` Part III exactly: resolve routine, reversible points
271
+ with judgment and a logged rationale; reserve structured questions for product
272
+ direction, external contracts, and expensive hard-to-reverse choices. Apply
273
+ Part IV's risk-driven advisory policy in both direct and autopilot modes; do not
274
+ restate reviewer topology here.
316
275
 
317
- The exception under autopilot: a 50/50 between two large irreversible
318
- choices (e.g., SQL vs document store for this epic's persistence layer).
319
- Append a `## Blocker` section and return without advancing autopilot will
320
- skip and surface the blocker.
276
+ Record decisions under `## Design decisions`. When autopilot is the active
277
+ driver, it never asks; use evidence and the least irreversible sound choice.
278
+ Only contradictory state that Part III identifies as a hard halt blocks
279
+ advancement. Child briefs reference the decisions relevant to their later design
280
+ passes.
321
281
 
322
282
  ### Phase 5: Pre-mortem
323
283
 
@@ -360,6 +320,9 @@ capability it covers, why it exists in this epic, what it does NOT cover>
360
320
  - Position in epic: <e.g., "foundation feature — others depend on its types"
361
321
  / "consumer of feature-X" / "independent capability">
362
322
 
323
+ ## Simplification opportunity
324
+ - <what this feature should delete, consolidate, replace, or deliberately retain>
325
+
363
326
  ## Foundation references
364
327
  - `docs/VISION.md` — relevant section(s) (only if directly relevant)
365
328
  - `docs/ARCHITECTURE.md` — relevant component(s)
@@ -413,6 +376,10 @@ feature lands.">
413
376
  - `<feature-id-2>` — <one-line description> — depends on: `[<feature-id-1>]`
414
377
  - `<feature-id-3>` — <one-line description> — depends on: `[<feature-id-1>]`
415
378
 
379
+ ### Simplification arcs
380
+
381
+ - <feature-id> — <code/tests/checks/abstractions/subsystems it should remove or consolidate>
382
+
416
383
  ### Decomposition risks
417
384
 
418
385
  <from pre-mortem, if any. Otherwise omit the section.>
@@ -146,9 +146,9 @@ The body should already have a brief from `scope`. Use it as the seed for design
146
146
 
147
147
  ### Phase 2: Ground yourself
148
148
 
149
- The principles skill auto-loads — both code-design (Ports & Adapters, SSOT,
150
- Generated Contracts, Fail Fast) and substrate-execution (Item-IS-the-Work,
151
- Rolling-Foundation, Late-Binding) are active.
149
+ The principles skill auto-loads — code-design includes proportional rigor, code
150
+ economy, useful tests, and leaving touched areas simpler; substrate-execution
151
+ includes Item-IS-the-Work, Rolling-Foundation, and Late-Binding.
152
152
 
153
153
  Read:
154
154
  1. `docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md` (foundation docs that
@@ -201,68 +201,29 @@ agent rules (tag semantics, test integrity, review policy). Treat AGENTS as
201
201
  canonical if they disagree. Recency improves adherence. Confirm your approach
202
202
  aligns with project conventions.
203
203
 
204
- ### Phase 4.5: Surface ambiguities
205
-
206
- Read the feature brief and the design space you've started to map, and
207
- derive specific, concrete design questions about *this* feature's actual
208
- work requirements gaps, architecture trade-offs, scope boundaries,
209
- integration assumptions, UX decisions. The questions must come from the
210
- feature in front of you; examples of the *shape* only:
211
-
212
- - "Should the cache invalidate on write or rely on TTL only?"
213
- - "Does the upload accept multipart, or a presigned URL flow?"
214
- - "When the parser hits a malformed row, do we skip and continue or fail
215
- the whole batch?"
216
- - "Is paging cursor-based or offset-based?"
217
-
218
- Skip anything the brief, parent epic body, foundation docs, or codebase
219
- already pin. Skip anything that's safely an implementation-time call.
220
-
221
- Aim for the smallest set of questions that meaningfully resolve direction
222
- — typically 2-5. Zero is fine if everything's already pinned.
223
-
224
- **Cross-model advisory review under autopilot.** If this skill is running as a
225
- delegation from active autopilot, the feature has large/risky architectural
226
- decisions, and the body does not already contain useful `## Design decisions`
227
- from a prior `--only-questions` pass, apply the cross-model advisory review
228
- policy from `principles/SKILL.md` before resolving the questions yourself.
229
-
230
- Use one focused `peer` pass only when a different model class is available.
231
- Ask for missing questions, risks, ambiguous constraints, and alternatives for
232
- this feature's design — not for a final verdict. Do not run the multi-pass
233
- `peer-review` loop during routine autopilot design. If peeragent is
234
- unavailable, the peer would use the same model class, or the invocation fails,
235
- continue with host judgment and note that the advisory pass was skipped.
236
- If the peeragent target is Claude Opus, allow 10 to 30 minutes for a large
237
- review; no return after a few minutes is not evidence that it has hung.
238
-
239
- Summarize the useful output under `## Other agent review` in the feature body
240
- and fold accepted questions/risks into the decisions you log. Do not paste the
241
- peer transcript into the item.
242
-
243
- If this skill is running **as a delegation from an active autopilot run or
244
- harness goal**, resolve each question with judgment (prioritize: consistent
245
- with foundation docs > simpler option > defers irreversible decisions) and log
246
- under `## Design decisions` in the body:
204
+ ### Phase 4.5: Resolve design decisions
205
+
206
+ Identify concrete decisions raised by this feature's requirements, architecture,
207
+ scope, integrations, and UX. Ignore points already settled by the brief, parent,
208
+ foundation docs, code, or an existing `## Design decisions` section, and defer
209
+ safe implementation details. Zero open decisions is valid.
210
+
211
+ Apply `principles/SKILL.md` Part III exactly: resolve routine, reversible points
212
+ with judgment and a logged rationale; reserve structured questions for product
213
+ direction, external contracts, and expensive hard-to-reverse choices. Apply
214
+ Part IV's risk-driven advisory policy in both direct and autopilot modes; do not
215
+ restate reviewer topology here.
216
+
217
+ Record decisions in the feature body:
247
218
 
248
219
  ```markdown
249
220
  ## Design decisions
250
- - **<question>**: <choice> — <one-line rationale>
221
+ - **<decision>**: <choice> — <one-line rationale>
251
222
  ```
252
223
 
253
- If the body already contains a `## Design decisions` section (from a prior
254
- `--only-questions` pass or from `epic-design` Phase 4.7), treat those
255
- locked-in answers as inputs — do NOT re-ask them.
256
-
257
- In every other invocation — including direct user invocation under harness
258
- auto mode (`permissions.defaultMode: "auto"`) — ask the user via
259
- `structured question tool` before locking in. Harness-level "work without pausing"
260
- reminders do **not** suppress these checkpoints. See `principles/SKILL.md`
261
- Part III for the full caller-awareness rule.
262
-
263
- The exception under autopilot: a 50/50 between two large irreversible choices
264
- (e.g., SQL vs document store). Append a `## Blocker` section and return
265
- without advancing — autopilot will skip and surface the blocker.
224
+ When autopilot is the active driver, it never asks; use evidence and the least
225
+ irreversible sound choice. Only contradictory state that Part III identifies as
226
+ a hard halt blocks advancement.
266
227
 
267
228
  ### Phase 4.6: UI surface fallback (runs when ux-ui-design is installed)
268
229
 
@@ -320,6 +281,17 @@ For each unit, specify:
320
281
 
321
282
  Make strong decisions about abstractions, naming, and module boundaries.
322
283
 
284
+ #### 5d. Elimination and cleanup pass
285
+
286
+ Before adding another unit or abstraction, ask what this feature can delete,
287
+ inline, consolidate, or make unnecessary in the area it touches. Consider code,
288
+ tests, checks, configuration, compatibility paths, and existing abstractions.
289
+ Fold safe cohesive cleanup into a unit. Create explicit `[refactor]` or
290
+ `[cleanup]` child stories when the cleanup is worthwhile but independently
291
+ reviewable; park broader work. If a candidate reduces behavior or guarantees,
292
+ record it as a design decision for user confirmation rather than assuming
293
+ removal.
294
+
323
295
  ### Phase 5.5: Pre-mortem
324
296
 
325
297
  Before finalizing, attack the design:
@@ -334,12 +306,20 @@ feature body.
334
306
 
335
307
  ### Phase 6: Test approach
336
308
 
337
- For each unit, design:
338
- - **Unit tests** — behaviors to verify, edge cases, error paths
339
- - **Integration points** — where does this unit meet other units; what tests prove the seams
340
- - **Test data** — fixtures, factories, seed data needed
341
-
342
- If a unit is hard to test, the design is probably wrong. Note it and revise.
309
+ Design the smallest useful test surface:
310
+ - **Interface tests** — important behavior at stable public boundaries and
311
+ cross-unit seams
312
+ - **Regression tests** — bugs or demonstrated risks this work must not repeat
313
+ - **Unit tests** — only for genuinely complex isolated logic where examples add
314
+ confidence
315
+ - **Test removal** — duplicate, tautological, obsolete, or implementation-bound
316
+ tests this change can safely retire
317
+ - **Test data** — only fixtures or factories the chosen tests actually need
318
+
319
+ Do not create a test for every unit, branch, edge, or acceptance statement by
320
+ default. State what risk or contract each proposed test protects. Hard-to-test
321
+ important behavior may indicate a bad boundary; simple code needing no isolated
322
+ test is not itself a design flaw.
343
323
 
344
324
  ### Phase 7: Order and child stories
345
325
 
@@ -418,9 +398,13 @@ Update the feature file. Append (after the existing brief) sections like:
418
398
  1. <unit / story>
419
399
  2. <unit / story>
420
400
 
401
+ ## Simplification
402
+ - <code/tests/checks/abstractions removed, consolidated, or intentionally retained>
403
+ - <cleanup/refactor stories, if any>
404
+
421
405
  ## Testing
422
- ### Unit Tests: `tests/path/<name>.test.ext`
423
- <test approach for each unit>
406
+ - <interface, regression, or complex-unit tests and the value each protects>
407
+ - <low-value tests to remove, if any>
424
408
 
425
409
  ## Risks
426
410
  <from pre-mortem, if any>
@@ -2,20 +2,19 @@
2
2
  name: fix
3
3
  description: >
4
4
  ALWAYS invoke this skill when the user asks to fix a specific verified bug — do not just edit code
5
- inline. Diagnoses and repairs a specific bug as a single-stride substrate story. Reproduces the
6
- issue, identifies the root cause, writes a failing test, applies the minimal fix, confirms, and
7
- creates a story item under .work/active/stories/ at stage:review capturing the work. Use when
8
- something is verifiably broken — not for unverified hunches, refactors, or feature additions.
9
- Triggers on "fix bug X", "fix the typo in", "fix this issue", "this is broken — fix it", and "patch
10
- this item".
5
+ inline. Diagnoses and repairs the bug as a focused substrate story: reproduces it, identifies the
6
+ root cause, writes a failing test, applies the minimal fix, verifies it, and continues through
7
+ review to done unless the caller requests stop-at-review. Use when something is verifiably broken,
8
+ not for unverified hunches, refactors, feature additions, or architectural work. Triggers on "fix
9
+ bug X", "fix the typo in", "fix this issue", "this is broken — fix it", and "patch this item".
11
10
  ---
12
11
 
13
12
  # Fix
14
13
 
15
- You diagnose and repair a specific reported bug, capturing the work as a single
16
- substrate story that lands at `stage: review`. The discipline is the same as a
17
- careful bug-fix workflow — reproduce, diagnose to root cause, write a regression
18
- test, apply the minimal fix, confirm but the artifact is a substrate item, not
14
+ You diagnose and repair a specific reported bug, capturing the work as a focused
15
+ substrate story that completes through its review lane by default. The discipline
16
+ is reproduce, diagnose to root cause, write a regression test, apply the minimal
17
+ fix, confirm, and honor review's verdict. The artifact is the substrate item, not
19
18
  a separate fix doc.
20
19
 
21
20
  ## When to invoke
@@ -128,46 +127,65 @@ for separate consideration — don't bundle.
128
127
 
129
128
  If any step fails, return to diagnosis. Do not ship a fix you can't confirm works.
130
129
 
131
- **Test integrity during Phase 6.** If running the full suite surfaces
132
- *other* failing tests:
130
+ **Test integrity during Phase 6.** Follow the project's test-integrity rules and
131
+ the worker posture in `../principles/references/subagents.md`: fix bad tests
132
+ in-session, park other production bugs rather than bundling them, and never game
133
+ a test to make it pass.
133
134
 
134
- - Bad tests (stale fixtures, drifted assertions, broken mocks) → fix
135
- in-session if the fix is small and scoped to this bug's surface area;
136
- otherwise park.
137
- - Pre-existing real production bugs → park via `/agile-workflow:park`.
138
- Do NOT bundle them into this fix's commit; this skill is for *one*
139
- bug.
140
- - NEVER make a test pass by weakening its assertion or silencing it
141
- without a documented reason. The regression test you wrote in Phase 3
142
- must verify behavior, not "whatever the code returns now".
135
+ ### Phase 7: Commit and complete the lifecycle
143
136
 
144
- ### Phase 7: Advance to review and commit
145
-
146
- 1. Update story stage: `implementing review`. The PostToolUse hook auto-bumps `updated:`.
147
- 2. Append an "Implementation notes" section to the story body capturing:
137
+ 1. Update the story stage: `implementing review`. The PostToolUse hook
138
+ auto-bumps `updated:`.
139
+ 2. Append an "Implementation notes" section capturing:
140
+ - Execution capability selected from risk and scope, plus the rationale
141
+ - Effective `review_weight` and its source
148
142
  - Files changed
149
143
  - Test added
150
- - Adjacent issues parked (with their backlog ids)
151
- 3. Commit:
144
+ - Adjacent issues parked (with backlog ids)
145
+
146
+ Choose capability without a routine model-tier question unless the caller or
147
+ project explicitly overrides it. Resolve review weight from an explicit caller
148
+ override, then project convention, otherwise `standard`; the principles and
149
+ review skills own the weight matrix.
150
+ 3. Commit the fix:
152
151
  ```bash
153
152
  git add .work/active/stories/<id>.md <changed-files> <test-file>
154
153
  git commit -m "fix: <short description> (<story-id>)"
155
154
  ```
155
+ 4. Unless the caller explicitly requested `stop-at-review` (including "stop at
156
+ review", "leave at review", or "hand off for review") or a project convention
157
+ sets that boundary, invoke `/agile-workflow:review <id>` in the same invocation
158
+ and forward the effective `review_weight`. The review lane owns its required
159
+ context and verdict:
160
+ - approve: advance and commit `review → done`
161
+ - bounce: append `## Review findings`, return the story to `implementing`, and
162
+ report the bounce
163
+ - blocker: append `## Blocker` and report it without claiming completion
164
+
165
+ A weight of `none` skips independent review, but the review lane still requires
166
+ the same green verification and acceptance evidence before administrative
167
+ closure. Review remains a real lifecycle act, not silent self-approval. With
168
+ `stop-at-review`, leave the committed story at `review` and report the explicit
169
+ boundary.
156
170
 
157
171
  ## Output
158
172
 
159
173
  Brief report in conversation:
160
- - **Story**: `<id>` at `stage: review`
174
+ - **Story**: `<id>` at `stage: done`, `stage: review` by explicit override, or
175
+ `stage: implementing` after a documented bounce
176
+ - **Review**: lane verdict, limitation, or blocker
161
177
  - **Root cause**: one sentence
162
178
  - **Fix**: file(s) changed
163
- - **Test**: file path, what it asserts
164
- - **Parked for separate consideration**: any adjacent issues you noticed but didn't bundle
179
+ - **Test**: file path and behavior asserted
180
+ - **Execution capability**: choice and rationale
181
+ - **Review weight**: effective value and source
182
+ - **Parked for separate consideration**: adjacent issues not bundled
165
183
 
166
184
  ## Guardrails
167
185
 
168
186
  - Do NOT skip the test (Phase 3). Fixes without tests recur.
169
187
  - Do NOT bundle refactoring or unrelated improvements into the fix's commit.
170
- - Do NOT advance the story past `review` the user reviews and runs
171
- `/agile-workflow:review` to advance to `done`.
172
- - If the fix would touch > 5 files or change a public interface, stop. This isn't a
173
- fix; it's a feature with refactor implications. Use `/agile-workflow:scope` instead.
188
+ - Do not self-approve at `review`; invoke the review lane and honor its verdict.
189
+ - Broad scope (for example, many files, a public-interface change, or multiple
190
+ subsystems) is a signal that this is a feature rather than a targeted fix, not
191
+ a review-stop rule. Route it through `/agile-workflow:scope`.