@windagency/valora-plugin-engineering 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.
@@ -0,0 +1,551 @@
1
+ ---
2
+ name: review-plan
3
+ description: Validate implementation plan quality, completeness, and feasibility before execution begins
4
+ experimental: true
5
+ argument-hint: '<plan-document-path> [--strict-mode] [--threshold=7.0] [--focus=<completeness|risks|feasibility|actionability|all>] [--checklist]'
6
+ allowed-tools:
7
+ - codebase_search
8
+ - read_file
9
+ - grep
10
+ - list_dir
11
+ - glob_file_search
12
+ - run_terminal_cmd # Required for modern CLI tools (jq, yq, rg, fd)
13
+ - query_session
14
+ model: gpt-5-thinking-high
15
+ agent: lead
16
+ prompts:
17
+ pipeline:
18
+ - stage: context
19
+ prompt: context.load-plan-context
20
+ required: true
21
+ inputs:
22
+ plan_document: $ARG_1
23
+ previous_plan_version: $CONTEXT_previous_plan
24
+ outputs:
25
+ - plan_structure
26
+ - task_requirements
27
+ - complexity_assessment
28
+ - stage: completeness
29
+ prompt: review.validate-completeness
30
+ batch: true
31
+ required: true
32
+ inputs:
33
+ document_type: 'plan'
34
+ plan_structure: $STAGE_context.plan_structure
35
+ task_requirements: $STAGE_context.task_requirements
36
+ outputs:
37
+ - completeness_score
38
+ - missing_sections
39
+ - gaps_identified
40
+ - stage: feasibility
41
+ prompt: review.validate-technical-feasibility
42
+ required: true
43
+ parallel: true
44
+ inputs:
45
+ plan_structure: $STAGE_context.plan_structure
46
+ complexity_assessment: $STAGE_context.complexity_assessment
47
+ outputs:
48
+ - feasibility_score
49
+ - technical_concerns
50
+ - blockers_identified
51
+ - stage: risks
52
+ prompt: review.validate-risk-coverage
53
+ batch: true
54
+ required: true
55
+ parallel: true
56
+ inputs:
57
+ plan_structure: $STAGE_context.plan_structure
58
+ complexity_assessment: $STAGE_context.complexity_assessment
59
+ outputs:
60
+ - risk_coverage_score
61
+ - unaddressed_risks
62
+ - mitigation_gaps
63
+ - stage: steps
64
+ prompt: review.validate-step-quality
65
+ batch: true
66
+ required: true
67
+ parallel: true
68
+ inputs:
69
+ plan_structure: $STAGE_context.plan_structure
70
+ outputs:
71
+ - step_quality_score
72
+ - vague_steps
73
+ - actionability_issues
74
+ - stage: tests
75
+ prompt: review.validate-test-strategy
76
+ batch: true
77
+ required: true
78
+ parallel: true
79
+ inputs:
80
+ plan_structure: $STAGE_context.plan_structure
81
+ outputs:
82
+ - test_coverage_score
83
+ - testing_gaps
84
+ - stage: synthesis
85
+ prompt: review.synthesize-plan-assessment
86
+ batch: true
87
+ required: true
88
+ inputs:
89
+ completeness_score: $STAGE_completeness.completeness_score
90
+ feasibility_score: $STAGE_feasibility.feasibility_score
91
+ risk_coverage_score: $STAGE_risks.risk_coverage_score
92
+ step_quality_score: $STAGE_steps.step_quality_score
93
+ test_coverage_score: $STAGE_tests.test_coverage_score
94
+ all_gaps: $STAGE_completeness.gaps_identified
95
+ all_concerns: $STAGE_feasibility.technical_concerns
96
+ outputs:
97
+ - overall_confidence
98
+ - go_no_go_decision
99
+ - improvement_recommendations
100
+ - critical_issues
101
+ merge_strategy: sequential
102
+ rollback_on_failure: context
103
+ cache_strategy: none
104
+ retry_policy:
105
+ max_attempts: 1
106
+ backoff_ms: 0
107
+ retry_on:
108
+ - error
109
+ ---
110
+
111
+ # Plan Review Command
112
+
113
+ ## Role
114
+
115
+ Use the [agent] profile
116
+
117
+ ## Goal
118
+
119
+ **Validate implementation plan quality and readiness** by conducting a comprehensive review to ensure the plan is complete, feasible, safe, and actionable before implementation begins. This command serves as a **critical quality gate** preventing flawed plans from reaching execution.
120
+
121
+ **Primary Objectives**:
122
+
123
+ 1. **Validate completeness** - Ensure all required plan sections are present and thorough
124
+ 2. **Assess technical feasibility** - Verify proposed approach is implementable with available tools/knowledge
125
+ 3. **Evaluate risk coverage** - Confirm all risks are identified with adequate mitigation strategies
126
+ 4. **Review step quality** - Ensure implementation steps are clear, specific, and actionable
127
+ 5. **Validate test strategy** - Confirm testing approach is comprehensive and realistic
128
+ 6. **Check dependencies** - Verify all dependencies are identified and available
129
+ 7. **Assess effort estimates** - Evaluate if time/complexity estimates are reasonable
130
+ 8. **Make go/no-go decision** - Provide clear recommendation: proceed or revise plan
131
+
132
+ **This command answers**: "Is this plan ready for implementation, or does it need refinement?"
133
+
134
+ ## Context
135
+
136
+ ### Input Arguments
137
+
138
+ ```plaintext
139
+ $ARGUMENTS
140
+ ```
141
+
142
+ ### Configuration Parameters
143
+
144
+ ```structured
145
+ <details>
146
+ <summary>Review Configuration Options</summary>
147
+
148
+ **--strict-mode** (default: false)
149
+ - Enable strict validation with higher quality thresholds
150
+ - Any score below 8/10 triggers no-go recommendation
151
+ - Requires explicit mitigation for all identified risks
152
+
153
+ **--focus** (default: all)
154
+ - `completeness` - Deep dive on plan structure and sections
155
+ - `risks` - Emphasize risk assessment and mitigation quality
156
+ - `feasibility` - Focus on technical implementability
157
+ - `actionability` - Prioritize step clarity and specificity
158
+ - `all` - Comprehensive review across all dimensions
159
+
160
+ **--threshold** (default: 7.0)
161
+ - Minimum overall confidence score to recommend proceeding
162
+ - Range: 0-10 (scores below threshold = no-go)
163
+ - Strict mode overrides this to 8.0
164
+
165
+ **--compare-to** (optional)
166
+ - Previous plan version for comparison
167
+ - Highlights improvements or regressions
168
+ - Validates that feedback was addressed
169
+
170
+ **--checklist** (default: false)
171
+ - Quick validation mode using PLAN_QUALITY_CHECKLIST.md template
172
+ - Binary Y/N validation of 35 items across 7 sections
173
+ - Target completion: ~3 minutes (vs ~14 min for full review)
174
+ - Skips detailed narrative assessment, focuses on pass/fail criteria
175
+ - Use for pre-review self-validation before full review
176
+ - Quality gate: 80% (28/35 items) must pass
177
+
178
+ **--skip-iterations-if-excellent** (default: true)
179
+ - Enable early exit optimization for high-confidence plans
180
+ - If overall confidence ≥ 8.5 AND no critical blockers AND all dimensions ≥ 7.0
181
+ - Skips secondary review iterations, immediately proceeds to GO decision
182
+ - Saves 10-15 minutes per review when conditions are met
183
+ - Recommended for low-risk, well-structured plans
184
+
185
+ </details>
186
+ ```
187
+
188
+ ### Session Context Variables
189
+
190
+ The command leverages session context for enhanced functionality:
191
+
192
+ **Input Variables** (optional):
193
+
194
+ - `$CONTEXT_previous_plan`: Path to previous plan version for comparison (set via `--compare-to` flag or session)
195
+ - `$SESSION_gathered_knowledge`: Codebase context from prior `gather-knowledge` execution
196
+
197
+ **Output Variables** (produced):
198
+
199
+ - `$SESSION_last_review_decision`: GO or NO-GO decision from this review
200
+ - `$SESSION_last_review_score`: Overall confidence score (0-10)
201
+ - `$SESSION_last_review_report`: Path to generated review report
202
+
203
+ These variables enable workflow continuity across commands within the same session.
204
+
205
+ ### Review Dimensions
206
+
207
+ The review evaluates plans across these quality dimensions:
208
+
209
+ 1. **Completeness (20%)** - All required sections present and thorough
210
+ 2. **Feasibility (25%)** - Technically implementable with available resources
211
+ 3. **Risk Coverage (20%)** - Risks identified and properly mitigated
212
+ 4. **Step Quality (20%)** - Clear, specific, actionable implementation steps
213
+ 5. **Test Strategy (15%)** - Comprehensive testing approach defined
214
+
215
+ **Overall Confidence Score** = Weighted average of dimension scores
216
+
217
+ ## Rules
218
+
219
+ ### Quality Thresholds
220
+
221
+ The review evaluates plans across 5 dimensions, each contributing to an overall confidence score:
222
+
223
+ **Overall Confidence Ranges**:
224
+
225
+ - **9.0-10.0** → EXCELLENT - Proceed with high confidence
226
+ - **7.5-8.9** → GOOD - Proceed with normal confidence
227
+ - **6.0-7.4** → ACCEPTABLE - Proceed with caution
228
+ - **4.0-5.9** → NEEDS WORK - Revise plan before proceeding
229
+ - **0.0-3.9** → INADEQUATE - Major revision required
230
+
231
+ **Decision Logic**:
232
+
233
+ - Score ≥ threshold (default 7.0) AND no critical blockers → **GO**
234
+ - Score < threshold OR critical blocker present → **NO-GO**
235
+ - Strict mode: threshold = 8.0
236
+
237
+ ### Dimension Weights
238
+
239
+ ```plaintext
240
+ Overall Confidence = (
241
+ Completeness × 20% +
242
+ Feasibility × 25% +
243
+ Risk Coverage × 20% +
244
+ Step Quality × 20% +
245
+ Test Strategy × 15%
246
+ )
247
+ ```
248
+
249
+ **Each dimension is evaluated in detail by its respective prompt**:
250
+
251
+ 1. `review.validate-plan-completeness` - Checks all required sections are present and substantive
252
+ 2. `review.validate-technical-feasibility` - Verifies approach is technically sound and implementable
253
+ 3. `review.validate-risk-coverage` - Ensures risks are identified and mitigated
254
+ 4. `review.validate-step-quality` - Confirms steps are clear, specific, and actionable
255
+ 5. `review.validate-test-strategy` - Validates comprehensive testing approach
256
+
257
+ ### Critical Blockers (Automatic NO-GO)
258
+
259
+ Any of these triggers immediate NO-GO regardless of score:
260
+
261
+ - Technical impossibility or unavailable dependencies
262
+ - Data loss risk without mitigation
263
+ - Security vulnerability without remediation
264
+ - Breaking change without compatibility plan
265
+ - High-severity risk without mitigation strategy
266
+
267
+ ## Process Steps
268
+
269
+ The review follows a structured pipeline executed by specialized prompts:
270
+
271
+ ### Step 1: Load Plan Context
272
+
273
+ **Prompt**: `review.load-plan-context`
274
+
275
+ Parse the implementation plan document to extract structure, requirements, complexity assessment, and metadata.
276
+
277
+ **Outputs**: plan_structure, task_requirements, complexity_assessment
278
+
279
+ ### Step 2: Validate Completeness
280
+
281
+ **Prompt**: `review.validate-completeness` (document_type="plan")
282
+
283
+ Ensure all 8 required plan sections are present with substantive, task-specific content. Uses the reusable completeness validation prompt configured for plan validation.
284
+
285
+ **Required Sections**: Task Overview, Complexity Assessment, Dependencies, Risk Assessment, Implementation Steps, Testing Strategy, Rollback Strategy, Effort Estimate
286
+
287
+ **Outputs**: completeness_score (0-10), missing_sections, gaps_identified
288
+
289
+ ### Step 3: Validate Technical Feasibility
290
+
291
+ **Prompt**: `review.validate-technical-feasibility`
292
+
293
+ Assess if the proposed approach is technically sound, dependencies are available, and complexity assessment is realistic. Uses codebase search to verify existing patterns and dependencies.
294
+
295
+ **Outputs**: feasibility_score (0-10), technical_concerns, blockers_identified
296
+
297
+ ### Step 4: Validate Risk Coverage
298
+
299
+ **Prompt**: `review.validate-risk-coverage`
300
+
301
+ Ensure risks across all categories (technical, business, operational) are identified with appropriate severity and mitigation strategies.
302
+
303
+ **Outputs**: risk_coverage_score (0-10), unaddressed_risks, mitigation_gaps
304
+
305
+ ### Step 5: Validate Step Quality
306
+
307
+ **Prompt**: `review.validate-step-quality`
308
+
309
+ Verify implementation steps are atomic, specific, actionable, properly sequenced, and include validation criteria.
310
+
311
+ **Outputs**: step_quality_score (0-10), vague_steps, actionability_issues
312
+
313
+ ### Step 6: Validate Test Strategy
314
+
315
+ **Prompt**: `review.validate-test-strategy`
316
+
317
+ Confirm testing approach covers necessary test types, scenarios (happy path, errors, edge cases), and has clear acceptance criteria.
318
+
319
+ **Outputs**: test_coverage_score (0-10), testing_gaps
320
+
321
+ ### Step 7: Synthesize Assessment
322
+
323
+ **Prompt**: `review.synthesize-plan-assessment`
324
+
325
+ Calculate overall confidence score using weighted average, aggregate all issues, make go/no-go decision, and generate comprehensive review report.
326
+
327
+ **Outputs**: overall_confidence (0-10), go_no_go_decision, improvement_recommendations, critical_issues
328
+
329
+ ## Output Format
330
+
331
+ The final output is a comprehensive **Plan Review Report** generated by the `review.synthesize-plan-assessment` prompt.
332
+
333
+ **Report Structure**:
334
+
335
+ 1. **Executive Summary** - Decision, overall confidence, review metadata
336
+ 2. **Dimension Scores** - Table showing all 5 dimension scores with weights
337
+ 3. **Detailed Assessment** - Section-by-section analysis with strengths, gaps, and recommendations
338
+ 4. **Critical Issues** - Must-fix blockers (if any)
339
+ 5. **Improvement Recommendations** - Prioritized by critical/important/nice-to-have
340
+ 6. **Decision Rationale** - Why GO or NO-GO with confidence level
341
+ 7. **Next Steps** - Clear guidance on what to do next
342
+
343
+ **Sample Executive Summary**:
344
+
345
+ ```markdown
346
+ ## EXECUTIVE SUMMARY
347
+
348
+ **Decision**: 🟢 GO
349
+ **Overall Confidence**: 7.5/10.0 - GOOD
350
+ **Review Date**: 2025-01-15T14:30:00Z
351
+ **Reviewer**: @lead
352
+
353
+ The plan is well-structured and ready for implementation with minor improvements
354
+ recommended during execution. No critical blockers identified.
355
+ ```
356
+
357
+ See `review.synthesize-plan-assessment` prompt for complete output format specification.
358
+
359
+ ## Output Requirements
360
+
361
+ ### Review Quality Checklist
362
+
363
+ Ensure the final review report:
364
+
365
+ - ✅ All 5 dimensions evaluated with justified scores
366
+ - ✅ Clear GO or NO-GO decision with comprehensive rationale
367
+ - ✅ Critical issues and blockers explicitly highlighted
368
+ - ✅ Recommendations are actionable and prioritized
369
+ - ✅ Next steps are clear and specific
370
+ - ✅ Tone is constructive and professional
371
+
372
+ ### Handoff to Next Phase
373
+
374
+ **Decision Flow**:
375
+
376
+ - **GO** + standard mode (complexity < 7) → `/implement`
377
+ - **GO** + incremental mode (complexity ≥ 7) → `/implement step-by-step`
378
+ - **NO-GO** → `/plan` (incorporate review feedback and address critical issues)
379
+
380
+ ## Metrics Collection
381
+
382
+ After synthesis stage completes, emit optimization and quality metrics as JSON:
383
+
384
+ ```typescript
385
+ optimization_metrics: {
386
+ early_exit_triggered: boolean, // true if overall_confidence >= 8.5 and skipped iterations
387
+ initial_confidence: number, // From $STAGE_synthesis.overall_confidence
388
+ time_saved_minutes: number | undefined // If early_exit: 10-15 min saved
389
+ }
390
+
391
+ quality_metrics: {
392
+ plan_approved: boolean, // true if go_no_go_decision === 'GO'
393
+ review_score: number, // From $STAGE_synthesis.overall_confidence (0-10 scaled to 0-100)
394
+ iterations: number // Count of review iterations (default: 1, increments if resubmitted)
395
+ }
396
+ ```
397
+
398
+ Store these in command outputs for session logging and metrics extraction.
399
+
400
+ ## Command Output Summary
401
+
402
+ Print the following summary at command completion:
403
+
404
+ **For GO decision:**
405
+
406
+ ```markdown
407
+ ## 🟢 Plan Review: GO
408
+
409
+ **Overall Confidence**: [X.X]/10.0
410
+ **Decision**: GO - Ready for implementation
411
+
412
+ ### Dimension Scores
413
+
414
+ | Dimension | Score | Weight |
415
+ | ------------- | ------ | ------ |
416
+ | Completeness | [X]/10 | 20% |
417
+ | Feasibility | [X]/10 | 25% |
418
+ | Risk Coverage | [X]/10 | 20% |
419
+ | Step Quality | [X]/10 | 20% |
420
+ | Test Strategy | [X]/10 | 15% |
421
+
422
+ ### Recommendations
423
+
424
+ - [Recommendation 1]
425
+ - [Recommendation 2]
426
+
427
+ ### Next Step
428
+
429
+ → `/implement` to execute implementation plan
430
+ → `/implement step-by-step` (recommended if complexity ≥ 7)
431
+ ```
432
+
433
+ **For NO-GO decision:**
434
+
435
+ ```markdown
436
+ ## 🔴 Plan Review: NO-GO
437
+
438
+ **Overall Confidence**: [X.X]/10.0
439
+ **Decision**: NO-GO - Revisions required
440
+
441
+ ### Critical Issues
442
+
443
+ 1. [Blocker 1]
444
+ 2. [Blocker 2]
445
+
446
+ ### Required Changes
447
+
448
+ - [Change 1]
449
+ - [Change 2]
450
+
451
+ ### Next Step
452
+
453
+ → `/plan` to address review feedback and resubmit
454
+ ```
455
+
456
+ ---
457
+
458
+ ## Quick Checklist Mode
459
+
460
+ When `--checklist` flag is used, the review switches to a fast binary validation mode:
461
+
462
+ ### Purpose
463
+
464
+ Reduce review time from ~14 min to ~3 min by using the standardised `PLAN_QUALITY_CHECKLIST.md` template for quick pass/fail validation.
465
+
466
+ ### Checklist Sections (35 items total)
467
+
468
+ | Section | Items | Focus |
469
+ | ------------------------- | ----- | ---------------------------------------- |
470
+ | 1. Dependencies | 5 | All dependencies identified with sources |
471
+ | 2. Risk Assessment | 5 | Risks identified with mitigations |
472
+ | 3. Step Atomicity | 5 | Steps are atomic with file paths |
473
+ | 4. Testing Strategy | 5 | Unit/integration/E2E coverage |
474
+ | 5. Rollback Procedures | 5 | Quick rollback documented |
475
+ | 6. Effort Estimation | 5 | Estimates with confidence levels |
476
+ | 7. Architecture Alignment | 5 | (Architecture plans only) |
477
+
478
+ ### Quality Gate
479
+
480
+ - **Minimum threshold**: 80% (28/35 items)
481
+ - **Critical items** (must pass):
482
+ - 2.2 - Each risk has mitigation strategy
483
+ - 3.2 - Each step includes specific file paths
484
+ - 5.1 - Quick rollback procedure documented
485
+
486
+ ### When to Use Checklist Mode
487
+
488
+ - **Self-validation** before requesting full review
489
+ - **Quick pre-flight check** before implementation
490
+ - **Iterative refinement** to track improvement
491
+ - **Tiered planning** between architecture and implementation phases
492
+
493
+ ### Checklist Output
494
+
495
+ ```markdown
496
+ ## Plan Quality Checklist Results
497
+
498
+ **Plan**: [PLAN-IMPL-TASK-001.md]
499
+ **Result**: PASS (31/35 items - 89%)
500
+
501
+ ### Section Scores
502
+
503
+ | Section | Passed | Total |
504
+ | ------------------- | ------ | ----- |
505
+ | Dependencies | 5 | 5 |
506
+ | Risk Assessment | 4 | 5 |
507
+ | Step Atomicity | 5 | 5 |
508
+ | Testing Strategy | 5 | 5 |
509
+ | Rollback Procedures | 4 | 5 |
510
+ | Effort Estimation | 4 | 5 |
511
+ | Architecture | 4 | 5 |
512
+
513
+ ### Critical Items
514
+
515
+ - [x] 2.2 - Each risk has mitigation strategy
516
+ - [x] 3.2 - Each step includes specific file paths
517
+ - [x] 5.1 - Quick rollback procedure documented
518
+
519
+ ### Failed Items
520
+
521
+ - 2.3 - Risk likelihood not assessed for 2 risks
522
+ - 5.4 - Rollback time estimate missing
523
+ - 6.4 - Buffer for unknowns not included
524
+ - 7.2 - Component boundaries not clearly defined
525
+
526
+ ### Next Step
527
+
528
+ → Address 4 failed items, then proceed to implementation
529
+ → Or run `/review-plan` for full narrative assessment
530
+ ```
531
+
532
+ ### Workflow Integration
533
+
534
+ ```
535
+ /plan-architecture
536
+ |
537
+ v
538
+ /review-plan --checklist <-- Quick validation (~3 min)
539
+ |
540
+ v (if PASS)
541
+ /plan-implementation
542
+ |
543
+ v
544
+ /review-plan --checklist <-- Quick validation (~3 min)
545
+ |
546
+ v (if PASS)
547
+ /review-plan <-- Full review (optional, ~14 min)
548
+ |
549
+ v
550
+ /implement
551
+ ```