@gtrabanco/pi-agentic-workflow 0.2.0 → 0.4.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 (44) hide show
  1. package/README.es.md +0 -1
  2. package/README.md +0 -1
  3. package/package.json +1 -1
  4. package/skills/design-feature/SKILL.md +31 -2
  5. package/skills/evidence-grounding/SKILL.md +13 -2
  6. package/skills/evidence-grounding/references/ROWS.md +1 -1
  7. package/skills/execute-phase/SKILL.md +6 -4
  8. package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +5 -4
  9. package/skills/execute-phase/references/CLOSEOUT.md +5 -4
  10. package/skills/execute-phase/references/FOLDING.md +3 -2
  11. package/skills/execute-phase/references/UNIT_LOOP.md +1 -2
  12. package/skills/fold-findings/SKILL.md +1 -1
  13. package/skills/fold-findings/references/FOLD_POLICY.md +7 -0
  14. package/skills/log-session/SKILL.md +7 -1
  15. package/skills/plan-feature-scaffold/SKILL.md +13 -1
  16. package/skills/plan-fix/SKILL.md +13 -1
  17. package/skills/pre-execution-review/SKILL.md +1 -1
  18. package/skills/pre-execution-review/references/LEDGERS.md +23 -1
  19. package/skills/pre-execution-review/references/POLICY.md +1 -1
  20. package/skills/review-a11y/SKILL.md +10 -1
  21. package/skills/review-brand/SKILL.md +10 -1
  22. package/skills/review-change/SKILL.md +10 -7
  23. package/skills/review-change/references/OUTPUT_AND_GUARDRAILS.md +3 -1
  24. package/skills/review-change/references/PERSIST_AND_DECIDE.md +35 -15
  25. package/skills/review-change/references/REVIEW_PROCESS.md +73 -13
  26. package/skills/review-code/SKILL.md +12 -1
  27. package/skills/review-design/SKILL.md +10 -1
  28. package/skills/review-implementation/SKILL.md +1 -1
  29. package/skills/review-implementation/references/CLASSIFY.md +9 -1
  30. package/skills/review-perf/SKILL.md +10 -1
  31. package/skills/review-plan/SKILL.md +1 -1
  32. package/skills/review-plan/references/OUTPUT.md +9 -0
  33. package/skills/review-security/SKILL.md +10 -1
  34. package/skills/review-seo/SKILL.md +10 -1
  35. package/skills/review-spec/SKILL.md +1 -1
  36. package/skills/review-spec/references/OUTPUT.md +9 -0
  37. package/skills/review-verify/SKILL.md +10 -1
  38. package/skills/ship-roadmap/SKILL.md +2 -2
  39. package/skills/ship-roadmap/references/ADVANCE.md +6 -5
  40. package/skills/ship-roadmap/references/MODEL_ROUTING.md +1 -1
  41. package/skills/triage-issue/SKILL.md +1 -1
  42. package/skills/triage-issue/references/REVIEW_FINDING_PROCESS.md +1 -1
  43. package/skills/verification-contract/SKILL.md +22 -2
  44. package/skills/loop-review-fold/SKILL.md +0 -191
