@gtrabanco/pi-agentic-workflow 0.1.0

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 (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.es.md +154 -0
  3. package/README.md +148 -0
  4. package/dist/config/defaults.d.ts +8 -0
  5. package/dist/config/defaults.js +11 -0
  6. package/dist/config/load.d.ts +19 -0
  7. package/dist/config/load.js +76 -0
  8. package/dist/config/merge.d.ts +4 -0
  9. package/dist/config/merge.js +43 -0
  10. package/dist/config/schema.d.ts +21 -0
  11. package/dist/config/schema.js +144 -0
  12. package/dist/config/types.d.ts +53 -0
  13. package/dist/config/types.js +12 -0
  14. package/dist/extension/factory.d.ts +47 -0
  15. package/dist/extension/factory.js +49 -0
  16. package/dist/extension/index.d.ts +4 -0
  17. package/dist/extension/index.js +84 -0
  18. package/dist/routing/catalogue.d.ts +35 -0
  19. package/dist/routing/catalogue.js +79 -0
  20. package/dist/routing/dispatch.d.ts +34 -0
  21. package/dist/routing/dispatch.js +191 -0
  22. package/dist/routing/state.d.ts +13 -0
  23. package/dist/routing/state.js +65 -0
  24. package/dist/routing/types.d.ts +90 -0
  25. package/dist/routing/types.js +3 -0
  26. package/dist/settings/console.d.ts +55 -0
  27. package/dist/settings/console.js +266 -0
  28. package/dist/settings/store.d.ts +3 -0
  29. package/dist/settings/store.js +24 -0
  30. package/dist/settings/view.d.ts +11 -0
  31. package/dist/settings/view.js +46 -0
  32. package/package.json +59 -0
  33. package/skills/audit-docs/SKILL.md +171 -0
  34. package/skills/audit-pr/SKILL.md +201 -0
  35. package/skills/audit-pr/references/01_MERGE_GATES.md +24 -0
  36. package/skills/audit-pr/references/02_CLOSURE_AND_SCOPE_GATES.md +83 -0
  37. package/skills/audit-pr/references/03_AUDIT_PROCESS.md +69 -0
  38. package/skills/audit-pr/references/04_VERDICT.md +69 -0
  39. package/skills/audit-pr/references/05_ROUTING_AND_GUARDRAILS.md +58 -0
  40. package/skills/audit-pr/references/PORTABILITY.md +17 -0
  41. package/skills/design-feature/SKILL.md +162 -0
  42. package/skills/design-feature/references/INTERVIEW.md +52 -0
  43. package/skills/design-feature/references/PORTABILITY.md +15 -0
  44. package/skills/design-feature/references/UPSERT_EXAMPLE.md +8 -0
  45. package/skills/design-feature/references/WRITE_AND_UPSERT.md +92 -0
  46. package/skills/discover-repository-state/SKILL.md +83 -0
  47. package/skills/execute-phase/SKILL.md +115 -0
  48. package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +54 -0
  49. package/skills/execute-phase/references/CLOSEOUT.md +74 -0
  50. package/skills/execute-phase/references/DESCOPE.md +35 -0
  51. package/skills/execute-phase/references/EXECUTION_CONTRACT.md +147 -0
  52. package/skills/execute-phase/references/FOLDING.md +73 -0
  53. package/skills/execute-phase/references/FORGE_BODY.md +24 -0
  54. package/skills/execute-phase/references/HANDOFF.md +21 -0
  55. package/skills/execute-phase/references/OPPORTUNISTIC_FINDING.md +45 -0
  56. package/skills/execute-phase/references/PREFLIGHT.md +152 -0
  57. package/skills/execute-phase/references/UNIT_LOOP.md +88 -0
  58. package/skills/execute-phase/references/WORKFLOWS_FEATURE.md +37 -0
  59. package/skills/execute-phase/references/WORKFLOWS_FIX.md +43 -0
  60. package/skills/execute-phase/references/WORKFLOWS_LEGACY.md +26 -0
  61. package/skills/execute-phase/references/WORKFLOWS_SMALL_PHASED.md +38 -0
  62. package/skills/fold-findings/SKILL.md +141 -0
  63. package/skills/fold-findings/references/FOLD_POLICY.md +43 -0
  64. package/skills/fold-findings/references/FOLD_PROCESS.md +41 -0
  65. package/skills/generate-docs/SKILL.md +145 -0
  66. package/skills/generate-docs/references/ADAPTERS.md +15 -0
  67. package/skills/generate-docs/references/ADAPTER_DISCOVERY.md +33 -0
  68. package/skills/generate-docs/references/GENERATION_PROCESS.md +90 -0
  69. package/skills/init-workspace/SKILL.md +152 -0
  70. package/skills/init-workspace/references/BOOTSTRAP_DISCOVERY.md +70 -0
  71. package/skills/init-workspace/references/BOOTSTRAP_WRITE.md +58 -0
  72. package/skills/init-workspace/references/PORTABILITY.md +16 -0
  73. package/skills/init-workspace/references/UPGRADE.md +83 -0
  74. package/skills/log-session/SKILL.md +159 -0
  75. package/skills/loop-review-fold/SKILL.md +168 -0
  76. package/skills/orchestration-envelope/SKILL.md +81 -0
  77. package/skills/orchestration-envelope/references/TURN_CONTRACT.md +21 -0
  78. package/skills/phase-contract/SKILL.md +82 -0
  79. package/skills/plan-feature/SKILL.md +179 -0
  80. package/skills/plan-feature/references/ROUTING.md +83 -0
  81. package/skills/plan-feature-from-issue/SKILL.md +140 -0
  82. package/skills/plan-feature-scaffold/SKILL.md +93 -0
  83. package/skills/plan-feature-scaffold/references/SCAFFOLD_PROCESS.md +76 -0
  84. package/skills/plan-fix/SKILL.md +115 -0
  85. package/skills/plan-fix/references/PLANNING_PROCESS.md +118 -0
  86. package/skills/plan-fix/references/SPEC_CONTRACT.md +22 -0
  87. package/skills/planning-preflight/SKILL.md +130 -0
  88. package/skills/product-audit/SKILL.md +225 -0
  89. package/skills/product-audit/references/AUDIT_DIMENSIONS.md +24 -0
  90. package/skills/product-audit/references/AUDIT_PROCESS.md +85 -0
  91. package/skills/resolve-repository-state/SKILL.md +79 -0
  92. package/skills/review-a11y/SKILL.md +60 -0
  93. package/skills/review-brand/SKILL.md +65 -0
  94. package/skills/review-change/SKILL.md +156 -0
  95. package/skills/review-change/references/ADVERSARIAL_RECOMMENDATION.md +31 -0
  96. package/skills/review-change/references/ADVERSARIAL_SETUP.md +86 -0
  97. package/skills/review-change/references/ADVERSARIAL_SYNTHESIS.md +53 -0
  98. package/skills/review-change/references/OUTPUT_AND_GUARDRAILS.md +85 -0
  99. package/skills/review-change/references/PERSIST_AND_DECIDE.md +151 -0
  100. package/skills/review-change/references/PORTABILITY.md +74 -0
  101. package/skills/review-change/references/REVIEW_PROCESS.md +86 -0
  102. package/skills/review-code/SKILL.md +69 -0
  103. package/skills/review-debt/SKILL.md +72 -0
  104. package/skills/review-design/SKILL.md +60 -0
  105. package/skills/review-implementation/SKILL.md +108 -0
  106. package/skills/review-implementation/references/CLASSIFY.md +96 -0
  107. package/skills/review-implementation/references/FIND.md +35 -0
  108. package/skills/review-perf/SKILL.md +79 -0
  109. package/skills/review-security/SKILL.md +65 -0
  110. package/skills/review-seo/SKILL.md +65 -0
  111. package/skills/review-verify/SKILL.md +66 -0
  112. package/skills/ship-roadmap/SKILL.md +120 -0
  113. package/skills/ship-roadmap/references/ADVANCE.md +90 -0
  114. package/skills/ship-roadmap/references/AUDIT_AND_MERGE.md +64 -0
  115. package/skills/ship-roadmap/references/CLOSEOUT_AND_LOG.md +26 -0
  116. package/skills/ship-roadmap/references/FOUNDING.md +101 -0
  117. package/skills/ship-roadmap/references/GUARDRAILS.md +56 -0
  118. package/skills/ship-roadmap/references/MODEL_ROUTING.md +14 -0
  119. package/skills/ship-roadmap/references/PORTABILITY.md +34 -0
  120. package/skills/ship-roadmap/references/RECOVERY_AND_SELECTION.md +93 -0
  121. package/skills/ship-roadmap/references/STOP_CONDITIONS.md +9 -0
  122. package/skills/ship-roadmap/references/TERMINAL_REPORT.md +34 -0
  123. package/skills/triage-issue/SKILL.md +148 -0
  124. package/skills/triage-issue/references/AUDIT_FINDINGS.md +35 -0
  125. package/skills/triage-issue/references/FOLD_LEDGER.md +32 -0
  126. package/skills/triage-issue/references/ISSUE_PROCESS.md +101 -0
  127. package/skills/triage-issue/references/LABELS.md +83 -0
  128. package/skills/triage-issue/references/REVIEW_FINDING_PROCESS.md +41 -0
  129. package/skills/verification-contract/SKILL.md +77 -0
  130. package/skills/workflow-status/SKILL.md +143 -0
  131. package/skills/workflow-status/references/CRASH_RECOVERY.md +66 -0
  132. package/skills/workflow-status/references/ENVELOPE_CORE.md +107 -0
  133. package/skills/workflow-status/references/ENVELOPE_FIELDS.md +77 -0
  134. package/skills/workflow-status/references/GUARDRAILS.md +17 -0
  135. package/skills/workflow-status/references/PORTABILITY.md +14 -0
  136. package/skills/workflow-status/references/SENSOR_CORE.md +95 -0
  137. package/skills/workflow-status/references/SENSOR_SIGNALS.md +128 -0
@@ -0,0 +1,86 @@
1
+ ## Process
2
+
3
+ 1. **Route selection.** No flag → the default single-reviewer review. With
4
+ `--adversarial N` → run the **adversarial multi-reviewer mode** below
5
+ instead (N reviewers FIND, per the *Isolation rule*). With `--synthesize` →
6
+ skip straight to that mode's fusion step (N findings tables pasted in, per
7
+ the synthesis contract). Either way, everything from step 2 onward runs
8
+ once, over the fused table.
9
+ **Freeze the reviewed commit before any pass:** after the clean/remote-current
10
+ check, run `git rev-parse HEAD` once and retain its 40-hex output as the
11
+ **reviewed head SHA**. The final PR receipt may be written only for that exact
12
+ commit; a PR whose head changes during the review requires a fresh review.
13
+ 2. **Frozen acceptance + SPEC drift check (structural).** Locate sibling
14
+ `ACCEPTANCE.md`, recompute its blob, and require an exact match with the
15
+ execution receipt before assessing the candidate. Missing/mismatch is a
16
+ `workflow` fix-now finding and no passing receipt may be posted. Legacy units
17
+ use the verification contract's committed SPEC-blob fallback. Then build a
18
+ **per-criterion coverage table** from the manifest — one row per acceptance
19
+ criterion, no free-form comparison:
20
+
21
+ ```
22
+ | criterion | evidence (file:line or command run) | met | unmet | untouched |
23
+ ```
24
+
25
+ Cross-check manifest IDs against the governing SPEC so neither silently
26
+ omits a criterion. Then map each diff hunk to a criterion — or to `none`. Findings, axis
27
+ `spec-drift`: (a) every criterion marked `unmet`/`untouched` that the unit
28
+ claims delivered, and (b) every `none`-mapped hunk (work the SPEC never
29
+ asked for — silent scope excess). Catching drift at a phase checkpoint is
30
+ far cheaper than at the `audit-pr` merge gate. (No SPEC found → note it
31
+ and skip.)
32
+ 3. **Workflow-discipline check (mechanical, every review).** On the branch
33
+ under review, verify and file findings under axis `workflow`:
34
+ commits follow `<type>(<scope>): <summary>`; phase labels in touched
35
+ planning docs are `P1, P2, …` (never `S1`/"Steps"); the phase's per-phase
36
+ docs were updated (TASKS ticks, progress entry); no commit landed on the
37
+ default branch; artifacts are in the project's declared docs language;
38
+ **the tree is clean and the remote current** — run `git status --porcelain`
39
+ (any tracked modification, code or docs, = a `workflow` finding: work is
40
+ sitting outside the commits under review) and, when the branch has an open
41
+ PR, `git fetch` + `git status -sb` (commits ahead of the remote = a
42
+ `workflow` finding: the PR and CI are judging a stale branch). Both are
43
+ **fix-now** — a review verdict on a branch whose real state isn't pushed
44
+ is worthless. Run the greps/`git log`/`git status` — don't infer compliance.
45
+ 4. **Applicable pack passes (the finders).** For each axis the matrix +
46
+ footprint mark as relevant, run the workflow's own internal skill for it
47
+ (`review-code`, `review-security`, `review-verify`, `review-design`,
48
+ `review-a11y`, `review-brand`, `review-perf`, `review-seo`) — **isolated,
49
+ per the *Isolation rule* above**, each returning ONLY its fixed-format
50
+ findings table + `PASS|FAIL`. **Skip the rest** and say which you skipped and
51
+ why. The pack ships with the workflow, so an applicable pass can never be
52
+ "missing". Passes **FIND** only — none of them classifies.
53
+ 5. **Optional extras.** If the project recorded additional platform review skills
54
+ (stack-specific linters, framework skills) and they are installed, run them
55
+ **in addition** — their findings merge into the same table. Never treat an
56
+ absent extra as a gap; the pack already covered the axis.
57
+ 6. **Synthesize.** Fuse all findings into **one** findings table, deduped by
58
+ `file:line` + axis, per the synthesis contract (the same fusion rules apply
59
+ in the default single-reviewer case). Columns: `# | Finding | Axis | Sev |
60
+ Evidence | Suggested fix` — **unclassified**. Overlapping signals on the same
61
+ defect collapse into one row. Add a **`Reviewers n/N`** column when running
62
+ in `--adversarial N` mode (omitted entirely in the default single-reviewer
63
+ case).
64
+ 7. **Classify (once).** Run `review-implementation` over the synthesized table
65
+ (isolated, per the *Isolation rule*) — the single classification engine
66
+ (D5). It verifies axis coverage (every applicable axis represented; a
67
+ missing axis is a `coverage` finding) and applies the current-unit contract:
68
+ `ignore` first, then fix-now / replan-in-unit / decision-required for
69
+ current-unit work, `proposal` for genuinely independent future capabilities
70
+ → the **classified decision table** (Sev, Class, WHY, impl risk, long-term
71
+ impact, premature-opt?, Route). No per-pass or per-reviewer classification,
72
+ no re-litigation.
73
+ 8. **Debt transform.** Run `review-debt` over the classified table — it
74
+ transforms debt-shaped findings into explicit TRIGGER-carrying debt items;
75
+ it does not rescan the diff (SPEC contract).
76
+ 9. **Manual-verification checklist.** List what automated review **cannot** confirm
77
+ and a human must check — visual correctness, real-device/locale behavior, UX
78
+ feel, perf under load, anything marked *verify*. Be explicit so the dev has zero
79
+ doubt about what to eyeball.
80
+ 10. **Route the outcomes.** fix-now findings fold into the current unit (or gain
81
+ user-confirmed phases via replan-in-unit); decision-required stops for the
82
+ user's decision; genuinely independent future capabilities become
83
+ **non-blocking proposals** — batched in the report with a trigger, and
84
+ **never** sent to `triage-issue` automatically (D3). `review-change` creates
85
+ no backlog work. No non-fix-now finding may end without a destination — none
86
+ silently lost.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: review-code
3
+ user-invocable: false
4
+ version: 1.0.1
5
+ author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
6
+ license: MIT
7
+ description: >
8
+ Internal correctness + simplification review pass of the agentic-workflow
9
+ review pack — composed in-turn by review-change and product-audit; not a menu
10
+ entry. Checks correctness, error handling, duplication, dead code, and
11
+ simplification opportunities against the project's own conventions. Findings
12
+ only; never edits code.
13
+ ---
14
+
15
+ # Review Code (internal)
16
+
17
+ Composed by `review-change` / `product-audit` within their conversation — on any
18
+ agent, follow this file inline as the routed step. **Findings only; never edits,
19
+ never refactors.**
20
+
21
+ ## Scope
22
+
23
+ The diff or path/glob the caller passes; default the current change vs the
24
+ default branch. State the scope at the top of the returned table.
25
+
26
+ ## Checklist (evaluate EVERY item — none is optional; n/a must be stated)
27
+
28
+ ✓ No logic errors on the changed paths (trace each modified function's inputs →
29
+ outputs, including boundary values)
30
+ ✓ Every error path is handled — no swallowed exceptions, no empty catch, no
31
+ silently-ignored return codes
32
+ ✓ No duplicated logic (a changed block does not re-implement an existing
33
+ helper — cite the existing one if it does)
34
+ ✓ No dead code introduced (unused functions, params, imports, unreachable
35
+ branches)
36
+ ✓ No leftover TODO/FIXME/HACK markers in the diff
37
+ ✓ Naming and file conventions match the project's docs (read them first; cite
38
+ the convention violated)
39
+ ✓ No new abstraction beyond what the SPEC requires (an interface/base class
40
+ with one implementation is a finding)
41
+ ✓ No new dependency not justified in the SPEC
42
+ ✓ Simplification: any changed block that can lose lines without losing
43
+ behavior (cite before/after)
44
+ ✓ Edge cases the SPEC's dev scenarios name are actually handled in code, not
45
+ just in tests
46
+
47
+ ## Return exactly
48
+
49
+ ```
50
+ REVIEW CODE — scope: <scope>
51
+
52
+ | # | Finding | Sev | Evidence | Suggested fix |
53
+ |---|---------|-----|----------|---------------|
54
+ | 1 | <what> | critical|major|minor | <file:line> | <smallest action> |
55
+
56
+ Checklist: <n> evaluated, <n> pass, <n> findings, <n> n/a (<which + why>)
57
+ Summary: <1-2 sentences>
58
+ Decision: PASS | FAIL
59
+ ```
60
+
61
+ FAIL if any critical or major finding is open; PASS otherwise. Minor findings
62
+ never block — they route to the caller's triage step.
63
+
64
+ ## Done when
65
+
66
+ - Every checklist item was evaluated with evidence (file:line or command output)
67
+ or explicitly marked n/a with the reason.
68
+ - The fixed-format block above is returned — nothing more, nothing less — and
69
+ no code was changed.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: review-debt
3
+ user-invocable: false
4
+ version: 1.1.0
5
+ author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
6
+ license: MIT
7
+ description: >
8
+ Internal tech-debt transform pass of the agentic-workflow review pack —
9
+ composed in-turn by review-change and product-audit; not a menu entry.
10
+ Transforms the synthesized findings table into explicit debt items, each with
11
+ a re-trigger condition; it does not rescan the diff. Findings only; never
12
+ edits code.
13
+ ---
14
+
15
+ # Review Tech Debt (internal)
16
+
17
+ Composed by `review-change` / `product-audit` within their conversation — on any
18
+ agent, follow this file inline as the routed step. **Findings only; never edits,
19
+ never refactors.**
20
+
21
+ ## Scope
22
+
23
+ The caller's **synthesized findings table** (the fused, classified decision
24
+ table). This pass does **not** rescan the diff: debt-shaped findings are already
25
+ in the table, and every ownership decision already happened in the finder axes
26
+ (`review-code`, `review-verify`, …). State the scope — the change the table was
27
+ synthesized over — at the top of the returned table.
28
+
29
+ ## Transform (evaluate EVERY row — none is optional; n/a must be stated)
30
+
31
+ Turn the table's tech-debt-shaped rows (TODO/FIXME/HACK, duplication, stale or
32
+ orphaned abstractions, dead code, complexity hotspots, missing tests,
33
+ workarounds pinned to upstream fixes) into explicit, payable debt items:
34
+
35
+ ✓ Restate each debt-shaped finding at `file:line` with what it defers
36
+ ✓ Attribute it to the axis already recorded in the table — never re-litigate ownership
37
+ ✓ Confirm every debt item carries a TRIGGER: the condition under which it must be
38
+ paid (e.g. "3rd consumer appears", ">100k rows") — a debt item without a
39
+ trigger is itself a finding
40
+ ✓ Verify no current-unit debt was mislabeled non-blocking: current-unit work
41
+ cannot be `postpone`/`tradeoff`/`wontfix` — a table showing one is flagged back
42
+ to the classifier, never reclassified here
43
+ ✓ Honor the dead-code exception: staged/planned code cross-checked against the
44
+ roadmap/SPEC/TASKS is not dead code — mark *verify* when unsure, never assert
45
+
46
+ ## Return exactly
47
+
48
+ ```
49
+ REVIEW TECH DEBT — scope: <scope>
50
+
51
+ | # | Finding | Sev | Evidence | Suggested fix |
52
+ |---|---------|-----|----------|---------------|
53
+ | 1 | <what> | critical|major|minor | <file:line> | <trigger + smallest action> |
54
+
55
+ Rows: <n> transformed, <n> with trigger, <n> findings, <n> n/a (<which + why>)
56
+ Summary: <1-2 sentences>
57
+ Decision: PASS | FAIL
58
+ ```
59
+
60
+ For this pass, the Suggested fix column carries the TRIGGER — the condition
61
+ under which the debt must be paid — alongside the smallest action.
62
+
63
+ FAIL if any critical or major finding is open; PASS otherwise. Minor findings
64
+ never block — they surface in the caller's report as debt notes.
65
+
66
+ ## Done when
67
+
68
+ - Every debt-shaped row of the synthesized table was transformed with evidence
69
+ (`file:line`) or explicitly marked n/a with the reason.
70
+ - Every debt item carries a trigger; no current-unit debt was mislabeled.
71
+ - The fixed-format block above is returned — nothing more, nothing less — and
72
+ no code was changed.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: review-design
3
+ user-invocable: false
4
+ version: 1.0.1
5
+ author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
6
+ license: MIT
7
+ description: >
8
+ Internal UI/UX design review pass of the agentic-workflow review pack —
9
+ composed in-turn by review-change and product-audit; not a menu entry.
10
+ Checks the changed UI against the project's design doc: consistency, states,
11
+ responsiveness, and reuse — applies only when the project has a UI and the
12
+ change touches it. Findings only; never edits code.
13
+ ---
14
+
15
+ # Review Design (internal)
16
+
17
+ Composed by `review-change` / `product-audit` within their conversation — on any
18
+ agent, follow this file inline as the routed step. **Findings only; never edits,
19
+ never refactors.**
20
+
21
+ ## Scope
22
+
23
+ The diff or path/glob the caller passes; default the current change vs the
24
+ default branch. State the scope at the top of the returned table.
25
+
26
+ ## Checklist (evaluate EVERY item — none is optional; n/a must be stated)
27
+
28
+ ✓ Read the project's design doc first (e.g. docs/frontend/DESIGN.md) — cite the rule for every finding
29
+ ✓ Changed components reuse the design system (no one-off styles/colors/spacing duplicating existing tokens or components)
30
+ ✓ Every new/changed view handles ALL states: loading, empty, error, success (cite each)
31
+ ✓ Responsive behavior stated and honored at the project's breakpoints (n/a if the platform has none)
32
+ ✓ No hardcoded user-facing strings where the project declares i18n (cite the i18n doc)
33
+ ✓ Visual hierarchy: primary action distinguishable, one primary action per view
34
+ ✓ Consistency with sibling screens (same patterns for the same interactions — cite the diverging sibling)
35
+ ✓ Destructive actions require confirmation and are visually distinct
36
+ ✓ Feedback on every user action (submit, save, fail) — no silent operations
37
+
38
+ ## Return exactly
39
+
40
+ ```
41
+ REVIEW DESIGN — scope: <scope>
42
+
43
+ | # | Finding | Sev | Evidence | Suggested fix |
44
+ |---|---------|-----|----------|---------------|
45
+ | 1 | <what> | critical|major|minor | <file:line> | <smallest action> |
46
+
47
+ Checklist: <n> evaluated, <n> pass, <n> findings, <n> n/a (<which + why>)
48
+ Summary: <1-2 sentences>
49
+ Decision: PASS | FAIL
50
+ ```
51
+
52
+ FAIL if any critical or major finding is open; PASS otherwise. Minor findings
53
+ never block — they route to the caller's triage step.
54
+
55
+ ## Done when
56
+
57
+ - Every checklist item was evaluated with evidence (file:line or command output)
58
+ or explicitly marked n/a with the reason.
59
+ - The fixed-format block above is returned — nothing more, nothing less — and
60
+ no code was changed.
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: review-implementation
3
+ user-invocable: false
4
+ version: 1.4.0
5
+ argument-hint: <path-or-glob>
6
+ allowed-tools: Read, Grep, Glob, Bash, WebFetch
7
+ author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
8
+ license: MIT
9
+ description: >
10
+ Internal scope/classification engine composed by review-change (and reused by
11
+ the audit skills): consumes the synthesized findings table, verifies every
12
+ applicable axis is represented, and classifies each finding into a decision
13
+ table (fix-now / replan-in-unit / decision-required / proposal / ignore).
14
+ Findings only — never refactors.
15
+ ---
16
+
17
+ # Review Implementation (internal scope/classification engine)
18
+
19
+ The classification engine the review/audit skills compose: it consumes the
20
+ **synthesized findings table** (the fused output of the applicable per-axis
21
+ passes), verifies every applicable axis is represented, and returns the
22
+ classified decision table — then stops. Never refactors or edits code. It owns
23
+ the **scope/axis-coverage contract** and the **classification rubric** (the
24
+ current-unit contract + routing) that `review-change`, `audit-pr`, and
25
+ `product-audit` reference instead of restating.
26
+
27
+ It does **not** scan the diff: every finding concern has exactly one owning
28
+ pass (see the [axis ownership map](references/FIND.md)) — the per-axis passes
29
+ (`review-code`, `review-security`, `review-verify`, `review-perf`,
30
+ design/a11y/brand/SEO) find, and this engine classifies. No broad findings
31
+ scan here.
32
+
33
+ ## When to use
34
+
35
+ - Invoked by `review-change` (the user-facing review entry) as its
36
+ classification engine, over the fused findings table.
37
+ - The audit skills reference its rubric and coverage contract.
38
+
39
+ ## Scope
40
+
41
+ The caller's scope statement (the branch diff vs. the default branch, or the
42
+ passed path/glob) is authoritative; the synthesized table was gathered over it.
43
+ State the scope at the top of the classified report.
44
+
45
+ ## Step 0 — Discover the project (always first)
46
+
47
+ Per the agent guide's **Workflow conventions** + **documentation map**, read
48
+ what THIS skill needs: the architecture/layering rules, the testing philosophy,
49
+ and any runtime/platform, security, money, i18n/SEO/a11y and bundle rules. Pull
50
+ the project's specific risk axes from its guardrail skills where present. The
51
+ `FIND.md` axis map is the default; the project's docs refine which axes are
52
+ applicable.
53
+
54
+ ## Step 1 — Verify axis coverage (the synthesized table)
55
+
56
+ For the declared scope, confirm **every applicable axis is represented** in the
57
+ synthesized findings table — one finding owner per axis, per the `FIND.md`
58
+ map: an axis the change touches that the table says nothing about is a
59
+ **missing-axis finding** (axis `coverage`), not a silent pass. Overlapping
60
+ signals from different passes on the same defect collapse into one row during
61
+ synthesis — the table must contain neither duplicates nor gaps. State which
62
+ axes were applicable and confirm each appears.
63
+
64
+ ## Step 2 — Classify (the current-unit contract)
65
+
66
+ Read [Classify and route](references/CLASSIFY.md) and classify every row of the
67
+ synthesized table without reopening source files: `ignore` first (the claim),
68
+ then the current-unit contract (fix-now / replan-in-unit / decision-required
69
+ for in-scope work), then `proposal` for genuinely independent future
70
+ capabilities. One pass — no per-pass or per-reviewer classification.
71
+
72
+ ## Context budget
73
+
74
+ The input is the synthesized table, not the diff. Read at most 10 non-diff
75
+ files in full for surrounding context (callers, contracts, SPEC); targeted
76
+ reads (≤ 50 lines of a named range) and grep/glob results don't count. Record
77
+ each classification as its table row immediately and drop raw file content.
78
+
79
+ ## Guardrails
80
+
81
+ - **Findings + table only. Never refactor or edit code in this skill.**
82
+ - **One classifier.** Classification happens HERE, once, over the fused
83
+ table — never per-reviewer, never re-litigated in the per-axis passes.
84
+ - Honor the dead-code exception — staged/planned code is not dead code.
85
+ - Don't inflate severity; separate "correctness/security" from "taste".
86
+ - Don't deflate either: current-unit work is never `postpone`/`tradeoff`/
87
+ `wontfix`/`disputed` and never a new issue — size routes to
88
+ `replan-in-unit`, not to a downgrade (current-unit contract in `CLASSIFY.md`).
89
+ - Otherwise per the project's **Workflow conventions** (docs-language,
90
+ evidence): cite `file:line`, mark uncertainties *verify*.
91
+
92
+ ## Relationship to other skills
93
+
94
+ - **Classification engine of `review-change`** — the user-facing review skill
95
+ runs the applicable per-axis passes (the finders), fuses their tables, then
96
+ composes this engine to classify. `audit-pr` and `product-audit` reuse this
97
+ rubric.
98
+ - Sits in **Stage 4** of the feature workflow (verification & review).
99
+ - `fix-now` folds into the current unit; `replan-in-unit` appends
100
+ user-confirmed phases then `execute-phase` on the same branch;
101
+ `decision-required` blocks for the user; independent work becomes proposals
102
+ the user routes to `triage-issue` (D3).
103
+
104
+ ## Done when
105
+
106
+ - A synthesized table consumed, axis coverage verified (no applicable axis
107
+ missing, no duplicate rows), every finding classified with reasoning and
108
+ routed — and **no code changed**.
@@ -0,0 +1,96 @@
1
+ ## Classify and route (no refactor)
2
+
3
+ The single classification engine is `review-implementation`, run **once** over
4
+ the **synthesized** findings table (D5). Classify each finding into exactly one
5
+ class, in this order. Never reopen source files to classify; the table's
6
+ evidence is authoritative.
7
+
8
+ ### Step 1 — `ignore` first (the claim, not a class choice)
9
+
10
+ `ignore` claims **"this is not a real defect"** — a false positive or a
11
+ negligible taste/overengineering note. It is decided first, on the claim alone:
12
+ a false positive has no fix and no scope to check, so it never runs through the
13
+ current-unit gate. If the finding IS a real defect, it is not `ignore` — drop it
14
+ only with a rationale.
15
+
16
+ ### Step 2 — Is it current-unit work? (only blocking outcomes)
17
+
18
+ A finding belongs to the **current unit** when it maps to the governing SPEC, a
19
+ phase, a documented invariant, correctness, security, accessibility, a required
20
+ UX/error state, or an expectation necessary for a competent user to consider an
21
+ in-scope capability complete (D2: complete capabilities, not short unit
22
+ duration). Current-unit work has **only blocking outcomes**:
23
+
24
+ - **fix-now** — it can fold directly. It is NEVER a tracked issue and NEVER
25
+ routes to `plan-fix`: it folds into the current unit's open phase (AC 12).
26
+ - **replan-in-unit** — it needs additional user-confirmed phases (see *Large
27
+ in-scope fix-now → replan, never downgrade* below).
28
+ - **decision-required** — a new product/architecture decision is unavoidable.
29
+ Stop and surface it; the unit blocks until the user decides.
30
+
31
+ For current-unit work, `postpone`, `tradeoff`, `wontfix`, `disputed`, and
32
+ reviewer-created issue creation are **forbidden** (AC 10). A previously approved
33
+ trade-off is **cited as existing evidence**, never reinvented by review.
34
+ `disputed` remains a later fold/user outcome, not a reviewer shortcut.
35
+
36
+ ### Step 3 — Independent future capabilities → proposals, never issues
37
+
38
+ Only a **truly independent future capability** — work the current unit does not
39
+ promise and no competent user expects from it (D3) — may become a
40
+ **non-blocking proposal**: batched in the report with a trigger, and NEVER sent
41
+ to `triage-issue` automatically. `review-change` creates no backlog work; only
42
+ the user routes a proposal to `triage-issue`.
43
+
44
+ ### Large in-scope fix-now → replan, never downgrade
45
+
46
+ An in-scope fix-now too large to fold as-is (multi-file redesign, or evidence
47
+ the unit should have been split) keeps its **fix-now** class — size is never a
48
+ reason to downgrade. Set its `Route` to **`replan-in-unit`**: the unit's SPEC
49
+ `## Phases` ledger gets one or more new phases covering the work, on the SAME
50
+ branch — proposed to the user for confirmation, then executed via
51
+ `execute-phase`. It never routes to `plan-fix` or a new issue (AC 12). Placement
52
+ depends on whether the final `Hardening & PR` phase has already run:
53
+
54
+ - **Hardening not yet executed** → insert the new phase(s) BEFORE it; the
55
+ ledger's existing close-out stays last.
56
+ - **Hardening already executed** → append the new phase(s) AFTER it, plus one
57
+ fresh final `Hardening & PR` phase closing them out — the ledger must always
58
+ end with an unexecuted hardening close-out covering every phase before it; a
59
+ completed hardening never vouches for work added after it ran.
60
+
61
+ The finding is not folded directly; it is folded by the new phase(s).
62
+
63
+ ### Decision table
64
+
65
+ For every finding, give the reasoning columns. Example (generic — your findings,
66
+ your domains):
67
+
68
+ | Finding | Axis | Sev | Class | WHY | Implementation risk | Long-term impact | Premature-opt? | Route |
69
+ |---|---|---|---|---|---|---|---|---|
70
+ | API token committed in a config file | security | high | fix-now | Credential exposure | Low (move to secret store) | Incident risk | no | fold into phase |
71
+ | New export endpoint has no failure-mode test | tests | med | fix-now | Untested error path | Low | Regression risk | no | fold into phase |
72
+ | Fixing this backend bug pulls in an auth redesign | correctness | high | decision-required | Unavoidable product/architecture decision | — | Blocking | no | surface decision, block |
73
+ | Rate limiter reusable across the fleet | architecture | low | proposal | Independent of this unit (D3) | — | — | yes | batch proposal + trigger |
74
+ | Single-caller wrapper around a stdlib call | overengineering | low | ignore | Indirection with no payoff | — | Negligible | no | note rationale |
75
+
76
+ - **Sev** — **high**: correctness, security, or data-loss risk, or a merge
77
+ blocker. **med**: degraded behavior, a real untested path, or notable debt.
78
+ **low**: taste, cosmetics, or micro-optimization without a measured need.
79
+ - **WHY** — one-sentence justification for the class.
80
+ - **Implementation risk** — risk of *fixing* it now (blast radius, churn).
81
+ - **Long-term impact** — cost of *not* fixing it (debt, drift, incident odds).
82
+ - **Premature-opt?** — yes/no: optimizing without a measured need?
83
+ - **Route** — where it goes next (below).
84
+
85
+ ## Routing (what each class feeds)
86
+
87
+ - **fix-now** → fold directly into the current unit's open phase; never a
88
+ tracked issue, never `plan-fix` (AC 12).
89
+ - **fix-now / `replan-in-unit`** → new phase(s) appended to the unit's SPEC
90
+ `## Phases` ledger (user confirms first), then `execute-phase` on the same
91
+ branch — never a downgrade, never a tracked issue (AC 12).
92
+ - **fix-now / `decision-required`** → stop and surface the decision; the unit
93
+ blocks until the user decides. No issue is created.
94
+ - **proposal** (independent future capability) → batched in the report with a
95
+ trigger; the **user** decides whether to route it to `triage-issue` (D3).
96
+ - **ignore** → note the rationale in the report; no further action.
@@ -0,0 +1,35 @@
1
+ ## Axis ownership — one concern, one pass
2
+
3
+ The internal review pack assigns **every review concern to exactly one owning
4
+ pass**. No pass rescans another's surface; the per-axis passes find, and
5
+ `review-implementation` (the scope/classification engine) verifies coverage and
6
+ classifies the synthesized table.
7
+
8
+ | Concern | Owning pass | Looks for |
9
+ |---|---|---|
10
+ | Bug / correctness | `review-code` | Logic errors, wrong edge-case handling, races, unhandled rejections, imprecise numeric handling |
11
+ | Simplification / dead code / duplication | `review-code` | Unused exports, unreachable branches, commented-out blocks, obsolete files, duplicate logic — **see exception below** |
12
+ | Overengineering | `review-code` | Unnecessary abstractions, single-caller indirection, speculative generality, micro-opt without a measured bottleneck |
13
+ | Architecture / runtime compatibility | `review-code` | Broken dependency direction, business logic in the wrong layer, abstraction bypass, cross-layer shortcut, runtime-incompatible deps, blocking calls in the request path |
14
+ | Project-rule violations | `review-code` | Whatever the project's docs mandate (e.g. domain value-object rules, no hardcoded UI strings, don't hide user-facing limitations, naming conventions) |
15
+ | Security / cybersecurity | `review-security` | Secrets in code, injection, missing authz, unsafe deserialization, PII exposure, weak crypto, SSRF, over-broad CORS, leaking errors, dependency security |
16
+ | Tests — failing/weak & missing | `review-verify` | Flaky/over-mocked/snapshot-heavy tests, uncovered branches, new use-cases/adapters without tests, SPEC dev-scenario failure modes not exercised |
17
+ | Performance / bundle-size | `review-perf` | Algorithmic/resource/performance evidence, heavy/duplicate deps, accidental large imports, non-tree-shakeable patterns |
18
+ | Design / a11y / brand / SEO | `review-design` / `review-a11y` / `review-brand` / `review-seo` | Only their named surfaces |
19
+ | Tech-debt triggers | `review-debt` | Transform of the synthesized table — every debt-character finding gains an explicit TRIGGER (a debt item without a trigger is itself a finding) |
20
+
21
+ ### Dead-code exception (important)
22
+
23
+ Do **not** flag code as removable if it is **intentionally staged for an
24
+ in-progress or planned feature**. Before reporting the dead-code concern
25
+ (`review-code`), cross-check the roadmap, feature SPECs/`TASKS.md`, and
26
+ `known-issues.md`: if the code is wired into a planned phase or another
27
+ feature, classify it *intentional / in-progress*, not dead. When unsure, mark
28
+ it **verify** and ask — never assert "dead" on a guess.
29
+
30
+ ### Coverage contract (consumed by `review-implementation`)
31
+
32
+ The classification engine verifies that every applicable axis for the declared
33
+ scope is represented in the synthesized findings table: an axis the change
34
+ touches with no table row is a **missing-axis finding** (axis `coverage`),
35
+ not a silent pass.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: review-perf
3
+ user-invocable: false
4
+ version: 1.1.0
5
+ author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
6
+ license: MIT
7
+ description: >
8
+ Internal performance review pass of the agentic-workflow review pack — composed
9
+ in-turn by review-change and product-audit; not a menu entry. Checks the
10
+ changed paths for algorithmic and resource regressions: N+1s, hot-path
11
+ allocations, asset weight, and leaks. Findings only; never edits code.
12
+ ---
13
+
14
+ # Review Performance (internal)
15
+
16
+ Composed by `review-change` / `product-audit` within their conversation — on any
17
+ agent, follow this file inline as the routed step. **Findings only; never edits,
18
+ never refactors.**
19
+
20
+ ## Scope
21
+
22
+ The diff or path/glob the caller passes; default the current change vs the
23
+ default branch. State the scope at the top of the returned table.
24
+
25
+ ## Checklist (evaluate EVERY item — none is optional; n/a must be stated)
26
+
27
+ - ✓ No N+1 query/IO pattern on changed data-access paths (loop bodies issuing
28
+ queries/requests — cite)
29
+ - ✓ Algorithmic complexity of new code paths stated where input can grow (an
30
+ unbounded O(n²) on user data is a major finding)
31
+ - ✓ No blocking IO/sync work added on hot/request paths where the platform is
32
+ async
33
+ - ✓ Resources opened by the change are closed/released on ALL paths including
34
+ errors (files, connections, subscriptions, timers)
35
+ - ✓ No unbounded growth introduced (caches without eviction, arrays that only
36
+ append, listeners never removed)
37
+ - ✓ Web only: bundle/asset impact of the change stated (new dep size, image
38
+ weight, lazy-loading where the project uses it) — n/a otherwise
39
+ - ✓ Repeated computation hoisted where a loop recomputes an invariant (cite)
40
+ - ✓ Pagination/limits on any new listing that reads user-scaled data
41
+ - ✓ No premature optimization either: complexity added for speed without a
42
+ cited measurement is a finding (the repo forbids overengineering)
43
+ - ✓ **Measured evidence when declared** — the project's agent guide declares a
44
+ `Performance commands` block with a `bench` command AND the diff touches
45
+ paths its benchmarks cover: RUN the benchmark on the base branch and on the
46
+ change, and cite both numbers in Evidence as
47
+ `<cmd> → base <x> / change <y> (<±z%>)`. A regression beyond the noise band
48
+ (the project's declared band, else ±5%) is a **major** finding; a delta
49
+ inside the band is no finding. The declared command failing (non-zero exit)
50
+ is itself a finding (the gate can't measure) — never silently skipped.
51
+ - ✓ **No declared perf commands** → state exactly
52
+ `n/a — no declared perf commands` for the item above (never skip it
53
+ silently), and if the diff adds algorithmic code on input that can grow,
54
+ add a **minor** finding recommending the project adopt the tooling via
55
+ `init-workspace`'s Performance tooling round.
56
+
57
+ ## Return exactly
58
+
59
+ ```
60
+ REVIEW PERF — scope: <scope>
61
+
62
+ | # | Finding | Sev | Evidence | Suggested fix |
63
+ |---|---------|-----|----------|---------------|
64
+ | 1 | <what> | critical|major|minor | <file:line — or, for measured findings, `<cmd> → base <x> / change <y> (<±z%>)`> | <smallest action> |
65
+
66
+ Checklist: <n> evaluated, <n> pass, <n> findings, <n> n/a (<which + why>)
67
+ Summary: <1-2 sentences>
68
+ Decision: PASS | FAIL
69
+ ```
70
+
71
+ FAIL if any critical or major finding is open; PASS otherwise. Minor findings
72
+ never block — they route to the caller's triage step.
73
+
74
+ ## Done when
75
+
76
+ - Every checklist item was evaluated with evidence (file:line or command output)
77
+ or explicitly marked n/a with the reason.
78
+ - The fixed-format block above is returned — nothing more, nothing less — and
79
+ no code was changed.