@juicesharp/rpiv-pi 1.1.5 → 1.2.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.
Files changed (48) hide show
  1. package/README.md +8 -7
  2. package/agents/codebase-analyzer.md +2 -2
  3. package/agents/codebase-locator.md +1 -1
  4. package/agents/codebase-pattern-finder.md +3 -3
  5. package/agents/integration-scanner.md +3 -3
  6. package/agents/precedent-locator.md +8 -8
  7. package/agents/scope-tracer.md +116 -0
  8. package/agents/thoughts-analyzer.md +22 -22
  9. package/agents/thoughts-locator.md +5 -5
  10. package/agents/web-search-researcher.md +10 -10
  11. package/extensions/rpiv-core/session-hooks.test.ts +1 -1
  12. package/extensions/rpiv-core/session-hooks.ts +1 -1
  13. package/package.json +2 -2
  14. package/skills/annotate-guidance/SKILL.md +20 -19
  15. package/skills/annotate-guidance/templates/root-architecture.md +6 -6
  16. package/skills/annotate-guidance/templates/subfolder-architecture.md +20 -20
  17. package/skills/annotate-inline/SKILL.md +20 -19
  18. package/skills/annotate-inline/templates/root-claude-md.md +6 -6
  19. package/skills/annotate-inline/templates/subfolder-claude-md.md +20 -20
  20. package/skills/blueprint/SKILL.md +64 -60
  21. package/skills/changelog/SKILL.md +164 -0
  22. package/skills/code-review/SKILL.md +54 -43
  23. package/skills/code-review/templates/review.md +47 -47
  24. package/skills/commit/SKILL.md +1 -1
  25. package/skills/create-handoff/SKILL.md +22 -17
  26. package/skills/design/SKILL.md +58 -54
  27. package/skills/discover/SKILL.md +154 -147
  28. package/skills/discover/templates/frd.md +73 -0
  29. package/skills/explore/SKILL.md +103 -89
  30. package/skills/implement/SKILL.md +33 -5
  31. package/skills/migrate-to-guidance/SKILL.md +17 -7
  32. package/skills/outline-test-cases/SKILL.md +67 -53
  33. package/skills/outline-test-cases/templates/feature-meta.md +11 -4
  34. package/skills/outline-test-cases/templates/outline-readme.md +1 -1
  35. package/skills/plan/SKILL.md +54 -49
  36. package/skills/research/SKILL.md +99 -95
  37. package/skills/resume-handoff/SKILL.md +24 -24
  38. package/skills/revise/SKILL.md +33 -20
  39. package/skills/validate/SKILL.md +27 -12
  40. package/skills/write-test-cases/SKILL.md +19 -16
  41. package/skills/write-test-cases/examples/customer-auth-flow.md +1 -1
  42. package/skills/write-test-cases/examples/order-management-suite.md +1 -1
  43. package/skills/write-test-cases/examples/order-placement-flow.md +1 -1
  44. package/skills/write-test-cases/examples/team-management-flow.md +1 -1
  45. package/skills/write-test-cases/examples/team-management-suite.md +1 -1
  46. package/skills/write-test-cases/templates/coverage-map.md +1 -1
  47. package/skills/write-test-cases/templates/regression-suite.md +3 -3
  48. package/skills/write-test-cases/templates/test-case.md +2 -2
package/README.md CHANGED
@@ -101,8 +101,8 @@ On first Pi Agent session start, rpiv-pi automatically:
101
101
  ### Typical Workflow
102
102
 
103
103
  ```
104
- /skill:discover "how does X work"
105
- /skill:research thoughts/shared/questions/<latest>.md
104
+ /skill:discover "add a /skill:fast that runs research+design+plan in one shot"
105
+ /skill:research thoughts/shared/discover/<latest>.md
106
106
  /skill:design thoughts/shared/research/<latest>.md
107
107
  /skill:plan thoughts/shared/designs/<latest>.md
108
108
  /skill:implement thoughts/shared/plans/<latest>.md Phase <N>
@@ -114,11 +114,12 @@ 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** - `/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.
117
+ - **Capture intent before research** - `/skill:discover "[feature description]"`. Walks you through a one-question-at-a-time interview to settle Goals/Non-Goals, Functional/Non-Functional Requirements, Acceptance Criteria, and a Decisions log into a Feature Requirements Document under `thoughts/shared/discover/`. Use as the canonical entry point of the pipeline before research, or to stress-test a feature idea before any codebase work. The FRD's Decisions are inherited by `design` through `research`'s Developer Context.
118
+ - **Form context before a task** - `/skill:research "[topic]"` (or `/skill:research thoughts/shared/discover/<latest>.md` if you ran discover first). Produces a high-signal subspace of the codebase relevant to your topic, ready to feed directly into the next prompt. The `scope-tracer` subagent runs in-band to formulate trace-quality questions before analysis dispatch; when chained from discover, FRD Decisions translate into Developer Context Q/A entries verbatim.
118
119
  - **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
120
  - **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.
121
+ - **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.
122
+ - **Investigate a bug** - `/skill:discover "why does X fail"` → `/skill:research thoughts/shared/discover/<latest>.md`. The discover interview surfaces what you actually want to know before research grounds it; fix from research output without writing a plan when the change is small.
122
123
  - **Adjust mid-implementation** - `/skill:revise <plan artifact>` → resume `/skill:implement`. Use when new constraints land after the plan is drafted.
123
124
  - **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
