devflow-kit 0.5.0 → 0.6.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.
@@ -5,378 +5,427 @@ allowed-tools: Task, Bash, Read, Write, Grep, Glob
5
5
 
6
6
  ## Your Task
7
7
 
8
- Perform a comprehensive review of this entire feature branch by orchestrating multiple specialized sub-agents in parallel. This is designed for thorough analysis before creating pull requests or merging branches.
8
+ Orchestrate multiple specialized audit sub-agents to review the current branch, then synthesize their findings into an actionable summary.
9
9
 
10
- ### Step 1: Analyze Branch Changes
10
+ ---
11
+
12
+ ## Step 1: Determine Review Scope
11
13
 
12
- First, determine the branch and base for comparison:
14
+ Get the current branch and base branch:
13
15
 
14
16
  ```bash
15
17
  # Get current branch
16
18
  CURRENT_BRANCH=$(git branch --show-current)
17
19
  if [ -z "$CURRENT_BRANCH" ]; then
18
- echo "❌ Not on a branch (detached HEAD). Checkout a feature branch first."
20
+ echo "❌ Not on a branch (detached HEAD)"
19
21
  exit 1
20
22
  fi
21
23
 
22
- # Determine base branch (main, master, or develop)
24
+ # Find base branch
23
25
  BASE_BRANCH=""
24
26
  for branch in main master develop; do
25
- if git show-ref --verify --quiet refs/heads/$branch; then
26
- BASE_BRANCH=$branch
27
- break
28
- fi
27
+ if git show-ref --verify --quiet refs/heads/$branch; then
28
+ BASE_BRANCH=$branch
29
+ break
30
+ fi
29
31
  done
30
32
 
31
33
  if [ -z "$BASE_BRANCH" ]; then
32
- echo "❌ Could not find base branch (main/master/develop). Specify manually."
34
+ echo "❌ Could not find base branch (main/master/develop)"
33
35
  exit 1
34
36
  fi
35
37
 
36
- echo "=== BRANCH REVIEW SCOPE ==="
37
- echo "Current branch: $CURRENT_BRANCH"
38
- echo "Base branch: $BASE_BRANCH"
39
- echo ""
40
-
41
- # Check if there are changes to review
38
+ # Check for changes
42
39
  if git diff --quiet $BASE_BRANCH...HEAD; then
43
- echo "No changes between $BASE_BRANCH and $CURRENT_BRANCH"
40
+ echo "ℹ️ No changes between $BASE_BRANCH and $CURRENT_BRANCH"
44
41
  exit 0
45
42
  fi
46
43
 
47
- # Show comprehensive change summary
48
- echo "=== CHANGES TO REVIEW ==="
44
+ # Show change summary
45
+ echo "=== CODE REVIEW SCOPE ==="
46
+ echo "Branch: $CURRENT_BRANCH"
47
+ echo "Base: $BASE_BRANCH"
48
+ echo ""
49
49
  git diff --stat $BASE_BRANCH...HEAD
50
50
  echo ""
51
- echo "=== COMMIT HISTORY ==="
52
- git log --oneline $BASE_BRANCH..HEAD
51
+ git log --oneline $BASE_BRANCH..HEAD | head -5
53
52
  echo ""
54
53
  ```
55
54
 
56
- ### Step 2: Detect Change Categories
55
+ ---
57
56
 
58
- Analyze what types of changes are in this branch to determine which specialized agents are needed:
57
+ ## Step 2: Set Up Audit Structure
59
58
 
60
- ```bash
61
- # Check if database-related files changed
62
- DB_CHANGES=$(git diff --name-only $BASE_BRANCH...HEAD | grep -E '\.(sql|prisma|migration|knex|sequelize|db)' || true)
63
- DB_CHANGES+=$(git diff --name-only $BASE_BRANCH...HEAD | grep -iE '(migration|schema|database|models/)' || true)
64
-
65
- if [ -n "$DB_CHANGES" ]; then
66
- echo "🗄️ Database changes detected - will run database audit"
67
- INCLUDE_DB_AUDIT=true
68
- else
69
- echo "ℹ️ No database changes detected - skipping database audit"
70
- INCLUDE_DB_AUDIT=false
71
- fi
72
- echo ""
59
+ Create directory for audit reports:
73
60
 
74
- # Set up audit directory structure
61
+ ```bash
75
62
  TIMESTAMP=$(date +%Y-%m-%d_%H%M)
