rpi-kit 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.claude-plugin/marketplace.json +9 -6
  2. package/.claude-plugin/plugin.json +4 -4
  3. package/AGENTS.md +2016 -117
  4. package/CHANGELOG.md +83 -0
  5. package/README.md +116 -169
  6. package/agents/atlas.md +61 -0
  7. package/agents/clara.md +49 -0
  8. package/agents/forge.md +38 -0
  9. package/agents/hawk.md +54 -0
  10. package/agents/luna.md +50 -0
  11. package/agents/mestre.md +61 -0
  12. package/agents/nexus.md +63 -0
  13. package/agents/pixel.md +48 -0
  14. package/agents/quill.md +40 -0
  15. package/agents/razor.md +41 -0
  16. package/agents/sage.md +52 -0
  17. package/agents/scout.md +49 -0
  18. package/agents/shield.md +51 -0
  19. package/bin/cli.js +160 -53
  20. package/bin/onboarding.js +46 -28
  21. package/commands/rpi/archive.md +149 -0
  22. package/commands/rpi/docs.md +106 -168
  23. package/commands/rpi/implement.md +163 -401
  24. package/commands/rpi/init.md +150 -67
  25. package/commands/rpi/learn.md +114 -0
  26. package/commands/rpi/new.md +85 -155
  27. package/commands/rpi/onboarding.md +157 -336
  28. package/commands/rpi/party.md +212 -0
  29. package/commands/rpi/plan.md +241 -205
  30. package/commands/rpi/research.md +162 -104
  31. package/commands/rpi/review.md +350 -104
  32. package/commands/rpi/rpi.md +125 -0
  33. package/commands/rpi/simplify.md +156 -93
  34. package/commands/rpi/status.md +91 -114
  35. package/package.json +7 -3
  36. package/skills/rpi-agents/SKILL.md +63 -39
  37. package/skills/rpi-workflow/SKILL.md +160 -186
  38. package/agents/code-reviewer.md +0 -108
  39. package/agents/code-simplifier.md +0 -82
  40. package/agents/cto-advisor.md +0 -61
  41. package/agents/doc-synthesizer.md +0 -67
  42. package/agents/doc-writer.md +0 -37
  43. package/agents/explore-codebase.md +0 -88
  44. package/agents/plan-executor.md +0 -95
  45. package/agents/product-manager.md +0 -59
  46. package/agents/requirement-parser.md +0 -51
  47. package/agents/senior-engineer.md +0 -61
  48. package/agents/test-engineer.md +0 -23
  49. package/agents/ux-designer.md +0 -58
  50. package/codex.md +0 -72
  51. package/commands/rpi/add-todo.md +0 -83
  52. package/commands/rpi/set-profile.md +0 -124
  53. package/commands/rpi/test.md +0 -198
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rpi:plan
3
- description: Generate adaptive plan artifacts from research. Creates PLAN.md with task checklist, eng.md, and optionally pm.md and ux.md.
4
- argument-hint: "<feature-slug> [--force] [--skip-pm] [--skip-ux]"
3
+ description: Generate implementation plan with Mestre (architect), Clara (PM), and Pixel (UX).
4
+ argument-hint: "<feature-name> [--force]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -12,280 +12,316 @@ allowed-tools:
12
12
  - AskUserQuestion
13
13
  ---
14
14
 
15
- <objective>
16
- Generate implementation plan artifacts from the research output. Adapts which artifacts to create based on feature type.
17
- </objective>
15
+ # /rpi:plan — Plan Phase
18
16
 
19
- <process>
17
+ Mestre (architecture), Clara (product), and Pixel (UX, conditional) collaborate to produce a complete implementation plan. Nexus validates coherence across all outputs.
20
18
 
21
- ## 1. Load config and parse arguments
19
+ ---
22
20
 
23
- Read `.rpi.yaml` for configuration. Also read `profile` and `models` keys.
24
- Parse `$ARGUMENTS`:
25
- - First argument: `{feature-slug}` (required)
26
- - `--force`: proceed even if research verdict was NO-GO
27
- - `--skip-pm`: don't generate pm.md
28
- - `--skip-ux`: don't generate ux.md
21
+ ## Step 1: Load config and validate
29
22
 
