planflow-ai 1.3.0 → 1.3.4
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/.claude/commands/brainstorm.md +2 -2
- package/.claude/commands/discovery-plan.md +11 -0
- package/.claude/commands/execute-plan.md +26 -2
- package/.claude/commands/flow.md +5 -0
- package/.claude/commands/heartbeat.md +1 -1
- package/.claude/commands/learn.md +4 -6
- package/.claude/commands/{brain.md → note.md} +12 -12
- package/.claude/commands/review-code.md +61 -1
- package/.claude/commands/review-pr.md +61 -1
- package/.claude/commands/setup.md +11 -1
- package/.claude/resources/core/_index.md +102 -2
- package/.claude/resources/core/compaction-guide.md +111 -0
- package/.claude/resources/core/discovery-sub-agents.md +266 -0
- package/.claude/resources/core/phase-isolation.md +222 -0
- package/.claude/resources/core/resource-capture.md +1 -1
- package/.claude/resources/core/review-adaptive-depth.md +217 -0
- package/.claude/resources/core/review-multi-agent.md +289 -0
- package/.claude/resources/core/review-severity-ranking.md +149 -0
- package/.claude/resources/core/review-verification.md +158 -0
- package/.claude/resources/core/session-scratchpad.md +105 -0
- package/.claude/resources/patterns/review-code-templates.md +315 -2
- package/.claude/resources/skills/_index.md +108 -42
- package/.claude/resources/skills/brain-skill.md +3 -3
- package/.claude/resources/skills/discovery-skill.md +50 -6
- package/.claude/resources/skills/execute-plan-skill.md +14 -6
- package/.claude/resources/skills/review-code-skill.md +73 -0
- package/.claude/resources/skills/review-pr-skill.md +58 -0
- package/README.md +38 -3
- package/dist/cli/commands/heartbeat.js.map +1 -1
- package/dist/cli/daemon/heartbeat-daemon.js +31 -1
- package/dist/cli/daemon/heartbeat-daemon.js.map +1 -1
- package/dist/cli/daemon/heartbeat-parser.d.ts.map +1 -1
- package/dist/cli/daemon/heartbeat-parser.js +6 -0
- package/dist/cli/daemon/heartbeat-parser.js.map +1 -1
- package/dist/cli/handlers/claude.js +20 -12
- package/dist/cli/handlers/claude.js.map +1 -1
- package/dist/cli/types.d.ts +1 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/rules/skills/brain-skill.mdc +4 -4
- package/skills/plan-flow/SKILL.md +1 -1
- package/skills/plan-flow/brain/SKILL.md +1 -1
- package/templates/shared/AGENTS.md.template +1 -1
- package/templates/shared/CLAUDE.md.template +11 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
|
|
2
|
+
# Review Verification
|
|
3
|
+
|
|
4
|
+
## Purpose
|
|
5
|
+
|
|
6
|
+
Second-pass verification step for `/review-code` and `/review-pr`. After the initial analysis produces findings, each finding is re-examined against surrounding code context to filter false positives. Reduces noise, improves trust in the final review output.
|
|
7
|
+
|
|
8
|
+
**Scope**: `/review-code` (Step 5b) and `/review-pr` (Step 3b). Applied after analysis, before document generation.
|
|
9
|
+
|
|
10
|
+
**Goal**: Surface only actionable findings. A review that cries wolf on false positives trains developers to ignore it. Verification ensures every reported finding is worth the developer's attention.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Verification Step Definition
|
|
15
|
+
|
|
16
|
+
For each finding from the initial analysis:
|
|
17
|
+
|
|
18
|
+
1. Re-read **15 lines above and 15 lines below** the flagged line (30 lines of context total)
|
|
19
|
+
2. Evaluate **3 standard verification questions** (same for every finding)
|
|
20
|
+
3. Evaluate **1 category-specific question** (based on the finding's category)
|
|
21
|
+
4. Classify the finding as **Confirmed**, **Likely**, or **Dismissed**
|
|
22
|
+
|
|
23
|
+
Apply this process to every finding before generating the review document.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Standard Verification Questions
|
|
28
|
+
|
|
29
|
+
Ask these three questions for every finding, regardless of category:
|
|
30
|
+
|
|
31
|
+
**Q1 — Is this actually a bug/issue, or does the surrounding code handle it?**
|
|
32
|
+
Check if adjacent code (error handling, guards, fallbacks, input validation) already addresses the concern raised. Look 15 lines above for upstream guards and 15 lines below for downstream handling.
|
|
33
|
+
|
|
34
|
+
**Q2 — Is there a test that covers this case?**
|
|
35
|
+
Look for test files related to the flagged code. If a test explicitly covers the scenario being flagged, the finding may be a false positive — the behavior is intentional and validated.
|
|
36
|
+
|
|
37
|
+
**Q3 — Would a senior developer agree this is a real issue?**
|
|
38
|
+
Apply the experienced developer filter. Trivial style preferences, subjective choices, or extremely minor nits that would not appear in a real code review should be dismissed. If the concern is valid but low-stakes, it may still qualify as a Suggestion.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Category-Specific Verification Questions
|
|
43
|
+
|
|
44
|
+
After the three standard questions, evaluate one additional question based on the finding's category:
|
|
45
|
+
|
|
46
|
+
| Category | Verification Question |
|
|
47
|
+
|----------|----------------------|
|
|
48
|
+
| Security | Is there actually an exploit path, or is this internal-only code with no user input reaching the flagged point? |
|
|
49
|
+
| Logic bug | Can this code path actually be reached with the flagged state? Trace the call chain from entry points. |
|
|
50
|
+
| Performance | Is this in a hot path (called per-request, inside a loop, on every render), or is it called once during init/setup? |
|
|
51
|
+
| Pattern violation | Does the surrounding code intentionally deviate for a documented reason (comment, TODO, legacy marker, explicit override)? |
|
|
52
|
+
| Missing test | Is this logic already covered by integration or e2e tests, even if no unit test exists for this specific function? |
|
|
53
|
+
| Error handling | Is the error actually possible at this point, or is it prevented by upstream validation or type constraints? |
|
|
54
|
+
| Type safety | Does the runtime context guarantee the type, even if TypeScript cannot prove it statically? |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Classification Criteria
|
|
59
|
+
|
|
60
|
+
| Classification | Criteria | Action |
|
|
61
|
+
|---------------|----------|--------|
|
|
62
|
+
| **Confirmed** | Clear issue with evidence from context. At least 2 of 3 standard questions support the finding. | Keep in output as-is |
|
|
63
|
+
| **Likely** | Probable issue but context is ambiguous. 1 of 3 standard questions supports; others are uncertain. | Keep in output with `[Likely]` tag |
|
|
64
|
+
| **Dismissed** | False positive. Context clearly shows the code is correct. All 3 standard questions fail to support the finding. | Remove from output |
|
|
65
|
+
|
|
66
|
+
### Conservative Classification Rules
|
|
67
|
+
|
|
68
|
+
**Rule 1 — When in doubt, choose Likely over Dismissed.**
|
|
69
|
+
It is better to show an ambiguous finding to the user than to hide a real issue. Only dismiss when context clearly resolves the concern.
|
|
70
|
+
|
|
71
|
+
**Rule 2 — Never dismiss a Critical severity finding.**
|
|
72
|
+
Critical findings can be downgraded to Likely at most. A Critical finding that appears to be a false positive should be tagged `[Likely]` and explained — never silently removed.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Output Format
|
|
77
|
+
|
|
78
|
+
### Verification Summary Template
|
|
79
|
+
|
|
80
|
+
Include this block in the review document, after the Review Summary metrics table:
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## Verification Summary
|
|
84
|
+
|
|
85
|
+
| Metric | Count |
|
|
86
|
+
|--------|-------|
|
|
87
|
+
| Initial findings | {N} |
|
|
88
|
+
| Confirmed | {N} |
|
|
89
|
+
| Likely (needs human judgment) | {N} |
|
|
90
|
+
| Dismissed (false positives filtered) | {N} |
|
|
91
|
+
| **False positive rate** | **{N}%** |
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Finding Tag Format
|
|
95
|
+
|
|
96
|
+
Likely findings get `[Likely]` prepended to their title:
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
### [Likely] Finding Title
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Confirmed findings have no special tag — they are the default and need no marker.
|
|
103
|
+
|
|
104
|
+
Dismissed findings are removed entirely from the output. They do not appear in the final review document.
|
|
105
|
+
|
|
106
|
+
### Review Summary Metrics Update
|
|
107
|
+
|
|
108
|
+
The existing Review Summary metrics table should reflect post-verification counts:
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
| Metric | Value |
|
|
112
|
+
|--------|-------|
|
|
113
|
+
| Total findings (before verification) | {N} |
|
|
114
|
+
| **Findings after verification** | **{N}** |
|
|
115
|
+
| Critical | {N} |
|
|
116
|
+
| Major | {N} |
|
|
117
|
+
| Minor | {N} |
|
|
118
|
+
| Suggestion | {N} |
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Insertion Points
|
|
124
|
+
|
|
125
|
+
### For review-code-skill.md
|
|
126
|
+
|
|
127
|
+
Insert as **Step 5b: Verify Findings** — after Step 5 (Pattern Conflicts), before Step 6b (Pattern Review).
|
|
128
|
+
|
|
129
|
+
### For review-pr-skill.md
|
|
130
|
+
|
|
131
|
+
Insert as **Step 3b: Verify Findings** — after Step 3 (Analyze Code Changes), before Step 4 (Generate Document).
|
|
132
|
+
|
|
133
|
+
### Logic (same for both)
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
1. Collect all findings from the analysis step
|
|
137
|
+
2. For each finding:
|
|
138
|
+
a. Re-read surrounding context (15 lines above + 15 lines below)
|
|
139
|
+
b. Evaluate 3 standard verification questions
|
|
140
|
+
c. Evaluate 1 category-specific question
|
|
141
|
+
d. Classify as Confirmed / Likely / Dismissed
|
|
142
|
+
3. Remove Dismissed findings from the findings list
|
|
143
|
+
4. Tag Likely findings with [Likely] prefix in their title
|
|
144
|
+
5. Generate Verification Summary stats
|
|
145
|
+
6. Proceed to document generation with the filtered findings list
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Related Files
|
|
151
|
+
|
|
152
|
+
| File | Purpose |
|
|
153
|
+
|------|---------|
|
|
154
|
+
| `.claude/resources/skills/review-code-skill.md` | Add Step 5b (Verify Findings) |
|
|
155
|
+
| `.claude/resources/skills/review-pr-skill.md` | Add Step 3b (Verify Findings) |
|
|
156
|
+
| `.claude/resources/patterns/review-code-templates.md` | Add Verification Summary to review document template |
|
|
157
|
+
| `.claude/commands/review-code.md` | Add verification reference |
|
|
158
|
+
| `.claude/commands/review-pr.md` | Add verification reference |
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
|
|
2
|
+
# Session Scratchpad
|
|
3
|
+
|
|
4
|
+
## Purpose
|
|
5
|
+
|
|
6
|
+
The session scratchpad (`flow/.scratchpad.md`) is an ephemeral per-session file for raw notes, temporary analysis, and in-progress observations. It bridges the gap between transient session work and permanent artifacts (ledger, brain, memory).
|
|
7
|
+
|
|
8
|
+
**Core principle**: Write things down so they survive compaction; promote the valuable ones before session ends.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Session Start Behavior
|
|
13
|
+
|
|
14
|
+
On session start:
|
|
15
|
+
1. If `flow/.scratchpad.md` exists and has content, read it silently
|
|
16
|
+
2. If entries look stale (from a previous session), scan for promotable items:
|
|
17
|
+
- Learnings → promote to `flow/ledger.md`
|
|
18
|
+
- Error patterns → promote to `flow/brain/errors/`
|
|
19
|
+
- Feature context → promote to `flow/brain/features/`
|
|
20
|
+
- User preferences → promote to `flow/ledger.md` (User Preferences section)
|
|
21
|
+
3. After promotion, clear the file (reset to empty template)
|
|
22
|
+
4. If the file is empty or doesn't exist, skip — no action needed
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Write Triggers
|
|
27
|
+
|
|
28
|
+
Write to the scratchpad when you encounter:
|
|
29
|
+
|
|
30
|
+
| Trigger | Example Entry |
|
|
31
|
+
|---------|---------------|
|
|
32
|
+
| **Non-obvious error resolution** | "Fixed ESM import issue — need `type: module` in package.json AND `moduleResolution: node16` in tsconfig" |
|
|
33
|
+
| **Architectural insight** | "This project uses barrel exports everywhere — new files need re-export in index.ts" |
|
|
34
|
+
| **Dead-end approach** | "Tried using `fs.watch` for file monitoring — unreliable on Linux, switched to chokidar" |
|
|
35
|
+
| **User preference discovered** | "User prefers terse responses, no trailing summaries" |
|
|
36
|
+
| **Open question** | "Need to verify: does the CI pipeline run on Node 18 or 20?" |
|
|
37
|
+
| **Mid-task context** | "Reviewing auth module — found 3 unused imports, will clean up after main task" |
|
|
38
|
+
|
|
39
|
+
### What NOT to Write
|
|
40
|
+
|
|
41
|
+
- Routine file reads or grep results (re-readable)
|
|
42
|
+
- Build/test output (captured in logs)
|
|
43
|
+
- Things already captured by brain-capture blocks
|
|
44
|
+
- Obvious facts derivable from the code
|
|
45
|
+
- Full code snippets (reference file:line instead)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## File Format
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Session Scratchpad
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
|
|
56
|
+
- [{timestamp}] {note}
|
|
57
|
+
- [{timestamp}] {note}
|
|
58
|
+
|
|
59
|
+
## Open Questions
|
|
60
|
+
|
|
61
|
+
- {question}
|
|
62
|
+
|
|
63
|
+
## Promote Before Session End
|
|
64
|
+
|
|
65
|
+
- [ ] {item to promote} → {target: ledger/brain/memory}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Keep under **50 lines**. When approaching the limit, promote older entries or discard low-value ones.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Promotion Rules
|
|
73
|
+
|
|
74
|
+
Before session ends (or when the scratchpad is getting full):
|
|
75
|
+
|
|
76
|
+
1. **Scan each entry** and classify:
|
|
77
|
+
- **Promote**: Valuable insight that should persist → move to appropriate target
|
|
78
|
+
- **Discard**: Transient note, already acted on, or no future value → delete
|
|
79
|
+
2. **Promotion targets**:
|
|
80
|
+
| Content Type | Target | Section |
|
|
81
|
+
|-------------|--------|---------|
|
|
82
|
+
| Project learning / workaround | `flow/ledger.md` | What Works / What Didn't Work |
|
|
83
|
+
| User preference | `flow/ledger.md` | User Preferences |
|
|
84
|
+
| Error pattern | `flow/brain/errors/{name}.md` | New or updated entry |
|
|
85
|
+
| Feature context | `flow/brain/features/{name}.md` | Timeline update |
|
|
86
|
+
| Reusable pattern | `flow/resources/pending-patterns.md` | Pattern capture buffer |
|
|
87
|
+
3. **After promotion**, clear the scratchpad (leave just the empty template headers)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Compaction Integration
|
|
92
|
+
|
|
93
|
+
During `/compact`, the scratchpad is in the **preserve** list — its contents survive compaction summaries. This is critical because scratchpad notes often contain context that would otherwise be lost.
|
|
94
|
+
|
|
95
|
+
After compaction, the model should re-read `flow/.scratchpad.md` to restore any notes written before compaction.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Rules
|
|
100
|
+
|
|
101
|
+
1. **Lightweight writes** — single-line entries, not paragraphs
|
|
102
|
+
2. **No duplication** — don't write what brain-capture already captures
|
|
103
|
+
3. **Self-manage size** — promote or discard when approaching 50 lines
|
|
104
|
+
4. **Promote before ending** — always scan for promotable items before session ends
|
|
105
|
+
5. **Not a task list** — use `flow/tasklist.md` for tasks, scratchpad is for observations
|
|
@@ -61,15 +61,48 @@ For each changed file, similar implementations in the codebase:
|
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
64
|
+
## Verification Summary
|
|
65
|
+
|
|
66
|
+
| Metric | Count |
|
|
67
|
+
|--------|-------|
|
|
68
|
+
| Initial findings | {N} |
|
|
69
|
+
| Confirmed | {N} |
|
|
70
|
+
| Likely (needs human judgment) | {N} |
|
|
71
|
+
| Dismissed (false positives filtered) | {N} |
|
|
72
|
+
| **False positive rate** | **{N}%** |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Executive Summary
|
|
77
|
+
|
|
78
|
+
> Only include when total findings ≥ 5. Omit for smaller reviews.
|
|
79
|
+
|
|
80
|
+
**Risk level**: {Low | Medium | High}
|
|
81
|
+
|
|
82
|
+
**Top issues to address**:
|
|
83
|
+
|
|
84
|
+
1. {Finding title} ({Severity}) — `{file}:{line}`
|
|
85
|
+
2. {Finding title} ({Severity}) — `{file}:{line}`
|
|
86
|
+
3. {Finding title} ({Severity}) — `{file}:{line}`
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
64
90
|
## Findings
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
> Findings are grouped by severity (Critical → Major → Minor → Suggestion).
|
|
93
|
+
> For findings classified as "Likely" during verification, prepend `[Likely]` to the heading.
|
|
94
|
+
> Omit empty severity sections.
|
|
95
|
+
> Related findings across files may be grouped — see review-severity-ranking.md.
|
|
96
|
+
|
|
97
|
+
### Critical Findings
|
|
98
|
+
|
|
99
|
+
#### Finding 1: {Finding Name}
|
|
67
100
|
|
|
68
101
|
| Field | Value |
|
|
69
102
|
| -------------- | ------------------------------------------------ |
|
|
70
103
|
| File | `{file_path}` |
|
|
71
104
|
| Line | {line_number} |
|
|
72
|
-
| Severity |
|
|
105
|
+
| Severity | Critical |
|
|
73
106
|
| Fix Complexity | {X/10} - {Level} |
|
|
74
107
|
| Pattern | {Reference to pattern from rules, if applicable} |
|
|
75
108
|
|
|
@@ -84,6 +117,24 @@ See `{reference_file_path}` for how this is handled elsewhere in the codebase.
|
|
|
84
117
|
// Suggested code improvement
|
|
85
118
|
\`\`\`
|
|
86
119
|
|
|
120
|
+
### Major Findings
|
|
121
|
+
|
|
122
|
+
#### Finding N: {Finding Name}
|
|
123
|
+
|
|
124
|
+
> Same format as Critical Findings.
|
|
125
|
+
|
|
126
|
+
### Minor Findings
|
|
127
|
+
|
|
128
|
+
#### Finding N: {Finding Name}
|
|
129
|
+
|
|
130
|
+
> Same format as Critical Findings.
|
|
131
|
+
|
|
132
|
+
### Suggestions
|
|
133
|
+
|
|
134
|
+
#### Finding N: {Finding Name}
|
|
135
|
+
|
|
136
|
+
> Same format as Critical Findings.
|
|
137
|
+
|
|
87
138
|
---
|
|
88
139
|
|
|
89
140
|
## Pattern Conflicts
|
|
@@ -184,6 +235,268 @@ List any particularly well-written code or good practices observed:
|
|
|
184
235
|
|
|
185
236
|
---
|
|
186
237
|
|
|
238
|
+
## Lightweight Review Template (< 50 lines)
|
|
239
|
+
|
|
240
|
+
Use this compact template when the changeset is under 50 lines.
|
|
241
|
+
|
|
242
|
+
```markdown
|
|
243
|
+
# Local Code Review: {Description}
|
|
244
|
+
|
|
245
|
+
**Project**: [[{project-name}]]
|
|
246
|
+
|
|
247
|
+
## Review Information
|
|
248
|
+
|
|
249
|
+
| Field | Value |
|
|
250
|
+
| -------------- | --------------------- |
|
|
251
|
+
| Date | {date} |
|
|
252
|
+
| Files Reviewed | {number_of_files} |
|
|
253
|
+
| Scope | {all/staged/unstaged} |
|
|
254
|
+
| Language(s) | {detected_languages} |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Review Summary
|
|
259
|
+
|
|
260
|
+
| Metric | Value |
|
|
261
|
+
|--------|-------|
|
|
262
|
+
| **Review Mode** | Lightweight (< 50 lines) |
|
|
263
|
+
| **Total Findings** | {count} |
|
|
264
|
+
| **Status** | {LGTM / Needs Changes} |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Findings
|
|
269
|
+
|
|
270
|
+
> Only present if issues were found. Skip this section entirely for LGTM reviews.
|
|
271
|
+
|
|
272
|
+
### Finding 1: {Finding Name}
|
|
273
|
+
|
|
274
|
+
| Field | Value |
|
|
275
|
+
| -------------- | ------------------------------------------------ |
|
|
276
|
+
| File | `{file_path}` |
|
|
277
|
+
| Line | {line_number} |
|
|
278
|
+
| Severity | {Critical/Major/Minor} |
|
|
279
|
+
| Fix Complexity | {X/10} - {Level} |
|
|
280
|
+
|
|
281
|
+
**Description**:
|
|
282
|
+
{Detailed explanation of the issue found}
|
|
283
|
+
|
|
284
|
+
**Suggested Fix**:
|
|
285
|
+
\`\`\`{language}
|
|
286
|
+
// Suggested code improvement
|
|
287
|
+
\`\`\`
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Positive Highlights
|
|
292
|
+
|
|
293
|
+
- {Highlight 1}
|
|
294
|
+
- {Highlight 2}
|
|
295
|
+
- {Highlight 3}
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Commit Readiness
|
|
300
|
+
|
|
301
|
+
| Status | {Ready to Commit / Needs Changes} |
|
|
302
|
+
| ------ | --------------------------------- |
|
|
303
|
+
| Reason | {Brief explanation} |
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
> **Note**: Lightweight reviews skip Reference Implementations, Pattern Conflicts, Rule Update Recommendations, and Verification Summary sections.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Deep Review Template (500+ lines)
|
|
311
|
+
|
|
312
|
+
Use this template for large changesets. Findings are grouped by severity instead of by file, and an executive summary is prepended.
|
|
313
|
+
|
|
314
|
+
```markdown
|
|
315
|
+
# Local Code Review: {Description}
|
|
316
|
+
|
|
317
|
+
**Project**: [[{project-name}]]
|
|
318
|
+
|
|
319
|
+
## Review Information
|
|
320
|
+
|
|
321
|
+
| Field | Value |
|
|
322
|
+
| -------------- | --------------------- |
|
|
323
|
+
| Date | {date} |
|
|
324
|
+
| Files Reviewed | {number_of_files} |
|
|
325
|
+
| Scope | {all/staged/unstaged} |
|
|
326
|
+
| Language(s) | {detected_languages} |
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Executive Summary
|
|
331
|
+
|
|
332
|
+
### Files Changed by Category
|
|
333
|
+
|
|
334
|
+
| Category | Files | Lines Changed |
|
|
335
|
+
|----------|-------|--------------|
|
|
336
|
+
| Core Logic | {N} | +{add}/-{del} |
|
|
337
|
+
| Infrastructure | {N} | +{add}/-{del} |
|
|
338
|
+
| UI/Presentation | {N} | +{add}/-{del} |
|
|
339
|
+
| Tests | {N} | +{add}/-{del} |
|
|
340
|
+
|
|
341
|
+
### Risk Assessment
|
|
342
|
+
|
|
343
|
+
**Overall Risk**: {Low | Medium | High}
|
|
344
|
+
|
|
345
|
+
{1-2 sentence justification based on scope, categories affected, and finding severity distribution}
|
|
346
|
+
|
|
347
|
+
### Top 3 Findings
|
|
348
|
+
|
|
349
|
+
1. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
350
|
+
2. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
351
|
+
3. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Review Agents
|
|
356
|
+
|
|
357
|
+
> Multi-agent parallel review section. Only present in Deep mode (500+ lines).
|
|
358
|
+
|
|
359
|
+
| Agent | Model | Findings | After Dedup |
|
|
360
|
+
|-------|-------|----------|-------------|
|
|
361
|
+
| Security | sonnet | {N} | {N} |
|
|
362
|
+
| Logic & Bugs | sonnet | {N} | {N} |
|
|
363
|
+
| Performance | sonnet | {N} | {N} |
|
|
364
|
+
| Pattern Compliance | haiku | {N} | {N} |
|
|
365
|
+
| **Total** | | **{N}** | **{N}** |
|
|
366
|
+
|
|
367
|
+
Duplicates removed: {N}
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Changed Files
|
|
372
|
+
|
|
373
|
+
| File | Category | Status | Lines Changed |
|
|
374
|
+
| ------------- | -------------- | ---------- | ------------- |
|
|
375
|
+
| `{file_path}` | {Core/Infra/UI/Tests} | {modified} | +{add}/-{del} |
|
|
376
|
+
| ... | ... | ... | ... |
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Reference Implementations Found
|
|
381
|
+
|
|
382
|
+
> Same format as standard template — per changed file, similar implementations in the codebase.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Review Summary
|
|
387
|
+
|
|
388
|
+
| Metric | Value |
|
|
389
|
+
| --------------------- | ------------------ |
|
|
390
|
+
| **Review Mode** | Deep (500+ lines) |
|
|
391
|
+
| **Total Findings** | {count} |
|
|
392
|
+
| Critical | {critical_count} |
|
|
393
|
+
| Major | {major_count} |
|
|
394
|
+
| Minor | {minor_count} |
|
|
395
|
+
| Suggestion | {suggestion_count} |
|
|
396
|
+
| **Pattern Conflicts** | {conflict_count} |
|
|
397
|
+
| **Total Fix Effort** | {sum_of_scores}/X |
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Verification Summary
|
|
402
|
+
|
|
403
|
+
| Metric | Count |
|
|
404
|
+
|--------|-------|
|
|
405
|
+
| Initial findings | {N} |
|
|
406
|
+
| Confirmed | {N} |
|
|
407
|
+
| Likely (needs human judgment) | {N} |
|
|
408
|
+
| Dismissed (false positives filtered) | {N} |
|
|
409
|
+
| **False positive rate** | **{N}%** |
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Critical Findings
|
|
414
|
+
|
|
415
|
+
### Finding 1: {Finding Name}
|
|
416
|
+
|
|
417
|
+
| Field | Value |
|
|
418
|
+
| -------------- | ------------------------------------------------ |
|
|
419
|
+
| File | `{file_path}` |
|
|
420
|
+
| Line | {line_number} |
|
|
421
|
+
| Severity | Critical |
|
|
422
|
+
| Fix Complexity | {X/10} - {Level} |
|
|
423
|
+
| Category | {Core Logic/Infrastructure/UI/Tests} |
|
|
424
|
+
| Pattern | {Reference to pattern from rules, if applicable} |
|
|
425
|
+
|
|
426
|
+
**Description**:
|
|
427
|
+
{Detailed explanation}
|
|
428
|
+
|
|
429
|
+
**Reference Implementation**:
|
|
430
|
+
See `{reference_file_path}` for how this is handled elsewhere.
|
|
431
|
+
|
|
432
|
+
**Suggested Fix**:
|
|
433
|
+
\`\`\`{language}
|
|
434
|
+
// Suggested code improvement
|
|
435
|
+
\`\`\`
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## Major Findings
|
|
440
|
+
|
|
441
|
+
### Finding N: {Finding Name}
|
|
442
|
+
|
|
443
|
+
> Same format as Critical Findings.
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## Minor Findings
|
|
448
|
+
|
|
449
|
+
### Finding N: {Finding Name}
|
|
450
|
+
|
|
451
|
+
> Same format as Critical Findings.
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Suggestions
|
|
456
|
+
|
|
457
|
+
### Finding N: {Finding Name}
|
|
458
|
+
|
|
459
|
+
> Same format as Critical Findings.
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Pattern Conflicts
|
|
464
|
+
|
|
465
|
+
> Same format as standard template.
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## Rule Update Recommendations
|
|
470
|
+
|
|
471
|
+
> Same format as standard template.
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
## Positive Highlights
|
|
476
|
+
|
|
477
|
+
- {Highlight 1}
|
|
478
|
+
- {Highlight 2}
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Commit Readiness
|
|
483
|
+
|
|
484
|
+
| Status | {Ready to Commit/Needs Changes/Needs Discussion} |
|
|
485
|
+
| ------ | ------------------------------------------------ |
|
|
486
|
+
| Reason | {Brief explanation} |
|
|
487
|
+
|
|
488
|
+
### Before Committing
|
|
489
|
+
|
|
490
|
+
- [ ] Address all Critical findings
|
|
491
|
+
- [ ] Address all Major findings
|
|
492
|
+
- [ ] Review Pattern Conflicts and decide on resolution
|
|
493
|
+
- [ ] Update rules files if new patterns should be documented
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
> **Note**: Deep reviews always include the Verification Summary, group findings by severity, and prepend an Executive Summary with risk assessment. The Changed Files table includes a Category column.
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
187
500
|
## Example Output
|
|
188
501
|
|
|
189
502
|
### Pattern Conflict Example
|