@@ -1,191 +0,0 @@
1
- ---
2
- name: loop-review-fold
3
- user-invocable: true
4
- version: 3.0.0
5
- argument-hint: <NN> | --fix <issue-number>
6
- author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
7
- license: MIT
8
- description: >
9
- Run the simple review-change/fold-findings loop for an open feature or fix
10
- unit. Inspect persisted review evidence first so a previous review resumes
11
- with fold-findings instead of reviewing the same candidate again. Unresolved
12
- findings go to triage-issue with an immediate-fix instruction; oversized
13
- findings become a user-confirmed plan-feature or plan-fix replan with new
14
- phases. Triggers: "loop-review-fold", "review and fold this PR", "run the
15
- review fold loop".
16
- ---
17
-
18
- # Review / Fold Loop
19
-
20
- Run one small state loop over the current feature or fix unit:
21
-
22
- ```text
23
- review-change ── findings ──▶ fold-findings ── changed HEAD ──▶ review-change
24
- ▲ │
25
- └──────── current PASS ◀───────┘
26
- └─ unresolved ─▶ triage-issue
27
- ```
28
-
29
- This skill is a router, not a third review or repair implementation. It reads
30
- the durable evidence left by `review-change` and `fold-findings`, chooses the
31
- next action, and stops when a user decision or manual phase execution is
32
- required. Never merge, create an unrelated issue, or silently discard a
33
- finding.
34
-
35
- ## Turn contract
36
-
37
- ```text
38
- ✓ The feature/fix unit, branch, PR, current HEAD, acceptance, and finding ledger were checked
39
- ✓ The first action was selected from persisted evidence: PASS, review-change, or fold-findings
40
- ✓ review-change ran only when no current review result required fold-findings first
41
- ✓ A successful fold was followed by review-change on the new HEAD
42
- ✓ Every unresolved finding is named and routed to triage-issue --prioritize-now
43
- ✓ An oversized finding routes to plan-feature or plan-fix, new P<n> phases, and manual user execution
44
- ✓ No merge, unrelated issue, acceptance weakening, or silent finding drop occurred
45
- ✓ The fixed result and the closing → Next: block are the final output
46
- ```
47
-
48
- Any unchecked box means the turn is not done.
49
-
50
- ## When to use
51
-
52
- Use after `execute-phase` opens the unit PR, or when the user asks to review and
53
- fold an open feature or fix. The argument identifies the unit:
54
-
55
- - `/loop-review-fold <NN>` for a feature unit.
56
- - `/loop-review-fold --fix <issue-number>` for a fix unit.
57
-
58
- Do not use this entrypoint to edit this skill, inspect its implementation as the
59
- requested deliverable, or invent a target when the unit argument is missing.
60
-
61
- ## Step 0 — Discover the project (always first)
62
-
63
- Read the target project's agent guide and documentation map. Then verify the
64
- target unit, current branch, open PR, remote HEAD, frozen acceptance artifact,
65
- the latest `review-change` result/receipt, and the unit's `review-findings.md`.
66
- Use repository and forge commands required by the project's own conventions.
67
- Narration, an old chat result, or a clean worktree alone is not evidence.
68
-
69
- If the target, PR, acceptance, or ledger cannot be verified, stop with
70
- `BLOCKED` and name the exact missing input and recovery command. Do not create
71
- replacement artifacts in this router.
72
-
73
- ## Process
74
-
75
- Apply this first-match table exactly:
76
-
77
- | Persisted state on the current HEAD | First action |
78
- |---|---|
79
- | Exact current `REVIEW-PASS`, matching acceptance, and no open finding rows | `PASS`; do not run either skill |
80
- | A review result exists for this HEAD and it leaves any `folded: no` row | `fold-findings` on the complete open queue |
81
- | No usable current review result and no open queue | `review-change` on the current HEAD |
82
-
83
- Then continue as follows:
84
-
85
- 1. Run the selected skill in its own fresh context and follow that skill's
86
- contract literally. This loop does not copy its internal checklist.
87
- 2. If `review-change` returns `REVIEW-PASS`, verify its exact-HEAD receipt and
88
- zero open rows, then return `PASS`.
89
- 3. If `review-change` returns findings, run `fold-findings` for every open
90
- `fix-now` row. Do not start another review before that queue is processed.
91
- 4. If `fold-findings` changes and pushes the candidate, run `review-change` on
92
- that new HEAD. Never review an unchanged HEAD a second time.
93
- 4a. Before step 5, split the open queue by **owning stage** (the `route` cell each
94
- `review-change` finding carries: `product | plan | source | environment |
95
- runtime`). Only `source`, `environment` and `runtime` rows may be folded or
96
- triaged here. A `plan`-owned row stops the loop with `BLOCKED` and hands off to
97
- `/plan-feature <unit>` (fix: `/plan-fix <n>`) for one root-caused re-cut, then
98
- `/review-plan <unit>`; a `product`-owned row goes to `/design-feature <unit>`
99
- then `/review-spec <unit>`. Folding repairs the candidate; it cannot repair the
100
- authority that describes it, so never fold a row whose artifact of record is a
101
- planning document, and never send one to `triage-issue` to make it disappear.
102
- 4b. On entering a **second** local review→fold cycle for the same finding family,
103
- diagnose before editing again: emit the `CONVERGENCE-ANOMALY` report defined by
104
- `pre-execution-review` (repeated vs new ids, snapshot digest and
105
- `artifactRevisionId` move, what was missed, owning stage, why the prior
106
- repair failed, route to owner) and continue from the owner it names. A third
107
- blind edit is not a repair attempt, and no cycle count here is ever hidden.
108
-
109
- 5. If any finding remains unresolved (`DISPUTED`, `BLOCKED`, `REPLAN`, or an
110
- open row left after folding), stop the loop and hand every such ID to:
111
-
112
- ```text
113
- /triage-issue --prioritize-now <unit-or-fix> F1 F2 ...
114
- ```
115
-
116
- Tell `triage-issue` to try to resolve every named finding immediately. It
117
- may route a small correction back to the current unit, but it must not hide,
118
- downgrade, or postpone a review finding merely to finish the loop.
119
- 6. When the smallest correct correction is too large for the current fold,
120
- `triage-issue` must choose a replan route: re-run `/plan-feature <slug>` for
121
- a feature or `/plan-fix <issue-number>` for a fix, append explicit new
122
- `P<n>` phases to the unit's SPEC, and stop. The loop then asks the user to
123
- execute those phases manually with `/execute-phase <unit> P<n>` (or the
124
- fix equivalent) before invoking this loop again.
125
-
126
- Do not use a hidden retry count. The loop ends at the first `PASS`, blocked
127
- prerequisite, unresolved finding, or required manual replan. A later user
128
- invocation starts from the newly persisted state. The loop files nothing: an
129
- unresolved finding never becomes a forge issue from here, and deferring one out of
130
- the unit requires the user to amend the governing SPEC first.
131
-
132
- ## Fixed output contract
133
-
134
- Return exactly:
135
-
136
- ```text
137
- REVIEW-FOLD LOOP — PASS | TRIAGE-REQUIRED | BLOCKED
138
- Unit: <unit> · PR: <url> · HEAD: <sha>
139
- First action: PASS | review-change | fold-findings
140
- Review: <PASS | FAIL | not-run> · Fold: <changed | unchanged | not-run>
141
- Owned elsewhere: <plan → /plan-feature + /review-plan | product → /design-feature
142
- + /review-spec | none>
143
- Unresolved: <F1 + F2 + … | none>
144
- Evidence: <one concise line explaining the selected action and result>
145
-
146
- → Next: <one concrete command or user action> — <why>
147
- · <alternative when applicable>
148
- ```
149
-
150
- Use `TRIAGE-REQUIRED` whenever a finding needs `triage-issue`, a replan, or a
151
- user decision. Replace every placeholder, list each actual finding ID exactly
152
- once joined with ` + `, and never emit a literal ellipsis.
153
-
154
- ## Guardrails
155
-
156
- Allowed: read target evidence, invoke `review-change`, invoke `fold-findings`,
157
- and route unresolved findings to `triage-issue`.
158
-
159
- Forbidden: implementing a fix in this router, editing review classifications,
160
- marking findings folded, creating unrelated issues, weakening acceptance or
161
- checks, merging, or claiming that a user has implemented newly planned phases.
162
- Also forbidden: folding a `plan`- or `product`-owned finding, re-editing on a
163
- second local cycle before the convergence diagnosis is reported, and treating an
164
- absent pre-execution PASS as foldable debt.
165
-
166
- ## Relationship to other skills
167
-
168
- `execute-phase` hands off here after a unit PR opens. `review-change` owns
169
- read-only classification and the SHA-bound pass receipt. `fold-findings` owns
170
- the actual correction and ledger tick. `triage-issue --prioritize-now` owns the
171
- decision for unresolved findings and routes oversized work to `plan-feature` or
172
- `plan-fix`; the user then executes the appended phases manually.
173
-
174
- ## Portability (agents other than Claude Code)
175
-
176
- If fresh contexts or subagents are unavailable, invoke each delegated skill in
177
- a new conversation and re-read the persisted HEAD, receipt, and ledger before
178
- continuing. If the host has no slash-command menu, open each named `SKILL.md`
179
- and follow it literally. Never claim a clean review after the same context
180
- implemented the correction.
181
-
182
- ## Done when
183
-
184
- The current HEAD has a verified `REVIEW-PASS` and no open findings, or every
185
- remaining finding has a concrete triage/replan hand-off and the user has been
186
- told to implement the new phases manually.
187
-
188
- → Next: print the matching terminal route from the fixed output contract — never send a non-PASS result to audit-pr
189
- · PASS → /audit-pr — consume the current exact-HEAD REVIEW-PASS
190
- · TRIAGE-REQUIRED → /triage-issue --prioritize-now <unit> F<k> — resolve every actual unresolved finding, then plan/execute new phases manually
191
- · BLOCKED → the exact recovery command — supply the missing target, PR, acceptance, or ledger input before re-running the loop