30
- ## 1b. Resolve model
23
+ 1. Read `.rpi.yaml` for config. Apply defaults if missing:
24
+ - `folder`: `rpi/features`
25
+ - `specs_dir`: `rpi/specs`
26
+ - `context_file`: `rpi/context.md`
27
+ - `ux_agent`: `auto`
28
+ 2. Parse `$ARGUMENTS` to extract `{slug}` and optional `--force` flag.
29
+ 3. Validate `rpi/features/{slug}/research/RESEARCH.md` exists. If not:
30
+ ```
31
+ RESEARCH.md not found for '{slug}'. Run /rpi:research {slug} first.
32
+ ```
33
+ Stop.
31
34
 
32
- Resolve the model for the `plan` phase following the Model Resolution Algorithm in the rpi-workflow skill. Store as `{resolved_model}`. If a model is resolved, output the status message before agent spawns.
35
+ ## Step 2: Check research verdict
33
36
 
34
- ## 2. Resolve feature path and validate prerequisites
37
+ 1. Read `rpi/features/{slug}/research/RESEARCH.md`.
38
+ 2. Look for the `## Verdict` section.
39
+ 3. If verdict is `NO-GO` and `--force` was NOT passed:
40
+ ```
41
+ Research verdict is NO-GO for '{slug}'.
42
+ Review RESEARCH.md for details and alternatives.
43
+ To override: /rpi:plan {slug} --force
44
+ ```
45
+ Stop.
46
+ 4. If `--force` was passed: proceed despite NO-GO verdict.
35
47
 
36
- Parse `{feature-slug}` from arguments.
48
+ ## Step 3: Check existing plan
37
49
 
38
- **Resolution order:**
39
- 1. Check if `{folder}/{feature-slug}/` exists type = "feature", path = `{folder}/{feature-slug}`
40
- 2. If not, Glob `{folder}/*/changes/{feature-slug}/` if found, type = "change", path = matched path, parent_path = parent directory
41
- 3. If multiple matches → AskUserQuestion listing all matches with full paths
42
- 4. If no match error: `Feature not found: {feature-slug}. Run /rpi:new {feature-slug} first.`
50
+ 1. Check if `rpi/features/{slug}/plan/PLAN.md` already exists.
51
+ 2. If it exists and `--force` was NOT passed:
52
+ - Ask the user: "PLAN.md already exists for '{slug}'. Overwrite? (yes/no)"
53
+ - If no: stop.
54
+ 3. If `--force` was passed or user confirms: proceed (will overwrite).
43
55
 
44
- If `type == "change"`:
45
- - Set `parent_path` to the parent feature directory
46
- - Read parent artifacts for agent context:
47
- - `{parent_path}/REQUEST.md`
48
- - `{parent_path}/research/RESEARCH.md` (if exists)
49
- - `{parent_path}/plan/PLAN.md` (if exists)
50
- - `{parent_path}/plan/eng.md` (if exists)
56
+ ## Step 4: Gather context
51
57
 
52
- Read `{path}/research/RESEARCH.md`. If missing:
53
- ```
54
- Research not found. Run /rpi:research {feature-slug} first.
55
- ```
58
+ 1. Read `rpi/features/{slug}/REQUEST.md` store as `$REQUEST`.
59
+ 2. Read `rpi/features/{slug}/research/RESEARCH.md` — store as `$RESEARCH`.
60
+ 3. Read `rpi/context.md` (project context) if it exists — store as `$CONTEXT`.
61
+ 4. Scan `rpi/specs/` for specs relevant to the feature — store as `$RELEVANT_SPECS`.
56
62
 
57
- Check verdict. If NO-GO and no `--force`:
58
- ```
59
- Research verdict is NO-GO. Review alternatives in RESEARCH.md.
60
- To proceed anyway: /rpi:plan {feature-slug} --force
61
- ```
63
+ ## Step 5: Detect frontend
62
64
 
