devflow-kit 0.6.1 → 0.8.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.
- package/CHANGELOG.md +64 -0
- package/README.md +83 -16
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -4
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
- package/src/claude/agents/devflow/audit-performance.md +1 -1
- package/src/claude/agents/devflow/audit-security.md +1 -1
- package/src/claude/agents/devflow/brainstorm.md +279 -0
- package/src/claude/agents/devflow/catch-up.md +3 -6
- package/src/claude/agents/devflow/code-review.md +307 -0
- package/src/claude/agents/devflow/commit.md +3 -5
- package/src/claude/agents/devflow/debug.md +2 -1
- package/src/claude/agents/devflow/design.md +491 -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/brainstorm.md +68 -0
- package/src/claude/commands/devflow/breakdown.md +125 -0
- package/src/claude/commands/devflow/code-review.md +152 -346
- package/src/claude/commands/devflow/commit.md +8 -19
- package/src/claude/commands/devflow/design.md +82 -0
- package/src/claude/commands/devflow/devlog.md +2 -3
- package/src/claude/commands/devflow/implement.md +50 -457
- package/src/claude/commands/devflow/plan.md +133 -395
- package/src/claude/skills/devflow/research/SKILL.md +36 -33
- package/src/claude/agents/devflow/research.md +0 -609
- package/src/claude/commands/devflow/plan-next-steps.md +0 -212
- package/src/claude/commands/devflow/research.md +0 -51
|
@@ -1,338 +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
|
-
AUDIT_BASE_DIR=".docs/audits/${
|
|
21
|
+
AUDIT_BASE_DIR=".docs/audits/${BRANCH_SLUG}"
|
|
64
22
|
mkdir -p "$AUDIT_BASE_DIR"
|
|
65
23
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Step 3: Launch Audit Sub-Agents in Parallel
|
|
73
|
-
|
|
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:
|
|
79
|
-
|
|
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"
|
|
83
|
-
|
|
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"
|
|
86
|
-
|
|
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"
|
|
89
|
-
|
|
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"
|
|
92
|
-
|
|
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"
|
|
95
|
-
|
|
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"
|
|
98
|
-
|
|
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"
|
|
101
|
-
|
|
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"
|
|
104
|
-
|
|
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
|
|
24
|
+
# Detect project type for conditional audits
|
|
25
|
+
HAS_TYPESCRIPT=false
|
|
26
|
+
[ -f "tsconfig.json" ] && HAS_TYPESCRIPT=true
|
|
114
27
|
|
|
115
|
-
|
|
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
|
|
116
30
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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"
|
|
120
36
|
```
|
|
121
37
|
|
|
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`:
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
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
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## 🚦 Merge Recommendation
|
|
164
|
-
|
|
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
|
|
170
|
-
|
|
171
|
-
**Confidence**: {High/Medium/Low}
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
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}
|
|
186
|
-
|
|
187
|
-
### Architecture (HIGH: X)
|
|
188
|
-
{List high issues from architecture audit's 🔴 section}
|
|
189
|
-
- **[Issue]** - `file:line` - {description}
|
|
190
|
-
|
|
191
|
-
### Tests (HIGH: X)
|
|
192
|
-
{List high issues from tests audit's 🔴 section}
|
|
193
|
-
- **[Issue]** - `file:line` - {description}
|
|
194
|
-
|
|
195
|
-
### Complexity (HIGH: X)
|
|
196
|
-
{List high issues from complexity audit's 🔴 section}
|
|
197
|
-
- **[Issue]** - `file:line` - {description}
|
|
198
|
-
|
|
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}
|
|
214
|
-
|
|
215
38
|
---
|
|
216
39
|
|
|
217
|
-
##
|
|
40
|
+
## Phase 2: Run Audit Sub-Agents (Parallel)
|
|
218
41
|
|
|
219
|
-
|
|
42
|
+
Launch ALL applicable audit sub-agents in a **single message** using multiple Task tool calls for parallel execution.
|
|
220
43
|
|
|
221
|
-
|
|
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
|
|
44
|
+
**IMPORTANT:** You MUST launch these as parallel Task calls in ONE message.
|
|
227
45
|
|
|
228
|
-
|
|
46
|
+
**Always Launch (7 core audits):**
|
|
229
47
|
|
|
230
|
-
|
|
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
|
+
```
|
|
231
53
|
|
|
232
|
-
|
|
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
|
+
```
|
|
233
59
|
|
|
234
|
-
|
|
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
|
+
```
|
|
235
65
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- Complexity: {count} pre-existing issues
|
|
242
|
-
- Dependencies: {count} pre-existing issues
|
|
243
|
-
- 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
|
+
```
|
|
244
71
|
|
|
245
|
-
|
|
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
|
+
```
|
|
246
77
|
|
|
247
|
-
|
|
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
|
+
```
|
|
248
83
|
|
|
249
|
-
|
|
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
|
+
```
|
|
250
89
|
|
|
251
|
-
**
|
|
252
|
-
- CRITICAL: {total_critical}
|
|
253
|
-
- HIGH: {total_high}
|
|
254
|
-
- MEDIUM: {total_medium}
|
|
90
|
+
**Conditional Audits:**
|
|
255
91
|
|
|
256
|
-
**
|
|
257
|
-
|
|
258
|
-
|
|
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
|
+
```
|
|
259
97
|
|
|
260
|
-
**
|
|
261
|
-
|
|
262
|
-
|
|
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
|
+
```
|
|
263
103
|
|
|
264
104
|
---
|
|
265
105
|
|
|
266
|
-
##
|
|
267
|
-
|
|
268
|
-
**Before Merge (Priority Order):**
|
|
269
|
-
|
|
270
|
-
1. {Highest priority blocking issue from any audit}
|
|
271
|
-
- File: {file:line}
|
|
272
|
-
- Fix: {recommended fix}
|
|
273
|
-
|
|
274
|
-
2. {Second highest priority blocking issue}
|
|
275
|
-
- File: {file:line}
|
|
276
|
-
- Fix: {recommended fix}
|
|
277
|
-
|
|
278
|
-
3. {Third highest priority blocking issue}
|
|
279
|
-
- File: {file:line}
|
|
280
|
-
- Fix: {recommended fix}
|
|
281
|
-
|
|
282
|
-
{Continue for all blocking issues}
|
|
283
|
-
|
|
284
|
-
**While You're Here (Optional):**
|
|
285
|
-
- Review ⚠️ sections in individual audit reports
|
|
286
|
-
- Fix issues in code you modified
|
|
106
|
+
## Phase 3: Synthesis (After Audits Complete)
|
|
287
107
|
|
|
288
|
-
**
|
|
289
|
-
- Create issues for pre-existing problems
|
|
290
|
-
- Track in technical debt backlog
|
|
108
|
+
**WAIT for all Phase 2 audits to complete before proceeding.**
|
|
291
109
|
|
|
292
|
-
|
|
110
|
+
After all audit sub-agents have finished, launch THREE synthesis sub-agents in **parallel**:
|
|
293
111
|
|
|
294
|
-
|
|
112
|
+
### 3.1 code-review sub-agent (Summary Report)
|
|
295
113
|
|
|
296
|
-
|
|
297
|
-
|
|
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)
|
|
114
|
+
```
|
|
115
|
+
Generate code review summary for branch ${CURRENT_BRANCH}.
|
|
307
116
|
|
|
308
|
-
|
|
117
|
+
Context:
|
|
118
|
+
- Branch: ${CURRENT_BRANCH}
|
|
119
|
+
- Base: ${BASE_BRANCH}
|
|
120
|
+
- Audit Directory: ${AUDIT_BASE_DIR}
|
|
121
|
+
- Timestamp: ${TIMESTAMP}
|
|
309
122
|
|
|
310
|
-
|
|
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
|
|
311
128
|
|
|
312
|
-
|
|
313
|
-
|
|
129
|
+
Report back: Merge recommendation and issue counts
|
|
130
|
+
```
|
|
314
131
|
|
|
315
|
-
|
|
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
|
|
132
|
+
### 3.2 pr-comments sub-agent (PR Comments)
|
|
319
133
|
|
|
320
|
-
|
|
321
|
-
|
|
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
|
+
```
|
|
322
153
|
|
|
323
|
-
|
|
154
|
+
### 3.3 tech-debt sub-agent (Tech Debt Management)
|
|
324
155
|
|
|
325
|
-
|
|
326
|
-
|
|
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
|
|
327
173
|
```
|
|
328
174
|
|
|
329
|
-
|
|
175
|
+
**IMPORTANT:** Launch all THREE synthesis sub-agents in a SINGLE message for parallel execution.
|
|
330
176
|
|
|
331
177
|
---
|
|
332
178
|
|
|
333
|
-
##
|
|
179
|
+
## Phase 4: Present Results
|
|
334
180
|
|
|
335
|
-
|
|
181
|
+
After ALL synthesis sub-agents complete, consolidate their reports and display final summary:
|
|
336
182
|
|
|
337
183
|
```markdown
|
|
338
184
|
🔍 CODE REVIEW COMPLETE
|
|
@@ -342,90 +188,50 @@ Show clear, actionable summary:
|
|
|
342
188
|
|
|
343
189
|
---
|
|
344
190
|
|
|
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
|
-
---
|
|
354
|
-
|
|
355
|
-
## 🔴 Issues You Introduced ({total_count})
|
|
356
|
-
|
|
357
|
-
{Show top 3-5 most critical blocking issues}
|
|
358
|
-
|
|
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}
|
|
373
|
-
|
|
374
|
-
---
|
|
375
|
-
|
|
376
|
-
## ⚠️ Issues in Code You Touched ({total_count})
|
|
377
|
-
|
|
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
|
|
384
|
-
|
|
385
|
-
See individual reports for details.
|
|
191
|
+
## 🚦 Merge Status: {RECOMMENDATION from code-review agent}
|
|
386
192
|
|
|
387
193
|
---
|
|
388
194
|
|
|
389
|
-
##
|
|
195
|
+
## 📊 Issues Found
|
|
390
196
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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 |
|
|
394
202
|
|
|
395
203
|
---
|
|
396
204
|
|
|
397
|
-
##
|
|
398
|
-
|
|
399
|
-
**Summary**: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
|
|
205
|
+
## 📝 Artifacts Created
|
|
400
206
|
|
|
401
|
-
**
|
|
402
|
-
{
|
|
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
|
|
403
212
|
|
|
404
213
|
---
|
|
405
214
|
|
|
406
215
|
## 🎯 Next Steps
|
|
407
216
|
|
|
408
|
-
{If
|
|
409
|
-
1.
|
|
410
|
-
2.
|
|
411
|
-
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
|
|
412
221
|
|
|
413
|
-
{If
|
|
414
|
-
1. Review ⚠️
|
|
222
|
+
{If APPROVED:}
|
|
223
|
+
1. Review ⚠️ suggestions (optional)
|
|
415
224
|
2. Create commits: `/commit`
|
|
416
225
|
3. Create PR: `/pull-request`
|
|
417
|
-
|
|
418
|
-
{Always show:}
|
|
419
|
-
💡 Full details in: ${AUDIT_BASE_DIR}/review-summary.${TIMESTAMP}.md
|
|
420
226
|
```
|
|
421
227
|
|
|
422
228
|
---
|
|
423
229
|
|
|
424
|
-
##
|
|
230
|
+
## Orchestration Rules
|
|
425
231
|
|
|
426
|
-
1. **
|
|
427
|
-
2. **
|
|
428
|
-
3. **
|
|
429
|
-
4. **
|
|
430
|
-
5. **
|
|
431
|
-
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
|
|
@@ -5,24 +5,13 @@ description: Create intelligent atomic commits with safety checks and clean git
|
|
|
5
5
|
|
|
6
6
|
## Your task
|
|
7
7
|
|
|
8
|
-
Launch the `commit` sub-agent to analyze changes, detect safety issues, group into atomic commits, and
|
|
8
|
+
Launch the `commit` sub-agent to analyze changes, detect safety issues, group into atomic commits, and **execute them immediately**.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
The agent will:
|
|
11
|
+
1. Analyze uncommitted changes
|
|
12
|
+
2. Run safety checks (abort if secrets/dangerous files found)
|
|
13
|
+
3. Group into logical atomic commits
|
|
14
|
+
4. **Execute commits without asking for confirmation**
|
|
15
|
+
5. Report what was committed
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
```markdown
|
|
15
|
-
📦 COMMIT ASSISTANT COMPLETE
|
|
16
|
-
|
|
17
|
-
{Brief summary of proposed commits from sub-agent}
|
|
18
|
-
|
|
19
|
-
🚨 SAFETY ISSUES:
|
|
20
|
-
{Any dangerous files or secrets detected}
|
|
21
|
-
|
|
22
|
-
📋 PROPOSED COMMITS:
|
|
23
|
-
{Summary of atomic commit groups}
|
|
24
|
-
|
|
25
|
-
📄 Full commit plan available from sub-agent output above
|
|
26
|
-
|
|
27
|
-
💡 Next: {Review and confirm commits / Address safety issues first}
|
|
28
|
-
```
|
|
17
|
+
Trust the agent's judgment. It will only abort for genuine safety issues (secrets, credentials).
|