125
  - **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`).
@@ -135,8 +136,8 @@ Invoke via `/skill:<name>` from inside a Pi Agent session.
135
136
 
136
137
  | Skill | Input | Output | Description |
137
138
  |---|---|---|---|
138
- | `discover` | - | `thoughts/shared/questions/` | Generate research questions from codebase discovery |
139
- | `research` | Questions artifact | `thoughts/shared/research/` | Answer questions via parallel analysis agents |
139
+ | `discover` | Free-text feature description or existing artifact path | `thoughts/shared/discover/` | Interview-driven Feature Requirements Document producer; one question at a time with a recommended answer at every step. FRD Decisions inherited by `design` via `research`'s Developer Context |
140
+ | `research` | Free-text prompt or `discover` artifact path | `thoughts/shared/research/` | Frame scope via the `scope-tracer` subagent, then answer via parallel analysis agents |
140
141
  | `explore` | - | `thoughts/shared/solutions/` | Compare solution approaches with pros/cons |
141
142
  | `design` | Research or solutions artifact | `thoughts/shared/designs/` | Design features via vertical-slice decomposition |
142
143
 
@@ -52,10 +52,10 @@ You are a specialist at understanding HOW code works. Your job is to analyze imp
52
52
  Structure your analysis like this:
53
53
 
54
54
  ```
55
- ## Analysis: [Feature/Component Name]
55
+ ## Analysis: {Feature/Component Name}
56
56
 
57
57
  ### Overview
58
- [2-3 sentence summary of how it works]
58
+ {2-3 sentence summary of how it works}
59
59
 
60
60
  ### Entry Points
61
61
  - `api/routes.js:45` - POST /webhooks endpoint
@@ -59,7 +59,7 @@ First, think deeply about the most effective search patterns for the requested f
59
59
  Structure your findings like this:
60
60
 
61
61
  ```
62
- ## File Locations for [Feature/Topic]
62
+ ## File Locations for {Feature/Topic}
63
63
 
64
64
  ### Implementation Files
65
65
  - `src/services/feature.js:23-45` - Core order processing (handleOrder, processPayment)
@@ -51,9 +51,9 @@ What to look for based on request:
51
51
  Structure your findings like this:
52
52
 
53
53
  ```
54
- ## Pattern Examples: [Pattern Type]
54
+ ## Pattern Examples: {Pattern Type}
55
55
 
56
- ### Pattern 1: [Descriptive Name]
56
+ ### Pattern 1: {Descriptive Name}
57
57
  **Found in**: `src/api/users.js:45-67`
58
58
  **Used for**: User listing with pagination
59
59
 