63
- If plan artifacts already exist, ask: "Plan already exists. Overwrite?"
65
+ Check the project root for frontend framework config files:
66
+ - `next.config.*` or `next.config.ts` → Next.js
67
+ - `vite.config.*` → Vite (React/Vue/Svelte)
68
+ - `angular.json` → Angular
69
+ - `svelte.config.*` → Svelte/SvelteKit
70
+ - `nuxt.config.*` → Nuxt
71
+ - `package.json` containing `react`, `vue`, `angular`, or `svelte` in dependencies
64
72
 
65
- ## 3. Detect feature type and confirm artifacts
73
+ Set `$HAS_FRONTEND` to `true` if any of these are detected.
66
74
 
67
- Analyze RESEARCH.md to detect feature type:
68
- - Has UI components, user flows, or frontend files suggest pm.md + ux.md
69
- - Backend only, API, or infrastructure suggest skipping ux.md
70
- - Simple utility or refactor suggest skipping pm.md + ux.md
75
+ Read `ux_agent` from `.rpi.yaml`:
76
+ - If `always`: set `$RUN_PIXEL` to `true` regardless of frontend detection.
77
+ - If `never`: set `$RUN_PIXEL` to `false` regardless.
78
+ - If `auto` (default): set `$RUN_PIXEL` to `$HAS_FRONTEND`.
71
79
 
72
- Present detection to user with AskUserQuestion:
73
- "Based on the research, this looks like a {type} feature. I'll generate:"
74
- - Options showing which artifacts will be created
75
- - Let user confirm or adjust
80
+ ## Step 6: Launch Mestre — first pass (eng.md)
76
81
 
77
- Apply any `--skip-pm` or `--skip-ux` flags as overrides.
82
+ Launch Mestre agent with this prompt:
78
83
 
79
- ## 3b. Interview user for alignment
84
+ ```
85
+ You are Mestre. Generate the engineering specification for feature: {slug}
80
86
 
81
- Read all research artifacts:
82
- - `{folder}/{feature-slug}/REQUEST.md`
83
- - `{folder}/{feature-slug}/research/RESEARCH.md`
87
+ ## Request
88
+ {$REQUEST}
84
89
 
85
- Based on the content, interview the user using AskUserQuestion to clarify anything that could affect the plan. Ask about **all relevant dimensions** — not just one:
90
+ ## Research
91
+ {$RESEARCH}
86
92
 
87
- - **Technical implementation**: preferred patterns, constraints, performance requirements, existing code to build on
88
- - **UI & UX** (if applicable): expected flows, interaction patterns, states (loading, empty, error), design preferences
89
- - **Concerns**: risks identified in research, areas of uncertainty, things the user is worried about
90
- - **Tradeoffs**: decisions surfaced in research that have multiple valid approaches — present options and ask for preference
91
- - **Scope boundaries**: what explicitly should NOT be in this plan, MVP vs. future
93
+ ## Project Context
94
+ {$CONTEXT}
92
95
 
93
- Rules:
94
- - Ask focused, specific questions based on what you read — not generic ones
95
- - Reference concrete findings from the research (e.g., "Research found two patterns for X: {A} and {B}. Which do you prefer?")
96
- - If the research surfaced CONCERN or BLOCK verdicts, ask about those specifically
97
- - Group related questions together — don't ask one at a time unless a follow-up depends on a previous answer
98
- - Document the user's answers — they will be passed as additional context to the agents in subsequent steps
96
+ ## Relevant Specs
97
+ {$RELEVANT_SPECS}
99
98
 
100
- After the interview, create a brief alignment summary that will be included in agent prompts:
101
- ```
102
- ## User Alignment Notes
103
- {Summary of key decisions, preferences, and constraints from the interview}
99
+ Your task:
100
+ 1. Read the request and research findings carefully
101
+ 2. Make technical decisions: approach, architecture, patterns to follow
102
+ 3. Identify files to create, modify, and remove
103
+ 4. List architectural risks with mitigations
104
+ 5. Output using your eng.md format: [Mestre -- Engineering Specification]
105
+
106
+ Be pragmatic. Follow existing codebase patterns from context.md and research findings. No over-engineering.
104
107
  ```
105
108
 
106
- ## 4. Generate eng.md (always)
109
+ Store the output as `$ENG_OUTPUT`.
110
+
111
+ ## Step 7: Launch Clara — pm.md
112
+
113
+ Launch Clara agent with this prompt:
107
114
 
108
- Launch senior-engineer agent. If a model was resolved in Step 1b, include `model: "{resolved_model}"` in the Agent tool call.
109
115
  ```
