devflow-kit 0.7.0 → 0.8.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.
@@ -1,339 +1,184 @@
1
1
  ---
2
2
  description: Comprehensive branch review using specialized sub-agents for PR readiness
3
- allowed-tools: Task, Bash, Read, Write, Grep, Glob
3
+ allowed-tools: Task, Bash, Read, Grep, Glob
4
4
  ---
5
5
 
6
6
  ## Your Task
7
7
 
8
- Orchestrate multiple specialized audit sub-agents to review the current branch, then synthesize their findings into an actionable summary.
8
+ Orchestrate specialized audit sub-agents to review the current branch, then synthesize findings into PR comments and tech debt tracking.
9
9
 
10
10
  ---
11
11
 
12
- ## Step 1: Determine Review Scope
13
-
14
- Get the current branch and base branch:
12
+ ## Phase 1: Setup
15
13
 
16
14
  ```bash
17
- # Get current branch
15
+ # Get current branch for directory naming
18
16
  CURRENT_BRANCH=$(git branch --show-current)
19
- if [ -z "$CURRENT_BRANCH" ]; then
20
- echo "❌ Not on a branch (detached HEAD)"
21
- exit 1
22
- fi
23
-
24
- # Find base branch
25
- BASE_BRANCH=""
26
- for branch in main master develop; do
27
- if git show-ref --verify --quiet refs/heads/$branch; then
28
- BASE_BRANCH=$branch
29
- break
30
- fi
31
- done
32
-
33
- if [ -z "$BASE_BRANCH" ]; then
34
- echo "❌ Could not find base branch (main/master/develop)"
35
- exit 1
36
- fi
37
-
38
- # Check for changes
39
- if git diff --quiet $BASE_BRANCH...HEAD; then
40
- echo "ℹ️ No changes between $BASE_BRANCH and $CURRENT_BRANCH"
41
- exit 0
42
- fi
43
-
44
- # Show change summary
45
- echo "=== CODE REVIEW SCOPE ==="
46
- echo "Branch: $CURRENT_BRANCH"
47
- echo "Base: $BASE_BRANCH"
48
- echo ""
49
- git diff --stat $BASE_BRANCH...HEAD
50
- echo ""
51
- git log --oneline $BASE_BRANCH..HEAD | head -5
52
- echo ""
53
- ```
54
-
55
- ---
56
-
57
- ## Step 2: Set Up Audit Structure
58
-
59
- Create directory for audit reports:
17
+ BRANCH_SLUG=$(echo "${CURRENT_BRANCH:-standalone}" | sed 's/\//-/g')
60
18
 
61
- ```bash
19
+ # Coordination variables (shared across all sub-agents)
62
20
  TIMESTAMP=$(date +%Y-%m-%d_%H%M)
63
- BRANCH_SLUG=$(echo "$CURRENT_BRANCH" | sed 's/\//-/g')
64
21
  AUDIT_BASE_DIR=".docs/audits/${BRANCH_SLUG}"
65
22
  mkdir -p "$AUDIT_BASE_DIR"
66
23
 
67
- echo "📁 Audit reports: $AUDIT_BASE_DIR"
68
- echo ""
69
- ```
70
-
71
- ---
72
-
73
- ## Step 3: Launch Audit Sub-Agents in Parallel
74
-
75
- Use the Task tool to launch all audit sub-agents in parallel. Each will analyze the branch and save its report.
76
-
77
- **Launch these sub-agents:**
78
-
79
- Use Task tool with `subagent_type` for each audit:
80
-
81
- ```
82
- 1. Launch audit-security sub-agent:
83
- "Analyze branch ${CURRENT_BRANCH} for security issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md"
84
-
85
- 2. Launch audit-performance sub-agent:
86
- "Analyze branch ${CURRENT_BRANCH} for performance issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md"
87
-
88
- 3. Launch audit-architecture sub-agent:
89
- "Analyze branch ${CURRENT_BRANCH} for architecture issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md"
90
-
91
- 4. Launch audit-tests sub-agent:
92
- "Analyze branch ${CURRENT_BRANCH} for test coverage and quality issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md"
93
-
94
- 5. Launch audit-complexity sub-agent:
95
- "Analyze branch ${CURRENT_BRANCH} for code complexity issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md"
96
-
97
- 6. Launch audit-dependencies sub-agent:
98
- "Analyze branch ${CURRENT_BRANCH} for dependency issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md"
99
-
100
- 7. Launch audit-documentation sub-agent:
101
- "Analyze branch ${CURRENT_BRANCH} for documentation issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md"
102
-
103
- 8. Launch audit-typescript sub-agent (if TypeScript project):
104
- "Analyze branch ${CURRENT_BRANCH} for TypeScript issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md"
105
-
106
- 9. Launch audit-database sub-agent (if database changes detected):
107
- "Analyze branch ${CURRENT_BRANCH} for database issues. Compare against ${BASE_BRANCH}. Save report to ${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md"
108
- ```
109
-
110
- **IMPORTANT:** Launch ALL applicable sub-agents in a single message using multiple Task tool calls for parallel execution.
111
-
112
- ---
113
-
114
- ## Step 4: Read Audit Reports
24
+ # Detect project type for conditional audits
25
+ HAS_TYPESCRIPT=false
26
+ [ -f "tsconfig.json" ] && HAS_TYPESCRIPT=true
115
27
 
