planflow-ai 1.3.0 → 1.3.2
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/heartbeat.md +1 -1
- package/.claude/commands/learn.md +1 -1
- package/.claude/commands/{brain.md → note.md} +12 -12
- package/.claude/commands/review-code.md +53 -0
- package/.claude/commands/review-pr.md +53 -0
- package/.claude/resources/core/_index.md +50 -2
- 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/patterns/review-code-templates.md +315 -2
- package/.claude/resources/skills/_index.md +9 -1
- package/.claude/resources/skills/brain-skill.md +3 -3
- 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/handlers/claude.js +20 -12
- package/dist/cli/handlers/claude.js.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 +1 -1
|
@@ -58,7 +58,7 @@ WHAT IT IS:
|
|
|
58
58
|
|
|
59
59
|
WHAT IT IS NOT:
|
|
60
60
|
- Not /discovery-plan — no codebase scanning, no requirements docs
|
|
61
|
-
- Not /
|
|
61
|
+
- Not /note — no knowledge capture, no wiki-links
|
|
62
62
|
- Not a plan — no phases, no complexity scores
|
|
63
63
|
|
|
64
64
|
RECOMMENDED MODEL:
|
|
@@ -67,7 +67,7 @@ RECOMMENDED MODEL:
|
|
|
67
67
|
RELATED COMMANDS:
|
|
68
68
|
/discovery-plan Ground the brainstorm idea into the project
|
|
69
69
|
/create-plan Create plan from discovery document
|
|
70
|
-
/
|
|
70
|
+
/note Capture knowledge (different purpose)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
---
|
|
@@ -81,7 +81,7 @@ TEACHING MODE (/learn about <topic>):
|
|
|
81
81
|
Index: ~/plan-flow/brain/learns/_index.md (LRN-* codes)
|
|
82
82
|
|
|
83
83
|
RELATED COMMANDS:
|
|
84
|
-
/
|
|
84
|
+
/note Capture meeting notes, ideas, brainstorms
|
|
85
85
|
/setup Generate project pattern files
|
|
86
86
|
/review-code Review local uncommitted changes
|
|
87
87
|
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Manual
|
|
2
|
+
description: Manual note entry - capture meeting notes, ideas, brainstorms, and insights into the project brain
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Note: Manual Knowledge Capture
|
|
6
6
|
|
|
7
7
|
## Command Description
|
|
8
8
|
|
|
@@ -18,25 +18,25 @@ This command allows manual brain entries for capturing meeting notes, brainstorm
|
|
|
18
18
|
**If the user invokes this command with `-help`, display only this section and stop:**
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
/
|
|
21
|
+
/note - Manual Brain Entry
|
|
22
22
|
|
|
23
23
|
DESCRIPTION:
|
|
24
24
|
Capture meeting notes, brainstorms, ideas, and insights into the
|
|
25
25
|
project brain. Creates Obsidian-compatible markdown with [[wiki-links]].
|
|
26
26
|
|
|
27
27
|
USAGE:
|
|
28
|
-
/
|
|
29
|
-
/
|
|
30
|
-
/
|
|
28
|
+
/note <free text> Free-text mode (default)
|
|
29
|
+
/note -guided Guided mode with structured questions
|
|
30
|
+
/note -help Show this help
|
|
31
31
|
|
|
32
32
|
ARGUMENTS:
|
|
33
33
|
free text Unstructured text to parse and categorize
|
|
34
34
|
-guided Triggers structured question mode
|
|
35
35
|
|
|
36
36
|
EXAMPLES:
|
|
37
|
-
/
|
|
38
|
-
/
|
|
39
|
-
/
|
|
37
|
+
/note Had a call with the team about auth flow. Decision: use JWT with refresh tokens.
|
|
38
|
+
/note Discovered that the API rate limits at 100 req/min. Need to add throttling.
|
|
39
|
+
/note -guided
|
|
40
40
|
|
|
41
41
|
OUTPUT:
|
|
42
42
|
- Writes to appropriate flow/brain/ subdirectory
|
|
@@ -90,7 +90,7 @@ If no content and no `-guided` flag, ask:
|
|
|
90
90
|
```markdown
|
|
91
91
|
What would you like to capture? You can:
|
|
92
92
|
1. Type free text and I'll categorize it automatically
|
|
93
|
-
2. Use `/
|
|
93
|
+
2. Use `/note -guided` for structured prompts
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
---
|
|
@@ -175,7 +175,7 @@ Brain entry captured!
|
|
|
175
175
|
|
|
176
176
|
```
|
|
177
177
|
+------------------------------------------+
|
|
178
|
-
| /
|
|
178
|
+
| /note COMMAND |
|
|
179
179
|
+------------------------------------------+
|
|
180
180
|
|
|
|
181
181
|
v
|
|
@@ -214,7 +214,7 @@ Brain entry captured!
|
|
|
214
214
|
|
|
215
215
|
### Recommended Loading Order
|
|
216
216
|
|
|
217
|
-
1. **Always load first**: This command file (`commands/
|
|
217
|
+
1. **Always load first**: This command file (`commands/note.md`)
|
|
218
218
|
2. **Load indexes**: Load `_index.md` files for relevant folders
|
|
219
219
|
3. **Expand on-demand**: Use reference codes to load specific sections when needed
|
|
220
220
|
|
|
@@ -46,6 +46,11 @@ WORKFLOW:
|
|
|
46
46
|
4. Compares against existing patterns
|
|
47
47
|
5. Generates review document with findings
|
|
48
48
|
|
|
49
|
+
ADAPTIVE DEPTH:
|
|
50
|
+
< 50 lines Lightweight (security, logic bugs, breaking changes only)
|
|
51
|
+
50-500 lines Standard (full review)
|
|
52
|
+
500+ lines Deep (multi-pass, severity-grouped, executive summary)
|
|
53
|
+
|
|
49
54
|
REVIEW CATEGORIES:
|
|
50
55
|
- Pattern compliance
|
|
51
56
|
- Code quality issues
|
|
@@ -149,6 +154,13 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
149
154
|
| PTN-REV-1 | Review document structure | Creating review output |
|
|
150
155
|
| COR-AP-1 | Allowed patterns overview | Checking pattern compliance |
|
|
151
156
|
| COR-FP-1 | Forbidden patterns overview | Identifying anti-patterns |
|
|
157
|
+
| COR-MA-1 | Multi-agent subagent definitions | Deep mode parallel review setup |
|
|
158
|
+
| COR-MA-2 | Coordinator dedup and merge | Deep mode result processing |
|
|
159
|
+
| COR-SR-1 | Severity re-ranking algorithm | Ordering findings by impact |
|
|
160
|
+
| COR-SR-2 | Finding grouping rules | Grouping related findings |
|
|
161
|
+
| COR-AD-1 | Adaptive depth size detection | Determining review mode |
|
|
162
|
+
| COR-AD-2 | Lightweight review mode | Changeset < 50 lines |
|
|
163
|
+
| COR-AD-3 | Deep review mode | Changeset 500+ lines |
|
|
152
164
|
|
|
153
165
|
### Expansion Instructions
|
|
154
166
|
|
|
@@ -241,6 +253,47 @@ Only save if the user approves. Do not re-ask if declined.
|
|
|
241
253
|
|
|
242
254
|
---
|
|
243
255
|
|
|
256
|
+
## Multi-Agent Parallel Review
|
|
257
|
+
|
|
258
|
+
For Deep mode reviews (500+ lines), the review is split into 4 specialized subagents running in parallel:
|
|
259
|
+
|
|
260
|
+
| Agent | Focus | Model |
|
|
261
|
+
|-------|-------|-------|
|
|
262
|
+
| Security | Vulnerabilities, secrets, injection, auth bypass | sonnet |
|
|
263
|
+
| Logic & Bugs | Edge cases, null handling, race conditions, wrong logic | sonnet |
|
|
264
|
+
| Performance | N+1 queries, memory leaks, blocking I/O, re-renders | sonnet |
|
|
265
|
+
| Pattern Compliance | Forbidden/allowed patterns, naming, consistency | haiku |
|
|
266
|
+
|
|
267
|
+
The coordinator merges results, deduplicates overlapping findings, then runs verification and re-ranking.
|
|
268
|
+
|
|
269
|
+
See `.claude/resources/core/review-multi-agent.md` for full rules.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Adaptive Depth
|
|
274
|
+
|
|
275
|
+
Review depth scales automatically based on changeset size:
|
|
276
|
+
|
|
277
|
+
| Lines Changed | Mode | Behavior |
|
|
278
|
+
|--------------|------|----------|
|
|
279
|
+
| < 50 | **Lightweight** | Quick-scan for security, logic bugs, breaking changes only. Skips pattern loading, similar implementations, verification pass. |
|
|
280
|
+
| 50–500 | **Standard** | Full review (current behavior, no changes). |
|
|
281
|
+
| 500+ | **Deep** | Multi-pass review with file categorization, severity-grouped output, executive summary, and mandatory verification pass. |
|
|
282
|
+
|
|
283
|
+
Thresholds are hardcoded. The detected mode is displayed before the review starts.
|
|
284
|
+
|
|
285
|
+
See `.claude/resources/core/review-adaptive-depth.md` for full rules and `.claude/resources/patterns/review-code-templates.md` for lightweight and deep templates.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Verification Pass
|
|
290
|
+
|
|
291
|
+
After initial analysis, all findings undergo a second-pass verification. Each finding is re-examined against 15 lines of surrounding context and classified as Confirmed, Likely, or Dismissed. False positives are filtered before output. A Verification Summary shows filter stats.
|
|
292
|
+
|
|
293
|
+
See `.claude/resources/core/review-verification.md` for classification criteria, category-specific questions, and output format.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
244
297
|
## Pattern Capture
|
|
245
298
|
|
|
246
299
|
During code review, silently watch for anti-patterns found in changed code, good patterns that should be documented, and pattern conflicts between new and existing code. Append captured patterns to `flow/resources/pending-patterns.md` without interrupting work.
|
|
@@ -49,6 +49,11 @@ WORKFLOW:
|
|
|
49
49
|
5. Analyzes code changes
|
|
50
50
|
6. Generates review document
|
|
51
51
|
|
|
52
|
+
ADAPTIVE DEPTH:
|
|
53
|
+
< 50 lines Lightweight (security, logic bugs, breaking changes only)
|
|
54
|
+
50-500 lines Standard (full review)
|
|
55
|
+
500+ lines Deep (multi-pass, severity-grouped, executive summary)
|
|
56
|
+
|
|
52
57
|
REVIEW INCLUDES:
|
|
53
58
|
- Summary of changes
|
|
54
59
|
- Pattern compliance check
|
|
@@ -146,6 +151,13 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
146
151
|
| PTN-PR-1 | PR review patterns | Creating review output |
|
|
147
152
|
| COR-AP-1 | Allowed patterns overview | Checking pattern compliance |
|
|
148
153
|
| COR-FP-1 | Forbidden patterns overview | Identifying anti-patterns |
|
|
154
|
+
| COR-MA-1 | Multi-agent subagent definitions | Deep mode parallel review setup |
|
|
155
|
+
| COR-MA-2 | Coordinator dedup and merge | Deep mode result processing |
|
|
156
|
+
| COR-SR-1 | Severity re-ranking algorithm | Ordering findings by impact |
|
|
157
|
+
| COR-SR-2 | Finding grouping rules | Grouping related findings |
|
|
158
|
+
| COR-AD-1 | Adaptive depth size detection | Determining review mode |
|
|
159
|
+
| COR-AD-2 | Lightweight review mode | Changeset < 50 lines |
|
|
160
|
+
| COR-AD-3 | Deep review mode | Changeset 500+ lines |
|
|
149
161
|
|
|
150
162
|
### Expansion Instructions
|
|
151
163
|
|
|
@@ -238,3 +250,44 @@ During this skill's execution, watch for valuable reference materials worth pres
|
|
|
238
250
|
At natural break points, if you encounter information that could be useful for future development (API specs, architecture notes, config references, domain knowledge, etc.), ask the user: "I found something that could be useful for future reference: _{brief description}_. Should I save it to `flow/resources/`?"
|
|
239
251
|
|
|
240
252
|
Only save if the user approves. Do not re-ask if declined.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Multi-Agent Parallel Review
|
|
257
|
+
|
|
258
|
+
For Deep mode reviews (500+ lines), the review is split into 4 specialized subagents running in parallel:
|
|
259
|
+
|
|
260
|
+
| Agent | Focus | Model |
|
|
261
|
+
|-------|-------|-------|
|
|
262
|
+
| Security | Vulnerabilities, secrets, injection, auth bypass | sonnet |
|
|
263
|
+
| Logic & Bugs | Edge cases, null handling, race conditions, wrong logic | sonnet |
|
|
264
|
+
| Performance | N+1 queries, memory leaks, blocking I/O, re-renders | sonnet |
|
|
265
|
+
| Pattern Compliance | Forbidden/allowed patterns, naming, consistency | haiku |
|
|
266
|
+
|
|
267
|
+
The coordinator merges results, deduplicates overlapping findings, then runs verification and re-ranking.
|
|
268
|
+
|
|
269
|
+
See `.claude/resources/core/review-multi-agent.md` for full rules.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Adaptive Depth
|
|
274
|
+
|
|
275
|
+
Review depth scales automatically based on changeset size:
|
|
276
|
+
|
|
277
|
+
| Lines Changed | Mode | Behavior |
|
|
278
|
+
|--------------|------|----------|
|
|
279
|
+
| < 50 | **Lightweight** | Quick-scan for security, logic bugs, breaking changes only. Skips pattern loading, full analysis, verification pass. |
|
|
280
|
+
| 50–500 | **Standard** | Full review (current behavior, no changes). |
|
|
281
|
+
| 500+ | **Deep** | Multi-pass review with file categorization, severity-grouped output, executive summary, and mandatory verification pass. |
|
|
282
|
+
|
|
283
|
+
Thresholds are hardcoded. The detected mode is displayed before the review starts.
|
|
284
|
+
|
|
285
|
+
See `.claude/resources/core/review-adaptive-depth.md` for full rules.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Verification Pass
|
|
290
|
+
|
|
291
|
+
After initial analysis, all findings undergo a second-pass verification. Each finding is re-examined against 15 lines of surrounding context and classified as Confirmed, Likely, or Dismissed. False positives are filtered before output. A Verification Summary shows filter stats.
|
|
292
|
+
|
|
293
|
+
See `.claude/resources/core/review-verification.md` for classification criteria, category-specific questions, and output format.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
Core rules define the foundational coding standards that apply across the entire project. These include best practices to follow (allowed patterns), anti-patterns to avoid (forbidden patterns), and complexity scoring for implementation planning.
|
|
7
7
|
|
|
8
|
-
**Total Files**:
|
|
9
|
-
**Reference Codes**: COR-AP-1 through COR-
|
|
8
|
+
**Total Files**: 18 files, ~3020 lines
|
|
9
|
+
**Reference Codes**: COR-AP-1 through COR-AD-4
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -118,6 +118,40 @@ Core rules define the foundational coding standards that apply across the entire
|
|
|
118
118
|
| COR-DA-2 | Token extraction and UI detection rules | design-awareness.md | 182-260 |
|
|
119
119
|
| COR-DA-3 | Discovery question flow and execution injection | design-awareness.md | 262-350 |
|
|
120
120
|
|
|
121
|
+
### Review Verification (`review-verification.md`)
|
|
122
|
+
|
|
123
|
+
| Code | Description | Source | Lines |
|
|
124
|
+
|------|-------------|--------|-------|
|
|
125
|
+
| COR-RV-1 | Verification logic, questions, and classification criteria | review-verification.md | 1-120 |
|
|
126
|
+
| COR-RV-2 | Output format and insertion points | review-verification.md | 122-200 |
|
|
127
|
+
|
|
128
|
+
### Review Multi-Agent (`review-multi-agent.md`)
|
|
129
|
+
|
|
130
|
+
| Code | Description | Source | Lines |
|
|
131
|
+
|------|-------------|--------|-------|
|
|
132
|
+
| COR-MA-1 | Subagent definitions (security, logic, performance, patterns) with prompts and models | review-multi-agent.md | 30-130 |
|
|
133
|
+
| COR-MA-2 | Coordinator behavior (spawn, collect, deduplicate, verify, rank, output) | review-multi-agent.md | 132-195 |
|
|
134
|
+
| COR-MA-3 | Subagent input rules and diff splitting for very large changesets | review-multi-agent.md | 100-130 |
|
|
135
|
+
| COR-MA-4 | Insertion points for review-code and review-pr skills | review-multi-agent.md | 197-220 |
|
|
136
|
+
|
|
137
|
+
### Review Severity Re-Ranking (`review-severity-ranking.md`)
|
|
138
|
+
|
|
139
|
+
| Code | Description | Source | Lines |
|
|
140
|
+
|------|-------------|--------|-------|
|
|
141
|
+
| COR-SR-1 | Ranking algorithm (severity → confidence → complexity) | review-severity-ranking.md | 14-26 |
|
|
142
|
+
| COR-SR-2 | Grouping related findings (patterns, rules, format) | review-severity-ranking.md | 28-88 |
|
|
143
|
+
| COR-SR-3 | Executive summary trigger and risk level derivation | review-severity-ranking.md | 90-120 |
|
|
144
|
+
| COR-SR-4 | Output structure and insertion points | review-severity-ranking.md | 122-150 |
|
|
145
|
+
|
|
146
|
+
### Review Adaptive Depth (`review-adaptive-depth.md`)
|
|
147
|
+
|
|
148
|
+
| Code | Description | Source | Lines |
|
|
149
|
+
|------|-------------|--------|-------|
|
|
150
|
+
| COR-AD-1 | Size detection, line counting rules, and tier definitions | review-adaptive-depth.md | 14-47 |
|
|
151
|
+
| COR-AD-2 | Lightweight review mode (< 50 lines) — checks, skips, output | review-adaptive-depth.md | 51-101 |
|
|
152
|
+
| COR-AD-3 | Deep review mode (500+ lines) — categorization, passes, executive summary | review-adaptive-depth.md | 103-187 |
|
|
153
|
+
| COR-AD-4 | Insertion points for review-code and review-pr skills | review-adaptive-depth.md | 189-205 |
|
|
154
|
+
|
|
121
155
|
---
|
|
122
156
|
|
|
123
157
|
## When to Expand
|
|
@@ -160,6 +194,20 @@ Core rules define the foundational coding standards that apply across the entire
|
|
|
160
194
|
| COR-DA-1 | Need design context template or personality options |
|
|
161
195
|
| COR-DA-2 | Need token extraction or UI detection heuristics |
|
|
162
196
|
| COR-DA-3 | Need design question flow or execution injection rules |
|
|
197
|
+
| COR-RV-1 | Need verification questions or classification criteria |
|
|
198
|
+
| COR-RV-2 | Need verification output format or skill insertion points |
|
|
199
|
+
| COR-MA-1 | Need subagent definitions or prompt templates for deep review |
|
|
200
|
+
| COR-MA-2 | Need coordinator dedup/merge behavior |
|
|
201
|
+
| COR-MA-3 | Need subagent input rules or diff splitting strategy |
|
|
202
|
+
| COR-MA-4 | Need multi-agent insertion points for review skills |
|
|
203
|
+
| COR-SR-1 | Need ranking algorithm for review findings |
|
|
204
|
+
| COR-SR-2 | Need grouping rules for related findings |
|
|
205
|
+
| COR-SR-3 | Need executive summary trigger conditions |
|
|
206
|
+
| COR-SR-4 | Need severity re-ranking output structure or insertion points |
|
|
207
|
+
| COR-AD-1 | Need size detection thresholds or line counting rules |
|
|
208
|
+
| COR-AD-2 | Need lightweight review mode behavior |
|
|
209
|
+
| COR-AD-3 | Need deep review mode behavior (categorization, passes, executive summary) |
|
|
210
|
+
| COR-AD-4 | Need insertion points for adaptive depth in review skills |
|
|
163
211
|
|
|
164
212
|
---
|
|
165
213
|
|
|
@@ -13,7 +13,7 @@ During any skill execution, the LLM watches for information that could be valuab
|
|
|
13
13
|
|
|
14
14
|
### During Any Skill Execution
|
|
15
15
|
|
|
16
|
-
While executing any plan-flow skill (`/setup`, `/discovery-plan`, `/create-plan`, `/execute-plan`, `/review-code`, `/review-pr`, `/write-tests`, `/create-contract`, `/
|
|
16
|
+
While executing any plan-flow skill (`/setup`, `/discovery-plan`, `/create-plan`, `/execute-plan`, `/review-code`, `/review-pr`, `/write-tests`, `/create-contract`, `/note`), watch for information that meets the capture criteria below.
|
|
17
17
|
|
|
18
18
|
When you identify something worth preserving:
|
|
19
19
|
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
|
|
2
|
+
# Review Adaptive Depth
|
|
3
|
+
|
|
4
|
+
## Purpose
|
|
5
|
+
|
|
6
|
+
Scale review depth based on changeset size. Small changes get a fast lightweight pass, large changes get a deeper multi-category review with severity-grouped output and executive summary. Medium changes use the standard review (no behavior change).
|
|
7
|
+
|
|
8
|
+
**Scope**: `/review-code` (Step 1b) and `/review-pr` (Step 1b). Applied after identifying changed files, before loading patterns.
|
|
9
|
+
|
|
10
|
+
**Goal**: Save tokens on trivial PRs and improve quality on complex ones. A 5-line typo fix shouldn't get the same depth as a 2000-line refactor.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Size Detection
|
|
15
|
+
|
|
16
|
+
### Line Counting Rules
|
|
17
|
+
|
|
18
|
+
Count total lines changed (additions + deletions) from the diff.
|
|
19
|
+
|
|
20
|
+
**Exclude** from the count:
|
|
21
|
+
- Lock files: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `Gemfile.lock`, `poetry.lock`, `Cargo.lock`, `go.sum`
|
|
22
|
+
- Generated files: any path containing `.generated.`, `dist/`, `build/`, `.min.js`, `.min.css`
|
|
23
|
+
- Pure whitespace/formatting changes (lines where only indentation changed)
|
|
24
|
+
|
|
25
|
+
**For review-code**: Use `git diff --stat` to get line counts, then subtract excluded files.
|
|
26
|
+
|
|
27
|
+
**For review-pr**: Use PR diff stats from `gh pr diff --stat` or Azure DevOps diff API, then subtract excluded files.
|
|
28
|
+
|
|
29
|
+
### Display Format
|
|
30
|
+
|
|
31
|
+
Always show the detected mode before starting the review:
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
**Review mode**: {Lightweight|Standard|Deep} ({N} lines changed across {M} files)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Tier Definitions
|
|
40
|
+
|
|
41
|
+
| Tier | Lines Changed | Review Mode |
|
|
42
|
+
|------|--------------|-------------|
|
|
43
|
+
| **Small** | < 50 | Lightweight |
|
|
44
|
+
| **Medium** | 50–500 | Standard (current behavior, no changes) |
|
|
45
|
+
| **Large** | 500+ | Deep |
|
|
46
|
+
|
|
47
|
+
Thresholds are hardcoded. No configuration needed.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Lightweight Review Mode (Small, < 50 lines)
|
|
52
|
+
|
|
53
|
+
For changesets under 50 lines, perform a focused quick-scan review.
|
|
54
|
+
|
|
55
|
+
### What to Check (ONLY these)
|
|
56
|
+
|
|
57
|
+
1. **Security issues** — hardcoded secrets, injection vulnerabilities, auth bypass, exposed credentials
|
|
58
|
+
2. **Obvious logic bugs** — wrong condition, off-by-one, null/undefined access, infinite loops
|
|
59
|
+
3. **Breaking changes** — API signature changes, removed exports, changed return types
|
|
60
|
+
|
|
61
|
+
### What to Skip
|
|
62
|
+
|
|
63
|
+
- Naming suggestions
|
|
64
|
+
- Pattern compliance
|
|
65
|
+
- Performance optimization
|
|
66
|
+
- Test coverage analysis
|
|
67
|
+
- Similar implementation search
|
|
68
|
+
- Pattern conflict detection
|
|
69
|
+
|
|
70
|
+
### Verification Pass
|
|
71
|
+
|
|
72
|
+
**Skip entirely.** Lightweight reviews produce few findings — verification adds overhead with minimal value on small changesets.
|
|
73
|
+
|
|
74
|
+
### Output
|
|
75
|
+
|
|
76
|
+
If no issues found, output a short **LGTM review**:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
## Review Summary
|
|
80
|
+
|
|
81
|
+
| Metric | Value |
|
|
82
|
+
|--------|-------|
|
|
83
|
+
| **Review Mode** | Lightweight (< 50 lines) |
|
|
84
|
+
| **Total Findings** | 0 |
|
|
85
|
+
| **Status** | LGTM |
|
|
86
|
+
|
|
87
|
+
## Positive Highlights
|
|
88
|
+
|
|
89
|
+
- {Highlight 1}
|
|
90
|
+
- {Highlight 2}
|
|
91
|
+
- {Highlight 3}
|
|
92
|
+
|
|
93
|
+
## Commit Readiness
|
|
94
|
+
|
|
95
|
+
| Status | Ready to Commit |
|
|
96
|
+
|--------|-----------------|
|
|
97
|
+
| Reason | No issues found in lightweight review |
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If issues ARE found, use the standard finding format but keep the compact template (no Reference Implementations, no Pattern Conflicts sections).
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Deep Review Mode (Large, 500+ lines)
|
|
105
|
+
|
|
106
|
+
For changesets over 500 lines, perform a structured multi-pass review.
|
|
107
|
+
|
|
108
|
+
### Step 1: Categorize Changed Files
|
|
109
|
+
|
|
110
|
+
Group all changed files by type:
|
|
111
|
+
|
|
112
|
+
| Category | Heuristics |
|
|
113
|
+
|----------|-----------|
|
|
114
|
+
| **Core Logic** | `src/`, `lib/`, `app/` (excluding UI paths), service files, utility files, business logic |
|
|
115
|
+
| **Infrastructure** | Config files, CI/CD (`.github/`, `.gitlab-ci`), build config, Docker, env files |
|
|
116
|
+
| **UI/Presentation** | Components, pages, layouts, styles, templates — detected by path (`components/`, `pages/`, `views/`) or extension (`.tsx`, `.jsx`, `.vue`, `.svelte`, `.css`, `.scss`) |
|
|
117
|
+
| **Tests** | Any file in `__tests__/`, `test/`, `tests/`, `spec/`, or files ending in `.test.*`, `.spec.*` |
|
|
118
|
+
|
|
119
|
+
Files that don't match any heuristic → default to **Core Logic**.
|
|
120
|
+
|
|
121
|
+
### Step 2: Prioritize Review Order
|
|
122
|
+
|
|
123
|
+
Review in this order: **Core Logic → Infrastructure → UI → Tests**
|
|
124
|
+
|
|
125
|
+
Core logic gets the deepest review. Tests get a quick coverage-adequacy scan.
|
|
126
|
+
|
|
127
|
+
### Step 3: Focused Passes per Category
|
|
128
|
+
|
|
129
|
+
| Category | Focus Areas |
|
|
130
|
+
|----------|-------------|
|
|
131
|
+
| **Core Logic** | Bugs, edge cases, security, error handling, null safety |
|
|
132
|
+
| **Infrastructure** | Security (secrets, permissions), breaking changes, compatibility |
|
|
133
|
+
| **UI/Presentation** | Accessibility, performance (re-renders, large bundles), state management |
|
|
134
|
+
| **Tests** | Coverage adequacy, test quality (quick scan only — not a full analysis) |
|
|
135
|
+
|
|
136
|
+
### Step 4: Always Run Verification Pass
|
|
137
|
+
|
|
138
|
+
All findings from deep review must go through the standard verification pass (see `review-verification.md`).
|
|
139
|
+
|
|
140
|
+
### Step 5: Severity-Grouped Output
|
|
141
|
+
|
|
142
|
+
Group findings by severity instead of by file:
|
|
143
|
+
|
|
144
|
+
```markdown
|
|
145
|
+
## Critical Findings
|
|
146
|
+
### Finding 1: ...
|
|
147
|
+
### Finding 2: ...
|
|
148
|
+
|
|
149
|
+
## Major Findings
|
|
150
|
+
### Finding 3: ...
|
|
151
|
+
|
|
152
|
+
## Minor Findings
|
|
153
|
+
### Finding 4: ...
|
|
154
|
+
|
|
155
|
+
## Suggestions
|
|
156
|
+
### Finding 5: ...
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Step 6: Executive Summary
|
|
160
|
+
|
|
161
|
+
Add an executive summary at the top of the review document, before the findings:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
## Executive Summary
|
|
165
|
+
|
|
166
|
+
### Files Changed by Category
|
|
167
|
+
|
|
168
|
+
| Category | Files | Lines Changed |
|
|
169
|
+
|----------|-------|--------------|
|
|
170
|
+
| Core Logic | {N} | +{add}/-{del} |
|
|
171
|
+
| Infrastructure | {N} | +{add}/-{del} |
|
|
172
|
+
| UI/Presentation | {N} | +{add}/-{del} |
|
|
173
|
+
| Tests | {N} | +{add}/-{del} |
|
|
174
|
+
|
|
175
|
+
### Risk Assessment
|
|
176
|
+
|
|
177
|
+
**Overall Risk**: {Low | Medium | High}
|
|
178
|
+
|
|
179
|
+
{1-2 sentence justification based on scope, categories affected, and finding severity distribution}
|
|
180
|
+
|
|
181
|
+
### Top 3 Findings
|
|
182
|
+
|
|
183
|
+
1. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
184
|
+
2. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
185
|
+
3. **[{Severity}]** {Finding title} — {one-line description} (`{file}:{line}`)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Insertion Points
|
|
191
|
+
|
|
192
|
+
### For review-code-skill.md
|
|
193
|
+
|
|
194
|
+
Insert as **Step 1b: Determine Review Depth** — after Step 1 (Identify Changed Files), before Step 2 (Load Review Patterns).
|
|
195
|
+
|
|
196
|
+
**Lightweight shortcut**: If Small tier, skip Steps 2-5 (pattern loading, similar implementations, full analysis, pattern conflicts). Perform abbreviated analysis checking only security/logic/breaking changes. Skip verification pass. Generate lightweight template.
|
|
197
|
+
|
|
198
|
+
**Deep expansion**: If Large tier, in Step 3 categorize files by type. In Step 4 run focused passes per category. In Step 5b apply verification to all findings. In Step 6 use deep template with severity grouping + executive summary.
|
|
199
|
+
|
|
200
|
+
### For review-pr-skill.md
|
|
201
|
+
|
|
202
|
+
Insert as **Step 1b: Determine Review Depth** — after Step 1 (Fetch PR Information), before Step 2 (Load Review Patterns).
|
|
203
|
+
|
|
204
|
+
Same lightweight shortcut and deep expansion logic as review-code.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Related Files
|
|
209
|
+
|
|
210
|
+
| File | Purpose |
|
|
211
|
+
|------|---------|
|
|
212
|
+
| `.claude/resources/skills/review-code-skill.md` | Add Step 1b (Determine Review Depth) |
|
|
213
|
+
| `.claude/resources/skills/review-pr-skill.md` | Add Step 1b (Determine Review Depth) |
|
|
214
|
+
| `.claude/resources/patterns/review-code-templates.md` | Add lightweight and deep templates |
|
|
215
|
+
| `.claude/resources/core/review-verification.md` | Verification pass (skipped for lightweight, required for deep) |
|
|
216
|
+
| `.claude/commands/review-code.md` | Add Adaptive Depth section |
|
|
217
|
+
| `.claude/commands/review-pr.md` | Add Adaptive Depth section |
|