110
- You are planning the technical implementation for a feature.
116
+ You are Clara. Generate the product specification for feature: {slug}
111
117
 
112
- Read these files:
113
- - {folder}/{feature-slug}/REQUEST.md
114
- - {folder}/{feature-slug}/research/RESEARCH.md
118
+ ## Request
119
+ {$REQUEST}
115
120
 
116
- User Alignment Notes (from interview):
117
- {alignment_summary}
121
+ ## Research
122
+ {$RESEARCH}
118
123
 
119
- Produce eng.md — a technical specification covering:
120
- 1. Architecture overview (how it fits into existing codebase)
121
- 2. Dependencies (new packages, existing modules to extend)
122
- 3. Data models (schema changes, new types)
123
- 4. API design (endpoints, contracts, error handling)
124
- 5. File structure (new files to create, existing files to modify)
125
- 6. Testing strategy (what to test, how)
124
+ ## Project Context
125
+ {$CONTEXT}
126
126
 
127
- Be concrete. Cite existing codebase files and patterns from the research.
128
- Follow senior-engineer rules from RPI agent guidelines.
127
+ Your task:
128
+ 1. Define user stories with concrete acceptance criteria (Given/When/Then)
129
+ 2. Classify requirements: must-have, nice-to-have, out-of-scope
130
+ 3. Cut anything that doesn't map to the core problem in REQUEST.md
131
+ 4. Define success metrics
132
+ 5. Output using your pm.md format: [Clara -- Product Specification]
133
+
134
+ Be ruthless with scope. Every requirement must have acceptance criteria.
129
135
  ```
130
136
 
131
- If `type == "change"`, append to the agent prompt:
137
+ Store the output as `$PM_OUTPUT`.
132
138
 
133
- ```
134
- ## Parent Feature Context
135
- {contents of parent artifacts read in step 2}
139
+ ## Step 8: Launch Pixel — ux.md (conditional)
140
+
141
+ Only if `$RUN_PIXEL` is `true`:
142
+
143
+ Launch Pixel agent with this prompt:
136
144
 
137
- This is a CHANGE to an existing feature. Focus on:
138
- - What's different from the parent implementation
139
- - Compatibility with existing code
140
- - Breaking changes to watch for
141
145
  ```
146
+ You are Pixel. Generate the UX specification for feature: {slug}
147
+
148
+ ## Request
149
+ {$REQUEST}
150
+
151
+ ## Research
152
+ {$RESEARCH}
142
153
 
143
- > **Note:** Also append this same parent context block to the pm.md (step 5), ux.md (step 6), and PLAN.md (step 7) agent prompts when `type == "change"`.
154
+ ## Project Context
155
+ {$CONTEXT}
144
156
 
145
- ## 5. Generate pm.md (if not skipped)
157
+ ## Engineering Specification
158
+ {$ENG_OUTPUT}
146
159
 
147
- Launch product-manager agent. If a model was resolved, include `model: "{resolved_model}"` in the Agent tool call.
160
+ Your task:
161
+ 1. Map the complete user flow from entry to completion
162
+ 2. Define all states: empty, loading, error, success, edge cases
163
+ 3. Identify accessibility requirements
164
+ 4. Consider responsive behavior
165
+ 5. Output using your ux.md format: [Pixel -- UX Specification]
166
+
167
+ Think from the user's perspective. If a flow needs a tooltip, the design failed.
148
168
  ```
149
- You are creating product requirements for a feature.
150
169
 
151
- Read these files:
152
- - {folder}/{feature-slug}/REQUEST.md
153
- - {folder}/{feature-slug}/research/RESEARCH.md
170
+ Store the output as `$UX_OUTPUT`.
171
+
172
+ If `$RUN_PIXEL` is `false`: set `$UX_OUTPUT` to `"No UX specification — no frontend detected."`.
154
173
 
