@juicesharp/rpiv-pi 1.7.0 → 1.8.1

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.
package/README.md CHANGED
@@ -185,7 +185,7 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
185
185
  | `/btw` | Ask a side question without polluting the main conversation _(requires `@juicesharp/rpiv-btw`, opt-in)_ |
186
186
  | `/languages` | Pick the UI language for rpiv-* TUI strings (Deutsch / English / Español / Français / Português / Português (Brasil) / Русский / Українська) |
187
187
  | `/todos` | Show current todo list |
188
- | `/web-search-config` | Set Brave Search API key |
188
+ | `/web-search-config` | Pick the active search provider and set its API key |
189
189
 
190
190
  ### Agents
191
191
 
@@ -220,7 +220,7 @@ Pi Agent discovers extensions via `"extensions": ["./extensions"]` and skills vi
220
220
 
221
221
  ## Configuration
222
222
 
223
- - **Web search** - run `/web-search-config` to set the Brave Search API key, or set the `BRAVE_SEARCH_API_KEY` environment variable
223
+ - **Web search** - run `/web-search-config` to pick a provider (Brave, Tavily, Serper, Exa, Jina, or Firecrawl) and set its API key; the per-provider env var (e.g. `BRAVE_SEARCH_API_KEY`, `EXA_API_KEY`) also works and takes precedence
224
224
  - **Advisor** - run `/advisor` to select a reviewer model and reasoning effort
225
225
  - **Side questions** _(opt-in: `pi install npm:@juicesharp/rpiv-btw`)_ - type `/btw <question>` anytime (even mid-stream) to ask the primary model a one-off question; answer appears in a borderless bottom overlay and never enters the main conversation
226
226
  - **UI language** - run `/languages` to pick the locale for rpiv-* TUI strings, or pass `pi --locale <code>` at startup. Detection priority: flag → `~/.config/rpiv-i18n/locale.json` → `LANG` / `LC_ALL` → English. LLM-facing copy stays English by design
@@ -240,7 +240,7 @@ Pi Agent discovers extensions via `"extensions": ["./extensions"]` and skills vi
240
240
  | Warning about missing siblings on session start | Sibling plugins not installed | Run `/rpiv-setup` |
241
241
  | `/rpiv-setup` fails on a package | Network or registry issue | Check connection, retry with `pi install npm:<pkg>`, re-run `/rpiv-setup` |
242
242
  | `/rpiv-setup` says "requires interactive mode" | Running in headless mode | Install manually: `pi install npm:<pkg>` for each sibling |
243
- | `web_search` or `web_fetch` errors | Brave API key not configured | Run `/web-search-config` or set `BRAVE_SEARCH_API_KEY` |
243
+ | `web_search` or `web_fetch` errors | Active provider's API key not configured | Run `/web-search-config` or set the matching env var (e.g. `BRAVE_SEARCH_API_KEY`, `EXA_API_KEY`) |
244
244
  | `advisor` tool not available after upgrade | Advisor model selection lost | Run `/advisor` to re-select a model |
245
245
  | Skills hang or serialize agent calls | Agent concurrency too low | Open `/agents`, raise `Settings → Max concurrency` |
246
246
 
@@ -2,7 +2,6 @@
2
2
  name: web-search-researcher
