@juicesharp/rpiv-pi 1.1.4 → 1.1.5
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 +43 -43
- package/agents/codebase-locator.md +1 -1
- package/agents/diff-auditor.md +1 -1
- package/agents/integration-scanner.md +1 -1
- package/agents/precedent-locator.md +1 -1
- package/agents/test-case-locator.md +1 -1
- package/extensions/rpiv-core/guidance.test.ts +5 -1
- package/extensions/rpiv-core/guidance.ts +33 -8
- package/extensions/rpiv-core/session-hooks.test.ts +19 -0
- package/package.json +2 -2
- package/skills/annotate-guidance/SKILL.md +1 -1
- package/skills/annotate-inline/SKILL.md +1 -1
- package/skills/blueprint/SKILL.md +1 -1
- package/skills/code-review/SKILL.md +1 -1
- package/skills/commit/SKILL.md +1 -1
- package/skills/create-handoff/SKILL.md +1 -1
- package/skills/design/SKILL.md +1 -1
- package/skills/discover/SKILL.md +1 -1
- package/skills/explore/SKILL.md +1 -1
- package/skills/implement/SKILL.md +1 -1
- package/skills/migrate-to-guidance/SKILL.md +1 -1
- package/skills/outline-test-cases/SKILL.md +1 -1
- package/skills/plan/SKILL.md +1 -1
- package/skills/research/SKILL.md +1 -1
- package/skills/resume-handoff/SKILL.md +1 -1
- package/skills/revise/SKILL.md +1 -1
- package/skills/validate/SKILL.md +1 -1
- package/skills/write-test-cases/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -11,31 +11,31 @@
|
|
|
11
11
|
[](https://www.npmjs.com/package/@juicesharp/rpiv-pi)
|
|
12
12
|
[](https://opensource.org/licenses/MIT)
|
|
13
13
|
|
|
14
|
-
> **Pi compatibility**
|
|
14
|
+
> **Pi compatibility** - `rpiv-pi` `0.14.x` tracks `@mariozechner/pi-coding-agent` `0.70.x` and `@tintinweb/pi-subagents` `0.6.x`. If you see peer-dep resolution issues after a Pi upgrade, open an issue.
|
|
15
15
|
|
|
16
|
-
> **⚠️ Upgrading from `0.13.x`**
|
|
16
|
+
> **⚠️ Upgrading from `0.13.x`** - `1.0.0` swaps the subagent provider from `npm:pi-subagents` (nicobailon fork) back to `npm:@tintinweb/pi-subagents` (resumed maintenance). On first launch after upgrade you'll see *"rpiv-pi requires 1 sibling extension(s): @tintinweb/pi-subagents"* - **run `/rpiv-setup` once and restart Pi**. The setup dialog previews both changes (install `@tintinweb/pi-subagents`, remove `npm:pi-subagents` from `~/.pi/agent/settings.json`) and applies them only after you confirm. After restart, run `/rpiv-update-agents` to refresh the 12 bundled specialist frontmatters. Customised `<cwd>/.pi/agents/*.md` files are not touched. The tool name reverts from `subagent` → `Agent` (param `subagent_type`/`description`/`prompt`) - only your own custom skills/agents need editing; the bundled rpiv-pi specialists are migrated in this release.
|
|
17
17
|
|
|
18
|
-
Skill-based development workflow for [Pi Agent](https://github.com/badlogic/pi-mono)
|
|
18
|
+
Skill-based development workflow for [Pi Agent](https://github.com/badlogic/pi-mono) - discover, research, design, plan, implement, and validate. rpiv-pi extends Pi Agent with a pipeline of chained AI skills, named subagents for parallel analysis, and session lifecycle hooks for automatic context injection.
|
|
19
19
|
|
|
20
20
|
## What you get
|
|
21
21
|
|
|
22
|
-
- **A pipeline of chained AI skills**
|
|
23
|
-
- **Named subagents for parallel analysis**
|
|
24
|
-
- **Session lifecycle hooks**
|
|
22
|
+
- **A pipeline of chained AI skills** - discover → research → design → plan → implement → validate, each producing a reviewable artifact under `thoughts/shared/`.
|
|
23
|
+
- **Named subagents for parallel analysis** - `codebase-analyzer`, `codebase-locator`, `codebase-pattern-finder`, `claim-verifier`, and 8 more, dispatched automatically by skills.
|
|
24
|
+
- **Session lifecycle hooks** - agent profiles, guidance files, and pipeline directories scaffold themselves on first launch.
|
|
25
25
|
|
|
26
26
|
## Prerequisites
|
|
27
27
|
|
|
28
|
-
- **Node.js**
|
|
29
|
-
- **[Pi Agent](https://github.com/badlogic/pi-mono)**
|
|
28
|
+
- **Node.js** - required by Pi Agent
|
|
29
|
+
- **[Pi Agent](https://github.com/badlogic/pi-mono)** - install globally so the `pi` command is available:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm install -g @mariozechner/pi-coding-agent
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
- **Model provider** *(first-time Pi Agent users only
|
|
35
|
+
- **Model provider** *(first-time Pi Agent users only - skip if `/login` already works or `~/.pi/agent/models.json` is configured)*. Pick one:
|
|
36
36
|
|
|
37
|
-
- **Subscription login**
|
|
38
|
-
- **BYOK (API key)**
|
|
37
|
+
- **Subscription login** - start Pi Agent and run `/login` to authenticate with Anthropic Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, or Gemini.
|
|
38
|
+
- **BYOK (API key)** - edit `~/.pi/agent/models.json` and add a provider entry with `baseUrl`, `api`, `apiKey`, and `models[]`. Example (z.ai GLM coding plan):
|
|
39
39
|
|
|
40
40
|
```json
|
|
41
41
|
{
|
|
@@ -64,7 +64,7 @@ Skill-based development workflow for [Pi Agent](https://github.com/badlogic/pi-m
|
|
|
64
64
|
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
- **git** *(recommended)*
|
|
67
|
+
- **git** *(recommended)* - rpiv-pi works without it, but branch and commit context won't be available to skills.
|
|
68
68
|
|
|
69
69
|
## Quick Start
|
|
70
70
|
|
|
@@ -114,18 +114,18 @@ Each skill produces an artifact consumed by the next. Run them in order, or jump
|
|
|
114
114
|
|
|
115
115
|
Skills compose. Pick the entry point that matches your intent:
|
|
116
116
|
|
|
117
|
-
- **Form context before a task**
|
|
118
|
-
- **Compare approaches before designing**
|
|
119
|
-
- **One-shot plan from research**
|
|
120
|
-
- **Full feature build**
|
|
121
|
-
- **Investigate a bug**
|
|
122
|
-
- **Adjust mid-implementation**
|
|
123
|
-
- **Review before shipping**
|
|
124
|
-
- **Audit a specific scope**
|
|
125
|
-
- **Review-driven plan revision**
|
|
126
|
-
- **Scaffold manual UI test specs**
|
|
127
|
-
- **Hand off across sessions**
|
|
128
|
-
- **Onboard a fresh repo**
|
|
117
|
+
- **Form context before a task** - `/skill:discover "[topic]"` → `/skill:research <questions artifact>`. Produces a high-signal subspace of the codebase relevant to your topic, ready to feed directly into the next prompt.
|
|
118
|
+
- **Compare approaches before designing** - `/skill:explore "[problem]"` → `/skill:design <solutions artifact>`. Use when multiple valid solutions exist; the solutions artifact is a first-class input to `design` alongside a `research` artifact.
|
|
119
|
+
- **One-shot plan from research** - `/skill:research <questions>` → `/skill:blueprint <research artifact>` → `/skill:implement`. Fuses `design` + `plan` into a single pass with the same slice-by-slice rigor, but spawns only `codebase-pattern-finder` upfront (vs `design`'s 4-agent fan-out) by trusting the research artifact's integration/precedent sections. Use for solo work or when no one else needs to review the design before implementation; pick `design` → `plan` when the design is itself a deliverable or when research is thin and you want the fuller verification sweep.
|
|
120
|
+
- **Full feature build** - `/skill:discover` → `research` → `design` → `plan` → `implement` → `validate` → (`code-review` ↔ `commit`). The default pipeline; jump in at any stage if you already have the input artifact. Review and commit are interchangeable in order - review `staged`/`working` before committing, or commit first and review the resulting branch (empty scope, first-parent vs default).
|
|
121
|
+
- **Investigate a bug** - `/skill:discover "why does X fail"` → `/skill:research <questions artifact>`. Fix from the research output without writing a plan when the change is small.
|
|
122
|
+
- **Adjust mid-implementation** - `/skill:revise <plan artifact>` → resume `/skill:implement`. Use when new constraints land after the plan is drafted.
|
|
123
|
+
- **Review before shipping** - `/skill:code-review` ↔ `/skill:commit`. Order is your call: review `staged`/`working` before committing to catch issues at the smallest blast radius, or commit first and review the resulting branch (empty scope defaults to feature-branch-vs-default-branch, first-parent). Produces a Quality/Security/Dependencies artifact under `thoughts/shared/reviews/` with claim-verifier-grounded findings and `status: approved | needs_changes`.
|
|
124
|
+
- **Audit a specific scope** - `/skill:code-review <commit|staged|working|hash|A..B|branch>`. Targeted lenses over a commit, range, staged/working tree, or PR branch; advisor adjudication applies when configured (`/advisor`).
|
|
125
|
+
- **Review-driven plan revision** - `/skill:code-review` → `/skill:revise <plan artifact>` → resume `/skill:implement`. When a mid-stream review surfaces structural findings that the existing plan can't absorb as spot fixes.
|
|
126
|
+
- **Scaffold manual UI test specs** - `/skill:outline-test-cases` → `/skill:write-test-cases <feature>`. Outline first via Frontend-First Discovery to map project scope and avoid duplicate coverage, then generate flow-based manual test cases (with a regression suite) under `.rpiv/test-cases/<feature>/`.
|
|
127
|
+
- **Hand off across sessions** - `/skill:create-handoff` → (new session) `/skill:resume-handoff <doc>`. Preserves context when stopping mid-task.
|
|
128
|
+
- **Onboard a fresh repo** - `/skill:annotate-guidance` once, then use the rest of the pipeline normally. Use `annotate-inline` instead if the project follows the `CLAUDE.md` convention.
|
|
129
129
|
|
|
130
130
|
### Skills
|
|
131
131
|
|
|
@@ -135,9 +135,9 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
|
|
|
135
135
|
|
|
136
136
|
| Skill | Input | Output | Description |
|
|
137
137
|
|---|---|---|---|
|
|
138
|
-
| `discover` |
|
|
138
|
+
| `discover` | - | `thoughts/shared/questions/` | Generate research questions from codebase discovery |
|
|
139
139
|
| `research` | Questions artifact | `thoughts/shared/research/` | Answer questions via parallel analysis agents |
|
|
140
|
-
| `explore` |
|
|
140
|
+
| `explore` | - | `thoughts/shared/solutions/` | Compare solution approaches with pros/cons |
|
|
141
141
|
| `design` | Research or solutions artifact | `thoughts/shared/designs/` | Design features via vertical-slice decomposition |
|
|
142
142
|
|
|
143
143
|
#### Implementation
|
|
@@ -145,7 +145,7 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
|
|
|
145
145
|
| Skill | Input | Output | Description |
|
|
146
146
|
|---|---|---|---|
|
|
147
147
|
| `plan` | Design artifact | `thoughts/shared/plans/` | Create phased implementation plans |
|
|
148
|
-
| `blueprint` | Research or solutions artifact | `thoughts/shared/plans/` | Fused `design` + `plan`: vertical-slice decomposition with micro-checkpoints, emits implement-ready phased plan in one pass. Lighter on subagent fan-out than `design`
|
|
148
|
+
| `blueprint` | Research or solutions artifact | `thoughts/shared/plans/` | Fused `design` + `plan`: vertical-slice decomposition with micro-checkpoints, emits implement-ready phased plan in one pass. Lighter on subagent fan-out than `design` - trusts the research artifact's integration/precedent sections instead of re-dispatching. Use when a separate design artifact isn't needed for review or handoff |
|
|
149
149
|
| `implement` | Plan artifact | Code changes | Execute plans phase by phase |
|
|
150
150
|
| `revise` | Plan artifact | Updated plan | Revise plans based on feedback |
|
|
151
151
|
| `validate` | Plan artifact | Validation report | Verify plan execution |
|
|
@@ -154,15 +154,15 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
|
|
|
154
154
|
|
|
155
155
|
| Skill | Input | Output | Description |
|
|
156
156
|
|---|---|---|---|
|
|
157
|
-
| `outline-test-cases` |
|
|
157
|
+
| `outline-test-cases` | - | `.rpiv/test-cases/` | Discover testable features with per-feature metadata |
|
|
158
158
|
| `write-test-cases` | Outline metadata | Test case specs | Generate manual test specifications |
|
|
159
159
|
|
|
160
160
|
#### Annotation
|
|
161
161
|
|
|
162
162
|
| Skill | Input | Output | Description |
|
|
163
163
|
|---|---|---|---|
|
|
164
|
-
| `annotate-guidance` |
|
|
165
|
-
| `annotate-inline` |
|
|
164
|
+
| `annotate-guidance` | - | `.rpiv/guidance/*.md` | Generate architecture guidance files |
|
|
165
|
+
| `annotate-inline` | - | `CLAUDE.md` files | Generate inline documentation |
|
|
166
166
|
| `migrate-to-guidance` | CLAUDE.md files | `.rpiv/guidance/` | Convert inline docs to guidance format |
|
|
167
167
|
|
|
168
168
|
#### Utilities
|
|
@@ -188,7 +188,7 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
|
|
|
188
188
|
|
|
189
189
|
### Agents
|
|
190
190
|
|
|
191
|
-
Agents are dispatched automatically by skills via the `Agent` tool
|
|
191
|
+
Agents are dispatched automatically by skills via the `Agent` tool - you don't invoke them directly.
|
|
192
192
|
|
|
193
193
|
| Agent | Purpose |
|
|
194
194
|
|---|---|
|
|
@@ -199,7 +199,7 @@ Agents are dispatched automatically by skills via the `Agent` tool — you don't
|
|
|
199
199
|
| `diff-auditor` | Walks a patch against a caller-supplied surface-list and emits `file:line \| verbatim \| surface-id \| note` rows |
|
|
200
200
|
| `integration-scanner` | Maps inbound references, outbound dependencies, config registrations, and event subscriptions for a component |
|
|
201
201
|
| `peer-comparator` | Compares a new file against a peer sibling and tags each invariant Mirrored / Missing / Diverged / Intentionally-absent |
|
|
202
|
-
| `precedent-locator` | Finds similar past changes in git history
|
|
202
|
+
| `precedent-locator` | Finds similar past changes in git history - commits, blast radius, and follow-up fixes |
|
|
203
203
|
| `test-case-locator` | Catalogs existing manual test cases under `.rpiv/test-cases/` and reports coverage stats |
|
|
204
204
|
| `thoughts-analyzer` | Performs deep-dive analysis on a research topic in `thoughts/` |
|
|
205
205
|
| `thoughts-locator` | Discovers relevant documents in the `thoughts/` directory |
|
|
@@ -209,27 +209,27 @@ Agents are dispatched automatically by skills via the `Agent` tool — you don't
|
|
|
209
209
|
|
|
210
210
|
```
|
|
211
211
|
rpiv-pi/
|
|
212
|
-
├── extensions/rpiv-core/
|
|
213
|
-
├── skills/
|
|
214
|
-
├── agents/
|
|
215
|
-
└── thoughts/shared/
|
|
212
|
+
├── extensions/rpiv-core/ - runtime extension: hooks, commands, guidance injection
|
|
213
|
+
├── skills/ - AI workflow skills (research → design → plan → implement)
|
|
214
|
+
├── agents/ - named subagent profiles dispatched by skills
|
|
215
|
+
└── thoughts/shared/ - pipeline artifact store
|
|
216
216
|
```
|
|
217
217
|
|
|
218
218
|
Pi Agent discovers extensions via `"extensions": ["./extensions"]` and skills via `"skills": ["./skills"]` in `package.json`.
|
|
219
219
|
|
|
220
220
|
## Configuration
|
|
221
221
|
|
|
222
|
-
- **Web search**
|
|
223
|
-
- **Advisor**
|
|
224
|
-
- **Side questions**
|
|
225
|
-
- **UI language**
|
|
226
|
-
- **Agent concurrency**
|
|
227
|
-
- **Agent profiles**
|
|
222
|
+
- **Web search** - run `/web-search-config` to set the Brave Search API key, or set the `BRAVE_SEARCH_API_KEY` environment variable
|
|
223
|
+
- **Advisor** - run `/advisor` to select a reviewer model and reasoning effort
|
|
224
|
+
- **Side questions** - 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
|
|
225
|
+
- **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
|
|
226
|
+
- **Agent concurrency** - open the `/agents` overlay and tune `Settings → Max concurrency` to match your provider's rate limits. `@tintinweb/pi-subagents` owns this setting; rpiv-pi does not seed it.
|
|
227
|
+
- **Agent profiles** - editable at `<cwd>/.pi/agents/`; sync from bundled defaults with `/rpiv-update-agents` (overwrites rpiv-managed files, preserves your custom agents)
|
|
228
228
|
|
|
229
229
|
## Uninstall
|
|
230
230
|
|
|
231
231
|
1. Remove rpiv-pi from Pi: `pi uninstall npm:@juicesharp/rpiv-pi`
|
|
232
|
-
2. Optional
|
|
232
|
+
2. Optional - uninstall the subagent runtime if no other plugin needs it: `pi uninstall npm:@tintinweb/pi-subagents`
|
|
233
233
|
3. Restart Pi.
|
|
234
234
|
|
|
235
235
|
## Troubleshooting
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: codebase-locator
|
|
3
|
-
description: Locates files, directories, and components relevant to a feature or task. Call `codebase-locator` with human
|
|
3
|
+
description: Locates files, directories, and components relevant to a feature or task. Call `codebase-locator` with a human-language prompt describing what you're looking for. A "super grep/find/ls" tool. Reach for it when you would otherwise reach for grep, find, or ls more than once.
|
|
4
4
|
tools: grep, find, ls
|
|
5
5
|
isolated: true
|
|
6
6
|
---
|
package/agents/diff-auditor.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: diff-auditor
|
|
3
|
-
description: "Row-only patch auditor. Walks a patch against a caller-supplied surface-list and emits one pipe-delimited row per finding
|
|
3
|
+
description: "Row-only patch auditor. Walks a patch against a caller-supplied surface-list and emits one pipe-delimited row per finding (`file:line | verbatim | surface-id | note`). Use whenever a diff needs evidence-only enumeration of matching patterns, with no narrative or severity."
|
|
4
4
|
tools: read, grep, find, ls
|
|
5
5
|
isolated: true
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: integration-scanner
|
|
3
|
-
description: Finds what connects to a given component or area
|
|
3
|
+
description: "Finds what connects to a given component or area: inbound references, outbound dependencies, config registrations, event subscriptions. The reverse-reference counterpart to codebase-locator. Use when you need to understand what calls, depends on, or wires into a component."
|
|
4
4
|
tools: grep, find, ls
|
|
5
5
|
isolated: true
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: precedent-locator
|
|
3
|
-
description: Finds similar past changes in git history
|
|
3
|
+
description: "Finds similar past changes in git history: commits, blast radius, follow-up fixes, and lessons from related thoughts/ docs. Use when planning a change and you need to know what went wrong last time something similar was done."
|
|
4
4
|
tools: bash, grep, find, read, ls
|
|
5
5
|
isolated: true
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-case-locator
|
|
3
|
-
description: Finds existing manual test cases in .rpiv/test-cases
|
|
3
|
+
description: "Finds existing manual test cases in .rpiv/test-cases/. Catalogs them by module, extracts frontmatter metadata (id, priority, status, tags), and reports coverage stats. Use before generating new test cases to avoid duplicates, or to audit what test coverage already exists in a project."
|
|
4
4
|
tools: grep, find, ls
|
|
5
5
|
isolated: true
|
|
6
6
|
---
|
|
@@ -63,7 +63,10 @@ describe("injectRootGuidance", () => {
|
|
|
63
63
|
const { pi } = createMockPi();
|
|
64
64
|
injectRootGuidance(projectDir, pi);
|
|
65
65
|
expect(pi.sendMessage).toHaveBeenCalledTimes(1);
|
|
66
|
-
|
|
66
|
+
const content = (pi.sendMessage as ReturnType<typeof vi.fn>).mock.calls[0][0].content;
|
|
67
|
+
expect(content).toContain("body");
|
|
68
|
+
expect(content).toContain("reference material, NOT a task");
|
|
69
|
+
expect(content).toContain("auto-loaded at session start");
|
|
67
70
|
});
|
|
68
71
|
|
|
69
72
|
it("is idempotent across calls within a session", () => {
|
|
@@ -132,5 +135,6 @@ describe("handleToolCallGuidance", () => {
|
|
|
132
135
|
const content = (pi.sendMessage as ReturnType<typeof vi.fn>).mock.calls[0][0].content;
|
|
133
136
|
expect(content).toContain("root");
|
|
134
137
|
expect(content).toContain("src");
|
|
138
|
+
expect(content).toContain("auto-loaded because write touched src/x.ts");
|
|
135
139
|
});
|
|
136
140
|
});
|
|
@@ -139,15 +139,10 @@ export function injectRootGuidance(cwd: string, pi: ExtensionAPI): void {
|
|
|
139
139
|
}
|
|
140
140
|
injectedGuidance.add(relativePath);
|
|
141
141
|
|
|
142
|
-
const
|
|
143
|
-
relativePath,
|
|
144
|
-
absolutePath,
|
|
145
|
-
content,
|
|
146
|
-
kind: "architecture",
|
|
147
|
-
});
|
|
142
|
+
const file: GuidanceFile = { relativePath, absolutePath, content, kind: "architecture" };
|
|
148
143
|
pi.sendMessage({
|
|
149
144
|
customType: MSG_TYPE_GUIDANCE,
|
|
150
|
-
content:
|
|
145
|
+
content: wrapGuidance(formatLabel(file), content, "auto-loaded at session start"),
|
|
151
146
|
display: !!pi.getFlag(FLAG_DEBUG),
|
|
152
147
|
});
|
|
153
148
|
}
|
|
@@ -181,7 +176,8 @@ export function handleToolCallGuidance(
|
|
|
181
176
|
injectedGuidance.add(g.relativePath);
|
|
182
177
|
}
|
|
183
178
|
|
|
184
|
-
const
|
|
179
|
+
const trigger = `auto-loaded because ${event.toolName} touched ${shortenPath(filePath, ctx.cwd)}`;
|
|
180
|
+
const contextParts = newFiles.map((g) => wrapGuidance(formatLabel(g), g.content, trigger));
|
|
185
181
|
|
|
186
182
|
pi.sendMessage({
|
|
187
183
|
customType: MSG_TYPE_GUIDANCE,
|
|
@@ -190,6 +186,35 @@ export function handleToolCallGuidance(
|
|
|
190
186
|
});
|
|
191
187
|
}
|
|
192
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Wrap guidance content in a non-task envelope. The opening disclaimer tells
|
|
191
|
+
* the agent this block is reference material — not an instruction — and states
|
|
192
|
+
* the trigger so the agent can judge whether the block is relevant to the
|
|
193
|
+
* current user request. Heading is `## Architecture Guidance:` to match the
|
|
194
|
+
* `PreToolUse:Read` hook output and the actual content (architecture.md).
|
|
195
|
+
*/
|
|
196
|
+
function wrapGuidance(label: string, content: string, trigger: string): string {
|
|
197
|
+
return [
|
|
198
|
+
`[rpiv-guidance — reference material, NOT a task. ${trigger}.`,
|
|
199
|
+
`Consult only if directly relevant to the user's current request; otherwise ignore.]`,
|
|
200
|
+
"",
|
|
201
|
+
`## Architecture Guidance: ${label}`,
|
|
202
|
+
"",
|
|
203
|
+
content,
|
|
204
|
+
].join("\n");
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Render a project-relative, forward-slash-normalized path for the trigger
|
|
209
|
+
* disclaimer. Falls back to the absolute path if the file lives outside the
|
|
210
|
+
* project root (defensive — `handleToolCallGuidance` already short-circuits
|
|
211
|
+
* via `resolveGuidance` in that case, so this branch is unreachable today).
|
|
212
|
+
*/
|
|
213
|
+
function shortenPath(filePath: string, cwd: string): string {
|
|
214
|
+
const r = relative(cwd, filePath);
|
|
215
|
+
return r && !r.startsWith("..") ? r.split(sep).join("/") : filePath;
|
|
216
|
+
}
|
|
217
|
+
|
|
193
218
|
/**
|
|
194
219
|
* Format a guidance file's heading label.
|
|
195
220
|
* extensions/rpiv-core/AGENTS.md → "extensions/rpiv-core (AGENTS.md)"
|
|
@@ -142,6 +142,25 @@ describe("session_start hook — notifications", () => {
|
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
+
describe("session_compact hook", () => {
|
|
146
|
+
it("re-injects guidance + git-context after compaction (clears caches first)", async () => {
|
|
147
|
+
const exec = stubGitExec({ branch: "main", commit: "abc", user: "alice" });
|
|
148
|
+
const { pi, captured } = createMockPi({ exec: exec as never });
|
|
149
|
+
registerSessionHooks(pi);
|
|
150
|
+
// Prime the git-context cache first via session_start so compact's clear has work to do.
|
|
151
|
+
await captured.events.get("session_start")?.[0](
|
|
152
|
+
{ reason: "startup" } as never,
|
|
153
|
+
createMockCtx({ cwd: projectDir, hasUI: false }) as never,
|
|
154
|
+
);
|
|
155
|
+
const sendBefore = (pi.sendMessage as ReturnType<typeof vi.fn>).mock.calls.length;
|
|
156
|
+
await captured.events.get("session_compact")?.[0]({} as never, createMockCtx({ cwd: projectDir }) as never);
|
|
157
|
+
// After compact, the next pi.sendMessage call (from injectGitContext) should fire because
|
|
158
|
+
// resetInjectedMarker + clearGitContextCache make takeGitContextIfChanged re-emit.
|
|
159
|
+
const sendAfter = (pi.sendMessage as ReturnType<typeof vi.fn>).mock.calls.length;
|
|
160
|
+
expect(sendAfter).toBeGreaterThan(sendBefore);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
145
164
|
describe("session_shutdown hook", () => {
|
|
146
165
|
it("clears git-context cache and allows takeGitContextIfChanged to re-emit", async () => {
|
|
147
166
|
const exec = stubGitExec({ branch: "main", commit: "abc", user: "alice" });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-pi",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "A skill-based development workflow for Pi Agent. Six skills (discover, research, design, plan, implement, validate) and the shared subagents that compose its ship-loop.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
7
7
|
"pi-extension",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: annotate-guidance
|
|
3
|
-
description: Generate architecture.md guidance files
|
|
3
|
+
description: Generate architecture.md guidance files under .rpiv/guidance/ that document a project's architecture and patterns for AI assistants, written to a shadow tree alongside the source. Use when the user wants to onboard Claude, Cursor, or an AI agent to a codebase via the guidance system, document architecture, or asks to "annotate guidance". Prefer this over annotate-inline when the project uses the .rpiv/guidance/ shadow tree instead of inline CLAUDE.md files.
|
|
4
4
|
argument-hint: [target-directory]
|
|
5
5
|
allowed-tools: Agent, Read, Write, Glob, Grep
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: annotate-inline
|
|
3
|
-
description: Generate CLAUDE.md files across a project
|
|
3
|
+
description: Generate CLAUDE.md files placed inline next to source code across a project, documenting architecture and patterns for AI assistants. Use when the user wants to onboard Claude to a codebase via inline CLAUDE.md files, generate per-directory guidance, document architecture in-place, or asks to "annotate inline". Prefer this over annotate-guidance when CLAUDE.md should live alongside the code rather than in a shadow tree.
|
|
4
4
|
argument-hint: [target-directory]
|
|
5
5
|
allowed-tools: Agent, Read, Write, Glob, Grep
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: blueprint
|
|
3
|
-
description: Plan features
|
|
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 (from discover then research) 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
4
|
argument-hint: [research artifact path]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-review
|
|
3
|
-
description: "Conduct comprehensive code reviews using specialist
|
|
3
|
+
description: "Conduct comprehensive code reviews of pending changes, a branch, or a PR using parallel specialist agents that audit the diff, compare against peer code, and verify claims. Use when the user asks to 'review this', wants pending changes, a PR, a branch, or a diff reviewed, or asks for a code review. Produces review documents in thoughts/shared/reviews/. Internal mechanics like row-only agent contracts and Gap-Finder set arithmetic are documented in the skill body."
|
|
4
4
|
argument-hint: "[scope]"
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/commit/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
|
-
description: Create structured git commits
|
|
3
|
+
description: Create structured git commits by analyzing staged and unstaged changes and grouping them logically into one or more commits with clear, descriptive messages. Use when the user asks to commit, says "commit this" or "commit my changes", wants help writing a commit message, or has finished a chunk of work that needs committing.
|
|
4
4
|
argument-hint: [message]
|
|
5
5
|
allowed-tools: Bash(git *), Read, Glob, Grep
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-handoff
|
|
3
|
-
description: Create context-preserving handoff
|
|
3
|
+
description: Create a context-preserving handoff document for session transitions, compacting the current task, decisions made, in-flight changes, and open questions into a single concise file so a fresh session can pick up where this one left off. Use when the user invokes /create-handoff, says context is getting large, asks to wrap up the session, or wants to hand off work to another session.
|
|
4
4
|
argument-hint: [description]
|
|
5
5
|
allowed-tools: Read, Write, Bash(git *), Glob, Grep
|
|
6
6
|
disable-model-invocation: true
|
package/skills/design/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design
|
|
3
|
-
description: Design features
|
|
3
|
+
description: Design complex features by decomposing them into vertical slices and producing a design artifact (architecture decisions, slice breakdown, file map) in thoughts/shared/designs/. The design feeds the plan or blueprint skill. Use for complex multi-component features touching 6+ files across multiple layers, when the user wants a feature designed before implementation. Requires a research artifact (from discover then research) or a solutions artifact (from explore). Prefer design over plan or blueprint when the focus is architecture and decomposition rather than phased execution steps.
|
|
4
4
|
argument-hint: [research artifact path]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/discover/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discover
|
|
3
|
-
description: Generate
|
|
3
|
+
description: Generate structured research questions for a feature or change area by exploring the codebase in parallel and reading key files for depth, then synthesizing dense question paragraphs for the research skill to consume. First stage of the two-phase research pipeline. Use when the user wants to deeply understand a codebase area before changes, asks to "discover" or "explore questions", or needs research questions formulated for a ticket or task. Produces question artifacts in thoughts/shared/questions/.
|
|
4
4
|
argument-hint: [research question or task/ticket description]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/explore/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: explore
|
|
3
|
-
description: Analyze solution options for
|
|
3
|
+
description: Analyze solution options for a feature or change, comparing approaches with pros, cons, trade-offs, and a recommended path. Use when the user is weighing approaches, asks "what are the options" or "how should we approach X", wants approaches compared, says "explore solutions", or faces a decision with multiple valid implementations. Produces solutions documents in thoughts/shared/solutions/, which can feed the design skill.
|
|
4
4
|
argument-hint: [feature/change description]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement
|
|
3
|
-
description: Execute approved implementation plans phase by phase
|
|
3
|
+
description: Execute an approved implementation plan from thoughts/shared/plans/ phase by phase, applying changes and verifying each phase against its success criteria before moving on. Use when the user invokes /implement, asks to "implement this plan", or wants an existing phased plan executed. Pair with revise to update plans mid-flight and validate to confirm completion.
|
|
4
4
|
argument-hint: "[plan-path] [Phase N]"
|
|
5
5
|
allowed-tools: Read, Edit, Write, Bash(*), Glob, Grep
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: migrate-to-guidance
|
|
3
|
-
description: Migrate
|
|
3
|
+
description: Migrate a project's inline CLAUDE.md files to the .rpiv/guidance/ shadow-tree system. Finds every CLAUDE.md, transforms internal references, and creates equivalent architecture.md files under .rpiv/guidance/. Use when the user wants to move from inline CLAUDE.md to the guidance shadow tree, consolidate scattered CLAUDE.md files into one place, or invokes /migrate-to-guidance.
|
|
4
4
|
argument-hint: [--delete-originals]
|
|
5
5
|
allowed-tools: Bash, Read, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: outline-test-cases
|
|
3
|
-
description: Discover testable features
|
|
3
|
+
description: Discover testable features in a project (frontend-first) and create a folder outline under .rpiv/test-cases/ with per-feature metadata. Incremental runs reuse the existing outline for smarter discovery and diff-based checkpoints. Use before write-test-cases to map project scope, when the user wants to plan or inventory test coverage, asks to "outline test cases", or wants a test-case scaffold generated for a project.
|
|
4
4
|
argument-hint: [target-directory]
|
|
5
5
|
allowed-tools: Agent, Read, Write, Edit, Glob, Grep
|
|
6
6
|
---
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
|
-
description:
|
|
3
|
+
description: Convert a design artifact into a phased implementation plan with parallelized atomic phases and explicit success criteria, written to thoughts/shared/plans/. Use after the design skill when the user wants a design turned into an actionable, phase-by-phase plan to hand to the implement skill. Prefer plan when a straightforward phased breakdown is sufficient, and prefer blueprint when iterative vertical-slice micro-checkpoints between phases are needed.
|
|
4
4
|
argument-hint: [design artifact path]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/research/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: research
|
|
3
|
-
description: Answer structured research questions
|
|
3
|
+
description: Answer structured research questions about a codebase using targeted parallel analysis agents, then synthesize findings into a research document in thoughts/shared/research/. Accepts either a questions artifact from discover OR a free-text prompt (auto-runs discover first). Use when the user wants in-depth research on a codebase area, asks to "research X", needs answers to architecture or behavior questions before designing changes, or has a discover artifact ready to consume.
|
|
4
4
|
argument-hint: [path to discover artifact | free-text research prompt]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: resume-handoff
|
|
3
|
-
description: Resume work from a handoff document. Reads handoff, verifies current state, and continues
|
|
3
|
+
description: Resume work from a handoff document produced by create-handoff. Reads the handoff, verifies current repo, branch, and state, and continues from where the previous session left off. Use at the start of a new session when the user references a handoff file, says "resume from handoff", "continue from where we left off", or invokes /resume-handoff.
|
|
4
4
|
argument-hint: [handoff-path]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/revise/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: revise
|
|
3
|
-
description:
|
|
3
|
+
description: Surgically update an existing implementation plan in thoughts/shared/plans/ based on review feedback, mid-implementation discoveries, or new constraints, preserving structure and quality rather than rewriting. Use when the user wants a plan adjusted after code-review feedback, has hit a blocker mid-implement, scope changed, or asks to "revise the plan".
|
|
4
4
|
argument-hint: "[plan-path] [feedback]"
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/validate/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: validate
|
|
3
|
-
description: Verify that an implementation plan was correctly executed
|
|
3
|
+
description: Verify that an implementation plan was correctly executed by running each phase's success criteria against the working tree and producing a validation report. Use after the implement skill completes, when the user asks to "validate the plan", wants a post-implementation audit, or needs to confirm a feature is fully shipped per its plan.
|
|
4
4
|
argument-hint: [plan-path]
|
|
5
5
|
allowed-tools: Read, Bash(git *), Bash(make *), Glob, Grep, Agent
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: write-test-cases
|
|
3
|
-
description: Generate manual test
|
|
3
|
+
description: Generate manual test-case specifications for a single feature by analyzing the implementing code in parallel, producing flow-based test cases plus a regression suite and project-wide coverage map under .rpiv/test-cases/{feature}/. Consumes an outline-test-cases _meta.md when available for warm-start. Use when the user wants test cases written for a specific feature, asks for QA specs, or has run outline-test-cases and is ready to flesh out a feature.
|
|
4
4
|
argument-hint: "[feature name, component path, feature slug, or _meta.md path] [additional instructions]"
|
|
5
5
|
---
|
|
6
6
|
|