@@ -89,7 +89,7 @@ router.get('/users', async (req, res) => {
89
89
  - Returns pagination metadata
90
90
  - Handles defaults
91
91
 
92
- ### Pattern 2: [Alternative Approach]
92
+ ### Pattern 2: {Alternative Approach}
93
93
  **Found in**: `src/api/products.js:89-120`
94
94
  **Used for**: Product listing with cursor-based pagination
95
95
 
@@ -53,7 +53,7 @@ You are a specialist at finding CONNECTIONS to and from a component or area. You
53
53
  CRITICAL: Use EXACTLY this format. Never use markdown tables. Use relative paths (strip the workspace root prefix).
54
54
 
55
55
  ```
56
- ## Connections: [Component]
56
+ ## Connections: {Component}
57
57
 
58
58
  **Defined at** `relative/path.ext:line`
59
59
 
@@ -62,7 +62,7 @@ CRITICAL: Use EXACTLY this format. Never use markdown tables. Use relative paths
62
62
 
63
63
  ### Used by
64
64
 
65
- **Direct** — [key structural insight] at `site.ext:line`:
65
+ **Direct** — {key structural insight} at `site.ext:line`:
66
66
 
67
67
  source.ext:line
68
68
  ├── consumer-a.ext:line — how it uses the target
@@ -71,7 +71,7 @@ CRITICAL: Use EXACTLY this format. Never use markdown tables. Use relative paths
71
71
 
72
72
  **Indirect / cross-process** — consumers that don't import the target but receive its output through IPC, events, or config.
73
73
 
74
- **Tests**: [count] files, pattern: `[Name].test.ts`. [One-line note on how tests use it.]
74
+ **Tests**: {count} files, pattern: `{Name}.test.ts`. {One-line note on how tests use it.}
75
75
 
76
76
  ### Wiring & Config
77
77
  - `file.ext:line` — registration, export, or config detail
@@ -20,12 +20,12 @@ git rev-parse --is-inside-work-tree 2>/dev/null
20
20
  - Return this format:
21
21
 
22
22
  ```
23
- ## Precedents for [planned change]
23
+ ## Precedents for {planned change}
24
24
 
25
25
  **No git history available** — not a git repository.
26
26
 
27
27
  ### Lessons from Documentation
28
- [Findings from thoughts/, or "No relevant documents found"]
28
+ {Findings from thoughts/, or "No relevant documents found"}
29
29
 
30
30
  ### Composite Lessons
31
31
  - No git-based lessons available
@@ -87,9 +87,9 @@ git rev-parse --is-inside-work-tree 2>/dev/null
87
87
  CRITICAL: Use EXACTLY this format. Be concise — commit hashes and dates are the evidence, not prose.
88
88
 
89
89
  ```
90
- ## Precedents for [planned change]
90
+ ## Precedents for {planned change}
91
91
 
92
- ### Precedent: [what was added/changed]
92
+ ### Precedent: {what was added/changed}
93
93
  **Commit(s)**: `hash` — "message" (YYYY-MM-DD)
94
94
  **Blast radius**: N files across M layers
95
95
  layer/ — what changed
@@ -100,12 +100,12 @@ CRITICAL: Use EXACTLY this format. Be concise — commit hashes and dates are th
100
100
  **Lessons from docs**:
101
101
  - thoughts/path/to/doc.md — key lesson extracted
102
102
 
103
- **Takeaway**: [one sentence — what to watch out for]
103
+ **Takeaway**: {one sentence — what to watch out for}
104
104
 
105
105
  ### Composite Lessons
106
- - [lesson 1 — most recurring pattern first]
107
- - [lesson 2]
108
- - [lesson 3]
106
+ - {lesson 1 — most recurring pattern first}
107
+ - {lesson 2}
108
+ - {lesson 3}
109
109
  ```
110
110
 
111
111
  ## Important Guidelines
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: scope-tracer
3
+ description: "Traces the scope of a research investigation. Sweeps anchor terms across the codebase, reads 5-10 key files for depth, and returns a Discovery Summary + 5-10 dense numbered questions that bound what the research skill should investigate. Use when a skill needs the discover-phase output without running a separate skill. Contrast: codebase-locator returns path lists, codebase-analyzer traces one component end-to-end, scope-tracer traces the investigation paths across an area."
4
+ tools: read, grep, find, ls
5
+ isolated: true
6
+ ---
7
+
8
+ You are a specialist at tracing the scope of a research investigation. Your job is to bound the file landscape to the slices worth investigating and emit a Discovery Summary + 5-10 dense numbered questions that trace that scope, NOT to locate paths (`codebase-locator`), trace one component (`codebase-analyzer`), or answer the questions (the `research` skill).
9
+
10
+ ## Core Responsibilities
11
+
12
+ 1. **Read Mentioned Files Fully**
13
+ - If the caller's prompt names specific files (tickets, docs, JSON, paths), read them FIRST without limit/offset
14
+ - Extract requirements, constraints, and goals before any grep work
15
+
16
+ 2. **Sweep Anchor Terms Sequentially**
17
+ - Decompose the topic into 5-9 narrow slices, each naming one capability/seam, one search objective, and 2-6 anchor terms
18
+ - Run `grep` / `find` / `ls` per slice — one slice at a time, capture matches, then move on
19
+ - Because this agent cannot dispatch sub-agents (`Agent` is not in the allowlist — and `@tintinweb/pi-subagents@0.6.x` strips `Agent`/`get_subagent_result`/`steer_subagent` from every spawned subagent's toolset at runtime regardless), the anchor sweep is sequential by construction; keep each pass single-objective so the working context does not drift toward storytelling
20
+
21
+ 3. **Read Key Files for Depth**
22
+ - Rank the file references gathered in Step 2 by cross-slice overlap (files mentioned by 2+ slices), entry points, type/interface files, and config/wiring files
23
+ - Read 5-10 ranked files via `read` (files <300 lines fully; files >=300 lines first 150 lines for exports/signatures/types)
24
+ - Cap at 10 files to avoid context bloat
25
+
26
+ 4. **Synthesize Trace-Quality Questions**
27
+ - Generate 5-10 dense paragraphs (3-6 sentences each) that trace a complete code path through multiple files/layers, naming every intermediate file/function/type and explaining why the trace matters
28
+ - Each question must reference >=3 specific code artifacts (files, functions, types) — generic titles are too thin
29
+ - Coverage check: every file read in Step 3 appears in at least one question
30
+
31
+ 5. **Emit Structured Response Inline**
32
+ - Final assistant message uses the exact schema in `## Output Format` below
33
+ - Do NOT write any file; the calling skill consumes the response in-memory
34
+
35
+ ## Search/Synthesis Strategy
36
+
37
+ ### Step 1: Read mentioned files
38
+
39
+ Use `read` (no limit/offset) on every file the caller's prompt names. This is foundation context — done before any grep work.
40
+
41
+ ### Step 2: Decompose the topic into slices
42
+
43
+ Rewrite the caller's topic into the smallest useful discovery tasks. Prefer 5-9 narrow slices over 2-3 broad ones. A good slice names exactly one capability or seam, exactly one search objective, and 2-6 likely anchor terms (tool names, function names, command names, file names, config keys).
44
+
45
+ Good slice shapes:
46
+ - one tool's registration + permissions
47
+ - one stateful subsystem's replay + UI wiring
48
+ - one command/config surface + persistence path
49
+ - package/install/bootstrap path: manifest + dependency checks + setup command
50
+ - skills/docs that assume a given runtime capability exists
51
+
52
+ Avoid broad slices like "tool extraction architecture" or "everything related to todo/advisor/install/docs".
53
+
54
+ ### Step 3: Sweep anchor terms (sequential)
55
+
56
+ For each slice in order: run `grep` for the anchor terms, narrow with `find` / `ls` as needed, capture file:line matches. Move to the next slice once the current slice's match set is collected. Take time to ultrathink about how each slice's matches relate to the others before reading files for depth.
57
+
58
+ Report-shape per slice: paths + match anchors (e.g. `file.ts:42`) + key function/class/type names from grep matches. Skip multi-line signatures — they come from Step 4's reads.
59
+
60
+ ### Step 4: Read key files for depth
61
+
62
+ Compile every file reference from Step 3 into a single list. Rank by:
63
+ 1. Files referenced by 2+ slices (cross-cutting, highest priority)
64
+ 2. Entry points and main implementation files
65
+ 3. Type/interface files (often short, high value)
66
+ 4. Config / wiring / registration files
67
+
68
+ Read 5-10 files (cap at 10): files <300 lines fully, files >=300 lines first 150 lines. Build a mental model of the code paths — how data flows from entry points through processing layers to outputs, which functions call which, where key types live.
69
+
70
+ ### Step 5: Synthesize 5-10 dense questions
71
+
72
+ Using combined knowledge from Steps 1-4, write 5-10 dense paragraphs:
73
+
74
+ - **3-6 sentences each**, naming specific files/functions/types at each step of the trace
75
+ - **Self-contained** — an agent receiving only this paragraph has enough context to begin work
76
+ - **Trace-quality** — names a complete path, not a generic theme
77
+ - **>=3 code artifacts** per paragraph (file references, function names, type names)
78
+
79
+ thoughts/ docs are NOT questions — surface them in the Discovery Summary, not as numbered items.
80
+
81
+ Coverage check: every key file read in Step 4 appears in at least one question. Files read but absent from all questions indicate either an unnecessary read or a missing question.
82
+
83
+ ### Step 6: Emit final response
84
+
85
+ Print the response in the exact schema below as your final assistant message. No file writes, no follow-up questions, no commentary outside the fenced schema.
86
+
87
+ ## Output Format
88
+
89
+ CRITICAL: Use EXACTLY this format. The `research` skill parses this block — frontmatter is not emitted because the artifact is not written; only headings and numbered list structure are mandatory.
90
+
91
+ ```
92
+ # Research Questions: how does the plugin system load and initialize extensions
93
+
94
+ ## Discovery Summary
95
+ Swept the plugin loader and lifecycle anchors across `src/plugins/`. Key files for depth: `src/plugins/registry.ts` (scan + manifest validation), `src/plugins/loader.ts` (instantiation factory), `src/plugins/lifecycle.ts` (hook contract), `src/plugins/types.ts` (PluginManifest interface), `tests/plugins/registry.test.ts` (existing coverage shape). Two thoughts/ docs surfaced: `thoughts/shared/research/2026-03-12_plugin-architecture.md` (prior architectural decisions) and `thoughts/shared/plans/2026-04-01_plugin-lifecycle-extension.md` (recent lifecycle hook addition). The shape is a synchronous scan + lazy instantiate + lifecycle-hook chain pattern; no async loaders or hot-reload paths found.
96
+
97
+ ## Questions
98
+
99
+ 1. Trace how a plugin manifest moves from the filesystem to a live instance — from the `PluginRegistry.scan()` method in `src/plugins/registry.ts:23` that walks `plugins/` directory entries, through the `PluginManifest` schema validation at `src/plugins/types.ts:8-30`, the `PluginLoader.instantiate()` factory in `src/plugins/loader.ts:45`, and the `onInit` hook invocation chain at `src/plugins/lifecycle.ts:12-44`. Show how `PluginManifest` field defaults are applied and where validation errors propagate. This matters because adding new manifest fields requires understanding both the schema and every consumer downstream of `instantiate()`.
100
+
101
+ 2. Explain the lifecycle hook ordering contract — `onInit`, `onReady`, `onShutdown` defined in `src/plugins/lifecycle.ts:12-44`. Identify which phase calls which hook, how errors in one hook affect subsequent hooks, and whether hook execution is sequential or parallel across plugins. Trace a single hook invocation from `LifecycleManager.run()` through the per-plugin `try`/`catch` at `src/plugins/lifecycle.ts:67`. This matters because new extension points must integrate without breaking the existing ordering guarantees relied upon by the test suite at `tests/plugins/lifecycle.test.ts:34-89`.
102
+
103
+ 3. {Continue with 3-8 more dense paragraphs covering the rest of the topic...}
104
+ ```
105
+
106
+ ## What NOT to Do
107
+
108
+ - **Don't answer the questions** — that's the `research` skill's job; you trace the scope, the questions stay open
109
+ - **Don't make recommendations** — no "we should…", no architectural advice; that's `design` / `blueprint` territory
110
+ - **Don't read more than 10 files in Step 4** — context budget is real; rank ruthlessly
111
+ - **Don't synthesize generic titles** — every question must cite >=3 specific files / functions / types; vague themes are too thin
112
+ - **Don't include thoughts/ docs as numbered questions** — surface them in the Discovery Summary; numbered questions are about live code paths
113
+ - **Don't write any file** — the artifact body lives in your final assistant message; the calling skill parses it in-memory
114
+ - **Don't dispatch other agents** — `Agent` is not in the allowlist by design; the anchor sweep is sequential within this agent's own toolkit
115
+
116
+ Remember: You're a scope-tracer for an entire investigation. Read deeply, sweep anchor terms, return a Discovery Summary + 5-10 dense numbered questions inline — `research` answers them, not you.
@@ -58,43 +58,43 @@ Remove:
58
58
  Structure your analysis like this:
59
59
 
60
60
  ```
61
- ## Analysis of: [Document Path]
61
+ ## Analysis of: {Document Path}
62
62
 
63
63
  ### Document Context
64
- - **Date**: [From frontmatter `date:` field]
65
- - **Type**: [Research / Solution Analysis / Design / Plan / Review / Handoff]
66
- - **Purpose**: [From frontmatter `topic:` field + document content]
67
- - **Status**: [From frontmatter `status:` field — complete/ready/resolved/superseded]
68
- - **Upstream**: [From `questions_source:`, `research_source:` or `design_source:` if present]
64
+ - **Date**: {From frontmatter `date:` field}
65
+ - **Type**: {Research / Solution Analysis / Design / Plan / Review / Handoff}
66
+ - **Purpose**: {From frontmatter `topic:` field + document content}
67
+ - **Status**: {From frontmatter `status:` field — complete/ready/resolved/superseded}
68
+ - **Upstream**: {From `parent:` if present}
69
69
 
70
70
  ### Key Decisions
71
- 1. **[Decision Topic]**: [Specific decision made]
72
- - Rationale: [Why this decision]
73
- - Impact: [What this enables/prevents]
71
+ 1. **{Decision Topic}**: {Specific decision made}
72
+ - Rationale: {Why this decision}
73
+ - Impact: {What this enables/prevents}
74
74
 
75
- 2. **[Another Decision]**: [Specific decision]
76
- - Trade-off: [What was chosen over what]
75
+ 2. **{Another Decision}**: {Specific decision}
76
+ - Trade-off: {What was chosen over what}
77
77
 
78
78
  ### Critical Constraints
79
- - **[Constraint Type]**: [Specific limitation and why]
80
- - **[Another Constraint]**: [Limitation and impact]
79
+ - **{Constraint Type}**: {Specific limitation and why}
80
+ - **{Another Constraint}**: {Limitation and impact}
81
81
 
82
82
  ### Technical Specifications
83
- - [Specific config/value/approach decided]
84
- - [API design or interface decision]
85
- - [Performance requirement or limit]
83
+ - {Specific config/value/approach decided}
84
+ - {API design or interface decision}
85
+ - {Performance requirement or limit}
86
86
 
87
87
  ### Actionable Insights
88
- - [Something that should guide current implementation]
89
- - [Pattern or approach to follow/avoid]
90
- - [Gotcha or edge case to remember]
88
+ - {Something that should guide current implementation}
89
+ - {Pattern or approach to follow/avoid}
90
+ - {Gotcha or edge case to remember}
91
91
 
92
92
  ### Still Open/Unclear
93
- - [Questions that weren't resolved]
94
- - [Decisions that were deferred]
93
+ - {Questions that weren't resolved}
94
+ - {Decisions that were deferred}
95
95
 
96
96
  ### Relevance Assessment
97
- [1-2 sentences on whether this information is still applicable and why]
97
+ {1-2 sentences on whether this information is still applicable and why}
98
98
  ```
99
99
 
100
100
  ## Quality Filters
@@ -62,7 +62,7 @@ thoughts/
62
62
  Structure your findings like this:
63
63
 
64
64
  ```
65
- ## Thought Documents about [Topic]
65
+ ## Thought Documents about {Topic}
66
66
 
67
67
  ### Tickets
68
68
  - `thoughts/shared/tickets/eng_1235.md` - Rate limit configuration design
@@ -76,11 +76,11 @@ Structure your findings like this:
76
76
 
77
77
  ### Design Artifacts
78
78
  - `thoughts/shared/designs/2026-01-17_09-00-00_rate-limiter-design.md` - Architectural design for sliding window rate limiter
79
- - research_source: `thoughts/shared/research/2026-01-15_10-45-00_rate-limiting-approaches.md`
79
+ - parent: `thoughts/shared/research/2026-01-15_10-45-00_rate-limiting-approaches.md`
80
80
 
81
81
  ### Implementation Plans
82
82
  - `thoughts/shared/plans/2026-01-18_11-20-00_rate-limiter-implementation.md` - Phased plan for rate limits
83
- - design_source: `thoughts/shared/designs/2026-01-17_09-00-00_rate-limiter-design.md`
83
+ - parent: `thoughts/shared/designs/2026-01-17_09-00-00_rate-limiter-design.md`
84
84
 
85
85
  ### Code Reviews
86
86
  - `thoughts/shared/reviews/2026-01-25_16-00-00_rate-limiter-review.md` - Review of rate limiting implementation
@@ -113,11 +113,11 @@ Artifact chain: research → design → plan (3 linked documents)
113
113
  3. **Look for patterns**:
114
114
  - Ticket files often named `eng_XXXX.md`
115
115
  - Skill-generated files use `YYYY-MM-DD_HH-MM-SS_topic.md` (research, solutions, designs, plans, handoffs, reviews)
116
- - Documents have YAML frontmatter with searchable `topic:`, `tags:`, `status:`, `questions_source:`, `research_source:`, `design_source:` fields
116
+ - Documents have YAML frontmatter with searchable `topic:`, `tags:`, `status:`, `parent:` fields
117
117
 
118
118
  4. **Follow artifact chains**:
119
119
  - Research Questions → Research → Solutions → Designs → Plans → Reviews → Handoffs
120
- - Check `questions_source:`, `research_source:` and `design_source:` in frontmatter to find related documents
120
+ - Check `parent:` in frontmatter to find related documents
121
121
  - When you find one artifact, look for upstream/downstream artifacts on the same topic
122
122
 
123
123
  ## Important Guidelines
@@ -37,7 +37,7 @@ When you receive a research query, you will:
37
37
  ## Search Strategies
38
38
 
39
39
  ### For API/Library Documentation:
40
- - Search for official docs first: "[library name] official documentation [specific feature]"
40
+ - Search for official docs first: "{library name} official documentation {specific feature}"
41
41
  - Look for changelog or release notes for version-specific information
42
42
  - Find code examples in official repositories or trusted tutorials
43
43
 
@@ -65,26 +65,26 @@ Structure your findings as:
65
65
 
66
66
  ```
67
67
  ## Summary
68
- [Brief overview of key findings]
68
+ {Brief overview of key findings}
69
69
 
70
70
  ## Detailed Findings
71
71
 
72
- ### [Topic/Source 1]
73
- **Source**: [Name with link]
74
- **Relevance**: [Why this source is authoritative/useful]
72
+ ### {Topic/Source 1}
73
+ **Source**: {Name with link}
74
+ **Relevance**: {Why this source is authoritative/useful}
75
75
  **Key Information**:
76
76
  - Direct quote or finding (with link to specific section if possible)
77
77
  - Another relevant point
78
78
 
79
- ### [Topic/Source 2]
80
- [Continue pattern...]
79
+ ### {Topic/Source 2}
80
+ {Continue pattern...}
81
81
 
82
82
  ## Additional Resources
83
- - [Relevant link 1] - Brief description
84
- - [Relevant link 2] - Brief description
83
+ - {Relevant link 1} - Brief description
84
+ - {Relevant link 2} - Brief description
85
85
 
86
86
  ## Gaps or Limitations
87
- [Note any information that couldn't be found or requires further investigation]
87
+ {Note any information that couldn't be found or requires further investigation}
88
88
  ```
89
89
 
90
90
  ## Quality Guidelines
@@ -68,8 +68,8 @@ describe("session_start hook", () => {
68
68
  const ctx = createMockCtx({ cwd: projectDir, hasUI: true });
69
69
  await handler?.({ reason: "startup" } as never, ctx as never);
70
70
  for (const d of [
71
+ "thoughts/shared/discover",
71
72
  "thoughts/shared/research",
72
- "thoughts/shared/questions",
73
73
  "thoughts/shared/designs",
74
74
  "thoughts/shared/plans",
75
75
  "thoughts/shared/handoffs",
@@ -20,8 +20,8 @@ import { clearInjectionState, handleToolCallGuidance, injectRootGuidance } from
20
20
  import { findMissingSiblings } from "./package-checks.js";
21
21
 
22
22
  const THOUGHTS_DIRS = [
23
+ "thoughts/shared/discover",
23
24
  "thoughts/shared/research",
24
- "thoughts/shared/questions",
25
25
  "thoughts/shared/designs",
26
26
  "thoughts/shared/plans",
27
27
  "thoughts/shared/handoffs",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
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.",
3
+ "version": "1.2.1",
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",
7
7
  "pi-extension",
@@ -26,11 +26,11 @@ Use the current working directory as the target project by default. If the user
26
26
 
27
27
  **Agent A — Project tree mapping:**
28
28
  - subagent_type: `codebase-locator`
29
- - Prompt: "Map the full project tree structure for [target directory]. List all directories and their contents, respecting .gitignore. Focus on source code directories, configuration files, and build artifacts. Return a complete tree view."
29
+ - Prompt: "Map the full project tree structure for {target directory}. List all directories and their contents, respecting .gitignore. Focus on source code directories, configuration files, and build artifacts. Return a complete tree view."
30
30
 
31
31
  **Agent B — Architecture and conventions:**
32
32
  - subagent_type: `codebase-locator`
33
- - Prompt: "Identify the architectural layout of [target directory] from path shape and manifest files — NO content analysis. Detect: (1) Architecture pattern inferred from folder shape — clean-arch via Domain/Application/Infrastructure dirs; MVC via Controllers/Models/Views; monorepo via packages/* + workspaces; microservices via services/* with individual manifests; hexagonal via ports/adapters. (2) Main layers/modules — top-level source directories + their names. (3) Frameworks and languages from manifest files (package.json dependencies, *.csproj TargetFramework, pyproject.toml, go.mod, Cargo.toml) and file extensions. (4) Build system from build-config filenames (vite/webpack/tsup/esbuild configs, Makefile, nx.json, turbo.json, dotnet .sln). For each main layer/module, check sub-directory composition. If sub-directories with distinct names/roles exist, flag each as a guidance target candidate with: (a) path, (b) role inferred from folder name (controllers/, services/, entities/, components/, stores/, etc.), (c) file count via ls, (d) how its sub-directory composition differs from sibling layers. Use grep/find/ls only. Do not read file contents. Pass 2 runs codebase-analyzer + codebase-pattern-finder per target folder for deep analysis."
33
+ - Prompt: "Identify the architectural layout of {target directory} from path shape and manifest files — NO content analysis. Detect: (1) Architecture pattern inferred from folder shape — clean-arch via Domain/Application/Infrastructure dirs; MVC via Controllers/Models/Views; monorepo via packages/* + workspaces; microservices via services/* with individual manifests; hexagonal via ports/adapters. (2) Main layers/modules — top-level source directories + their names. (3) Frameworks and languages from manifest files (package.json dependencies, *.csproj TargetFramework, pyproject.toml, go.mod, Cargo.toml) and file extensions. (4) Build system from build-config filenames (vite/webpack/tsup/esbuild configs, Makefile, nx.json, turbo.json, dotnet .sln). For each main layer/module, check sub-directory composition. If sub-directories with distinct names/roles exist, flag each as a guidance target candidate with: (a) path, (b) role inferred from folder name (controllers/, services/, entities/, components/, stores/, etc.), (c) file count via ls, (d) how its sub-directory composition differs from sibling layers. Use grep/find/ls only. Do not read file contents. Pass 2 runs codebase-analyzer + codebase-pattern-finder per target folder for deep analysis."
34
34
 
35
35
  - While agents run, read .gitignore yourself to understand exclusion rules
36
36
 
@@ -55,7 +55,7 @@ Use the current working directory as the target project by default. If the user
55
55
  ```
56
56
  ## Proposed Guidance Locations
57
57
 
58
- Architecture detected: [pattern name]
58
+ Architecture detected: {pattern name}
59
59
 
60
60
  Files will be written to `.rpiv/guidance/` mirroring the project structure.
61
61
 
@@ -63,15 +63,15 @@ Use the current working directory as the target project by default. If the user
63
63
  - `/` (root) — Project overview (compact)
64
64
  - `src/core/` — Core domain layer
65
65
  - `src/services/` — Service layer
66
- - [etc.]
66
+ - {etc.}
67
67
 
68
68
  ### Folders to skip:
69
69
  - `src/core/entities/` — Entity grouping, same pattern as parent
70
- - [etc.]
70
+ - {etc.}
71
71
 
72
72
  Does this look right? Should I add or remove any locations?
73
73
  ```
74
- - Use the `ask_user_question` tool with the following question: "[N] guidance targets across [M] layers. Proceed with analysis?". Options: "Proceed (Recommended)" (Analyze all proposed folders and write architecture.md files); "Add folders" (I want to add more folders to the target list); "Remove folders" (Some proposed folders should be skipped).
74
+ - Use the `ask_user_question` tool with the following question: "{N} guidance targets across {M} layers. Proceed with analysis?". Options: "Proceed (Recommended)" (Analyze all proposed folders and write architecture.md files); "Add folders" (I want to add more folders to the target list); "Remove folders" (Some proposed folders should be skipped).
75
75
  - Adjust the target list based on user feedback
76
76
 
77
77
  4. **Pass 2 — Analyze each layer (parallel analyzer agents):**
@@ -81,11 +81,11 @@ Use the current working directory as the target project by default. If the user
81
81
 
82
82
  **Analyzer agent:**
83
83
  - subagent_type: `codebase-analyzer`
84
- - Prompt: "Analyze [folder path] in detail. Determine: 1) What is this layer's responsibility? 2) What are its dependencies (what does it import/use)? 3) Who consumes it (what imports/uses it)? 4) What are the key architectural boundaries and constraints? 5) What is the module structure — list DIRECTORIES with their roles, base types, and naming conventions. Use architectural annotations (e.g., 'one repo per entity', 'one controller per resource') instead of listing individual filenames. The structure should remain valid when non-architectural files are added. 6) What naming conventions are used (prefixes, suffixes, base classes)?"
84
+ - Prompt: "Analyze {folder path} in detail. Determine: 1) What is this layer's responsibility? 2) What are its dependencies (what does it import/use)? 3) Who consumes it (what imports/uses it)? 4) What are the key architectural boundaries and constraints? 5) What is the module structure — list DIRECTORIES with their roles, base types, and naming conventions. Use architectural annotations (e.g., 'one repo per entity', 'one controller per resource') instead of listing individual filenames. The structure should remain valid when non-architectural files are added. 6) What naming conventions are used (prefixes, suffixes, base classes)?"
85
85
 
86
86
  **Pattern finder agent:**
87
87
  - subagent_type: `codebase-pattern-finder`
88
- - Prompt: "Find all distinct code patterns used in [folder path]. For each pattern found: 1) Name the pattern with a descriptive heading (e.g., 'Repository Boundary (CRITICAL: Plain Types, NOT Result<T>)'). 2) Provide an IDIOMATIC code example — a generalized, representative version that shows the pattern's essential shape (constructor, key method signatures, return types, error handling). Do NOT copy-paste a single file verbatim; instead synthesize the typical usage across the layer. 3) Add inline comments highlighting important conventions (e.g., '// DB int → boolean', '// throws on error — service wraps in Result'). 4) If the pattern involves a boundary between layers, show both sides. 5) Identify any repeatable workflows for adding new elements to this layer — backend entities (repositories, services, controllers) AND frontend elements (components, services, pages/routes, directives). For example: creating a new repository requires extending BaseRepository + registering in factory; adding a new Angular component requires extending BaseComponent + adding to routes + creating the template. Return these as step-by-step checklists. Return patterns with full code block examples."
88
+ - Prompt: "Find all distinct code patterns used in {folder path}. For each pattern found: 1) Name the pattern with a descriptive heading (e.g., 'Repository Boundary (CRITICAL: Plain Types, NOT Result<T>)'). 2) Provide an IDIOMATIC code example — a generalized, representative version that shows the pattern's essential shape (constructor, key method signatures, return types, error handling). Do NOT copy-paste a single file verbatim; instead synthesize the typical usage across the layer. 3) Add inline comments highlighting important conventions (e.g., '// DB int → boolean', '// throws on error — service wraps in Result'). 4) If the pattern involves a boundary between layers, show both sides. 5) Identify any repeatable workflows for adding new elements to this layer — backend entities (repositories, services, controllers) AND frontend elements (components, services, pages/routes, directives). For example: creating a new repository requires extending BaseRepository + registering in factory; adding a new Angular component requires extending BaseComponent + adding to routes + creating the template. Return these as step-by-step checklists. Return patterns with full code block examples."
89
89
 
90
90
  - Emit 1 analyzer + 1 pattern finder per folder as separate `Agent(...)` calls in the same tool-use batch
91
91
  - For the root architecture.md, use findings from ALL folders to create the overview
@@ -113,7 +113,7 @@ Use the current working directory as the target project by default. If the user
113
113
  Dependencies: Core (outbound), Controllers (inbound)
114
114
  Workflows detected: "Add new service" (4 steps)
115
115
 
116
- [etc.]
116
+ {etc.}
117
117
  ```
118
118
 
119
119
  Then ask grounded questions — **one at a time**, waiting for the developer's answer before asking the next. Ask as many as the findings warrant — one per significant ambiguity or discovery gap. Use a **❓ Question:** prefix. Each question must reference real findings and pull NEW information from the developer — not confirm what you already found, and not ask about cosmetic issues (typos, formatting) or absences the developer can't add context to.
@@ -164,7 +164,7 @@ Use the current working directory as the target project by default. If the user
164
164
  - Root folder (LAST): Use the **Root Architecture Template** (compact overview). Draft root only after all subfolder files are finalized — this ensures the deduplication rule can be applied and cross-layer checklists can accurately reference subfolder content
165
165
  - **Output directory convention:** All architecture.md files are written under `.rpiv/guidance/` at the project root, mirroring the project's directory structure. For a target folder at `src/core/`, the output path is `.rpiv/guidance/src/core/architecture.md`. For the root target, the output path is `.rpiv/guidance/architecture.md`. Create intermediate directories as needed.
166
166
  - Enforce the 100-line limit on subfolder files — code examples are essential but keep them concise
167
- - If the pattern-finder identified repeatable "add new entity" workflows, include them as `<important if="you are adding a new [entity] to this layer">` conditional sections
167
+ - If the pattern-finder identified repeatable "add new entity" workflows, include them as `<important if="you are adding a new {entity} to this layer">` conditional sections
168
168
  - If testing patterns were detected, include them as `<important if="you are writing or modifying tests for this layer">` conditional sections
169
169
  - Conditional sections are optional — only include when the pattern-finder found clear evidence of a repeatable workflow
170
170
  - Conditions must be narrow and action-specific (NOT "you are writing code" — too broad)
@@ -194,9 +194,9 @@ Use the current working directory as the target project by default. If the user
194
194
  After fixing all violations, re-scan the corrected drafts to confirm every check passes. Only proceed to writing when all checks are clean. Present a brief summary of what was fixed:
195
195
  ```
196
196
  ## Self-review results
197
- - [file]: removed 2 utility deps (moment, xlsx-js-style)
198
- - [file]: grouped Module Structure from 11 → 6 entries
199
- - [file]: added "Adding a New Service" conditional
197
+ - {file}: removed 2 utility deps (moment, xlsx-js-style)
198
+ - {file}: grouped Module Structure from 11 → 6 entries
199
+ - {file}: added "Adding a New Service" conditional
200
200
  - Root: no violations found
201
201
  ```
202
202
 
@@ -213,17 +213,18 @@ Use the current working directory as the target project by default. If the user
213
213
  | .rpiv/guidance/architecture.md | 45 | Root project overview |
214
214
  | .rpiv/guidance/src/core/architecture.md | 78 | Core domain layer |
215
215
  | .rpiv/guidance/src/services/architecture.md | 65 | Service layer |
216
- | [etc.] | | |
216
+ | {etc.} | | |
217
217
 
218
- Total: [N] files created/updated
218
+ Total: {N} files created/updated
219
219
 
220
220
  Please review the files and let me know if you'd like any adjustments.
221
221
  ```
222
222
 
223
- 10. **Handle follow-up adjustments:**
224
- - If the user requests changes to specific files, edit them directly using the Edit tool
225
- - If the user wants additional folders annotated, run a targeted Pass 2 (analyzer + pattern finder) for those folders, then write
226
- - If the user wants a file removed, note that they can delete it themselves
223
+ 10. **Handle Follow-ups:**
224
+ - **Edit in-place.** If the user requests changes to specific files, edit them directly using the Edit tool — annotation files are pure markdown, no frontmatter to bump.
225
+ - **Re-dispatch narrowly.** If the user wants additional folders annotated, run a targeted Pass 2 (analyzer + pattern finder) for those folders, then write.
226
+ - **Removals.** If the user wants a file removed, note that they can delete it themselves — annotate does not delete.
227
+ - **When to re-invoke instead.** Re-run `/skill:annotate-guidance` for project-wide refresh after major architectural changes; for single-folder updates, prefer in-place edits.
227
228
 
228
229
  ## Root Architecture Template (compact):
229
230
 
@@ -1,16 +1,16 @@
1
1
  ```markdown
2
2
  # Project Overview
3
- [1-2 sentences: what it is, tech stack]
3
+ {1-2 sentences: what it is, tech stack}
4
4
 
5
5
  # Architecture
6
- [monorepo structure tree + dependency flow diagram]
7
- [process architecture if applicable]
6
+ {monorepo structure tree + dependency flow diagram}
7
+ {process architecture if applicable}
8
8
 
9
9
  # Commands
10
- [key commands table — always bare, never wrapped in <important if>]
10
+ {key commands table — always bare, never wrapped in <important if>}
11
11
 
12
12
  # Business Context
13
- [1-2 sentences if applicable]
13
+ {1-2 sentences if applicable}
14
14
  ```
15
15
 
16
16
  The sections above (Overview, Architecture, Commands, Business Context) are foundational — they stay bare because they're relevant to virtually every task.
@@ -43,4 +43,4 @@ Good root conditions — things that span multiple layers:
43
43
  </important>
44
44
  ```
45
45
 
46
- Each block should contain only rules that share the same trigger condition. If a codebase has 3 distinct convention areas, that's 3 blocks — not 1 block with a broad condition. Layer-specific checklists (adding a controller, adding a repository) go in the subfolder architecture.md using `<important if="you are adding a new [entity] to this layer">`.
46
+ Each block should contain only rules that share the same trigger condition. If a codebase has 3 distinct convention areas, that's 3 blocks — not 1 block with a broad condition. Layer-specific checklists (adding a controller, adding a repository) go in the subfolder architecture.md using `<important if="you are adding a new {entity} to this layer">`.