155
- User Alignment Notes (from interview):
156
- {alignment_summary}
174
+ ## Step 9: Launch Mestre — second pass (PLAN.md)
157
175
 
158
- Produce pm.md product requirements covering:
159
- 1. User stories with acceptance criteria
160
- 2. Scope definition with effort estimates (S/M/L/XL per item)
161
- 3. Out of scope (what this feature does NOT do)
162
- 4. Success metrics (how to measure if the feature works)
163
- 5. Edge cases and error scenarios
176
+ Launch Mestre agent to synthesize all specs into a concrete plan:
164
177
 
165
- Follow product-manager rules from RPI agent guidelines.
166
178
  ```
179
+ You are Mestre. Generate the implementation plan (PLAN.md) for feature: {slug}
167
180
 
168
- ## 6. Generate ux.md (if not skipped)
181
+ ## Engineering Specification
182
+ {$ENG_OUTPUT}
169
183
 
170
- Launch ux-designer agent. If a model was resolved, include `model: "{resolved_model}"` in the Agent tool call.
171
- ```
172
- You are designing the user experience for a feature.
184
+ ## Product Specification
185
+ {$PM_OUTPUT}
186
+
187
+ ## UX Specification
188
+ {$UX_OUTPUT}
189
+
190
+ ## Request
191
+ {$REQUEST}
173
192
 
174
- Read these files:
175
- - {folder}/{feature-slug}/REQUEST.md
176
- - {folder}/{feature-slug}/research/RESEARCH.md
193
+ ## Research
194
+ {$RESEARCH}
177
195
 
178
- User Alignment Notes (from interview):
179
- {alignment_summary}
196
+ ## Project Context
197
+ {$CONTEXT}
180
198
 
181
- Produce ux.md — UX design covering:
182
- 1. User journey (step-by-step flow from entry to completion)
183
- 2. Interaction patterns (what the user sees and does at each step)
184
- 3. Edge cases (errors, empty states, loading, permissions)
185
- 4. Existing components to reuse (cite from codebase research)
186
- 5. Accessibility considerations
199
+ Your task:
200
+ 1. Read all specifications and synthesize into numbered tasks
201
+ 2. Each task must have: effort estimate, file list, dependencies, test criteria
202
+ 3. Tasks must be small enough for one commit each
203
+ 4. Group tasks into phases where logical
204
+ 5. Include metadata: total tasks, total files, overall complexity
205
+ 6. Output using your PLAN.md format: [Mestre -- Implementation Plan]
187
206
 
188
- Follow ux-designer rules from RPI agent guidelines.
207
+ Rules:
208
+ - Tasks are numbered (1.1, 1.2, 2.1, etc.)
209
+ - Every task lists exact files it touches
210
+ - Dependencies reference task IDs
211
+ - If Clara marked something as out-of-scope, don't create tasks for it
189
212
  ```
190
213
 
191
- ## 7. Generate PLAN.md
214
+ Store the output as `$PLAN_OUTPUT`.
215
+
216
+ ## Step 10: Mestre generates delta specs
192
217
 
193
- After all agents complete (eng.md is required, pm.md and ux.md may be parallel), launch senior-engineer agent again to create the task breakdown. If a model was resolved, include `model: "{resolved_model}"` in the Agent tool call.
218
+ Launch Mestre agent to create delta specifications:
194
219
 
195
220
  ```
196
- You are creating an implementation plan from the technical spec.
221
+ You are Mestre. Generate delta specs for feature: {slug}
197
222
 
198
- Read these files:
199
- - {folder}/{feature-slug}/REQUEST.md
200
- - {folder}/{feature-slug}/research/RESEARCH.md
201
- - {folder}/{feature-slug}/plan/eng.md
202
- - {folder}/{feature-slug}/plan/pm.md (if exists)
203
- - {folder}/{feature-slug}/plan/ux.md (if exists)
223
+ ## Implementation Plan
224
+ {$PLAN_OUTPUT}
204
225
 