116
- After all sub-agents complete, read each generated report:
28
+ HAS_DB_CHANGES=false
29
+ git diff --name-only HEAD~10..HEAD 2>/dev/null | grep -qiE '(migration|schema|\.sql|prisma|drizzle|knex)' && HAS_DB_CHANGES=true
117
30
 
118
- ```bash
119
- # List generated reports
120
- ls -1 "$AUDIT_BASE_DIR"/*-report.${TIMESTAMP}.md
31
+ echo "=== CODE REVIEW ==="
32
+ echo "📁 Reports: $AUDIT_BASE_DIR"
33
+ echo "⏱️ Timestamp: $TIMESTAMP"
34
+ echo "📦 TypeScript: $HAS_TYPESCRIPT"
35
+ echo "🗄️ Database: $HAS_DB_CHANGES"
121
36
  ```
122
37
 
123
- Use the Read tool to read each report file:
124
- - `${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md`
125
- - `${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md`
126
- - `${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md`
127
- - `${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md`
128
- - `${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md`
129
- - `${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md`
130
- - `${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md`
131
- - (Plus typescript and database reports if generated)
132
-
133
- ---
134
-
135
- ## Step 5: Extract Blocking Issues
136
-
137
- From each report, extract issues from the **🔴 Issues in Your Changes** section.
138
-
139
- These are blocking issues introduced in this branch that must be fixed before merge.
140
-
141
- For each report:
142
- 1. Look for the "🔴 Issues in Your Changes (BLOCKING)" section
143
- 2. Extract all CRITICAL and HIGH severity issues
144
- 3. Note the file:line references
145
-
146
- Create a consolidated list of all blocking issues across all audits.
147
-
148
- ---
149
-
150
- ## Step 6: Create Summary Report
151
-
152
- Create a comprehensive summary at `${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md`:
153
-
154
- ```markdown
155
- # Code Review Summary - ${CURRENT_BRANCH}
156
-
157
- **Date**: $(date +%Y-%m-%d %H:%M:%S)
158
- **Branch**: ${CURRENT_BRANCH}
159
- **Base**: ${BASE_BRANCH}
160
- **Audits Run**: {count} specialized audits
161
-
162
- ---
163
-
164
- ## 🚦 Merge Recommendation
165
-
166
- {One of:}
167
- - ❌ **BLOCK MERGE** - Critical issues in your changes must be fixed
168
- - ⚠️ **REVIEW REQUIRED** - High priority issues need attention
169
- - ✅ **APPROVED WITH CONDITIONS** - Minor issues to address
170
- - ✅ **APPROVED** - No blocking issues found
171
-
172
- **Confidence**: {High/Medium/Low}
173
-
174
- ---
175
-
176
- ## 🔴 Blocking Issues (Must Fix Before Merge)
177
-
178
- Issues introduced in lines you added or modified:
179
-
180
- ### Security (CRITICAL: X, HIGH: Y)
181
- {List critical/high issues from security audit's 🔴 section}
182
- - **[Issue]** - `file:line` - {description}
183
-
184
- ### Performance (CRITICAL: X, HIGH: Y)
185
- {List critical/high issues from performance audit's 🔴 section}
186
- - **[Issue]** - `file:line` - {description}
187
-
188
- ### Architecture (HIGH: X)
189
- {List high issues from architecture audit's 🔴 section}
190
- - **[Issue]** - `file:line` - {description}
191
-
192
- ### Tests (HIGH: X)
193
- {List high issues from tests audit's 🔴 section}
194
- - **[Issue]** - `file:line` - {description}
195
-
196
- ### Complexity (HIGH: X)
197
- {List high issues from complexity audit's 🔴 section}
198
- - **[Issue]** - `file:line` - {description}
199
-
200
- ### Dependencies (CRITICAL: X, HIGH: Y)
201
- {List critical/high issues from dependencies audit's 🔴 section}
202
- - **[Issue]** - `file:line` - {description}
203
-
204
- ### Documentation (HIGH: X)
205
- {List high issues from documentation audit's 🔴 section}
206
- - **[Issue]** - `file:line` - {description}
207
-
208
- ### TypeScript (HIGH: X)
209
- {If applicable - list high issues from typescript audit's 🔴 section}
210
- - **[Issue]** - `file:line` - {description}
211
-
212
- ### Database (CRITICAL: X, HIGH: Y)
213
- {If applicable - list critical/high issues from database audit's 🔴 section}
214
- - **[Issue]** - `file:line` - {description}
215
-
216
38
  ---
217
39
 
218
- ## ⚠️ Should Fix While You're Here
40
+ ## Phase 2: Run Audit Sub-Agents (Parallel)
219
41
 
220
- Issues in code you touched (from ⚠️ sections of each audit):
42
+ Launch ALL applicable audit sub-agents in a **single message** using multiple Task tool calls for parallel execution.
221
43
 
222
- {Count of issues by audit - don't list all, just summarize}
223
- - Security: {count} issues in code you touched
224
- - Performance: {count} issues in code you touched
225
- - Architecture: {count} issues in code you touched
226
- - Tests: {count} issues in code you touched
227
- - Complexity: {count} issues in code you touched
44
+ **IMPORTANT:** You MUST launch these as parallel Task calls in ONE message.
228
45
 
229
- See individual audit reports for details.
46
+ **Always Launch (7 core audits):**
230
47
 
231
- ---
48
+ 1. **audit-security**
49
+ ```
50
+ Analyze branch for security issues. Compare against base branch.
51
+ Save report to: ${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md
52
+ ```
232
53
 
233
- ## ℹ️ Pre-existing Issues Found
54
+ 2. **audit-performance**
55
+ ```
56
+ Analyze branch for performance issues. Compare against base branch.
57
+ Save report to: ${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md
58
+ ```
234
59
 
235
- Issues unrelated to your changes (from ℹ️ sections):
60
+ 3. **audit-architecture**
61
+ ```
62
+ Analyze branch for architecture issues. Compare against base branch.
63
+ Save report to: ${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md
64
+ ```
236
65
 
237
- {Count by audit}
238
- - Security: {count} pre-existing issues
239
- - Performance: {count} pre-existing issues
240
- - Architecture: {count} pre-existing issues
241
- - Tests: {count} pre-existing issues
242
- - Complexity: {count} pre-existing issues
243
- - Dependencies: {count} pre-existing issues
244
- - Documentation: {count} pre-existing issues
66
+ 4. **audit-tests**
67
+ ```
68
+ Analyze branch for test coverage and quality issues. Compare against base branch.
69
+ Save report to: ${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md
70
+ ```
245
71
 
246
- Consider fixing in separate PRs.
72
+ 5. **audit-complexity**
73
+ ```
74
+ Analyze branch for code complexity issues. Compare against base branch.
75
+ Save report to: ${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md
76
+ ```
247
77
 
248
- ---
78
+ 6. **audit-dependencies**
79
+ ```
80
+ Analyze branch for dependency issues. Compare against base branch.
81
+ Save report to: ${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md
82
+ ```
249
83
 
250
- ## 📊 Summary by Category
84
+ 7. **audit-documentation**
85
+ ```
86
+ Analyze branch for documentation issues. Compare against base branch.
87
+ Save report to: ${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md
88
+ ```
251
89
 
252
- **Your Changes (🔴 BLOCKING):**
253
- - CRITICAL: {total_critical}
254
- - HIGH: {total_high}
255
- - MEDIUM: {total_medium}
90
+ **Conditional Audits:**
256
91
 
257
- **Code You Touched (⚠️ SHOULD FIX):**
258
- - HIGH: {total_high}
259
- - MEDIUM: {total_medium}
92
+ 8. **audit-typescript** (if HAS_TYPESCRIPT=true)
93
+ ```
94
+ Analyze branch for TypeScript issues. Compare against base branch.
95
+ Save report to: ${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md
96
+ ```
260
97
 
261
- **Pre-existing (ℹ️ OPTIONAL):**
262
- - MEDIUM: {total_medium}
263
- - LOW: {total_low}
98
+ 9. **audit-database** (if HAS_DB_CHANGES=true)
99
+ ```
100
+ Analyze branch for database issues. Compare against base branch.
101
+ Save report to: ${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md
102
+ ```
264
103
 
265
104
  ---
266
105
 
267
- ## 🎯 Action Plan
268
-
269
- **Before Merge (Priority Order):**
270
-
271
- 1. {Highest priority blocking issue from any audit}
272
- - File: {file:line}
273
- - Fix: {recommended fix}
274
-
275
- 2. {Second highest priority blocking issue}
276
- - File: {file:line}
277
- - Fix: {recommended fix}
278
-
279
- 3. {Third highest priority blocking issue}
280
- - File: {file:line}
281
- - Fix: {recommended fix}
282
-
283
- {Continue for all blocking issues}
284
-
285
- **While You're Here (Optional):**
286
- - Review ⚠️ sections in individual audit reports
287
- - Fix issues in code you modified
106
+ ## Phase 3: Synthesis (After Audits Complete)
288
107
 
289
- **Future Work:**
290
- - Create issues for pre-existing problems
291
- - Track in technical debt backlog
108
+ **WAIT for all Phase 2 audits to complete before proceeding.**
292
109
 
293
- ---
110
+ After all audit sub-agents have finished, launch THREE synthesis sub-agents in **parallel**:
294
111
 
295
- ## 📁 Individual Audit Reports
112
+ ### 3.1 code-review sub-agent (Summary Report)
296
113
 
297
- Detailed analysis available in:
298
- - [Security Audit](security-report.${TIMESTAMP}.md)
299
- - [Performance Audit](performance-report.${TIMESTAMP}.md)
300
- - [Architecture Audit](architecture-report.${TIMESTAMP}.md)
301
- - [Test Coverage Audit](tests-report.${TIMESTAMP}.md)
302
- - [Complexity Audit](complexity-report.${TIMESTAMP}.md)
303
- - [Dependencies Audit](dependencies-report.${TIMESTAMP}.md)
304
- - [Documentation Audit](documentation-report.${TIMESTAMP}.md)
305
- {If applicable:}
306
- - [TypeScript Audit](typescript-report.${TIMESTAMP}.md)
307
- - [Database Audit](database-report.${TIMESTAMP}.md)
114
+ ```
115
+ Generate code review summary for branch ${CURRENT_BRANCH}.
308
116
 
309
- ---
117
+ Context:
118
+ - Branch: ${CURRENT_BRANCH}
119
+ - Base: ${BASE_BRANCH}
120
+ - Audit Directory: ${AUDIT_BASE_DIR}
121
+ - Timestamp: ${TIMESTAMP}
310
122
 
311
- ## 💡 Next Steps
123
+ Tasks:
124
+ 1. Read all audit reports from ${AUDIT_BASE_DIR}/*-report.${TIMESTAMP}.md
125
+ 2. Extract and categorize all issues (🔴/⚠️/ℹ️)
126
+ 3. Generate summary report at ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
127
+ 4. Determine merge recommendation
312
128
 
313
- {If blocking issues exist:}
314
- **Fix blocking issues then re-run `/code-review` to verify**
129
+ Report back: Merge recommendation and issue counts
130
+ ```
315
131
 
316
- {If no blocking issues:}
317
- **Ready to create PR:**
318
- 1. Run `/commit` to create final commits
319
- 2. Run `/pull-request` to create PR with this review as reference
132
+ ### 3.2 pr-comments sub-agent (PR Comments)
320
133
 
321
- {If issues in touched code:}
322
- **Consider fixing ⚠️ issues while you're working in these files**
134
+ ```
135
+ Create PR comments for code review findings on branch ${CURRENT_BRANCH}.
136
+
137
+ Context:
138
+ - Branch: ${CURRENT_BRANCH}
139
+ - Audit Directory: ${AUDIT_BASE_DIR}
140
+ - Timestamp: ${TIMESTAMP}
141
+
142
+ Tasks:
143
+ 1. Read all audit reports from ${AUDIT_BASE_DIR}/*-report.${TIMESTAMP}.md
144
+ 2. Ensure PR exists (create draft if missing)
145
+ 3. Create individual comments for all 🔴 blocking issues
146
+ 4. Create individual comments for all ⚠️ should-fix issues
147
+ 5. Include suggested fixes with code examples
148
+ 6. Show pros/cons table when multiple approaches exist
149
+ 7. Add Claude Code attribution to each comment
150
+
151
+ Report back: PR number and count of comments created
152
+ ```
323
153
 
324
- ---
154
+ ### 3.3 tech-debt sub-agent (Tech Debt Management)
325
155
 
326
- *Review generated by DevFlow audit orchestration*
327
- *{Timestamp}*
156
+ ```
157
+ Manage tech debt for code review on branch ${CURRENT_BRANCH}.
158
+
159
+ Context:
160
+ - Branch: ${CURRENT_BRANCH}
161
+ - Audit Directory: ${AUDIT_BASE_DIR}
162
+ - Timestamp: ${TIMESTAMP}
163
+
164
+ Tasks:
165
+ 1. Read all audit reports from ${AUDIT_BASE_DIR}/*-report.${TIMESTAMP}.md
166
+ 2. Find or create Tech Debt Backlog issue
167
+ 3. Check if archive needed (approaching 60k char limit)
168
+ 4. Add new ℹ️ pre-existing issues (deduplicated)
169
+ 5. Check existing items - remove those that are fixed
170
+ 6. Update issue with changes
171
+
172
+ Report back: Issue number, items added, items removed
328
173
  ```
329
174
 
330
- Save this summary using Write tool.
175
+ **IMPORTANT:** Launch all THREE synthesis sub-agents in a SINGLE message for parallel execution.
331
176
 
332
177
  ---
333
178
 
334
- ## Step 7: Present Results to Developer
179
+ ## Phase 4: Present Results
335
180
 
336
- Show clear, actionable summary:
181
+ After ALL synthesis sub-agents complete, consolidate their reports and display final summary:
337
182
 
338
183
  ```markdown
339
184
  🔍 CODE REVIEW COMPLETE
@@ -343,90 +188,50 @@ Show clear, actionable summary:
343
188
 
344
189
  ---
345
190
 
346
- ## 🚦 Merge Status
347
-
348
- {Show the merge recommendation - one of:}
349
- ❌ **BLOCK MERGE** - {count} critical issues in your changes
350
- ⚠️ **REVIEW REQUIRED** - {count} high priority issues
351
- ✅ **APPROVED WITH CONDITIONS** - {count} minor issues
352
- ✅ **APPROVED** - No blocking issues found
353
-
354
- ---
355
-
356
- ## 🔴 Issues You Introduced ({total_count})
357
-
358
- {Show top 3-5 most critical blocking issues}
359
-
360
- **Security:**
361
- - {Issue 1} - `file:line`
362
-
363
- **Performance:**
364
- - {Issue 1} - `file:line`
365
-
366
- **Architecture:**
367
- - {Issue 1} - `file:line`
368
-
369
- {Show total counts}
370
- Total blocking issues: {count}
371
- - CRITICAL: {count}
372
- - HIGH: {count}
373
- - MEDIUM: {count}
374
-
375
- ---
376
-
377
- ## ⚠️ Issues in Code You Touched ({total_count})
378
-
379
- {Show counts by audit}
380
- - Security: {count} issues
381
- - Performance: {count} issues
382
- - Architecture: {count} issues
383
- - Tests: {count} issues
384
- - Complexity: {count} issues
385
-
386
- See individual reports for details.
191
+ ## 🚦 Merge Status: {RECOMMENDATION from code-review agent}
387
192
 
388
193
  ---
389
194
 
390
- ## ℹ️ Pre-existing Issues ({total_count})
195
+ ## 📊 Issues Found
391
196
 
392
- {Show count by audit}
393
- Found {count} legacy issues unrelated to your changes.
394
- Consider fixing in separate PRs.
197
+ | Category | Count | Action |
198
+ |----------|-------|--------|
199
+ | 🔴 Blocking | {count} | Must fix before merge |
200
+ | ⚠️ Should Fix | {count} | Fix while you're here |
201
+ | ℹ️ Pre-existing | {count} | Managed in tech debt |
395
202
 
396
203
  ---
397
204
 
398
- ## 📁 Reports Saved
399
-
400
- **Summary**: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
205
+ ## 📝 Artifacts Created
401
206
 
402
- **Individual Audits**:
403
- {List all generated reports}
207
+ - **Summary**: `${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md`
208
+ - **PR Comments**: {count} comments on PR #{number from pr-comments agent}
209
+ - **Tech Debt**: Issue #{number from tech-debt agent}
210
+ - Added: {count} new items
211
+ - Removed: {count} fixed items
404
212
 
405
213
  ---
406
214
 
407
215
  ## 🎯 Next Steps
408
216
 
409
- {If blocking issues:}
410
- 1. Fix the {count} blocking issues listed above
411
- 2. Re-run `/code-review` to verify fixes
412
- 3. Then create PR with `/pull-request`
217
+ {If BLOCK MERGE:}
218
+ 1. Review PR comments for fix suggestions
219
+ 2. Address 🔴 blocking issues
220
+ 3. Re-run `/code-review` to verify
413
221
 
414
- {If no blocking issues:}
415
- 1. Review ⚠️ issues (optional improvements)
222
+ {If APPROVED:}
223
+ 1. Review ⚠️ suggestions (optional)
416
224
  2. Create commits: `/commit`
417
225
  3. Create PR: `/pull-request`
418
-
419
- {Always show:}
420
- 💡 Full details in: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
421
226
  ```
422
227
 
423
228
  ---
424
229
 
425
- ## Key Principles
230
+ ## Orchestration Rules
426
231
 
427
- 1. **Launch sub-agents in parallel** - Use multiple Task calls in one message
428
- 2. **Read all reports** - Don't skip any audit results
429
- 3. **Extract blocking issues** - Focus on 🔴 sections from each report
430
- 4. **Be specific** - File:line references, exact issues, clear fixes
431
- 5. **Prioritize** - Blocking (must fix) vs should fix vs optional
432
- 6. **Be actionable** - Clear next steps based on findings
232
+ 1. **Phase 2 is parallel** - Launch ALL audit sub-agents in a single message
233
+ 2. **Phase 3 is parallel** - Launch ALL synthesis sub-agents in a single message (after Phase 2)
234
+ 3. **Don't read reports yourself** - Sub-agents handle all file reading
235
+ 4. **Don't create artifacts yourself** - Each sub-agent creates its own outputs
236
+ 5. **Pass context accurately** - Ensure AUDIT_BASE_DIR and TIMESTAMP reach all sub-agents
237
+ 6. **Consolidate results** - Combine reports from all three synthesis agents for final output