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.
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +159 -61
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
- package/src/claude/agents/devflow/code-review.md +307 -0
- package/src/claude/agents/devflow/pr-comments.md +285 -0
- package/src/claude/agents/devflow/tech-debt.md +338 -0
- package/src/claude/commands/devflow/code-review.md +151 -346
|
@@ -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,
|
|
3
|
+
allowed-tools: Task, Bash, Read, Grep, Glob
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Your Task
|
|
7
7
|
|
|
8
|
-
Orchestrate
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
##
|
|
40
|
+
## Phase 2: Run Audit Sub-Agents (Parallel)
|
|
219
41
|
|
|
220
|
-
|
|
42
|
+
Launch ALL applicable audit sub-agents in a **single message** using multiple Task tool calls for parallel execution.
|
|
221
43
|
|
|
222
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
253
|
-
- CRITICAL: {total_critical}
|
|
254
|
-
- HIGH: {total_high}
|
|
255
|
-
- MEDIUM: {total_medium}
|
|
90
|
+
**Conditional Audits:**
|
|
256
91
|
|
|
257
|
-
**
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
**
|
|
262
|
-
|
|
263
|
-
|
|
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
|
-
##
|
|
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
|
-
**
|
|
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
|
-
|
|
112
|
+
### 3.1 code-review sub-agent (Summary Report)
|
|
296
113
|
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
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
|
-
|
|
314
|
-
|
|
129
|
+
Report back: Merge recommendation and issue counts
|
|
130
|
+
```
|
|
315
131
|
|
|
316
|
-
|
|
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
|
-
|
|
322
|
-
|
|
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
|
-
|
|
327
|
-
|
|
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
|
-
|
|
175
|
+
**IMPORTANT:** Launch all THREE synthesis sub-agents in a SINGLE message for parallel execution.
|
|
331
176
|
|
|
332
177
|
---
|
|
333
178
|
|
|
334
|
-
##
|
|
179
|
+
## Phase 4: Present Results
|
|
335
180
|
|
|
336
|
-
|
|
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
|
-
##
|
|
195
|
+
## 📊 Issues Found
|
|
391
196
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
##
|
|
399
|
-
|
|
400
|
-
**Summary**: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
|
|
205
|
+
## 📝 Artifacts Created
|
|
401
206
|
|
|
402
|
-
**
|
|
403
|
-
{
|
|
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
|
|
410
|
-
1.
|
|
411
|
-
2.
|
|
412
|
-
3.
|
|
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
|
|
415
|
-
1. Review ⚠️
|
|
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
|
-
##
|
|
230
|
+
## Orchestration Rules
|
|
426
231
|
|
|
427
|
-
1. **
|
|
428
|
-
2. **
|
|
429
|
-
3. **
|
|
430
|
-
4. **
|
|
431
|
-
5. **
|
|
432
|
-
6. **
|
|
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
|