205
- User Alignment Notes (from interview):
206
- {alignment_summary}
226
+ ## Engineering Specification
227
+ {$ENG_OUTPUT}
207
228
 
208
- Produce PLAN.md an ordered task checklist organized by phases.
229
+ ## Relevant Current Specs
230
+ {$RELEVANT_SPECS}
209
231
 
210
- Format for each task:
211
- - [ ] **{phase}.{task}** {Task description}
212
- Effort: S | M | L | XL | Deps: {task IDs or "none"}
213
- Files: {files to create or modify}
214
- Test: {what to test behavior assertion in plain language}
232
+ Your task:
233
+ 1. Based on the plan, determine what specs need to change
234
+ 2. For each new system component: create a spec in delta/ADDED/
235
+ 3. For each existing spec that changes: create the updated version in delta/MODIFIED/
236
+ 4. For any spec that becomes obsolete: create a marker in delta/REMOVED/
237
+ 5. Delta specs capture ONLY what changes — not the entire system
215
238
 
216
- Group tasks into logical phases (e.g., Phase 1: Data Layer, Phase 2: Business Logic, Phase 3: UI, Phase 4: Integration).
239
+ Output the list of delta specs you will create, with their paths:
240
+ - delta/ADDED/{name}.md — {description}
241
+ - delta/MODIFIED/{name}.md — {description}
242
+ - delta/REMOVED/{name}.md — {description}
217
243
 
218
- Rules:
219
- - Every task should be completable in one focused session
220
- - L or XL tasks should be broken into smaller subtasks
221
- - Dependencies must be explicit — no circular deps
222
- - Files listed must be specific paths, not directories
223
- - Every task must have a Test field describing what behavior to verify
224
- - Test descriptions should be assertions, not vague: "returns 404 for missing user" not "test error handling"
225
- - After generating all tasks, count total tasks, unique files, and max dependency depth
226
- - These metrics will be used for session isolation tier detection
244
+ Then write each spec file.
227
245
  ```
228
246
 
229
- ## 7b. Compute plan metadata
247
+ ## Step 11: Launch Nexus — coherence validation
230
248
 
231
- After PLAN.md is generated, compute session isolation metrics:
249
+ Launch Nexus agent to validate coherence across all plan outputs:
232
250
 
233
- 1. Count total tasks in PLAN.md
234
- 2. Count unique files across all task `Files:` fields
235
- 3. Calculate max dependency depth:
236
- - For each task, follow its `Deps:` chain to find the longest path
237
- - Depth = longest chain length (task with no deps = depth 0)
238
- 4. Compute context weight:
239
- ```
240
- context_weight = task_count + (total_files * 0.5) + (max_depth * 2)
241
- ```
242
- 5. Determine suggested tier:
243
- - context_weight <= 8: tier 1
244
- - context_weight 9-18: tier 2
245
- - context_weight > 18: tier 3
246
- 6. Compute plan hash:
247
- - Collect all files listed in task `Files:` fields
248
- - For files that exist: read content, sort by path, concatenate
249
- - For files to be created: skip (they don't exist yet)
250
- - Hash the concatenated content with sha256
251
- ```bash
252
- cat {sorted existing files} | shasum -a 256 | cut -d' ' -f1
253
- ```
251
+ ```
252
+ You are Nexus. Validate coherence for feature: {slug}
253
+
254
+ ## Engineering Specification (Mestre)
255
+ {$ENG_OUTPUT}
254
256
 
255
- Append to the top of PLAN.md (after the title, before Phase 1):
257
+ ## Product Specification (Clara)
258
+ {$PM_OUTPUT}
256
259
 
