rpi-kit 1.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.
- package/AGENTS.md +143 -0
- package/LICENSE +21 -0
- package/README.md +173 -0
- package/agents/code-reviewer.md +108 -0
- package/agents/code-simplifier.md +82 -0
- package/agents/cto-advisor.md +61 -0
- package/agents/doc-synthesizer.md +67 -0
- package/agents/doc-writer.md +37 -0
- package/agents/explore-codebase.md +88 -0
- package/agents/plan-executor.md +74 -0
- package/agents/product-manager.md +59 -0
- package/agents/requirement-parser.md +51 -0
- package/agents/senior-engineer.md +61 -0
- package/agents/test-engineer.md +16 -0
- package/agents/ux-designer.md +58 -0
- package/bin/cli.js +147 -0
- package/commands/rpi/docs.md +193 -0
- package/commands/rpi/implement.md +275 -0
- package/commands/rpi/init.md +82 -0
- package/commands/rpi/new.md +100 -0
- package/commands/rpi/plan.md +175 -0
- package/commands/rpi/research.md +142 -0
- package/commands/rpi/review.md +131 -0
- package/commands/rpi/simplify.md +118 -0
- package/commands/rpi/status.md +115 -0
- package/commands/rpi/test.md +194 -0
- package/package.json +35 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
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]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Agent
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Generate implementation plan artifacts from the research output. Adapts which artifacts to create based on feature type.
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<process>
|
|
20
|
+
|
|
21
|
+
## 1. Load config and parse arguments
|
|
22
|
+
|
|
23
|
+
Read `.rpi.yaml` for configuration.
|
|
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
|
|
29
|
+
|
|
30
|
+
## 2. Validate prerequisites
|
|
31
|
+
|
|
32
|
+
Read `{folder}/{feature-slug}/research/RESEARCH.md`. If missing:
|
|
33
|
+
```
|
|
34
|
+
Research not found. Run /rpi:research {feature-slug} first.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Check the verdict in RESEARCH.md. If NO-GO and no `--force` flag:
|
|
38
|
+
```
|
|
39
|
+
Research verdict is NO-GO. Review alternatives in RESEARCH.md.
|
|
40
|
+
To proceed anyway: /rpi:plan {feature-slug} --force
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If plan artifacts already exist, ask: "Plan already exists. Overwrite?"
|
|
44
|
+
|
|
45
|
+
## 3. Detect feature type and confirm artifacts
|
|
46
|
+
|
|
47
|
+
Analyze RESEARCH.md to detect feature type:
|
|
48
|
+
- Has UI components, user flows, or frontend files → suggest pm.md + ux.md
|
|
49
|
+
- Backend only, API, or infrastructure → suggest skipping ux.md
|
|
50
|
+
- Simple utility or refactor → suggest skipping pm.md + ux.md
|
|
51
|
+
|
|
52
|
+
Present detection to user with AskUserQuestion:
|
|
53
|
+
"Based on the research, this looks like a {type} feature. I'll generate:"
|
|
54
|
+
- Options showing which artifacts will be created
|
|
55
|
+
- Let user confirm or adjust
|
|
56
|
+
|
|
57
|
+
Apply any `--skip-pm` or `--skip-ux` flags as overrides.
|
|
58
|
+
|
|
59
|
+
## 4. Generate eng.md (always)
|
|
60
|
+
|
|
61
|
+
Launch senior-engineer agent:
|
|
62
|
+
```
|
|
63
|
+
You are planning the technical implementation for a feature.
|
|
64
|
+
|
|
65
|
+
Read these files:
|
|
66
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
67
|
+
- {folder}/{feature-slug}/research/RESEARCH.md
|
|
68
|
+
|
|
69
|
+
Produce eng.md — a technical specification covering:
|
|
70
|
+
1. Architecture overview (how it fits into existing codebase)
|
|
71
|
+
2. Dependencies (new packages, existing modules to extend)
|
|
72
|
+
3. Data models (schema changes, new types)
|
|
73
|
+
4. API design (endpoints, contracts, error handling)
|
|
74
|
+
5. File structure (new files to create, existing files to modify)
|
|
75
|
+
6. Testing strategy (what to test, how)
|
|
76
|
+
|
|
77
|
+
Be concrete. Cite existing codebase files and patterns from the research.
|
|
78
|
+
Follow senior-engineer rules from RPI agent guidelines.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 5. Generate pm.md (if not skipped)
|
|
82
|
+
|
|
83
|
+
Launch product-manager agent:
|
|
84
|
+
```
|
|
85
|
+
You are creating product requirements for a feature.
|
|
86
|
+
|
|
87
|
+
Read these files:
|
|
88
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
89
|
+
- {folder}/{feature-slug}/research/RESEARCH.md
|
|
90
|
+
|
|
91
|
+
Produce pm.md — product requirements covering:
|
|
92
|
+
1. User stories with acceptance criteria
|
|
93
|
+
2. Scope definition with effort estimates (S/M/L/XL per item)
|
|
94
|
+
3. Out of scope (what this feature does NOT do)
|
|
95
|
+
4. Success metrics (how to measure if the feature works)
|
|
96
|
+
5. Edge cases and error scenarios
|
|
97
|
+
|
|
98
|
+
Follow product-manager rules from RPI agent guidelines.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 6. Generate ux.md (if not skipped)
|
|
102
|
+
|
|
103
|
+
Launch ux-designer agent:
|
|
104
|
+
```
|
|
105
|
+
You are designing the user experience for a feature.
|
|
106
|
+
|
|
107
|
+
Read these files:
|
|
108
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
109
|
+
- {folder}/{feature-slug}/research/RESEARCH.md
|
|
110
|
+
|
|
111
|
+
Produce ux.md — UX design covering:
|
|
112
|
+
1. User journey (step-by-step flow from entry to completion)
|
|
113
|
+
2. Interaction patterns (what the user sees and does at each step)
|
|
114
|
+
3. Edge cases (errors, empty states, loading, permissions)
|
|
115
|
+
4. Existing components to reuse (cite from codebase research)
|
|
116
|
+
5. Accessibility considerations
|
|
117
|
+
|
|
118
|
+
Follow ux-designer rules from RPI agent guidelines.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 7. Generate PLAN.md
|
|
122
|
+
|
|
123
|
+
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:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
You are creating an implementation plan from the technical spec.
|
|
127
|
+
|
|
128
|
+
Read these files:
|
|
129
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
130
|
+
- {folder}/{feature-slug}/research/RESEARCH.md
|
|
131
|
+
- {folder}/{feature-slug}/plan/eng.md
|
|
132
|
+
- {folder}/{feature-slug}/plan/pm.md (if exists)
|
|
133
|
+
- {folder}/{feature-slug}/plan/ux.md (if exists)
|
|
134
|
+
|
|
135
|
+
Produce PLAN.md — an ordered task checklist organized by phases.
|
|
136
|
+
|
|
137
|
+
Format for each task:
|
|
138
|
+
- [ ] **{phase}.{task}** {Task description}
|
|
139
|
+
Effort: S | M | L | XL | Deps: {task IDs or "none"}
|
|
140
|
+
Files: {files to create or modify}
|
|
141
|
+
Test: {what to test — behavior assertion in plain language}
|
|
142
|
+
|
|
143
|
+
Group tasks into logical phases (e.g., Phase 1: Data Layer, Phase 2: Business Logic, Phase 3: UI, Phase 4: Integration).
|
|
144
|
+
|
|
145
|
+
Rules:
|
|
146
|
+
- Every task should be completable in one focused session
|
|
147
|
+
- L or XL tasks should be broken into smaller subtasks
|
|
148
|
+
- Dependencies must be explicit — no circular deps
|
|
149
|
+
- Files listed must be specific paths, not directories
|
|
150
|
+
- Every task must have a Test field describing what behavior to verify
|
|
151
|
+
- Test descriptions should be assertions, not vague: "returns 404 for missing user" not "test error handling"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 8. Write all artifacts
|
|
155
|
+
|
|
156
|
+
Write all generated files to `{folder}/{feature-slug}/plan/`:
|
|
157
|
+
- `PLAN.md` (always)
|
|
158
|
+
- `eng.md` (always)
|
|
159
|
+
- `pm.md` (if generated)
|
|
160
|
+
- `ux.md` (if generated)
|
|
161
|
+
|
|
162
|
+
## 9. Present plan summary
|
|
163
|
+
|
|
164
|
+
Output:
|
|
165
|
+
```
|
|
166
|
+
Plan created for {feature-slug}:
|
|
167
|
+
- PLAN.md: {N} tasks across {M} phases
|
|
168
|
+
- eng.md: Technical specification
|
|
169
|
+
{- pm.md: Product requirements (if generated)}
|
|
170
|
+
{- ux.md: UX design (if generated)}
|
|
171
|
+
|
|
172
|
+
Next: /rpi:implement {feature-slug}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
</process>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rpi:research
|
|
3
|
+
description: Run research phase on a feature. Parallel agent analysis produces RESEARCH.md with GO/NO-GO verdict. Supports tiers (--quick, --standard, --deep).
|
|
4
|
+
argument-hint: "<feature-slug> [--quick|--standard|--deep] [--force]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Agent
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Run parallel research agents on a feature's REQUEST.md, synthesize findings into RESEARCH.md with a GO/NO-GO verdict.
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<process>
|
|
20
|
+
|
|
21
|
+
## 1. Load config and parse arguments
|
|
22
|
+
|
|
23
|
+
Read `.rpi.yaml` for folder path and default tier.
|
|
24
|
+
Parse `$ARGUMENTS`:
|
|
25
|
+
- First argument: `{feature-slug}` (required)
|
|
26
|
+
- Flags: `--quick`, `--standard`, `--deep` (override config tier)
|
|
27
|
+
- Flag: `--force` (proceed even if previous research exists)
|
|
28
|
+
|
|
29
|
+
## 2. Validate feature
|
|
30
|
+
|
|
31
|
+
Read `{folder}/{feature-slug}/REQUEST.md`. If it doesn't exist, error:
|
|
32
|
+
```
|
|
33
|
+
Feature not found: {folder}/{feature-slug}/REQUEST.md
|
|
34
|
+
Run /rpi:new {feature-slug} first.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If `{folder}/{feature-slug}/research/RESEARCH.md` already exists and `--force` not set, ask user:
|
|
38
|
+
"Research already exists for this feature. Overwrite?"
|
|
39
|
+
|
|
40
|
+
## 3. Determine agent composition by tier
|
|
41
|
+
|
|
42
|
+
**--quick (2 agents):**
|
|
43
|
+
- requirement-parser
|
|
44
|
+
- explore-codebase
|
|
45
|
+
|
|
46
|
+
**--standard (4 agents):**
|
|
47
|
+
- requirement-parser
|
|
48
|
+
- explore-codebase
|
|
49
|
+
- product-manager
|
|
50
|
+
- senior-engineer
|
|
51
|
+
|
|
52
|
+
**--deep (6 agents):**
|
|
53
|
+
- requirement-parser
|
|
54
|
+
- explore-codebase
|
|
55
|
+
- product-manager
|
|
56
|
+
- senior-engineer
|
|
57
|
+
- cto-advisor
|
|
58
|
+
- ux-designer (only if REQUEST.md suggests UI involvement)
|
|
59
|
+
|
|
60
|
+
## 4. Launch research agents in parallel
|
|
61
|
+
|
|
62
|
+
Use the Agent tool to launch ALL selected agents concurrently in a single message.
|
|
63
|
+
|
|
64
|
+
Each agent receives this prompt:
|
|
65
|
+
```
|
|
66
|
+
You are the {role-name} agent for the RPI workflow.
|
|
67
|
+
|
|
68
|
+
Read the following files before analysis:
|
|
69
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
70
|
+
|
|
71
|
+
Then analyze the feature from your role's perspective following the RPI agent guidelines.
|
|
72
|
+
|
|
73
|
+
Your output format:
|
|
74
|
+
## [{Your Role Title}]
|
|
75
|
+
|
|
76
|
+
### {Section Name}
|
|
77
|
+
Verdict: GO | CONCERN | BLOCK
|
|
78
|
+
{Findings with evidence — cite specific files, deps, patterns}
|
|
79
|
+
|
|
80
|
+
### {Next Section}
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
Estimated Complexity: S | M | L | XL
|
|
84
|
+
|
|
85
|
+
Follow your role-specific rules as defined in the rpi-agents skill.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For explore-codebase agent, also instruct it to scan the project codebase for relevant files, patterns, and conventions.
|
|
89
|
+
|
|
90
|
+
## 5. Synthesize into RESEARCH.md
|
|
91
|
+
|
|
92
|
+
After all agents complete, use the Agent tool to launch the doc-synthesizer agent.
|
|
93
|
+
|
|
94
|
+
Prompt:
|
|
95
|
+
```
|
|
96
|
+
You are the doc-synthesizer agent for the RPI workflow.
|
|
97
|
+
|
|
98
|
+
Merge the following research outputs into a single RESEARCH.md:
|
|
99
|
+
|
|
100
|
+
{paste all agent outputs}
|
|
101
|
+
|
|
102
|
+
Follow the RPI agent guidelines for doc-synthesizer:
|
|
103
|
+
1. Executive summary first: verdict, complexity, risk in 5 lines
|
|
104
|
+
2. No contradictions left unresolved
|
|
105
|
+
3. Preserve the strongest finding from each agent
|
|
106
|
+
4. If NO-GO, alternatives section is mandatory
|
|
107
|
+
5. Section order: Summary → Requirements → Product → Codebase → Technical → Strategic → Alternatives
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 6. Write RESEARCH.md
|
|
111
|
+
|
|
112
|
+
Write the synthesized output to `{folder}/{feature-slug}/research/RESEARCH.md`.
|
|
113
|
+
|
|
114
|
+
## 7. Present verdict
|
|
115
|
+
|
|
116
|
+
Display the executive summary to the user.
|
|
117
|
+
|
|
118
|
+
If **GO**:
|
|
119
|
+
```
|
|
120
|
+
Verdict: GO
|
|
121
|
+
Next: /rpi:plan {feature-slug}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If **GO with concerns**:
|
|
125
|
+
```
|
|
126
|
+
Verdict: GO with concerns
|
|
127
|
+
{list concerns}
|
|
128
|
+
Next: /rpi:plan {feature-slug}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If **NO-GO**:
|
|
132
|
+
```
|
|
133
|
+
Verdict: NO-GO
|
|
134
|
+
{reasons}
|
|
135
|
+
|
|
136
|
+
Alternatives:
|
|
137
|
+
{suggested alternatives from research}
|
|
138
|
+
|
|
139
|
+
Override: /rpi:plan {feature-slug} --force
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
</process>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rpi:review
|
|
3
|
+
description: Run code review against the implementation plan. Checks that all tasks are implemented, deviations are justified, and requirements are met.
|
|
4
|
+
argument-hint: "<feature-slug>"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Glob
|
|
8
|
+
- Grep
|
|
9
|
+
- Bash
|
|
10
|
+
- Agent
|
|
11
|
+
- Write
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<objective>
|
|
15
|
+
Review the implementation against the plan. Check completeness, correctness, and plan alignment. Output PASS or FAIL with specific findings.
|
|
16
|
+
</objective>
|
|
17
|
+
|
|
18
|
+
<process>
|
|
19
|
+
|
|
20
|
+
## 1. Load config and validate
|
|
21
|
+
|
|
22
|
+
Read `.rpi.yaml` for folder path.
|
|
23
|
+
Validate that all required files exist:
|
|
24
|
+
- `{folder}/{feature-slug}/plan/PLAN.md`
|
|
25
|
+
- `{folder}/{feature-slug}/plan/eng.md`
|
|
26
|
+
- `{folder}/{feature-slug}/implement/IMPLEMENT.md`
|
|
27
|
+
|
|
28
|
+
If any missing, error with guidance on which command to run.
|
|
29
|
+
|
|
30
|
+
## 2. Gather context
|
|
31
|
+
|
|
32
|
+
Read all plan and implementation files:
|
|
33
|
+
- REQUEST.md (original requirements)
|
|
34
|
+
- RESEARCH.md (research findings)
|
|
35
|
+
- PLAN.md (task checklist)
|
|
36
|
+
- eng.md (technical spec)
|
|
37
|
+
- pm.md (if exists — acceptance criteria)
|
|
38
|
+
- ux.md (if exists — UX requirements)
|
|
39
|
+
- IMPLEMENT.md (implementation record)
|
|
40
|
+
|
|
41
|
+
## 3. Launch code-reviewer agent
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
You are the code-reviewer agent for the RPI workflow.
|
|
45
|
+
|
|
46
|
+
Read these files for the complete feature context:
|
|
47
|
+
- {folder}/{feature-slug}/REQUEST.md
|
|
48
|
+
- {folder}/{feature-slug}/research/RESEARCH.md
|
|
49
|
+
- {folder}/{feature-slug}/plan/PLAN.md
|
|
50
|
+
- {folder}/{feature-slug}/plan/eng.md
|
|
51
|
+
{- {folder}/{feature-slug}/plan/pm.md (if exists)}
|
|
52
|
+
{- {folder}/{feature-slug}/plan/ux.md (if exists)}
|
|
53
|
+
- {folder}/{feature-slug}/implement/IMPLEMENT.md
|
|
54
|
+
|
|
55
|
+
Then review the actual code changes. Use Grep and Glob to find the files listed in the plan and verify the implementation.
|
|
56
|
+
|
|
57
|
+
Your review must check:
|
|
58
|
+
|
|
59
|
+
### 1. Completeness
|
|
60
|
+
- Are all tasks from PLAN.md implemented? List any missing tasks.
|
|
61
|
+
- Are all files from eng.md created/modified as specified?
|
|
62
|
+
|
|
63
|
+
### 2. Correctness
|
|
64
|
+
- Does the implementation match the technical approach in eng.md?
|
|
65
|
+
- If pm.md exists: are acceptance criteria met?
|
|
66
|
+
- If ux.md exists: are user flows implemented correctly?
|
|
67
|
+
|
|
68
|
+
### 3. Deviations
|
|
69
|
+
- Read the Deviations section of IMPLEMENT.md
|
|
70
|
+
- Are listed deviations justified?
|
|
71
|
+
- Are there unlisted deviations (implementation differs from plan but not recorded)?
|
|
72
|
+
|
|
73
|
+
### 4. Test coverage
|
|
74
|
+
- Does every task have at least one test?
|
|
75
|
+
- Do tests exercise real code through public interfaces (no mocks unless external dependency)?
|
|
76
|
+
- Do test names describe behavior clearly?
|
|
77
|
+
- Are edge cases from eng.md covered?
|
|
78
|
+
- If TDD was enabled: verify tests were written before implementation (check git log order)
|
|
79
|
+
|
|
80
|
+
### 5. Code quality
|
|
81
|
+
- Any obvious bugs or logic errors?
|
|
82
|
+
- Security concerns (injection, auth bypass, data exposure)?
|
|
83
|
+
|
|
84
|
+
### Output format:
|
|
85
|
+
|
|
86
|
+
## Review: {feature-slug}
|
|
87
|
+
|
|
88
|
+
### Verdict: {PASS|FAIL}
|
|
89
|
+
|
|
90
|
+
### Completeness
|
|
91
|
+
- {task_id}: {status} — {details}
|
|
92
|
+
|
|
93
|
+
### Correctness
|
|
94
|
+
- {finding with file:line reference}
|
|
95
|
+
|
|
96
|
+
### Deviations
|
|
97
|
+
- {deviation}: {justified|unjustified} — {reason}
|
|
98
|
+
|
|
99
|
+
### Issues (if any)
|
|
100
|
+
- [{severity}] {file}:{line} — {description}
|
|
101
|
+
|
|
102
|
+
Follow code-reviewer rules from RPI agent guidelines:
|
|
103
|
+
- Every finding cites a plan requirement or coding standard
|
|
104
|
+
- No style nitpicks — focus on correctness, completeness, plan alignment
|
|
105
|
+
- Verdict is PASS only if all requirements are met
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 4. Update IMPLEMENT.md
|
|
109
|
+
|
|
110
|
+
Write the review results into the `## Review` section of IMPLEMENT.md.
|
|
111
|
+
|
|
112
|
+
## 5. Present verdict
|
|
113
|
+
|
|
114
|
+
If PASS:
|
|
115
|
+
```
|
|
116
|
+
Review: PASS
|
|
117
|
+
All {N} tasks implemented. Requirements met.
|
|
118
|
+
Feature {feature-slug} is complete.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If FAIL:
|
|
122
|
+
```
|
|
123
|
+
Review: FAIL
|
|
124
|
+
{list specific gaps}
|
|
125
|
+
|
|
126
|
+
Options:
|
|
127
|
+
- Fix the issues and re-run: /rpi:review {feature-slug}
|
|
128
|
+
- Accept as-is: mark complete manually in IMPLEMENT.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
</process>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rpi:simplify
|
|
3
|
+
description: Run code simplification on a feature's implementation. Checks for reuse opportunities, quality issues, and efficiency problems, then fixes them.
|
|
4
|
+
argument-hint: "<feature-slug>"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Agent
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Run 3 parallel code review sub-agents (reuse, quality, efficiency) on the implementation changes, aggregate findings, and fix issues directly.
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<process>
|
|
20
|
+
|
|
21
|
+
## 1. Load config and identify changes
|
|
22
|
+
|
|
23
|
+
Read `.rpi.yaml` for folder path.
|
|
24
|
+
Read `{folder}/{feature-slug}/implement/IMPLEMENT.md` to identify what was implemented.
|
|
25
|
+
|
|
26
|
+
Get the diff of all implementation changes:
|
|
27
|
+
```bash
|
|
28
|
+
git diff HEAD~{number_of_commits}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If no git history, use the files listed in IMPLEMENT.md tasks and read them directly.
|
|
32
|
+
|
|
33
|
+
## 2. Launch 3 parallel sub-agents
|
|
34
|
+
|
|
35
|
+
Use the Agent tool to launch all 3 concurrently in a single message.
|
|
36
|
+
|
|
37
|
+
### Agent 1: Reuse Checker
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
You are checking code for reuse opportunities.
|
|
41
|
+
|
|
42
|
+
Here is the diff of recent changes:
|
|
43
|
+
{diff}
|
|
44
|
+
|
|
45
|
+
For each change:
|
|
46
|
+
1. Search the codebase for existing utilities and helpers that could replace newly written code. Use Grep to find similar patterns — check utility directories, shared modules, and adjacent files.
|
|
47
|
+
2. Flag any new function that duplicates existing functionality. Cite the existing function.
|
|
48
|
+
3. Flag inline logic that could use an existing utility — hand-rolled string manipulation, manual path handling, custom type guards.
|
|
49
|
+
|
|
50
|
+
Output format:
|
|
51
|
+
## Reuse Findings
|
|
52
|
+
- {file}:{line} — {description} → Use existing `{function}` from `{path}`
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Agent 2: Quality Checker
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
You are checking code quality in recent changes.
|
|
59
|
+
|
|
60
|
+
Here is the diff of recent changes:
|
|
61
|
+
{diff}
|
|
62
|
+
|
|
63
|
+
Check for:
|
|
64
|
+
1. Redundant state — state that duplicates existing state, cached values that could be derived
|
|
65
|
+
2. Parameter sprawl — adding parameters instead of restructuring
|
|
66
|
+
3. Copy-paste with slight variation — near-duplicate blocks that should be unified
|
|
67
|
+
4. Leaky abstractions — exposing internals, breaking abstraction boundaries
|
|
68
|
+
5. Stringly-typed code — raw strings where constants or enums exist
|
|
69
|
+
|
|
70
|
+
Output format:
|
|
71
|
+
## Quality Findings
|
|
72
|
+
- {file}:{line} — {pattern}: {description}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Agent 3: Efficiency Checker
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
You are checking code efficiency in recent changes.
|
|
79
|
+
|
|
80
|
+
Here is the diff of recent changes:
|
|
81
|
+
{diff}
|
|
82
|
+
|
|
83
|
+
Check for:
|
|
84
|
+
1. Unnecessary work — redundant computations, repeated reads, duplicate API calls, N+1 patterns
|
|
85
|
+
2. Missed concurrency — independent operations run sequentially
|
|
86
|
+
3. Hot-path bloat — blocking work on startup or per-request paths
|
|
87
|
+
4. Unnecessary existence checks — TOCTOU anti-pattern
|
|
88
|
+
5. Memory — unbounded structures, missing cleanup, listener leaks
|
|
89
|
+
6. Overly broad operations — reading entire files when portion needed
|
|
90
|
+
|
|
91
|
+
Output format:
|
|
92
|
+
## Efficiency Findings
|
|
93
|
+
- {file}:{line} — {pattern}: {description}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 3. Aggregate and fix
|
|
97
|
+
|
|
98
|
+
After all 3 agents complete:
|
|
99
|
+
|
|
100
|
+
1. Collect all findings
|
|
101
|
+
2. Skip false positives — if a finding doesn't apply or isn't worth fixing, skip silently
|
|
102
|
+
3. Fix each valid issue directly using Edit tool
|
|
103
|
+
4. For each fix, note what was changed
|
|
104
|
+
|
|
105
|
+
## 4. Output summary
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Simplify complete for {feature-slug}:
|
|
109
|
+
- Reuse: {N} findings, {M} fixed
|
|
110
|
+
- Quality: {N} findings, {M} fixed
|
|
111
|
+
- Efficiency: {N} findings, {M} fixed
|
|
112
|
+
|
|
113
|
+
{Or: "Code was already clean — no issues found."}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If called from /rpi:implement, return findings for recording in IMPLEMENT.md.
|
|
117
|
+
|
|
118
|
+
</process>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rpi:status
|
|
3
|
+
description: Show all RPI features and their current phase, progress, and status.
|
|
4
|
+
argument-hint: "[feature-slug]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Glob
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
Display detailed status cards for all features (or a specific feature) in the RPI workflow.
|
|
13
|
+
</objective>
|
|
14
|
+
|
|
15
|
+
<process>
|
|
16
|
+
|
|
17
|
+
## 1. Load config
|
|
18
|
+
|
|
19
|
+
Read `.rpi.yaml` for folder path. Default to `rpi/` if not found.
|
|
20
|
+
|
|
21
|
+
## 2. Discover features
|
|
22
|
+
|
|
23
|
+
Use Glob to find all `REQUEST.md` files:
|
|
24
|
+
```
|
|
25
|
+
{folder}/*/REQUEST.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Each parent directory is a feature slug.
|
|
29
|
+
|
|
30
|
+
If `$ARGUMENTS` specifies a feature slug, filter to that feature only.
|
|
31
|
+
|
|
32
|
+
If no features found:
|
|
33
|
+
```
|
|
34
|
+
No RPI features found in {folder}/.
|
|
35
|
+
Run /rpi:new to start your first feature.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 3. Determine phase for each feature
|
|
39
|
+
|
|
40
|
+
For each feature slug, check which files exist:
|
|
41
|
+
|
|
42
|
+
- `REQUEST.md` exists, no `research/RESEARCH.md` → Phase: **new**
|
|
43
|
+
- `research/RESEARCH.md` exists, no `plan/PLAN.md` → Phase: **researched**
|
|
44
|
+
- `plan/PLAN.md` exists, no `implement/IMPLEMENT.md` → Phase: **planned**
|
|
45
|
+
- `implement/IMPLEMENT.md` exists → Phase: **implementing** or **complete**
|
|
46
|
+
|
|
47
|
+
## 4. Gather details per feature
|
|
48
|
+
|
|
49
|
+
For each feature, read the relevant files to extract:
|
|
50
|
+
|
|
51
|
+
**If researched or later:**
|
|
52
|
+
- Read RESEARCH.md executive summary for verdict and complexity
|
|
53
|
+
|
|
54
|
+
**If planned or later:**
|
|
55
|
+
- Read PLAN.md to count total tasks and phases
|
|
56
|
+
|
|
57
|
+
**If implementing:**
|
|
58
|
+
- Read IMPLEMENT.md to count completed tasks `[x]` vs total `[ ]`
|
|
59
|
+
- Identify current task (first unchecked)
|
|
60
|
+
- Check for review verdict
|
|
61
|
+
|
|
62
|
+
**If complete:**
|
|
63
|
+
- Read IMPLEMENT.md for final review verdict and completion timestamp
|
|
64
|
+
|
|
65
|
+
## 5. Display detailed cards
|
|
66
|
+
|
|
67
|
+
Output a card per feature:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## {feature-slug}
|
|
71
|
+
Phase: {phase} ({progress details})
|
|
72
|
+
Verdict: {GO|GO with concerns|NO-GO|—}
|
|
73
|
+
{Complexity: S|M|L|XL (if known)}
|
|
74
|
+
{Current: Task {id} — {name} (if implementing)}
|
|
75
|
+
{Review: PASS|FAIL (if reviewed)}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Example output:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
# RPI Status
|
|
82
|
+
|
|
83
|
+
## oauth2-auth
|
|
84
|
+
Phase: implement (6/9 tasks)
|
|
85
|
+
Verdict: GO
|
|
86
|
+
Complexity: M
|
|
87
|
+
Current: Task 2.1 — Login component
|
|
88
|
+
|
|
89
|
+
## payment-system
|
|
90
|
+
Phase: research
|
|
91
|
+
Verdict: pending
|
|
92
|
+
Complexity: —
|
|
93
|
+
|
|
94
|
+
## dark-mode
|
|
95
|
+
Phase: plan (ready to implement)
|
|
96
|
+
Verdict: GO
|
|
97
|
+
Complexity: S
|
|
98
|
+
|
|
99
|
+
## csv-export
|
|
100
|
+
Phase: new
|
|
101
|
+
Verdict: —
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 6. Suggest next action
|
|
105
|
+
|
|
106
|
+
For each feature, suggest the logical next command:
|
|
107
|
+
- **new** → `/rpi:research {slug}`
|
|
108
|
+
- **researched (GO)** → `/rpi:plan {slug}`
|
|
109
|
+
- **researched (NO-GO)** → Review alternatives or `/rpi:plan {slug} --force`
|
|
110
|
+
- **planned** → `/rpi:implement {slug}`
|
|
111
|
+
- **implementing** → `/rpi:implement {slug} --resume`
|
|
112
|
+
- **complete (PASS)** → Done
|
|
113
|
+
- **complete (FAIL)** → `/rpi:review {slug}`
|
|
114
|
+
|
|
115
|
+
</process>
|