76
63
  AUDIT_BASE_DIR=".docs/audits/${CURRENT_BRANCH}"
77
64
  mkdir -p "$AUDIT_BASE_DIR"
78
65
 
79
- echo "📁 Audit reports will be saved to: $AUDIT_BASE_DIR"
66
+ echo "📁 Audit reports: $AUDIT_BASE_DIR"
80
67
  echo ""
81
68
  ```
82
69
 
83
- ### Step 3: Launch Specialized Sub-Agents in Parallel
70
+ ---
84
71
 
85
- Launch these sub-agents in parallel based on change detection.
72
+ ## Step 3: Launch Audit Sub-Agents in Parallel
86
73
 
87
- **IMPORTANT**: Pass the following variables to each sub-agent:
88
- - `CURRENT_BRANCH`: The branch being reviewed
89
- - `AUDIT_BASE_DIR`: Base directory for audit reports (`.docs/audits/${CURRENT_BRANCH}`)
90
- - `TIMESTAMP`: Current timestamp for report filenames
74
+ Use the Task tool to launch all audit sub-agents in parallel. Each will analyze the branch and save its report.
75
+
76
+ **Launch these sub-agents:**
77
+
78
+ Use Task tool with `subagent_type` for each audit:
91
79
 
92
- Each sub-agent should save its report to:
93
- ```
94
- ${AUDIT_BASE_DIR}/<audit-type>-report.${TIMESTAMP}.md
95
80
  ```
81
+ 1. Launch audit-security sub-agent:
82
+ "Analyze branch ${CURRENT_BRANCH} for security issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md"
96
83
 
97
- **Example paths**:
98
- - `.docs/audits/feature-auth/security-report.2025-10-18_1430.md`
99
- - `.docs/audits/feature-auth/performance-report.2025-10-18_1430.md`
84
+ 2. Launch audit-performance sub-agent:
85
+ "Analyze branch ${CURRENT_BRANCH} for performance issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md"
100
86
 
101
- **Core Audits (Always Run)**:
102
- 1. audit-security sub-agent `${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md`
103
- 2. audit-performance sub-agent → `${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md`
104
- 3. audit-architecture sub-agent → `${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md`
105
- 4. audit-tests sub-agent → `${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md`
106
- 5. audit-complexity sub-agent → `${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md`
107
- 6. audit-dependencies sub-agent → `${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md`
108
- 7. audit-documentation sub-agent → `${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md`
87
+ 3. Launch audit-architecture sub-agent:
88
+ "Analyze branch ${CURRENT_BRANCH} for architecture issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md"
109
89
 
110
- **Conditional Audits** (automatically detect and skip if not applicable):
111
- 8. audit-typescript sub-agent `${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md`
112
- 9. audit-database sub-agent → `${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md`
90
+ 4. Launch audit-tests sub-agent:
91
+ "Analyze branch ${CURRENT_BRANCH} for test coverage and quality issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md"
113
92
 
114
- ### Step 4: Synthesize Comprehensive Review
93
+ 5. Launch audit-complexity sub-agent:
94
+ "Analyze branch ${CURRENT_BRANCH} for code complexity issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md"
115
95
 
116
- After all sub-agents complete their analysis:
96
+ 6. Launch audit-dependencies sub-agent:
97
+ "Analyze branch ${CURRENT_BRANCH} for dependency issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md"
117
98
 
118
- 1. **Collect Results**: Gather findings from all 7-8 specialized sub-agents (depending on change types)
119
- 2. **Cross-Reference Issues**: Identify overlapping concerns between domains
120
- 3. **Prioritize for PR**: Focus on merge-blocking vs nice-to-have improvements
121
- 4. **Create PR-Ready Review**: Structure for easy consumption by human reviewers
99
+ 7. Launch audit-documentation sub-agent:
100
+ "Analyze branch ${CURRENT_BRANCH} for documentation issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md"
122
101
 
123
- ### Step 5: Save Comprehensive Review Document
102
+ 8. Launch audit-typescript sub-agent (if TypeScript project):
103
+ "Analyze branch ${CURRENT_BRANCH} for TypeScript issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md"
124
104
 
125
- Create a detailed review document at `${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md`:
105
+ 9. Launch audit-database sub-agent (if database changes detected):
106
+ "Analyze branch ${CURRENT_BRANCH} for database issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md"
107
+ ```
108
+
109
+ **IMPORTANT:** Launch ALL applicable sub-agents in a single message using multiple Task tool calls for parallel execution.
110
+
111
+ ---
112
+
113
+ ## Step 4: Read Audit Reports
114
+
115
+ After all sub-agents complete, read each generated report:
126
116
 
127
117
  ```bash
128
- REVIEW_FILE="${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md"
118
+ # List generated reports
119
+ ls -1 "$AUDIT_BASE_DIR"/*-report.${TIMESTAMP}.md
129
120
  ```
130
121
 
131
- **File structure**:
122
+ Use the Read tool to read each report file:
123
+ - `${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md`
124
+ - `${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md`
125
+ - `${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md`
126
+ - `${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md`
127
+ - `${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md`
128
+ - `${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md`
129
+ - `${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md`
130
+ - (Plus typescript and database reports if generated)
131
+
132
+ ---
133
+
134
+ ## Step 5: Extract Blocking Issues
135
+
136
+ From each report, extract issues from the **🔴 Issues in Your Changes** section.
137
+
138
+ These are blocking issues introduced in this branch that must be fixed before merge.
139
+
140
+ For each report:
141
+ 1. Look for the "🔴 Issues in Your Changes (BLOCKING)" section
142
+ 2. Extract all CRITICAL and HIGH severity issues
143
+ 3. Note the file:line references
144
+
145
+ Create a consolidated list of all blocking issues across all audits.
146
+
147
+ ---
148
+
149
+ ## Step 6: Create Summary Report
150
+
151
+ Create a comprehensive summary at `${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md`:
132
152
 
133
153
  ```markdown
134
- # Branch Review - {BRANCH_NAME}
135
- **Date**: {current_date}
136
- **Time**: {current_time}
137
- **Type**: Branch Review (PR Readiness Assessment)
138
- **Branch**: {CURRENT_BRANCH}
139
- **Base**: {BASE_BRANCH}
140
- **Reviewer**: AI Sub-Agent Orchestra
154
+ # Code Review Summary - ${CURRENT_BRANCH}
155
+
156
+ **Date**: $(date +%Y-%m-%d %H:%M:%S)
157
+ **Branch**: ${CURRENT_BRANCH}
158
+ **Base**: ${BASE_BRANCH}
159
+ **Audits Run**: {count} specialized audits
141
160
 
142
161
  ---
143
162
 
144
- ## 📊 Branch Overview
163
+ ## 🚦 Merge Recommendation
145
164
 
146
- **Commits**: {commit_count} commits
147
- **Files Changed**: {files_changed}
148
- **Lines Added**: {lines_added}
149
- **Lines Removed**: {lines_removed}
150
- **Review Duration**: {duration}
165
+ {One of:}
166
+ - ❌ **BLOCK MERGE** - Critical issues in your changes must be fixed
167
+ - ⚠️ **REVIEW REQUIRED** - High priority issues need attention
168
+ - ✅ **APPROVED WITH CONDITIONS** - Minor issues to address
169
+ - ✅ **APPROVED** - No blocking issues found
151
170
 
152
- ### Change Categories
153
- - 🎯 **Features**: {feature_changes}
154
- - 🐛 **Bug Fixes**: {bug_fixes}
155
- - 🔧 **Refactoring**: {refactoring}
156
- - 📚 **Documentation**: {doc_changes}
157
- - 🧪 **Tests**: {test_changes}
171
+ **Confidence**: {High/Medium/Low}
158
172
 
159
173
  ---
160
174
 
161
- ## 🎯 PR Readiness Assessment
175
+ ## 🔴 Blocking Issues (Must Fix Before Merge)
176
+
177
+ Issues introduced in lines you added or modified:
178
+
179
+ ### Security (CRITICAL: X, HIGH: Y)
180
+ {List critical/high issues from security audit's 🔴 section}
181
+ - **[Issue]** - `file:line` - {description}
182
+
183
+ ### Performance (CRITICAL: X, HIGH: Y)
184
+ {List critical/high issues from performance audit's 🔴 section}
185
+ - **[Issue]** - `file:line` - {description}
162
186
 
163
- ### 🚦 MERGE RECOMMENDATION
164
- **Status**: { READY TO MERGE | ⚠️ ISSUES TO ADDRESS | 🚫 NOT READY}
187
+ ### Architecture (HIGH: X)
188
+ {List high issues from architecture audit's 🔴 section}
189
+ - **[Issue]** - `file:line` - {description}
165
190
 
166
- **Confidence Level**: {High/Medium/Low}
191
+ ### Tests (HIGH: X)
192
+ {List high issues from tests audit's 🔴 section}
193
+ - **[Issue]** - `file:line` - {description}
167
194
 
168
- ### Blocking Issues (Must Fix Before Merge)
169
- - 🔴 {critical_issue_1} in {file:line}
170
- - 🔴 {critical_issue_2} in {file:line}
195
+ ### Complexity (HIGH: X)
196
+ {List high issues from complexity audit's 🔴 section}
197
+ - **[Issue]** - `file:line` - {description}
171
198
 
172
- ### High Priority (Should Fix Before Merge)
173
- - 🟠 {high_issue_1} in {file:line}
174
- - 🟠 {high_issue_2} in {file:line}
199
+ ### Dependencies (CRITICAL: X, HIGH: Y)
200
+ {List critical/high issues from dependencies audit's 🔴 section}
201
+ - **[Issue]** - `file:line` - {description}
202
+
203
+ ### Documentation (HIGH: X)
204
+ {List high issues from documentation audit's 🔴 section}
205
+ - **[Issue]** - `file:line` - {description}
206
+
207
+ ### TypeScript (HIGH: X)
208
+ {If applicable - list high issues from typescript audit's 🔴 section}
209
+ - **[Issue]** - `file:line` - {description}
210
+
211
+ ### Database (CRITICAL: X, HIGH: Y)
212
+ {If applicable - list critical/high issues from database audit's 🔴 section}
213
+ - **[Issue]** - `file:line` - {description}
175
214
 
176
215
  ---
177
216
 
178
- ## 🔍 Detailed Sub-Agent Analysis
217
+ ## ⚠️ Should Fix While You're Here
179
218
 
180
- ### 🔒 Security Analysis (audit-security)
181
- **Risk Level**: {Low/Medium/High/Critical}
219
+ Issues in code you touched (from ⚠️ sections of each audit):
182
220
 
183
- #### Security Issues Found
184
- {detailed security findings with file:line references}
221
+ {Count of issues by audit - don't list all, just summarize}
222
+ - Security: {count} issues in code you touched
223
+ - Performance: {count} issues in code you touched
224
+ - Architecture: {count} issues in code you touched
225
+ - Tests: {count} issues in code you touched
226
+ - Complexity: {count} issues in code you touched
185
227
 
186
- #### Security Recommendations
187
- {specific security improvements needed}
228
+ See individual audit reports for details.
188
229
 
189
- ### 📘 TypeScript Analysis (audit-typescript)
190
- **Type Safety**: {Excellent/Good/Acceptable/Poor}
191
- **Note**: Only included if TypeScript files changed or project uses TypeScript
230
+ ---
192
231
 
193
- #### TypeScript Issues Found
194
- {detailed type safety findings with file:line references}
232
+ ## ℹ️ Pre-existing Issues Found
195
233
 
196
- #### TypeScript Recommendations
197
- {specific type safety improvements needed}
234
+ Issues unrelated to your changes (from ℹ️ sections):
198
235
 
199
- ### Performance Analysis (audit-performance)
200
- **Performance Impact**: {Positive/Neutral/Negative}
236
+ {Count by audit}
237
+ - Security: {count} pre-existing issues
238
+ - Performance: {count} pre-existing issues
239
+ - Architecture: {count} pre-existing issues
240
+ - Tests: {count} pre-existing issues
241
+ - Complexity: {count} pre-existing issues
242
+ - Dependencies: {count} pre-existing issues
243
+ - Documentation: {count} pre-existing issues
201
244
 
202
- #### Performance Issues Found
203
- {detailed performance findings with optimizations}
245
+ Consider fixing in separate PRs.
204
246
 
205
- #### Performance Recommendations
206
- {specific performance improvements}
247
+ ---
207
248
 
208
- ### 🏗️ Architecture Analysis (audit-architecture)
209
- **Architecture Quality**: {Excellent/Good/Acceptable/Poor}
249
+ ## 📊 Summary by Category
210
250
 
211
- #### Architectural Issues Found
212
- {detailed architecture findings and design concerns}
251
+ **Your Changes (🔴 BLOCKING):**
252
+ - CRITICAL: {total_critical}
253
+ - HIGH: {total_high}
254
+ - MEDIUM: {total_medium}
213
255
 
214
- #### Architecture Recommendations
215
- {specific architectural improvements}
256
+ **Code You Touched (⚠️ SHOULD FIX):**
257
+ - HIGH: {total_high}
258
+ - MEDIUM: {total_medium}
216
259
 
217
- ### 🧪 Test Coverage Analysis (audit-tests)
218
- **Coverage Assessment**: {Excellent/Good/Adequate/Insufficient}
260
+ **Pre-existing (ℹ️ OPTIONAL):**
261
+ - MEDIUM: {total_medium}
262
+ - LOW: {total_low}
219
263
 
220
- #### Testing Issues Found
221
- {detailed test coverage gaps and quality issues}
264
+ ---
222
265
 
223
- #### Testing Recommendations
224
- {specific tests that should be added}
266
+ ## 🎯 Action Plan
225
267
 
226
- ### 🧠 Complexity Analysis (audit-complexity)
227
- **Maintainability Score**: {Excellent/Good/Acceptable/Poor}
268
+ **Before Merge (Priority Order):**
228
269
 
229
- #### Complexity Issues Found
230
- {detailed complexity and maintainability concerns}
270
+ 1. {Highest priority blocking issue from any audit}
271
+ - File: {file:line}
272
+ - Fix: {recommended fix}
231
273
 
232
- #### Complexity Recommendations
233
- {specific refactoring suggestions}
274
+ 2. {Second highest priority blocking issue}
275
+ - File: {file:line}
276
+ - Fix: {recommended fix}
234
277
 
235
- ### 📦 Dependency Analysis (audit-dependencies)
236
- **Dependency Health**: {Excellent/Good/Acceptable/Poor}
278
+ 3. {Third highest priority blocking issue}
279
+ - File: {file:line}
280
+ - Fix: {recommended fix}
237
281
 
238
- #### Dependency Issues Found
239
- {detailed dependency concerns and security issues}
282
+ {Continue for all blocking issues}
240
283
 
241
- #### Dependency Recommendations
242
- {specific dependency management improvements}
284
+ **While You're Here (Optional):**
285
+ - Review ⚠️ sections in individual audit reports
286
+ - Fix issues in code you modified
243
287
 
244
- ### 📚 Documentation Analysis (audit-documentation)
245
- **Documentation Quality**: {Excellent/Good/Acceptable/Poor}
288
+ **Future Work:**
289
+ - Create issues for pre-existing problems
290
+ - Track in technical debt backlog
246
291
 
247
- #### Documentation Issues Found
248
- {detailed documentation drift, missing docs, stale examples}
292
+ ---
249
293
 
250
- #### Documentation Recommendations
251
- {specific documentation updates needed}
294
+ ## 📁 Individual Audit Reports
252
295
 
253
- ### 🗄️ Database Analysis (audit-database)
254
- **Database Health**: {Excellent/Good/Acceptable/Poor}
255
- **Note**: Only included if database changes detected
296
+ Detailed analysis available in:
297
+ - [Security Audit](security-report.${TIMESTAMP}.md)
298
+ - [Performance Audit](performance-report.${TIMESTAMP}.md)
299
+ - [Architecture Audit](architecture-report.${TIMESTAMP}.md)
300
+ - [Test Coverage Audit](tests-report.${TIMESTAMP}.md)
301
+ - [Complexity Audit](complexity-report.${TIMESTAMP}.md)
302
+ - [Dependencies Audit](dependencies-report.${TIMESTAMP}.md)
303
+ - [Documentation Audit](documentation-report.${TIMESTAMP}.md)
304
+ {If applicable:}
305
+ - [TypeScript Audit](typescript-report.${TIMESTAMP}.md)
306
+ - [Database Audit](database-report.${TIMESTAMP}.md)
256
307
 
257
- #### Database Issues Found
258
- {detailed database design, migration, and query issues}
308
+ ---
259
309
 
260
- #### Database Recommendations
261
- {specific database improvements needed}
310
+ ## 💡 Next Steps
311
+
312
+ {If blocking issues exist:}
313
+ **Fix blocking issues then re-run `/code-review` to verify**
314
+
315
+ {If no blocking issues:}
316
+ **Ready to create PR:**
317
+ 1. Run `/commit` to create final commits
318
+ 2. Run `/pull-request` to create PR with this review as reference
319
+
320
+ {If issues in touched code:}
321
+ **Consider fixing ⚠️ issues while you're working in these files**
262
322
 
263
323
  ---
264
324
 
265
- ## 🎯 Action Plan
325
+ *Review generated by DevFlow audit orchestration*
326
+ *{Timestamp}*
327
+ ```
328
+
329
+ Save this summary using Write tool.
330
+
331
+ ---
266
332
 
267
- ### Pre-Merge Checklist (Blocking)
268
- - [ ] {blocking_action_1} - {estimated_effort}
269
- - [ ] {blocking_action_2} - {estimated_effort}
270
- - [ ] {blocking_action_3} - {estimated_effort}
333
+ ## Step 7: Present Results to Developer
271
334
 
272
- ### Post-Merge Improvements (Non-Blocking)
273
- - [ ] {improvement_1} - {estimated_effort}
274
- - [ ] {improvement_2} - {estimated_effort}
275
- - [ ] {improvement_3} - {estimated_effort}
335
+ Show clear, actionable summary:
276
336
 
277
- ### Follow-Up Tasks
278
- - [ ] {followup_1}
279
- - [ ] {followup_2}
337
+ ```markdown
338
+ 🔍 CODE REVIEW COMPLETE
339
+
340
+ **Branch**: ${CURRENT_BRANCH}
341
+ **Audits**: {count} specialized audits completed
280
342
 
281
343
  ---
282
344
 
283
- ## 📈 Quality Metrics
345
+ ## 🚦 Merge Status
346
+
347
+ {Show the merge recommendation - one of:}
348
+ ❌ **BLOCK MERGE** - {count} critical issues in your changes
349
+ ⚠️ **REVIEW REQUIRED** - {count} high priority issues
350
+ ✅ **APPROVED WITH CONDITIONS** - {count} minor issues
351
+ ✅ **APPROVED** - No blocking issues found
352
+
353
+ ---
284
354
 
285
- ### Code Quality Score: {score}/10
355
+ ## 🔴 Issues You Introduced ({total_count})
286
356
 
287
- **Breakdown**:
288
- - Security: {score}/10
289
- - TypeScript: {score}/10 (if applicable)
290
- - Performance: {score}/10
291
- - Architecture: {score}/10
292
- - Test Coverage: {score}/10
293
- - Maintainability: {score}/10
294
- - Dependencies: {score}/10
295
- - Documentation: {score}/10
296
- - Database: {score}/10 (if applicable)
357
+ {Show top 3-5 most critical blocking issues}
297
358
 
298
- ### Comparison to {BASE_BRANCH}
299
- - Quality Trend: {Improving/Stable/Declining}
300
- - Technical Debt: {Reduced/Neutral/Increased}
301
- - Test Coverage: {Increased/Maintained/Decreased}
359
+ **Security:**
360
+ - {Issue 1} - `file:line`
361
+
362
+ **Performance:**
363
+ - {Issue 1} - `file:line`
364
+
365
+ **Architecture:**
366
+ - {Issue 1} - `file:line`
367
+
368
+ {Show total counts}
369
+ Total blocking issues: {count}
370
+ - CRITICAL: {count}
371
+ - HIGH: {count}
372
+ - MEDIUM: {count}
302
373
 
303
374
  ---
304
375
 
305
- ## 🔗 Related Resources
376
+ ## ⚠️ Issues in Code You Touched ({total_count})
306
377
 
307
- ### Files Requiring Attention
308
- - {file1} - {reason}
309
- - {file2} - {reason}
310
- - {file3} - {reason}
378
+ {Show counts by audit}
379
+ - Security: {count} issues
380
+ - Performance: {count} issues
381
+ - Architecture: {count} issues
382
+ - Tests: {count} issues
383
+ - Complexity: {count} issues
311
384
 
312
- ### Similar Issues in Codebase
313
- - {related_issue_1} in {location}
314
- - {related_issue_2} in {location}
385
+ See individual reports for details.
315
386
 
316
- ### Documentation Updates Needed
317
- - {doc_update_1}
318
- - {doc_update_2}
387
+ ---
388
+
389
+ ## ℹ️ Pre-existing Issues ({total_count})
390
+
391
+ {Show count by audit}
392
+ Found {count} legacy issues unrelated to your changes.
393
+ Consider fixing in separate PRs.
319
394
 
320
395
  ---
321
396
 
322
- ## 💡 Reviewer Notes
397
+ ## 📁 Reports Saved
323
398
 
324
- ### Human Review Focus Areas
325
- Based on sub-agent analysis, human reviewers should focus on:
326
- 1. {focus_area_1} - {reason}
327
- 2. {focus_area_2} - {reason}
328
- 3. {focus_area_3} - {reason}
399
+ **Summary**: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
329
400
 
330
- ### Discussion Points
331
- - {discussion_point_1}
332
- - {discussion_point_2}
333
- - {discussion_point_3}
401
+ **Individual Audits**:
402
+ {List all generated reports}
334
403
 
335
404
  ---
336
405
 
337
- *Comprehensive review generated by DevFlow sub-agent orchestration*
338
- *Next: Address blocking issues, then create PR with this review as reference*
339
- ```
406
+ ## 🎯 Next Steps
340
407
 
341
- ### Step 6: Provide Executive Summary
408
+ {If blocking issues:}
409
+ 1. Fix the {count} blocking issues listed above
410
+ 2. Re-run `/code-review` to verify fixes
411
+ 3. Then create PR with `/pull-request`
342
412
 
343
- Give the developer a clear, actionable summary:
413
+ {If no blocking issues:}
414
+ 1. Review ⚠️ issues (optional improvements)
415
+ 2. Create commits: `/commit`
416
+ 3. Create PR: `/pull-request`
344
417
 
418
+ {Always show:}
419
+ 💡 Full details in: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
345
420
  ```
346
- 🔍 BRANCH REVIEW COMPLETE: {BRANCH_NAME}
347
-
348
- 📊 ANALYSIS SUMMARY:
349
- - Files analyzed: {X} files, {Y} commits
350
- - Issues found: {Critical} critical, {High} high, {Medium} medium, {Low} low
351
- - Review confidence: {High/Medium/Low}
352
-
353
- 🚦 PR READINESS: {✅ READY | ⚠️ ISSUES TO ADDRESS | 🚫 NOT READY}
354
-
355
- 🎯 CRITICAL ACTIONS BEFORE MERGE:
356
- 1. {Most critical blocking issue}
357
- 2. {Second most critical blocking issue}
358
- 3. {Third most critical blocking issue}
359
-
360
- ⚡ QUICK WINS:
361
- - {Easy fix 1} ({estimated time})
362
- - {Easy fix 2} ({estimated time})
363
-
364
- 📄 Full review: ${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md
365
-
366
- 📁 Individual audit reports:
367
- ${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md
368
- ${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md
369
- ${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md
370
- ${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md
371
- ${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md
372
- ${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md
373
- ${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md
374
- (+ typescript-report.${TIMESTAMP}.md if applicable)
375
- (+ database-report.${TIMESTAMP}.md if applicable)
376
-
377
- 🔄 NEXT STEPS:
378
- 1. Address blocking issues above
379
- 2. Run `/code-review` after fixes to verify
380
- 3. Create PR using this review as reference
381
- 4. Share review with team for human review focus
382
- ```
421
+
422
+ ---
423
+
424
+ ## Key Principles
425
+
426
+ 1. **Launch sub-agents in parallel** - Use multiple Task calls in one message
427
+ 2. **Read all reports** - Don't skip any audit results
428
+ 3. **Extract blocking issues** - Focus on 🔴 sections from each report
429
+ 4. **Be specific** - File:line references, exact issues, clear fixes
430
+ 5. **Prioritize** - Blocking (must fix) vs should fix vs optional
431
+ 6. **Be actionable** - Clear next steps based on findings