pi-feature-dev 1.7.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-feature-dev",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Portable coding-agent workflows packaged as skills.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,201 +1,187 @@
1
1
  ---
2
2
  name: plan-review
3
- description: Review implementation plans before execution. Use after a plan is created or when the user asks to validate a plan for correctness, scope, over-engineering, missing tests, unclear tasks, or project-convention fit. Reviews plan files such as docs/plans/*.md or a user-provided plan path. Prefer isolated read-only review when the host and policy support subagents, fresh-context workers, or review-only agents.
3
+ description: Review implementation plans against the actual repository before execution, combining plan-quality checks with an evidence-backed technical pre-mortem and a PASS / REVISE / BLOCK verdict. Use after a plan is created or when the user asks to validate a plan for correctness, scope, over-engineering, missing tests, project-convention fit, blast radius, rollback, migration risk, contract risk, authorization risk, production-config risk, or what could break. Review plan files such as docs/plans/*.md or a user-provided plan path. Prefer isolated read-only review when the host and policy support it.
4
4
  ---
5
5
 
6
+ # Plan Review
6
7
 
7
- You are an expert plan reviewer specializing in validating implementation plans before execution. Your role is to ensure plans solve the stated problem correctly, avoid over-engineering, include proper testing, and follow project conventions.
8
+ Review the plan before implementation. First verify that it solves the stated
9
+ problem with the smallest repository-aligned approach. Then assume the plan has
10
+ already shipped and failed; work backward from repository evidence to explain
11
+ why.
8
12
 
9
- **CRITICAL: READ-ONLY. Never modify files, only analyze and report findings.**
13
+ **Remain read-only. Analyze and report; never implement or edit the plan.**
10
14
 
11
- **CRITICAL: Every finding MUST include `[plan-review]` tag and reference specific plan sections.**
15
+ **Prefix every finding with `[plan-review]` and identify the affected plan
16
+ section or task.**
12
17
 
13
- ## Isolation Protocol
18
+ ## Isolate the Review
14
19
 
15
- Prefer an isolated reviewer when the host agent and active policy support subagents, fresh-context workers, review-only agents, or equivalent delegation.
20
+ Prefer an isolated reviewer when the host agent and active policy support
21
+ fresh-context, read-only workers or equivalent delegation.
16
22
 
17
23
  Give the isolated reviewer only:
18
- - The plan path or plan text
19
- - The original user request, if available
20
- - The repository root
21
- - Any explicit review focus from the user
22
-
23
- Do not pass the plan creator's hidden reasoning, conclusions, intended fixes, confidence claims, or prior review commentary.
24
-
25
- If isolated review is unavailable, perform a local read-only review. Treat prior planning context as untrusted, reload the plan and relevant project files from disk, and judge the plan against the repository and the original request.
26
-
27
- ## Expected Plan Contract
28
-
29
- A good implementation plan should include:
30
- - The problem being solved
31
- - Relevant files, systems, or workflows
32
- - Project context and existing patterns
33
- - A development approach
34
- - Ordered implementation tasks
35
- - Per-task code actions
36
- - Per-task test actions
37
- - Verification commands
38
- - Acceptance criteria or final validation
39
- - Explicit non-goals or post-completion work when relevant
40
-
41
- If the plan was created by `plan-make`, also check that it follows the expected structure from that skill, but do not require loading `plan-make` to perform this review.
42
-
43
- Key rules for implementation tasks:
44
- - Each task = one logical unit (one function, one endpoint, one component, one migration step, etc.)
45
- - Use specific descriptive names, not generic "[Core Logic]" or "[Implementation]"
46
- - Aim for ~5 checkboxes per task (more is OK if logically atomic)
47
- - Each code-change task MUST include writing/updating tests before moving to the next task
48
- - Tests are separate checklist items, not bundled with implementation
49
- - Relevant tests must be run and pass before moving to the next task
50
-
51
- ## Review Workflow
52
-
53
- ### Step 1: Locate Plan File
54
-
55
- 1. If the user provided a plan path, review that plan
56
- 2. Check `docs/plans/` for plan files (exclude `completed/` subdirectory)
57
- 3. If multiple plans exist and context is unclear, list available plans and ask user which to review
58
- 4. If no plans found, inform user and ask for plan location
59
-
60
- ### Step 2: Load Project Context
61
-
62
- Read relevant project guidance when present:
63
- - `AGENTS.md`
64
- - `CLAUDE.md`
65
- - nearby README or contributor docs
66
-
67
- Then:
68
- 1. Check for existing code patterns the plan should follow
69
- 2. Understand the codebase structure relevant to the plan
70
- 3. Limit context loading to files relevant to the plan's scope
71
-
72
- ### Step 3: Analyze Plan
73
-
74
- **Review Checklist:**
75
-
76
- #### Problem Definition (Critical)
77
- - Plan clearly states what problem is being solved
78
- - Problem description is specific, not vague
79
- - Success criteria are implicit or explicit
80
-
81
- #### Solution Correctness (Critical)
82
- - Proposed solution actually addresses the stated problem
83
- - No missing steps that would leave problem unsolved
84
- - Edge cases considered
85
-
86
- #### Scope Assessment (Important)
87
- - Scope is appropriate - not too broad, not too narrow
88
- - No scope creep (unrelated features bundled in)
89
- - Dependencies between tasks are logical
90
-
91
- #### Over-Engineering Detection (Critical)
92
- Patterns to detect:
93
- - Unnecessary abstractions
94
- - Premature generalization
95
- - Pattern abuse (using design patterns where simple code suffices)
96
- - Features "just in case" (YAGNI violations)
97
- - Excessive layering
98
- - Complex where simple would work
99
-
100
- #### Testing Requirements (Critical)
101
- Per expected plan contract:
102
- - Every code-change task includes test writing as separate checklist items
103
- - Tests for success AND error cases specified
104
- - Relevant test commands are listed and must pass before the next task
105
- - Test locations specified (path to test file)
106
-
107
- #### Maintainability (Important)
108
- - Solution will produce readable, maintainable code
109
- - Follows project conventions from loaded project instructions
110
- - No clever solutions where clear would work
111
- - Appropriate decomposition
112
-
113
- #### Task Granularity (Important)
114
- - Tasks are one logical unit (not multiple features bundled)
115
- - Specific names, not generic like "[Core Logic]"
116
- - Approximately 5 checkboxes per task (more OK if atomic)
117
- - Clear progression from task to task
118
-
119
- #### Convention Adherence (Important)
120
- - Follows naming conventions from loaded project instructions
121
- - Matches existing code patterns in the project
122
- - Uses project's preferred libraries/approaches
123
- - Comment style matches project rules
124
- - Aligns with user-provided custom rules (if loaded above)
125
-
126
- ## Output Format
127
-
128
- ```
129
- ## Plan Review: [plan-filename]
130
-
131
- ### Summary
132
- Brief assessment of plan quality (2-3 sentences)
133
-
134
- ### Critical Issues
135
- Issues that would cause the plan to fail or produce incorrect results.
136
-
137
- 1. [plan-review] **Section: Implementation Steps > Task 2** (severity: critical)
138
- - Issue: Task bundles multiple unrelated features (user auth + logging)
139
- - Impact: Will create tangled code, harder to test and review
140
- - Fix: Split into Task 2a (user auth) and Task 2b (logging)
141
-
142
- ### Important Issues
143
- Issues affecting quality or maintainability.
144
-
145
- 1. [plan-review] **Section: Technical Details** (severity: important)
146
- - Issue: Proposes custom validation library when project uses go-playground/validator
147
- - Impact: Inconsistent with existing codebase patterns
148
- - Fix: Use existing validator with custom rules
149
-
150
- ### Minor Issues
151
- Suggestions for improvement.
152
-
153
- 1. [plan-review] **Section: Overview** (severity: minor)
154
- - Issue: Success criteria not explicitly stated
155
- - Fix: Add "Acceptance Criteria" subsection
156
-
157
- ### Over-Engineering Concerns
158
- Specific patterns detected that add unnecessary complexity:
159
-
160
- - [plan-review] **Task 4**: Proposes interface for single implementation - defer abstraction until needed
161
- - [plan-review] **Technical Details**: Custom error type hierarchy when simple wrapped errors suffice
162
-
163
- ### Testing Coverage Assessment
164
- - Tasks with proper test requirements: X/Y
165
- - Missing test specifications: [list tasks]
166
- - Test-first (TDD) compliance: [yes/partial/no]
167
-
168
- ### Verdict
169
- **[APPROVE / APPROVE WITH NOTES / NEEDS REVISION]**
170
-
171
- [If NEEDS REVISION]:
172
- Priority fixes before implementation:
173
- 1. [most critical fix]
174
- 2. [second priority]
175
- 3. [third priority]
176
- ```
177
-
178
- ## Key Principles
179
-
180
- 1. **Solve the actual problem** - Plans must address the stated problem, not adjacent issues
181
- 2. **YAGNI ruthlessly** - Flag anything "for future flexibility" without current need
182
- 3. **Tests are mandatory** - Every code-change task must include test requirements
183
- 4. **Match existing patterns** - New code should look like it belongs in the codebase
184
- 5. **Simple over clever** - Prefer straightforward solutions
185
- 6. **Ask when unclear** - If plan context is ambiguous, ask user rather than guess
186
-
187
- ## When NOT to Flag
188
-
189
- - Reasonable abstractions that solve real problems
190
- - Testing infrastructure that the plan will actually use
191
- - Complexity that's inherent to the problem domain
192
- - Patterns that match existing codebase conventions
193
-
194
- ## Confidence Scoring
195
-
196
- Rate severity as:
197
- - **Critical**: Would cause plan failure or major issues
198
- - **Important**: Affects quality but plan could work
199
- - **Minor**: Suggestions for polish
200
-
201
- Only report issues you're confident about. If unsure whether something is over-engineering, note it as a question rather than a finding.
24
+
25
+ - The plan path or plan text.
26
+ - The original user request, if available.
27
+ - The repository root.
28
+ - Any explicit review focus from the user.
29
+
30
+ Do not pass the plan creator's hidden reasoning, conclusions, intended fixes,
31
+ confidence claims, or prior review commentary.
32
+
33
+ If isolation is unavailable, perform the review locally. Treat prior planning
34
+ context as untrusted, reload the plan and relevant project files from disk, and
35
+ judge the plan against the repository and original request.
36
+
37
+ ## Resolve the Review Target
38
+
39
+ 1. Review the user-provided plan path or plan text when present.
40
+ 2. Otherwise, list plans in `docs/plans/`, excluding `completed/`.
41
+ 3. If exactly one current plan exists, review it.
42
+ 4. If multiple plans exist and context does not identify one, ask the user to
43
+ choose.
44
+ 5. If no plan is available, ask for its path or text.
45
+
46
+ ## Build Repository Evidence
47
+
48
+ Read applicable project guidance such as `AGENTS.md`, `CLAUDE.md`, nearby
49
+ README files, and contributor documentation. Inspect the code and tests named
50
+ by the plan, then read their exports, immediate callers, and shared utilities.
51
+ Trace relevant data and control flow to repository boundaries.
52
+
53
+ Inspect migrations, schemas, configuration, deployment paths, authorization,
54
+ jobs, queues, caches, and operational documentation only when the planned
55
+ change can reach them. Prefer active code, tests, ADRs, and contracts over
56
+ generic best practice or historical precedent.
57
+
58
+ ## Run the Plan-Quality Pass
59
+
60
+ Check that the plan:
61
+
62
+ - States the actual problem, requested outcome, assumptions, non-goals, and
63
+ acceptance criteria.
64
+ - Records the relevant repository context, affected files, systems, and
65
+ workflows, the selected approach, and why it fits active patterns.
66
+ - Proposes a solution that can produce the outcome without missing steps and
67
+ handles relevant domain edge cases and failure paths.
68
+ - Keeps scope neither too broad nor too narrow: include all work required for
69
+ the outcome and exclude unrelated work.
70
+ - Follows all user and repository instructions, current code patterns, naming
71
+ and comment conventions, and preferred existing libraries.
72
+ - Produces readable, maintainable code through appropriate decomposition; do
73
+ not accept cleverness or layering that the problem does not require.
74
+ - Orders dependencies correctly and divides work into concrete, atomic tasks
75
+ with descriptive names and exact files, symbols, and commands.
76
+ - Gives every code-change task separate test work that protects the intended
77
+ rule, including exact test-file locations and relevant success, error, and
78
+ edge cases.
79
+ - Requires relevant tests to pass before the next task, names exact verification
80
+ commands, and records any external, credentialed, manual, or
81
+ environment-dependent step needed for completion.
82
+
83
+ If `plan-make` created the plan, also check its self-contained plan contract.
84
+ Do not require its exact headings when the same information is clear elsewhere.
85
+
86
+ ### Reject Over-Engineering and YAGNI Violations
87
+
88
+ Actively look for:
89
+
90
+ - Unnecessary abstractions or interfaces without a current use.
91
+ - Premature generalization and flexibility added "just in case."
92
+ - Pattern abuse where direct code meets the requirement.
93
+ - Excessive layers, indirection, configuration, or extension points.
94
+ - New dependencies or custom utilities that duplicate repository or standard
95
+ capabilities.
96
+ - Features and infrastructure not required by the requested outcome.
97
+
98
+ Require the simpler alternative when it satisfies the current requirement and
99
+ repository constraints. Do not flag complexity inherent to the domain.
100
+
101
+ Resolve uncertainty from repository evidence first. If a user decision could
102
+ change behavior, scope, approach, or verdict, ask instead of guessing. If the
103
+ review must conclude before the user answers, report the decision as `UNKNOWN`
104
+ and return `BLOCK` rather than inventing an assumption.
105
+
106
+ ## Run the Technical Pre-Mortem Pass
107
+
108
+ Assume the planned change was merged, deployed, and failed. Investigate the
109
+ failure as an accomplished fact instead of asking abstractly what might go
110
+ wrong.
111
+
112
+ Reconstruct the blast radius:
113
+
114
+ 1. Identify what the plan changes.
115
+ 2. Trace what depends on each changed surface.
116
+ 3. Trace what state, identity, contract, configuration, or infrastructure those
117
+ dependents share.
118
+
119
+ Use these as relevance-gated leads, not a coverage quota. Skip what the change
120
+ cannot touch, and follow evidence beyond this list:
121
+
122
+ - Historical, partial, and in-flight rows; migration ordering and
123
+ reversibility.
124
+ - Indirect contract consumers, strict schemas, and mixed-version coexistence.
125
+ - The sole producer of an identity, code, or foreign key.
126
+ - Authorization, ownership, tenancy, row scope, and secrets.
127
+ - Concurrency, idempotency, shared state, and partial failure.
128
+ - Deploy order, configuration defaults, and manual operational steps.
129
+ - Rollback: whether the documented lever still reverts the change and what
130
+ state survives in data, caches, queues, or jobs.
131
+ - Whether the system records the value that actually took effect, so a no-op
132
+ release remains distinguishable from a real one.
133
+ - Claims that a path is dormant, unused, or safe; verify them independently.
134
+ - Tests that mock the changed boundary, assert an implementation path instead
135
+ of an effect, or can pass after removing the assertion that protects the
136
+ rule.
137
+ - Mechanical fallout such as unused imports, dead code, lint failures, or type
138
+ errors caused by removing or replacing a branch.
139
+
140
+ ## Admit Findings Only With Proof
141
+
142
+ Before reporting a finding or requiring a plan edit, try to disprove it against
143
+ the repository. Admit it only when you can name the artifact that establishes
144
+ its premise and explain the causal link to the consequence. A `path:line`
145
+ citation alone is not evidence.
146
+
147
+ For every finding, provide:
148
+
149
+ - The failure symptom.
150
+ - The causal mechanism and supporting `path:line` evidence.
151
+ - One operation that would prove the finding false: a query, test, or file to
152
+ inspect.
153
+ - The smallest plan edit that prevents or contains the failure.
154
+
155
+ Report a claim as `UNKNOWN` only when the missing fact could change the verdict;
156
+ otherwise omit it. Keep verified facts separate from assumptions.
157
+
158
+ Treat repository ADRs, invariants, and active public or domain contracts as
159
+ constraints. Prescribe the mechanism the repository sanctions today, never one
160
+ it retires or forbids. If the plan genuinely requires a deviation, return
161
+ `BLOCK` for an owner decision instead of presenting the deviation as a routine
162
+ mitigation.
163
+
164
+ Do not invent findings to fill categories. Do not flag necessary domain
165
+ complexity, used test infrastructure, or repository-standard patterns without
166
+ evidence of harm.
167
+
168
+ ## Report the Result
169
+
170
+ Order findings by harm. Prefix each finding with `[plan-review]`, cite the plan
171
+ section or task, and include symptom, mechanism, falsifier, and smallest required
172
+ edit. Do not emit empty severity sections or follow a fixed finding quota.
173
+
174
+ After the findings, report:
175
+
176
+ - **Blast radius**: verified dependents and shared surfaces affected by the
177
+ plan.
178
+ - **Rollback**: the actual rollback lever, residual state, and any
179
+ verdict-changing unknowns.
180
+ - **Verdict**:
181
+ - **PASS** — implementable as written.
182
+ - **REVISE** — implementable only after the named plan edits; state those
183
+ edits as requirements, not advice.
184
+ - **BLOCK** — do not implement until an unmitigated blocking risk, forbidden
185
+ mechanism, or owner decision is resolved.
186
+
187
+ Report and stop. Do not implement.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Plan Review"
3
- short_description: "Review implementation plans before execution"
4
- default_prompt: "Use $plan-review to review this implementation plan for correctness, scope, testing, and project fit."
3
+ short_description: "Evidence-backed plan review and pre-mortem"
4
+ default_prompt: "Use $plan-review to review this implementation plan against the repository, run a technical pre-mortem, and return a PASS / REVISE / BLOCK verdict."