257
- ```markdown
258
- ## Metadata
259
- tasks: {count} | files: {count} | max_depth: {depth}
260
- context_weight: {weight}
261
- suggested_tier: {1|2|3}
262
- plan_hash: {sha256_hash}
260
+ ## Implementation Plan (Mestre)
261
+ {$PLAN_OUTPUT}
262
+
263
+ ## UX Specification (Pixel)
264
+ {$UX_OUTPUT}
265
+
266
+ Your task:
267
+ 1. Check that every must-have requirement from Clara's pm.md has at least one task in PLAN.md
268
+ 2. Check that every file in Mestre's eng.md appears in at least one PLAN.md task
269
+ 3. Check that no PLAN.md task contradicts Clara's out-of-scope items
270
+ 4. If Pixel's ux.md exists: check that UI flows have corresponding tasks
271
+ 5. Flag any gaps, contradictions, or missing coverage
272
+
273
+ Output as: [Nexus -- Coherence Validation]
274
+
275
+ ## Coherence Status
276
+ {PASS | PASS with gaps | FAIL}
277
+
278
+ ## Coverage
279
+ - Requirements covered: {N}/{total}
280
+ - Files covered: {N}/{total}
281
+
282
+ ## Issues Found
283
+ - {issue description} — Severity: {HIGH | MEDIUM | LOW}
284
+ (or "No issues found.")
285
+
286
+ ## Recommendations
287
+ - {recommendation}
288
+ (or "Plan is coherent. Ready for implementation.")
263
289
  ```
264
290
 
265
- ## 8. Write all artifacts
291
+ If Nexus reports FAIL: output the issues to the user and suggest re-running `/rpi:plan {slug} --force`.
266
292
 
267
- Write all generated files to `{folder}/{feature-slug}/plan/`:
268
- - `PLAN.md` (always)
269
- - `eng.md` (always)
270
- - `pm.md` (if generated)
271
- - `ux.md` (if generated)
293
+ ## Step 12: Write all artifacts
272
294
 
273
- ## 9. Present plan summary
295
+ 1. Ensure directory exists: `rpi/features/{slug}/plan/`
296
+ 2. Write `rpi/features/{slug}/plan/eng.md` with `$ENG_OUTPUT`
297
+ 3. Write `rpi/features/{slug}/plan/pm.md` with `$PM_OUTPUT`
298
+ 4. If `$RUN_PIXEL` is `true`: write `rpi/features/{slug}/plan/ux.md` with `$UX_OUTPUT`
299
+ 5. Write `rpi/features/{slug}/plan/PLAN.md` with `$PLAN_OUTPUT`
300
+ 6. Ensure delta directories exist:
301
+ ```bash
302
+ mkdir -p rpi/features/{slug}/delta/ADDED
303
+ mkdir -p rpi/features/{slug}/delta/MODIFIED
304
+ mkdir -p rpi/features/{slug}/delta/REMOVED
305
+ ```
306
+ 7. Write delta spec files from Step 10 into the appropriate delta subdirectories.
307
+
308
+ ## Step 13: Output summary
274
309
 
275
- Output:
276
310
  ```
277
- Plan created for {feature-slug}:
278
- - PLAN.md: {N} tasks across {M} phases
279
- - eng.md: Technical specification
280
- {- pm.md: Product requirements (if generated)}
281
- {- ux.md: UX design (if generated)}
282
-
283
- Session isolation: Tier {1|2|3} (context weight: {weight})
284
- {If tier 1: "Small feature — single session recommended"}
285
- {If tier 2: "Medium feature — session warning after {max_tasks_per_session} tasks"}
286
- {If tier 3: "Large feature — session checkpoints will be enforced"}
287
-
288
- Next: /rpi:implement {feature-slug}
311
+ Plan complete: rpi/features/{slug}/plan/
312
+
313
+ Artifacts:
314
+ - plan/eng.md (Mestre engineering spec)
315
+ - plan/pm.md (Clara product spec)
316
+ - plan/ux.md (Pixel — UX spec) ← only if frontend
317
+ - plan/PLAN.md (Mestre implementation tasks)
318
+ - delta/ADDED/ ({N} new specs)
319
+ - delta/MODIFIED/ ({N} updated specs)
320
+ - delta/REMOVED/ ({N} removed specs)
321
+
322
+ Tasks: {N} | Files: {N} | Complexity: {S|M|L|XL}
323
+ Coherence: {Nexus verdict}
324
+
325
+ Next: /rpi {slug}
326
+ Or explicitly: /rpi:implement {slug}
289
327
  ```
290
-
291
- </process>