3
3
  description: Do you find yourself desiring information that you don't quite feel well-trained (confident) on? Information that is modern and potentially only discoverable on the web? Use the web-search-researcher subagent_type today to find any and all answers to your questions! It will research deeply to figure out and attempt to answer your questions! If you aren't immediately satisfied you can get your money back! (Not really - but you can re-run web-search-researcher with an altered prompt in the event you're not satisfied the first time)
4
4
  tools: web_search, web_fetch, read, grep, find, ls
5
- isolated: true
6
5
  ---
7
6
 
8
7
  You are an expert web research specialist focused on finding accurate, relevant information from web sources. Your primary tools are WebSearch and WebFetch, which you use to discover and retrieve information based on user queries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "A skill-based development workflow for Pi Agent. Five skills (research, design, plan, implement, validate) and the shared subagents that compose its ship-loop.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -5,13 +5,13 @@ argument-hint: [target-directory]
5
5
  allowed-tools: Agent, Read, Write, Glob, Grep
6
6
  ---
7
7
 
8
- # Annotate Project
8
+ # Annotate Guidance
9
9
 
10
10
  You are tasked with generating architecture guidance files for a brownfield project. You will map the project structure, auto-detect its architecture, analyze each architectural layer, and batch-write compact architecture.md files under `.rpiv/guidance/` mirroring the project's directory structure.
11
11
 
12
- ## Initial Setup:
12
+ ## Input
13
13
 
14
- Use the current working directory as the target project by default. If the user provides a specific directory path as an argument, use that instead.
14
+ `$ARGUMENTS` optional target directory. Defaults to the current working directory.
15
15
 
16
16
  ## Steps to follow:
17
17
 
@@ -5,13 +5,13 @@ argument-hint: [target-directory]
5
5
  allowed-tools: Agent, Read, Write, Glob, Grep
6
6
  ---
7
7
 
8
- # Annotate Project
8
+ # Annotate Inline
9
9
 
10
10
  You are tasked with generating CLAUDE.md files across a brownfield project. You will map the project structure, auto-detect its architecture, analyze each architectural layer, and batch-write compact CLAUDE.md files at the root and relevant subdirectories.
11
11
 
12
- ## Initial Setup:
12
+ ## Input
13
13
 
14
- Use the current working directory as the target project by default. If the user provides a specific directory path as an argument, use that instead.
14
+ `$ARGUMENTS` optional target directory. Defaults to the current working directory.
15
15
 
16
16
  ## Steps to follow:
17
17
 
@@ -1,28 +1,26 @@
1
1
  ---
2
2
  name: blueprint
3
3
  description: Plan complex features by decomposing them into vertical slices (one slice equals one phase) with developer micro-checkpoints between phases, producing an implement-ready phased plan in thoughts/shared/plans/. Use for complex multi-component features touching 6+ files across multiple layers when iterative review between slices is valuable. Requires a research artifact or a solutions artifact (from explore). Prefer blueprint over plan when mid-flight micro-checkpoints matter, and prefer plan when a straightforward phased breakdown is enough.
4
- argument-hint: [research artifact path]
4
+ argument-hint: "[research artifact path]"
5
5
  ---
6
6
 
7
- # Plan
7
+ # Blueprint
8
8
 
9
9
  You are tasked with planning how code will be shaped for a feature or change AND emitting an implement-ready phased plan. Decompose the feature into vertical slices (one slice = one phase), generate code slice-by-slice with developer micro-checkpoints between slices, and write the final artifact directly into `thoughts/shared/plans/` for `/skill:implement` to consume.
10
10
 
11
- **How it works**:
12
- - Read input and key source files into context (Step 1)
13
- - Spawn targeted research agents for depth analysis (Step 2)
14
- - Identify ambiguities — triage into simple decisions and genuine ambiguities (Step 3)
15
- - Holistic self-critique — review the combined design for gaps and contradictions (Step 4)
16
- - Developer checkpoint — resolve genuine ambiguities one at a time (Step 5)
17
- - Decompose into vertical slices holistically before generating code (Step 6)
18
- - Generate code slice-by-slice with developer micro-checkpoints (Step 7)
19
- - Verify cross-slice integration consistency (Step 8 — internal, folded into final 7.3)
20
- - Finalize the design artifact (Step 9)
21
- - Review and iterate with the developer (Step 10)
11
+ ## Input
12
+
13
+ `$ARGUMENTS` path to a research artifact (`thoughts/shared/research/*.md`) or a solutions artifact (`thoughts/shared/solutions/*.md`).
14
+
15
+ ## Flow
16
+
17
+ 1. Input → 2. Research → 3. Dimension sweep → 4. Self-critique → 5. Checkpoint → 6. Decompose 7. Generate slices 8. Integration verify 9. Finalize → 10. Independent review → 11. Triage & iterate → 12. Follow-ups
22
18
 
23
19
  The final artifact is implement-ready.
24
20
 
25
- ## Step 1: Input Handling
21
+ ## Steps
22
+
23
+ ### Step 1: Input Handling
26
24
 
27
25
  When this command is invoked:
28
26
 
@@ -47,7 +45,7 @@ When this command is invoked:
47
45
 
48
46
  2. **Read any additional files mentioned** — tickets, related designs, existing implementations. Read them FULLY before proceeding.
49
47
 
50
- ## Step 2: Targeted Research
48
+ ### Step 2: Targeted Research
51
49
 
52
50
  This is NOT a discovery sweep. Focus on DEPTH (how things work, what patterns to follow) not BREADTH (where things are).
53
51
 
@@ -76,7 +74,7 @@ This is NOT a discovery sweep. Focus on DEPTH (how things work, what patterns to
76
74
  - Note assumptions that need verification
77
75
  - Determine true scope based on codebase reality
78
76
 
79
- ## Step 3: Identify Ambiguities — Dimension Sweep
77
+ ### Step 3: Identify Ambiguities — Dimension Sweep
80
78
 
81
79
  Walk Step 2 findings, inherited research Q/As, and carried Open Questions through six architectural dimensions that map 1:1 to the plan artifact's section coverage — the sweep guarantees downstream completeness. Add **migration** as a seventh dimension only if the feature changes persisted schema.
82
80
 
@@ -91,7 +89,7 @@ For each dimension, classify findings as **simple decisions** (one valid option,
91
89
 
92
90
  **Pre-validate every option** before queuing it against research constraints and runtime code behavior. Eliminate or caveat options that contradict Steps 1-2 evidence. **Coverage check**: every Step 2 file read appears in at least one decision or ambiguity; every dimension is addressed (silently-resolved valid, skipped-unchecked not).
93
91
 
94
- ## Step 4: Holistic Self-Critique
92
+ ### Step 4: Holistic Self-Critique
95
93
 
96
94
  Before presenting ambiguities to the developer, review the combined design picture holistically. Step 3 triages findings individually — this step checks whether they fit together as a coherent whole.
97
95
 
@@ -111,7 +109,7 @@ Before presenting ambiguities to the developer, review the combined design pictu
111
109
  - Issues that need developer input: add as new genuine ambiguities to the Step 5 checkpoint queue.
112
110
  - If no issues found: proceed to Step 5 with the existing ambiguity set.
113
111
 
114
- ## Step 5: Developer Checkpoint
112
+ ### Step 5: Developer Checkpoint
115
113
 
116
114
  Use the grounded-questions-one-at-a-time pattern. Use a **❓ Question:** prefix so the developer knows their input is needed. Each question must:
117
115
  - Reference real findings with `file:line` evidence
@@ -171,7 +169,7 @@ Files: {N} new, {M} modified
171
169
 
172
170
  Use the `ask_user_question` tool to confirm before proceeding. Question: "{Summary from design brief above}. Ready to proceed to decomposition?". Header: "Design". Options: "Proceed (Recommended)" (Decompose into vertical slices, then generate code slice-by-slice); "Adjust decisions" (Revisit one or more architectural decisions above); "Change scope" (Add or remove items from the building/not-building lists).
173
171
 
174
- ## Step 6: Feature Decomposition
172
+ ### Step 6: Feature Decomposition
175
173
 
176
174
  After the design summary is confirmed, decompose the feature into vertical slices. Each slice is a self-contained unit: types + implementation + wiring for one concern.
177
175
 
@@ -237,7 +235,7 @@ After the design summary is confirmed, decompose the feature into vertical slice
237
235
  - **NEW files**: `#### N. path/to/file.ext` + `**File**: path` + `**Changes**: NEW — {purpose}` + empty code fence (filled with full implementation in Step 7.4)
238
236
  - **MODIFY files**: `#### N. path/to/file.ext:line-range` + `**File**: path` + `**Changes**: MODIFY — {summary}` + empty code fence (filled with only the modified code in Step 7.4 — no "Current" block, the original is on disk)
239
237
 
240
- ## Step 7: Generate Slices (Iterative)
238
+ ### Step 7: Generate Slices (Iterative)
241
239
 
242
240
  Generate code one slice at a time. Each slice sees the fixed code from all previous slices.
243
241
 
@@ -245,7 +243,7 @@ Generate code one slice at a time. Each slice sees the fixed code from all previ
245
243
 
246
244
  **For each slice in the decomposition (sequential order):**
247
245
 
248
- ### 7.1. Generate slice code (internal)
246
+ #### 7.1. Generate slice code (internal)
249
247
 
250
248
  Generate complete, copy-pasteable code for every file in this slice — but **hold it for the artifact, do NOT present full code to the developer**. The developer sees a condensed review in 7.3; the full code goes into the artifact in 7.4.
251
249
 
@@ -260,7 +258,7 @@ No pseudocode, no TODOs, no placeholders — the code must be copy-pasteable by
260
258
 
261
259
  **Context grounding** (after slice 2): Before generating, re-read the artifact's prior `## Phase N` sections for files this slice touches (a file may appear in earlier phases; if so, this phase extends or revisits it). The artifact is the source of truth — generate code that extends what's already emitted, not what you remember from conversation.
262
260
 
263
- ### 7.2. Verify slice
261
+ #### 7.2. Verify slice
264
262
 
265
263
  Mandatory for every slice — no skipping, no shortcuts. Dispatch the `slice-verifier` agent with:
266
264
  - `artifact_path`: the Step-6 Write `file_path` (contains the skeleton plus locked prior phases; the current slice's code fence is still empty per 7.1/7.4 timing)
@@ -275,7 +273,7 @@ The agent emits a 3-row summary (`Decisions / Cross-slice / Research`). On any V
275
273
 
276
274
  Never proceed to 7.3 with a VIOLATION absent from the presentation.
277
275
 
278
- ### 7.3. Developer micro-checkpoint
276
+ #### 7.3. Developer micro-checkpoint
279
277
 
280
278
  Present a **condensed review** of the slice — NOT the full generated code. The developer reviews the design shape, not every line. For each file in the slice, show:
281
279
 
@@ -294,7 +292,7 @@ Use the `ask_user_question` tool to confirm. Question: "Slice {N/M}: {slice name
294
292
 
295
293
  **Checkpoint cadence**: One slice per checkpoint. Present each slice individually, regardless of slice count.
296
294
 
297
- ### 7.4. Incorporate feedback
295
+ #### 7.4. Incorporate feedback
298
296
 
299
297
  **Approve**: Lock this slice's code and **Edit the artifact immediately**:
300
298
  1. For each file in this slice, Edit the skeleton artifact to replace the empty code fence under that file's `#### N. path/...` subsection inside this slice's `## Phase N: {slice name}` section with the full generated code from 7.1
@@ -325,7 +323,7 @@ Update decomposition (add/remove/reorder remaining slices) and confirm before co
325
323
 
326
324
  **Revisit a decision**: Re-run Step 5 for the flagged ambiguity (one question). If decomposition is unaffected, update `## Decisions` and resume 7.1. If affected, cascade like Rethink — for each invalidated approved phase, ask reopen vs. annotate Plan History, then update remaining slices. Re-run 7.2 before re-presenting 7.3; artifact untouched until approval.
327
325
 
328
- ## Step 8: Integration Verification (internal)
326
+ ### Step 8: Integration Verification (internal)
329
327
 
330
328
  Runs during the final slice's 7.2 — no separate developer round-trip. Result feeds the final 7.3 question text.
331
329
 
@@ -333,7 +331,7 @@ Runs during the final slice's 7.2 — no separate developer round-trip. Result f
333
331
  2. **Constraint check**: every `## Verification Notes` and Precedent & Lesson entry from research is satisfied somewhere in the generated code.
334
332
  3. **Emit summary** for final 7.3: `OK` or `violations: {brief}`. No `ask_user_question` here — Step 7.3 absorbs the approval.
335
333
 
336
- ## Step 9: Finalize Plan Artifact
334
+ ### Step 9: Finalize Plan Artifact
337
335
 
338
336
  The artifact was created as a skeleton in Step 6 and filled progressively in Step 7.4 (code fences + Success Criteria). This step verifies and flips status.
339
337
 
@@ -353,7 +351,7 @@ The artifact was created as a skeleton in Step 6 and filled progressively in Ste
353
351
  - **NEW files**: `#### N. path/to/file.ext` + `**File**` + `**Changes**: NEW — {purpose}` + full implementation code block
354
352
  - **MODIFY files**: `#### N. path/to/file.ext:line-range` + `**File**` + `**Changes**: MODIFY — {summary}` + code block with only the modified/added code (no "Current" block — the original is on disk, implement reads it)
355
353
 
356
- ## Step 10: Independent Plan Review
354
+ ### Step 10: Independent Plan Review
357
355
 
358
356
  After Step 9 finalizes the artifact, dispatch an independent review subagent
359
357
  to walk every Phase code fence against the live codebase. The subagent runs
@@ -362,7 +360,7 @@ criticism > generation asymmetry plus fresh-context isolation. Inherits the
362
360
  orchestrator's model (no model upgrade required); the value comes from the
363
361
  fresh dispatch, not from a stronger model.
364
362
 
365
- ### 10.1. Dispatch the artifact-reviewer subagent
363
+ #### 10.1. Dispatch the artifact-reviewer subagent
366
364
 
367
365
  Reuse the exact `file_path` string passed to `Write` at Step 6 — the runtime already resolved it for this platform; do not rebuild it from `pwd`. `ls` to verify it still exists; abort dispatch on miss.
368
366
 
@@ -376,7 +374,7 @@ Review the finalized plan against the live codebase at HEAD. Walk every Phase co
376
374
  })
377
375
  ```
378
376
 
379
- ### 10.2. Persist the review table to the artifact
377
+ #### 10.2. Persist the review table to the artifact
380
378
 
381
379
  The agent returns a markdown table with columns `plan-loc | codebase-loc | severity | dimension | finding | recommendation`. Append it to the plan artifact as a new section, with a `resolution` column appended (initially blank, filled progressively at Step 11):
382
380
 
@@ -394,7 +392,7 @@ _Independent post-finalization review by artifact-reviewer subagent. Findings tr
394
392
 
395
393
  If the agent emits zero rows, still emit the section with a single line: `_No findings — artifact-reviewer cleared the artifact._`. Persistence is mandatory regardless of finding count — the section is the durable audit trail.
396
394
 
397
- ### 10.3. Tally findings for Step 11's prompt
395
+ #### 10.3. Tally findings for Step 11's prompt
398
396
 
399
397
  Count rows by severity. Store the counts in main context for Step 11's developer prompt:
400
398
 
@@ -404,7 +402,7 @@ Count rows by severity. Store the counts in main context for Step 11's developer
404
402
 
405
403
  Do NOT auto-apply any finding. The orchestrator never makes the apply / defer / dismiss judgment alone — that lives with the developer at Step 11. The reviewer's role is to surface; the developer's role is to triage.
406
404
 
407
- ### 10.4. Failure handling
405
+ #### 10.4. Failure handling
408
406
 
409
407
  If artifact-reviewer errors out (subprocess crash, malformed output, timeout):
410
408
  - Skip Step 10's findings; do not block on the failure.
@@ -414,7 +412,7 @@ If artifact-reviewer errors out (subprocess crash, malformed output, timeout):
414
412
 
415
413
  The developer review path at Step 11 absorbs the cost — that is how planning worked before this step existed.
416
414
 
417
- ## Step 11: Review & Iterate
415
+ ### Step 11: Review & Iterate
418
416
 
419
417
  1. **Triage artifact-reviewer findings first** (skip if Step 10 returned no findings):
420
418
 
@@ -459,7 +457,7 @@ The developer review path at Step 11 absorbs the cost — that is how planning w
459
457
  > 🆕 Tip: start a fresh session with `/new` first — chained skills work best with a clean context window.
460
458
  ```
461
459
 
462
- ## Step 12: Handle Follow-ups
460
+ ### Step 12: Handle Follow-ups
463
461
 
464
462
  - **Edit in-place.** Use the Edit tool to update the plan artifact directly — phase code stays one source of truth.
465
463
  - **Bump frontmatter.** Update `last_updated` + `last_updated_by`; set `last_updated_note: "Updated <brief description>"`.
@@ -9,9 +9,9 @@ allowed-tools: Bash(git *), Read, Edit
9
9
 
10
10
  You are tasked with regenerating the `## [Unreleased]` section of every affected `CHANGELOG.md` in the repository so it reflects all change since the last release tag — committed and uncommitted alike.
11
11
 
12
- ## Range hint
12
+ ## Input
13
13
 
14
- `$ARGUMENTS` (empty/literal → range starts at the last release tag from `git describe --tags --abbrev=0`)
14
+ `$ARGUMENTS` — optional `--since <ref>` flag. Empty/literal → range starts at the last release tag from `git describe --tags --abbrev=0`.
15
15
 
16
16
  ## Workflow
17
17
 
@@ -30,7 +30,7 @@ You are tasked with regenerating the `## [Unreleased]` section of every affected
30
30
 
31
31
  ## Step 2: Determine the change range
32
32
 
33
- 1. Parse `$ARGUMENTS` for a `--since <ref>` flag. If absent, set `SINCE=$(git describe --tags --abbrev=0)`.
33
+ 1. Parse the input for a `--since <ref>` flag. If absent, set `SINCE=$(git describe --tags --abbrev=0)`.
34
34
  2. The range is `$SINCE..HEAD` for committed changes, plus the current uncommitted+staged working tree.
35
35
 
36
36
  ## Step 3: Determine each CHANGELOG's scope, then collect commits + uncommitted hunks
@@ -6,25 +6,23 @@ argument-hint: "[scope]"
6
6
 
7
7
  # Code Review
8
8
 
9
- Scope: $ARGUMENTS
10
-
11
9
  Review changes across **Quality**, **Security**, **Dependencies** lenses with optional advisor adjudication. Valid scopes: `commit` | `staged` | `working` | hash | `A..B` | PR branch. **Empty scope defaults to feature-branch-vs-default-branch first-parent review** (default branch auto-detected; see Step 1).
12
10
 
13
- **How it works**:
14
- - Step 1 — resolve scope, read diff (with `-U30` context), derive flags, build semantic file map
15
- - Step 2 dispatch Wave-1: integration + precedents + (deps/CVE) + (peer-mirror); integration & peer-mirror gate Wave-2, precedents gates Step 5
16
- - Step 3 — dispatch Wave-2: Quality + Security lenses, file-oriented
17
- - Step 4 — dispatch Wave-3: Predicate-Trace + Interaction Sweep + Gap-Finder, all gated
18
- - Step 5 — reconcile via advisor or inline dimension-sweep (blocks on precedents)
19
- - Step 6 verify findings: re-read each cited file:line; drop/demote unverified
20
- - Step 7 — write artifact
21
- - Steps 8–9 — present and handle follow-ups
11
+ ## Input
12
+
13
+ `$ARGUMENTS` scope: `commit` | `staged` | `working` | a commit hash | `A..B` range | PR branch name. Empty defaults to feature-branch-vs-default-branch (first-parent).
14
+
15
+ ## Flow
16
+
17
+ 1. Input → 2. Wave-1 dispatch 3. Wave-2 dispatch → 4. Wave-3 dispatch 5. Reconcile → 6. Verify → 7. Write artifact → 8. Present → 9. Follow-ups
22
18
 
23
19
  **File-orientation contract**: agents reason about *files* as coherent units. Hunks are evidence *within* a file's analysis, never the unit of analysis. The `-U30` patch (Step 1) inlines function-level context so agents rarely need extra `Read` calls.
24
20
 
25
21
  Every Wave-2 agent prompt contains EXACTLY: (a) `Known Context:` followed by the Discovery Map verbatim, and (b) the literal string `.git/code-review-patch.diff` as the patch path. Nothing else from Wave-1 outputs — NOT the raw integration-scanner dump, NOT precedent-locator output, NOT Dependencies/CVE output. See "Wave-2 context isolation" in Step 3 for the failure mode when this is violated. Wave-1 agents that do not consume the Discovery Map (precedents, dependencies, CVE) get `ChangedFiles` / manifest-diff only.
26
22
 
27
- ## Step 1: Resolve Scope and Assemble the Diff
23
+ ## Steps
24
+
25
+ ### Step 1: Resolve Scope and Assemble the Diff
28
26
 
29
27
  1. **Detect default branch**: `DEFAULT_BRANCH=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@')`. Fallback: probe `main` then `master` (`git rev-parse --verify --quiet <name>`); if neither resolves, ask the user which branch is the integration target before proceeding. Use `$DEFAULT_BRANCH` wherever the parser below says `<default>`.
30
28
 
@@ -67,7 +65,7 @@ Every Wave-2 agent prompt contains EXACTLY: (a) `Known Context:` followed by the
67
65
 
68
66
  Drop a pair only when the peer doesn't exist at HEAD, no heuristic matches, or both files were added in this diff. Empty list ⇒ skip the peer-mirror agent. Co-modified peers are KEPT — the agent Reads them at HEAD (post-diff tree state), so any invariant present at HEAD counts as peer evidence regardless of whether the peer was edited in this diff.
69
67
 
70
- ## Step 2: Dispatch Wave-1 — Integration + Precedents + Deps/CVE + Peer-Mirror
68
+ ### Step 2: Dispatch Wave-1 — Integration + Precedents + Deps/CVE + Peer-Mirror
71
69
 
72
70
  Spawn ALL of the following in parallel at T=0 in a **single message with multiple Agent tool calls**. Do NOT wait for integration-scanner before dispatching precedents / dependencies / CVE — they do not consume Discovery-Map output, only `ChangedFiles` and the manifest diff (both orchestrator-produced in Step 1).
73
71
 
@@ -117,7 +115,7 @@ While these agents run, the orchestrator produces the rest of the Discovery Map
117
115
  **Synthesize the Discovery Map** — a compact block that Wave-2 agents receive verbatim as `Known Context`. Each file line carries a *role tag* and a *symbols-touched hint*; files are clustered by shared directory prefix so agents orient without re-reading the patch.
118
116
 
119
117
  ```
120
- ## Discovery Map
118
+ #### Discovery Map
121
119
 
122
120
  Review type: {ReviewType}
123
121
  Scope: {scope argument}
@@ -150,9 +148,9 @@ Peer mirrors: {peer-mirror agent output verbatim — Missing/Diverged rows only;
150
148
 
151
149
  **Symbols-touched hint**: extract top 1–3 top-level definitions from the diff's `+` lines using a heuristic appropriate to the file's language (class/function/def/fn/struct/trait/interface/type/export). Cap at ~80 chars. Leave blank if ambiguous — orientation, not completeness.
152
150
 
153
- ## Step 3: Dispatch Wave-2 — Quality + Security Lenses
151
+ ### Step 3: Dispatch Wave-2 — Quality + Security Lenses
154
152
 
155
- Spawn Quality + Security in parallel using the Agent tool. Each receives the `## Discovery Map` block inline as `Known Context` above its task, and a pointer to `.git/code-review-patch.diff` for the diff itself. Precedents / Dependencies / CVE are already running from Wave-1 — do NOT re-dispatch them here; the prompts below document what those Wave-1 agents received, they are not re-issued.
153
+ Spawn Quality + Security in parallel using the Agent tool. Each receives the Discovery Map block inline as `Known Context` above its task, and a pointer to `.git/code-review-patch.diff` for the diff itself. Precedents / Dependencies / CVE are already running from Wave-1 — do NOT re-dispatch them here; the prompts below document what those Wave-1 agents received, they are not re-issued.
156
154
 
157
155
  **Wave-2 context isolation (LOAD-BEARING — violations cause silent quality collapse)**: Each Wave-2 agent receives EXACTLY two things, nothing else: (1) the Discovery Map (digested form) and (2) the literal path string `.git/code-review-patch.diff`.
158
156
 
@@ -251,7 +249,7 @@ Spawn Quality + Security in parallel using the Agent tool. Each receives the `##
251
249
 
252
250
  **Wait for Quality + Security to complete** before proceeding. Precedents / Dependencies / CVE from Wave-1 may still be running; gather them before Step 5, not before Step 4.
253
251
 
254
- ## Step 4: Dispatch Wave-3 — Predicate-Trace + Interaction Sweep + Gap-Finder
252
+ ### Step 4: Dispatch Wave-3 — Predicate-Trace + Interaction Sweep + Gap-Finder
255
253
 
256
254
  Once Wave-2 (Quality + Security) completes, dispatch 4a and 4b as parallel agents **in a single message**; compute 4c inline (orchestrator-side set arithmetic — no agent). They do NOT consume each other's output:
257
255
 
@@ -259,7 +257,7 @@ Once Wave-2 (Quality + Security) completes, dispatch 4a and 4b as parallel agent
259
257
  - **Gap-Finder (4c)** is coverage arithmetic: `{in-scope files} − {files with ≥1 Quality/Security finding} = {uncovered files}`. Orchestrator already holds both sets post-Wave-2 — an agent would discard context only to re-receive it via prompt. Inline is strictly cheaper and deterministic.
260
258
  - If Predicate-Trace (4a) surfaces a row that was not visible in Quality's table, append it via a Step 9 follow-up — cheaper than a serial gate.
261
259
 
262
- ### Step 4a: Predicate-Trace
260
+ #### Step 4a: Predicate-Trace
263
261
 
264
262
  **Gate**: SKIP this sub-step (do not dispatch 4a) unless `HasGatingPredicate` is true AND the Quality lens returned ≥2 rows in its `Predicate-set coherence` table referencing the same enum/type. If skipped, 4b and 4c still dispatch.
265
263
 
@@ -279,7 +277,7 @@ Otherwise spawn ONE `codebase-analyzer` in parallel with 4b:
279
277
 
280
278
  Do NOT wait — 4b (Interaction Sweep) dispatches in the same message as 4a; 4c runs inline in the orchestrator.
281
279
 
282
- ### Step 4b: Interaction Sweep
280
+ #### Step 4b: Interaction Sweep
283
281
 
284
282
  **Gate**: SKIP this sub-step (do not dispatch 4b) when EITHER `len(ChangedFiles) < 2` OR the Quality lens returned fewer than 4 total observations across all files. Emergent interactions need surface area; tiny diffs cannot structurally produce them.
285
283
 
@@ -308,7 +306,7 @@ Otherwise spawn ONE `codebase-analyzer` in parallel with 4a:
308
306
  For findings involving ordering/races/concurrency across processes or handlers, name the ordering primitive that would prevent the race (distributed lock, exclusive-key wrapper, ordered partition, transaction, idempotency key, etc.) and explain why it does NOT apply here. Drop the finding if the primitive exists in the diff or nearby and your argument against it is speculative.
309
307
  ```
310
308
 
311
- ### Step 4c: Gap-Finder (orchestrator-side coverage arithmetic)
309
+ #### Step 4c: Gap-Finder (orchestrator-side coverage arithmetic)
312
310
 
313
311
  **Gate**: SKIP when `len(ChangedFiles) < 2`. Tiny diffs cannot structurally have coverage gaps.
314
312
 
@@ -324,7 +322,7 @@ No agent dispatch. Compute inline while 4a / 4b run:
324
322
 
325
323
  **Wait for ALL of 4a / 4b AND the Precedents agent from Wave-1 to complete** before proceeding to Step 5 (Reconciliation). Precedents is a **hard gate** — severity weighting in Step 5 reads its follow-up-within-30-days counts. Dependencies / CVE (when dispatched) also merge in here but are not individually hard-gated; wait for them too unless they clearly exceed the review SLA, in which case omit `## Dependencies` and note it in the artifact. 4c has no wait — it completes synchronously with the orchestrator.
326
324
 
327
- ## Step 5: Reconcile Findings
325
+ ### Step 5: Reconcile Findings
328
326
 
329
327
  **Barrier**: Step 5 MUST NOT begin until the Precedents agent has returned. Severity weighting depends on historical follow-up counts; starting reconciliation without them produces mis-weighted severities that the verification pass (Step 6) cannot correct.
330
328
 
@@ -363,7 +361,7 @@ No agent dispatch. Compute inline while 4a / 4b run:
363
361
  • *{spec A accepts Y} + {spec B rejects Y} + {workflow depends on both}* = **contradictory-predicate deadlock**
364
362
  Also check `thoughts/shared/reviews/*.md` and Precedents: if a prior review names a cascade whose constituents appear in current findings, cite it and assert reproduction. Missed cascades are the biggest historical quality regression; prefer false positives here.
365
363
 
366
- ## Step 6: Verify Findings
364
+ ### Step 6: Verify Findings
367
365
 
368
366
  Before writing the artifact, spawn ONE `claim-verifier` whose sole job is to ground every reconciled finding in the actual code at its cited `file:line`. This catches two classes of error the lenses cannot self-detect: (a) *confident assertions* the agent never opened a file to confirm, and (b) *rationalisations* ("intentional-by-design", "pre-existing", "not a real deadlock") that contradict what the code does. Lens agents reason from the patch; the verifier reasons from the file.
369
367
 
@@ -407,7 +405,7 @@ Before writing the artifact, spawn ONE `claim-verifier` whose sole job is to gro
407
405
 
408
406
  **Do not skip this step** — it is the only mechanism that stops confident-but-unread lens assertions from reaching the artifact.
409
407
 
410
- ## Step 7: Write the Review Document
408
+ ### Step 7: Write the Review Document
411
409
 
412
410
  1. **Determine metadata**:
413
411
  - Filename: `thoughts/shared/reviews/YYYY-MM-DD_HH-MM-SS_{scope-kebab}.md`
@@ -437,7 +435,7 @@ Before writing the artifact, spawn ONE `claim-verifier` whose sole job is to gro
437
435
 
438
436
  **Template shape**: Read the full template at `templates/review.md` (house pattern per `.rpiv/guidance/skills/architecture.md:66` — `templates/` subfolder, runtime-read, never inlined). At emission time: Read `templates/review.md`, fill every `{placeholder}` with reconciled-and-verified values from Steps 5 and 6, apply the section-omission rules above (delete the whole section AND its trailing separator line when its input is empty), strip the leading `<!-- -->` comment, and Write the result to the target path.
439
437
 
440
- ## Step 8: Present Summary
438
+ ### Step 8: Present Summary
441
439
 
442
440
  ```
443
441
  Review written to:
@@ -465,7 +463,7 @@ Ask follow-ups, or chain forward.
465
463
  > 🆕 Tip: start a fresh session with `/new` first — chained skills work best with a clean context window.
466
464
  ```
467
465
 
468
- ## Step 9: Handle Follow-ups
466
+ ### Step 9: Handle Follow-ups
469
467
 
470
468
  - **Append, never rewrite.** Edit the artifact to add a `## Follow-up {ISO 8601 timestamp}` section. The section heading's timestamp is the append-time record — no frontmatter update needed.
471
469
  - **Re-dispatch narrowly.** Spawn a single targeted `codebase-analyzer` on the area in question (1 agent max).
@@ -9,9 +9,9 @@ allowed-tools: Bash(git *), Read, Glob, Grep
9
9
 
10
10
  You are tasked with creating git commits for repository changes.
11
11
 
12
- ## Commit hint
12
+ ## Input
13
13
 
14
- `$ARGUMENTS` (empty/literal → infer from history and `git diff`)
14
+ `$ARGUMENTS` — optional commit message hint. Empty/literal → infer from history and `git diff`.
15
15
 
16
16
  ## Context:
17
17
  - **In-session**: If there's conversation history, use it to understand what was built/changed
@@ -10,6 +10,9 @@ disable-model-invocation: true
10
10
 
11
11
  You are tasked with writing a handoff document to hand off your work to another agent in a new session. You will create a handoff document that is thorough, but also **concise**. The goal is to compact and summarize your context without losing any of the key details of what you're working on.
12
12
 
13
+ ## Input
14
+
15
+ `$ARGUMENTS` — optional description (used in the handoff filename slug).
13
16
 
14
17
  ## Process
15
18
  ### 1. Filepath & Metadata