@paw-workflow/cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -0
- package/bin/paw.js +82 -0
- package/dist/agents/PAW-Review.agent.md +86 -0
- package/dist/agents/PAW.agent.md +171 -0
- package/dist/skills/paw-code-research/SKILL.md +209 -0
- package/dist/skills/paw-docs-guidance/SKILL.md +163 -0
- package/dist/skills/paw-git-operations/SKILL.md +196 -0
- package/dist/skills/paw-impl-review/SKILL.md +178 -0
- package/dist/skills/paw-implement/SKILL.md +153 -0
- package/dist/skills/paw-init/SKILL.md +118 -0
- package/dist/skills/paw-plan-review/SKILL.md +117 -0
- package/dist/skills/paw-planning/SKILL.md +217 -0
- package/dist/skills/paw-pr/SKILL.md +157 -0
- package/dist/skills/paw-review-baseline/SKILL.md +268 -0
- package/dist/skills/paw-review-correlation/SKILL.md +307 -0
- package/dist/skills/paw-review-critic/SKILL.md +373 -0
- package/dist/skills/paw-review-feedback/SKILL.md +437 -0
- package/dist/skills/paw-review-gap/SKILL.md +639 -0
- package/dist/skills/paw-review-github/SKILL.md +336 -0
- package/dist/skills/paw-review-impact/SKILL.md +569 -0
- package/dist/skills/paw-review-response/SKILL.md +118 -0
- package/dist/skills/paw-review-understanding/SKILL.md +372 -0
- package/dist/skills/paw-review-workflow/SKILL.md +239 -0
- package/dist/skills/paw-spec/SKILL.md +257 -0
- package/dist/skills/paw-spec-research/SKILL.md +138 -0
- package/dist/skills/paw-spec-review/SKILL.md +101 -0
- package/dist/skills/paw-status/SKILL.md +160 -0
- package/dist/skills/paw-transition/SKILL.md +134 -0
- package/dist/skills/paw-work-shaping/SKILL.md +99 -0
- package/dist/skills/paw-workflow/SKILL.md +142 -0
- package/lib/commands/install.js +103 -0
- package/lib/commands/list.js +18 -0
- package/lib/commands/uninstall.js +95 -0
- package/lib/commands/upgrade.js +119 -0
- package/lib/manifest.js +42 -0
- package/lib/paths.js +42 -0
- package/lib/registry.js +41 -0
- package/package.json +40 -0
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: paw-review-gap
|
|
3
|
+
description: Systematically identifies gaps in correctness, safety, testing, and maintainability, categorizing findings by severity.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "0.0.1"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Gap Analysis Activity Skill
|
|
9
|
+
|
|
10
|
+
Systematically identify gaps and issues across correctness, safety, testing, and maintainability dimensions, categorizing findings as Must/Should/Could based on evidence.
|
|
11
|
+
|
|
12
|
+
> **Reference**: Follow Core Review Principles from `paw-review-workflow` skill.
|
|
13
|
+
|
|
14
|
+
## Responsibilities
|
|
15
|
+
|
|
16
|
+
- Identify correctness issues (logic errors, edge cases, error handling)
|
|
17
|
+
- Find safety and security gaps (input validation, permission checks)
|
|
18
|
+
- Assess test coverage quantitatively (if reports available) and qualitatively (always)
|
|
19
|
+
- Evaluate maintainability (code duplication, pattern adherence, documentation)
|
|
20
|
+
- Categorize all findings as Must/Should/Could with evidence
|
|
21
|
+
- Recognize positive observations (mentoring value)
|
|
22
|
+
- Produce comprehensive GapAnalysis.md artifact
|
|
23
|
+
|
|
24
|
+
## Non-Responsibilities
|
|
25
|
+
|
|
26
|
+
- System-wide impact analysis (handled by paw-review-impact)
|
|
27
|
+
- Generating review comments (Output stage skills)
|
|
28
|
+
- Workflow orchestration (handled by workflow skill)
|
|
29
|
+
|
|
30
|
+
## Prerequisites
|
|
31
|
+
|
|
32
|
+
Verify these artifacts exist at `.paw/reviews/<identifier>/`:
|
|
33
|
+
- Phase 1: `ReviewContext.md`, `CodeResearch.md`, `DerivedSpec.md`
|
|
34
|
+
- Phase 2: `ImpactAnalysis.md`
|
|
35
|
+
|
|
36
|
+
If any artifact is missing, report the blocker and do not proceed.
|
|
37
|
+
|
|
38
|
+
## Step 1: Correctness Analysis
|
|
39
|
+
|
|
40
|
+
Identify logic and implementation errors:
|
|
41
|
+
|
|
42
|
+
### Logic Anomalies
|
|
43
|
+
|
|
44
|
+
- Incorrect conditional logic (wrong operators, inverted conditions)
|
|
45
|
+
- Off-by-one errors in loops or array access
|
|
46
|
+
- Race conditions or concurrency issues
|
|
47
|
+
- State management inconsistencies
|
|
48
|
+
|
|
49
|
+
### Edge Case Handling
|
|
50
|
+
|
|
51
|
+
- Missing null/undefined checks
|
|
52
|
+
- Empty array/object handling gaps
|
|
53
|
+
- Boundary value issues (min/max, zero, negative)
|
|
54
|
+
- String edge cases (empty, very long, special characters)
|
|
55
|
+
|
|
56
|
+
### Error Handling Gaps
|
|
57
|
+
|
|
58
|
+
- Missing try/catch blocks for operations that can fail
|
|
59
|
+
- Error swallowing without logging
|
|
60
|
+
- Unchecked promise rejections
|
|
61
|
+
- Missing error propagation
|
|
62
|
+
|
|
63
|
+
### State Transitions
|
|
64
|
+
|
|
65
|
+
- Invalid state transitions allowed
|
|
66
|
+
- Missing state validation
|
|
67
|
+
- Inconsistent state updates
|
|
68
|
+
|
|
69
|
+
### Cross-Repository Consistency
|
|
70
|
+
|
|
71
|
+
When reviewing PRs across multiple repositories, also check:
|
|
72
|
+
|
|
73
|
+
**Version Consistency:**
|
|
74
|
+
- Package versions compatible across repos (no conflicting dependency ranges)
|
|
75
|
+
- Shared type definitions match (same version of `@types/` packages)
|
|
76
|
+
- API version expectations aligned
|
|
77
|
+
|
|
78
|
+
**Coordinated Changes:**
|
|
79
|
+
- API changes in one repo have corresponding consumer updates in other repos
|
|
80
|
+
- Schema changes propagated to all consumers
|
|
81
|
+
- Missing coordinated updates flagged as gaps
|
|
82
|
+
|
|
83
|
+
**Timing Dependencies:**
|
|
84
|
+
- Deployment order matters (provider must deploy before consumer)
|
|
85
|
+
- Feature flag coordination required
|
|
86
|
+
- Database migration sequences across repos
|
|
87
|
+
|
|
88
|
+
**Detection:**
|
|
89
|
+
Cross-repo consistency applies when:
|
|
90
|
+
- Multiple artifact directories exist (`.paw/reviews/PR-<number>-<repo-slug>/`)
|
|
91
|
+
- ReviewContext.md contains `related_prs` entries
|
|
92
|
+
- ImpactAnalysis.md contains Cross-Repository Dependencies section
|
|
93
|
+
|
|
94
|
+
**Output:**
|
|
95
|
+
Add "Cross-Repository Gaps" subsection in GapAnalysis.md with coordinated change issues.
|
|
96
|
+
|
|
97
|
+
### Output
|
|
98
|
+
|
|
99
|
+
Correctness findings with file:line references, issue descriptions, and evidence
|
|
100
|
+
|
|
101
|
+
## Step 2: Safety & Security Analysis
|
|
102
|
+
|
|
103
|
+
Find security vulnerabilities and risks:
|
|
104
|
+
|
|
105
|
+
### Input Validation
|
|
106
|
+
|
|
107
|
+
- User input reaching sensitive operations without validation
|
|
108
|
+
- Missing sanitization of user-provided data
|
|
109
|
+
- Type coercion vulnerabilities
|
|
110
|
+
- Length/size checks missing
|
|
111
|
+
|
|
112
|
+
### Permission & Authorization
|
|
113
|
+
|
|
114
|
+
- Missing permission checks on operations
|
|
115
|
+
- Auth middleware bypassed
|
|
116
|
+
- Role-based access control gaps
|
|
117
|
+
- Resource ownership checks missing
|
|
118
|
+
|
|
119
|
+
### Data Exposure
|
|
120
|
+
|
|
121
|
+
- Sensitive data logged or returned in responses
|
|
122
|
+
- PII handling without protection
|
|
123
|
+
- Secrets in code or configuration
|
|
124
|
+
- Overly broad data access
|
|
125
|
+
|
|
126
|
+
### Injection Risks
|
|
127
|
+
|
|
128
|
+
- SQL injection (raw queries with user input)
|
|
129
|
+
- XSS (unescaped user content)
|
|
130
|
+
- Command injection
|
|
131
|
+
- Path traversal
|
|
132
|
+
|
|
133
|
+
### Cryptography
|
|
134
|
+
|
|
135
|
+
- Weak algorithms or key sizes
|
|
136
|
+
- Missing encryption for sensitive data
|
|
137
|
+
- Insecure random number generation
|
|
138
|
+
- Certificate validation disabled
|
|
139
|
+
|
|
140
|
+
### Output
|
|
141
|
+
|
|
142
|
+
Safety/security findings with severity, file:line references, and concrete risks
|
|
143
|
+
|
|
144
|
+
## Step 3: Testing Analysis
|
|
145
|
+
|
|
146
|
+
Assess test coverage and quality:
|
|
147
|
+
|
|
148
|
+
### Quantitative Coverage (if available)
|
|
149
|
+
|
|
150
|
+
- Look for `coverage/summary.json`, `lcov.info`, `coverage.xml` in repo
|
|
151
|
+
- Parse JSON: `coverage.summary.total.lines.pct`, `branches.pct`, `functions.pct`
|
|
152
|
+
- Parse LCOV: `LF`, `LH` (lines found/hit), `BRF`, `BRH` (branches)
|
|
153
|
+
- If absent: Note unavailable and proceed with qualitative
|
|
154
|
+
|
|
155
|
+
### Qualitative Coverage
|
|
156
|
+
|
|
157
|
+
**Depth Assessment:**
|
|
158
|
+
- Do tests verify edge cases (null, empty, boundary values)?
|
|
159
|
+
- Are error paths tested (exceptions, failures)?
|
|
160
|
+
- Are different code branches exercised?
|
|
161
|
+
- Do tests verify boundary conditions?
|
|
162
|
+
|
|
163
|
+
**Breadth Assessment:**
|
|
164
|
+
- Are integration points tested?
|
|
165
|
+
- Do tests cover user scenarios end-to-end?
|
|
166
|
+
- Are cross-component interactions tested?
|
|
167
|
+
- Is there happy path AND sad path coverage?
|
|
168
|
+
|
|
169
|
+
**Quality Assessment:**
|
|
170
|
+
- Do tests verify actual behavior vs trivially pass?
|
|
171
|
+
- Are assertions meaningful (not just "doesn't crash")?
|
|
172
|
+
- Do tests check side effects and state changes?
|
|
173
|
+
- Are tests clear about what they're verifying?
|
|
174
|
+
|
|
175
|
+
### Test Effectiveness
|
|
176
|
+
|
|
177
|
+
- Will these tests actually fail when the code is broken?
|
|
178
|
+
- Are assertions meaningful or trivially passing?
|
|
179
|
+
- Is there risk of false positives (tests fail when code is correct)?
|
|
180
|
+
- Do tests verify behavior or just exercise code?
|
|
181
|
+
|
|
182
|
+
### Test Maintainability
|
|
183
|
+
|
|
184
|
+
- Tests are code too - are they maintainable?
|
|
185
|
+
- Are tests overly complex or fragile?
|
|
186
|
+
- Do tests have good names explaining what they verify?
|
|
187
|
+
|
|
188
|
+
### Test Design
|
|
189
|
+
|
|
190
|
+
- Are tests separated appropriately between test methods?
|
|
191
|
+
- Do tests make simple, clear assertions?
|
|
192
|
+
- Are tests testing one thing or too many things?
|
|
193
|
+
|
|
194
|
+
### Heuristics for Test Quality
|
|
195
|
+
|
|
196
|
+
- Flag tests with no assertions (or only assert true)
|
|
197
|
+
- Note overly complex test setup (may indicate design issue)
|
|
198
|
+
- Check if test names clearly describe what's being tested
|
|
199
|
+
- Identify tests that would pass even with bugs in code
|
|
200
|
+
|
|
201
|
+
### Gap Detection
|
|
202
|
+
|
|
203
|
+
Compare code changes to test changes:
|
|
204
|
+
```
|
|
205
|
+
changed_files - test_diff_files → potential coverage gap
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Count new conditionals/branches:
|
|
209
|
+
- Each new `if/else` adds branches to cover
|
|
210
|
+
- Each new `switch/case` adds cases to test
|
|
211
|
+
- Each new loop adds edge cases (empty, one, many)
|
|
212
|
+
|
|
213
|
+
### Specific Test Gaps
|
|
214
|
+
|
|
215
|
+
- New functions without corresponding tests
|
|
216
|
+
- Modified functions without updated tests
|
|
217
|
+
- New error handling paths untested
|
|
218
|
+
- New branches/conditions without branch tests
|
|
219
|
+
|
|
220
|
+
### Output
|
|
221
|
+
|
|
222
|
+
Test coverage section with:
|
|
223
|
+
- Quantitative metrics (if available)
|
|
224
|
+
- Qualitative depth/breadth/quality assessment
|
|
225
|
+
- Specific coverage gaps with file:line references
|
|
226
|
+
- Overall assessment of test adequacy
|
|
227
|
+
|
|
228
|
+
## Step 4: Maintainability Analysis
|
|
229
|
+
|
|
230
|
+
Evaluate code quality and long-term maintenance:
|
|
231
|
+
|
|
232
|
+
### Code Duplication
|
|
233
|
+
|
|
234
|
+
- Repeated logic that could be extracted
|
|
235
|
+
- Copy-pasted code blocks
|
|
236
|
+
- Similar patterns across files without shared abstraction
|
|
237
|
+
|
|
238
|
+
### Pattern Adherence
|
|
239
|
+
|
|
240
|
+
- Divergence from established patterns (from CodeResearch.md)
|
|
241
|
+
- Inconsistent naming conventions
|
|
242
|
+
- Architectural patterns violated
|
|
243
|
+
- Style guide deviations
|
|
244
|
+
|
|
245
|
+
### Code Clarity
|
|
246
|
+
|
|
247
|
+
- Confusing variable/function names
|
|
248
|
+
- Complex nested logic without explanation
|
|
249
|
+
- Magic numbers or strings without constants
|
|
250
|
+
- Unclear control flow
|
|
251
|
+
|
|
252
|
+
### Documentation Gaps
|
|
253
|
+
|
|
254
|
+
- Complex algorithms without comments
|
|
255
|
+
- Public APIs without documentation
|
|
256
|
+
- Unclear function purposes
|
|
257
|
+
- Missing usage examples for non-obvious code
|
|
258
|
+
|
|
259
|
+
### User-Facing Documentation
|
|
260
|
+
|
|
261
|
+
- Do README files need updates?
|
|
262
|
+
- Are API docs updated for public interface changes?
|
|
263
|
+
- Do new features have usage documentation?
|
|
264
|
+
|
|
265
|
+
### Orphaned Documentation
|
|
266
|
+
|
|
267
|
+
- When code is deleted, is related documentation also removed?
|
|
268
|
+
- Are there docs referencing removed code/features?
|
|
269
|
+
- Do code comments reference deleted functions?
|
|
270
|
+
|
|
271
|
+
### Comment Quality Assessment
|
|
272
|
+
|
|
273
|
+
**WHY vs WHAT:**
|
|
274
|
+
- Do comments explain WHY not WHAT?
|
|
275
|
+
- Are comments necessary or is code self-explanatory?
|
|
276
|
+
- Should code be simplified instead of commented?
|
|
277
|
+
- Are comments providing value beyond what code shows?
|
|
278
|
+
|
|
279
|
+
**Comment Anti-Patterns:**
|
|
280
|
+
- Comments explaining what code does (code should be clearer)
|
|
281
|
+
- Commented-out code (should be removed, git history preserves it)
|
|
282
|
+
- Redundant comments (restating obvious code)
|
|
283
|
+
- Outdated comments (contradicting current code)
|
|
284
|
+
|
|
285
|
+
**Comment Best Practices:**
|
|
286
|
+
- Complex algorithms explained (regex, mathematical operations)
|
|
287
|
+
- Reasoning behind non-obvious decisions
|
|
288
|
+
- Gotchas or surprising behavior warnings
|
|
289
|
+
- External context (why workaround needed, ticket references)
|
|
290
|
+
|
|
291
|
+
**Heuristics:**
|
|
292
|
+
- Flag comments that just restate code: `// set x to 5` for `x = 5`
|
|
293
|
+
- Flag long comment blocks on simple code (simplify code instead)
|
|
294
|
+
- Note when complex code lacks explanatory comments
|
|
295
|
+
- Check if comments explain WHY for non-obvious decisions
|
|
296
|
+
|
|
297
|
+
### Output
|
|
298
|
+
|
|
299
|
+
Maintainability findings with improvement suggestions, including comment quality assessment
|
|
300
|
+
|
|
301
|
+
## Step 5: Performance Analysis
|
|
302
|
+
|
|
303
|
+
Identify inefficient code patterns:
|
|
304
|
+
|
|
305
|
+
### Algorithmic Inefficiency
|
|
306
|
+
|
|
307
|
+
- Worse complexity than baseline (O(n²) when O(n) was used before)
|
|
308
|
+
- Unnecessary iterations or transformations
|
|
309
|
+
- Inefficient data structure choices
|
|
310
|
+
|
|
311
|
+
### Resource Usage
|
|
312
|
+
|
|
313
|
+
- Missing indexes for database queries
|
|
314
|
+
- Lack of caching for repeated operations
|
|
315
|
+
- Unbounded operations (no pagination, no limits)
|
|
316
|
+
- Memory leaks or excessive allocations
|
|
317
|
+
|
|
318
|
+
**Note:** Deep performance analysis was done in Impact Analysis. Here, focus on obvious inefficiencies and code-level improvements.
|
|
319
|
+
|
|
320
|
+
### Output
|
|
321
|
+
|
|
322
|
+
Performance gap findings (if any obvious issues exist)
|
|
323
|
+
|
|
324
|
+
## Step 6: Categorize Findings
|
|
325
|
+
|
|
326
|
+
Apply Must/Should/Could categorization:
|
|
327
|
+
|
|
328
|
+
### Must - Correctness/Safety/Security with Concrete Impact
|
|
329
|
+
|
|
330
|
+
- Null pointer / undefined access that will crash
|
|
331
|
+
- Unchecked user input reaching SQL queries or file operations
|
|
332
|
+
- Permission bypass allowing unauthorized actions
|
|
333
|
+
- Auth weakening exposing sensitive operations
|
|
334
|
+
- Data corruption risk (race condition, bad state transition)
|
|
335
|
+
- Critical logic errors breaking core functionality
|
|
336
|
+
|
|
337
|
+
**Evidence Required:** Concrete impact (not just "could cause issues")
|
|
338
|
+
|
|
339
|
+
### Should - Quality/Completeness Improvements
|
|
340
|
+
|
|
341
|
+
- Missing tests for new code paths (but no critical path untested)
|
|
342
|
+
- Missing error handling for expected failures
|
|
343
|
+
- Code needing refactor or documentation for clarity
|
|
344
|
+
- Breaking changes needing migration plan (from ImpactAnalysis.md)
|
|
345
|
+
- Performance degradation in non-critical paths
|
|
346
|
+
- Pattern violations reducing maintainability
|
|
347
|
+
- Over-engineering (solving future vs current problems, unnecessary abstractions)
|
|
348
|
+
|
|
349
|
+
**Rationale Required:** Why this improves robustness or quality
|
|
350
|
+
|
|
351
|
+
### Over-engineering Detection
|
|
352
|
+
|
|
353
|
+
- Is code more generic than current requirements need?
|
|
354
|
+
- Are abstractions solving problems that don't exist yet?
|
|
355
|
+
- Is developer building for speculative future use cases?
|
|
356
|
+
- Are there configuration options that aren't actually needed?
|
|
357
|
+
- Is complexity added "just in case" vs for actual requirements?
|
|
358
|
+
|
|
359
|
+
**Guiding Principle:** Solve the problem that needs to be solved now, not the problem that might need to be solved in the future.
|
|
360
|
+
|
|
361
|
+
**Heuristics:**
|
|
362
|
+
- Flag generic interfaces with only one implementation
|
|
363
|
+
- Note parameterization beyond current use cases
|
|
364
|
+
- Identify "pluggable" architectures without multiple plugins
|
|
365
|
+
- Check for abstraction layers without clear current need
|
|
366
|
+
|
|
367
|
+
**Categorization:** Should (adds maintenance burden) or Could (suggest simplifying)
|
|
368
|
+
|
|
369
|
+
### Could - Optional Enhancements
|
|
370
|
+
|
|
371
|
+
- Code duplication that could be extracted (but not causing bugs)
|
|
372
|
+
- Naming improvements for marginal clarity gains
|
|
373
|
+
- Additional edge case tests beyond common scenarios
|
|
374
|
+
- Documentation enhancements for non-critical code
|
|
375
|
+
- Style consistency improvements
|
|
376
|
+
|
|
377
|
+
**Benefit Required:** Clear benefit stated (not just "nice to have")
|
|
378
|
+
|
|
379
|
+
### Categorization Rules
|
|
380
|
+
|
|
381
|
+
- **Don't inflate:** Style issues are not Must without concrete impact
|
|
382
|
+
- **Evidence-based:** Every Must/Should needs file:line + rationale
|
|
383
|
+
- **Informed by baseline:** Compare to patterns in CodeResearch.md
|
|
384
|
+
- **Severity != Category:** High-severity Should is not auto-promoted to Must
|
|
385
|
+
|
|
386
|
+
## Step 7: Identify Positive Observations
|
|
387
|
+
|
|
388
|
+
Recognize what the developer did well (mentoring value):
|
|
389
|
+
|
|
390
|
+
### Good Practices to Commend
|
|
391
|
+
|
|
392
|
+
- Well-designed code that's easy to understand
|
|
393
|
+
- Comprehensive test coverage (especially edge cases)
|
|
394
|
+
- Clear, meaningful naming
|
|
395
|
+
- Proper error handling and validation
|
|
396
|
+
- Good performance considerations
|
|
397
|
+
- Following established patterns well
|
|
398
|
+
- Clear documentation and comments
|
|
399
|
+
- Thoughtful architectural decisions
|
|
400
|
+
|
|
401
|
+
### Recognition Guidelines
|
|
402
|
+
|
|
403
|
+
- Be specific about what was done well (not generic praise)
|
|
404
|
+
- Highlight practices that should be emulated
|
|
405
|
+
- Note when developer addressed difficult problems elegantly
|
|
406
|
+
- Recognize attention to edge cases, testing, or maintainability
|
|
407
|
+
- Acknowledge when feedback from previous reviews was incorporated
|
|
408
|
+
|
|
409
|
+
### Output
|
|
410
|
+
|
|
411
|
+
Positive observations to include in GapAnalysis.md before critical findings
|
|
412
|
+
|
|
413
|
+
## Step 8: Style & Conventions Analysis
|
|
414
|
+
|
|
415
|
+
Evaluate adherence to style guidelines:
|
|
416
|
+
|
|
417
|
+
### Style Guide Compliance
|
|
418
|
+
|
|
419
|
+
- Is code following project style guide? (language-specific)
|
|
420
|
+
- Are there style violations that should be fixed?
|
|
421
|
+
- Are style preferences (vs requirements) marked as "Nit:"?
|
|
422
|
+
|
|
423
|
+
### Mixed Changes Anti-pattern
|
|
424
|
+
|
|
425
|
+
- Are style changes mixed with functional changes?
|
|
426
|
+
- Should formatting/style be in separate commit/PR?
|
|
427
|
+
- Note: "Makes it hard to see what is being changed"
|
|
428
|
+
|
|
429
|
+
### Style vs Preference
|
|
430
|
+
|
|
431
|
+
- Style guide requirements = Must/Should fix
|
|
432
|
+
- Personal preferences = "Nit:" (don't block on these)
|
|
433
|
+
- When no rule exists: maintain consistency with existing code
|
|
434
|
+
|
|
435
|
+
### Heuristics
|
|
436
|
+
|
|
437
|
+
- Check for common style violations (indentation, naming conventions)
|
|
438
|
+
- Identify large formatting changes mixed with logic changes
|
|
439
|
+
- Note when new code diverges from style guide
|
|
440
|
+
- Suggest extracting pure refactoring to separate PR if large
|
|
441
|
+
|
|
442
|
+
### Output
|
|
443
|
+
|
|
444
|
+
Style findings categorized as:
|
|
445
|
+
- Must/Should: Style guide violations
|
|
446
|
+
- Nit: Stylistic preferences that would improve code but aren't mandatory
|
|
447
|
+
|
|
448
|
+
## Step 9: Generate GapAnalysis.md
|
|
449
|
+
|
|
450
|
+
Create comprehensive gap analysis artifact at `.paw/reviews/<identifier>/GapAnalysis.md`:
|
|
451
|
+
|
|
452
|
+
```markdown
|
|
453
|
+
---
|
|
454
|
+
date: <timestamp>
|
|
455
|
+
git_commit: <head SHA>
|
|
456
|
+
branch: <head branch>
|
|
457
|
+
repository: <repo>
|
|
458
|
+
topic: "Gap Analysis for <PR Title or Branch>"
|
|
459
|
+
tags: [review, gaps, findings]
|
|
460
|
+
status: complete
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
# Gap Analysis for <PR Title or Branch>
|
|
464
|
+
|
|
465
|
+
## Summary
|
|
466
|
+
|
|
467
|
+
**Must Address**: X findings (correctness, safety, security)
|
|
468
|
+
**Should Address**: Y findings (quality, completeness)
|
|
469
|
+
**Could Consider**: Z findings (optional improvements)
|
|
470
|
+
|
|
471
|
+
<Brief overview of scope and key concerns>
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
## Positive Observations
|
|
476
|
+
|
|
477
|
+
<List of things developer did well, with specific examples>
|
|
478
|
+
|
|
479
|
+
- ✅ **Excellent test coverage**: Added comprehensive edge case tests for null, empty, and boundary conditions in `module.test.ts`
|
|
480
|
+
- ✅ **Clear error handling**: Proper validation with helpful error messages in `validator.ts:45-60`
|
|
481
|
+
- ✅ **Good performance consideration**: Used efficient algorithm avoiding nested loops in `processor.ts:123`
|
|
482
|
+
- ✅ **Well-designed architecture**: Clean separation of concerns in new module structure
|
|
483
|
+
- ✅ **Clear naming**: Functions and variables have descriptive, meaningful names
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Must Address (Correctness/Safety/Security)
|
|
488
|
+
|
|
489
|
+
### Finding M1: <Clear, Specific Title>
|
|
490
|
+
**File**: `path/to/file.ext:123-130`
|
|
491
|
+
**Category**: Correctness | Safety | Security
|
|
492
|
+
**Evidence**: <Exact code reference showing the issue>
|
|
493
|
+
**Issue**: <Clear description of what's wrong>
|
|
494
|
+
**Impact**: <What could go wrong - concrete consequences>
|
|
495
|
+
**Suggestion**: <Specific fix or approach to resolve>
|
|
496
|
+
**Related**: <IDs of related findings, if any>
|
|
497
|
+
|
|
498
|
+
### Finding M2: <Title>
|
|
499
|
+
[... same structure ...]
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## Should Address (Quality/Completeness)
|
|
504
|
+
|
|
505
|
+
### Finding S1: <Title>
|
|
506
|
+
**File**: `path/to/file.ext:456-460`
|
|
507
|
+
**Category**: Testing | Maintainability | Performance
|
|
508
|
+
**Evidence**: <Code reference>
|
|
509
|
+
**Issue**: <What's missing or could be better>
|
|
510
|
+
**Rationale**: <Why this matters for code quality or robustness>
|
|
511
|
+
**Suggestion**: <Recommended improvement>
|
|
512
|
+
**Related**: <IDs of related findings, if any>
|
|
513
|
+
|
|
514
|
+
### Finding S2: <Title>
|
|
515
|
+
[... same structure ...]
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Could Consider (Optional Improvements)
|
|
520
|
+
|
|
521
|
+
### Finding C1: <Title>
|
|
522
|
+
**File**: `path/to/file.ext:789-795`
|
|
523
|
+
**Category**: Maintainability | Testing | Documentation
|
|
524
|
+
**Observation**: <What could be enhanced>
|
|
525
|
+
**Benefit**: <How this would help (clarity, future changes, etc.)>
|
|
526
|
+
**Suggestion**: <Optional enhancement approach>
|
|
527
|
+
|
|
528
|
+
### Finding C2: <Title>
|
|
529
|
+
[... same structure ...]
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## Test Coverage Assessment
|
|
534
|
+
|
|
535
|
+
### Quantitative Metrics
|
|
536
|
+
|
|
537
|
+
**Note:** Coverage report <available|not available>
|
|
538
|
+
|
|
539
|
+
<If available:>
|
|
540
|
+
- Line Coverage: X%
|
|
541
|
+
- Branch Coverage: Y%
|
|
542
|
+
- Function Coverage: Z%
|
|
543
|
+
|
|
544
|
+
<If not available:>
|
|
545
|
+
Quantitative metrics not available. Qualitative analysis below.
|
|
546
|
+
|
|
547
|
+
### Qualitative Analysis
|
|
548
|
+
|
|
549
|
+
**Depth:**
|
|
550
|
+
<Do tests verify edge cases, error paths, boundary conditions?>
|
|
551
|
+
|
|
552
|
+
**Breadth:**
|
|
553
|
+
<Do tests cover integration points, user scenarios, cross-component interactions?>
|
|
554
|
+
|
|
555
|
+
**Quality:**
|
|
556
|
+
<Do tests verify behavior vs trivially pass? Are assertions meaningful?>
|
|
557
|
+
|
|
558
|
+
### Specific Coverage Gaps
|
|
559
|
+
|
|
560
|
+
<List uncovered code paths or missing test scenarios with file:line references>
|
|
561
|
+
|
|
562
|
+
**Overall Test Assessment:** Adequate | Needs Improvement | Critical Gaps
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## Scope Assessment
|
|
567
|
+
|
|
568
|
+
**Total Findings:** X Must + Y Should + Z Could = Total
|
|
569
|
+
**Critical Issues:** <count of Must findings>
|
|
570
|
+
**Quality Improvements:** <count of Should findings>
|
|
571
|
+
**Baseline Comparison:** <Are patterns from CodeResearch.md followed?>
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
## Guardrails
|
|
575
|
+
|
|
576
|
+
### Evidence-Based Categorization
|
|
577
|
+
|
|
578
|
+
- Every finding must have file:line + concrete evidence
|
|
579
|
+
- Must findings require demonstrable impact, not hypothetical
|
|
580
|
+
- Don't inflate severity without justification
|
|
581
|
+
|
|
582
|
+
### Not Inflated
|
|
583
|
+
|
|
584
|
+
- Style preferences are Could, not Must
|
|
585
|
+
- Lack of tests for non-critical code is Should, not Must
|
|
586
|
+
- Naming issues are Could unless causing real confusion
|
|
587
|
+
|
|
588
|
+
### Informed by Baseline
|
|
589
|
+
|
|
590
|
+
- Use CodeResearch.md to judge pattern consistency
|
|
591
|
+
- Compare to established conventions in codebase
|
|
592
|
+
- Note when new code diverges from existing patterns
|
|
593
|
+
|
|
594
|
+
### Coverage Context
|
|
595
|
+
|
|
596
|
+
- Always note when coverage reports unavailable
|
|
597
|
+
- Qualitative analysis still valuable without metrics
|
|
598
|
+
- Don't penalize for missing coverage tooling
|
|
599
|
+
|
|
600
|
+
### Batching Preview
|
|
601
|
+
|
|
602
|
+
- Identify related findings that share root causes
|
|
603
|
+
- Note where multiple findings could be addressed together
|
|
604
|
+
- This helps Output stage batch feedback efficiently
|
|
605
|
+
|
|
606
|
+
## Validation Checklist
|
|
607
|
+
|
|
608
|
+
Before completing, verify:
|
|
609
|
+
- [ ] All findings have file:line references with evidence
|
|
610
|
+
- [ ] Must findings have concrete impact statements (not speculation)
|
|
611
|
+
- [ ] Should findings have clear rationale for why they matter
|
|
612
|
+
- [ ] Could findings have stated benefits
|
|
613
|
+
- [ ] Positive observations identified and documented
|
|
614
|
+
- [ ] Test coverage assessed (quantitatively if available, qualitatively always)
|
|
615
|
+
- [ ] Test effectiveness and maintainability evaluated
|
|
616
|
+
- [ ] Comment quality assessed (WHY vs WHAT, necessity)
|
|
617
|
+
- [ ] Over-engineering detection applied
|
|
618
|
+
- [ ] Style guide adherence checked with "Nit:" labeling for preferences
|
|
619
|
+
- [ ] User-facing documentation completeness verified
|
|
620
|
+
- [ ] Orphaned documentation identified
|
|
621
|
+
- [ ] Categorization not inflated (style issues not promoted to Must)
|
|
622
|
+
- [ ] Baseline patterns from CodeResearch.md considered
|
|
623
|
+
- [ ] Related findings identified for batching
|
|
624
|
+
- [ ] GapAnalysis.md artifact generated with all required sections
|
|
625
|
+
|
|
626
|
+
## Completion Response
|
|
627
|
+
|
|
628
|
+
```
|
|
629
|
+
Activity complete.
|
|
630
|
+
Artifact saved: .paw/reviews/<identifier>/GapAnalysis.md
|
|
631
|
+
Status: Success
|
|
632
|
+
|
|
633
|
+
Key findings:
|
|
634
|
+
- Positive observations: X good practices identified
|
|
635
|
+
- Must-address: Y correctness/safety/security findings
|
|
636
|
+
- Should-address: Z quality/completeness findings
|
|
637
|
+
- Could-consider: W optional improvements
|
|
638
|
+
- Test coverage: [Adequate | Needs Improvement | Critical Gaps]
|
|
639
|
+
```
|