cc-mirror 1.0.3 → 1.1.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/README.md +168 -98
- package/dist/cc-mirror.mjs +807 -287
- package/dist/skills/multi-agent-orchestrator/SKILL.md +391 -0
- package/dist/skills/multi-agent-orchestrator/references/code-review.md +266 -0
- package/dist/skills/multi-agent-orchestrator/references/data-analysis.md +315 -0
- package/dist/skills/multi-agent-orchestrator/references/devops.md +309 -0
- package/dist/skills/multi-agent-orchestrator/references/documentation.md +310 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/code-review.md +301 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/data-analysis.md +347 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/devops.md +340 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/documentation.md +343 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/project-management.md +370 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/research.md +322 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/software-development.md +269 -0
- package/dist/skills/multi-agent-orchestrator/references/domains/testing.md +313 -0
- package/dist/skills/multi-agent-orchestrator/references/examples.md +377 -0
- package/dist/skills/multi-agent-orchestrator/references/guide.md +327 -0
- package/dist/skills/multi-agent-orchestrator/references/patterns.md +441 -0
- package/dist/skills/multi-agent-orchestrator/references/project-management.md +345 -0
- package/dist/skills/multi-agent-orchestrator/references/research.md +285 -0
- package/dist/skills/multi-agent-orchestrator/references/software-development.md +242 -0
- package/dist/skills/multi-agent-orchestrator/references/testing.md +282 -0
- package/dist/skills/multi-agent-orchestrator/references/tools.md +454 -0
- package/dist/tui.mjs +1063 -405
- package/package.json +2 -2
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Documentation Orchestration Patterns
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [API Documentation](#api-documentation)
|
|
5
|
+
2. [Code Documentation](#code-documentation)
|
|
6
|
+
3. [README Generation](#readme-generation)
|
|
7
|
+
4. [Architecture Documentation](#architecture-documentation)
|
|
8
|
+
5. [User Guides](#user-guides)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## API Documentation
|
|
13
|
+
|
|
14
|
+
### Pattern: Endpoint Discovery and Documentation
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
User Request: "Document all REST API endpoints"
|
|
18
|
+
|
|
19
|
+
Phase 1: EXPLORE
|
|
20
|
+
└─ Explore agent: Find all route definitions
|
|
21
|
+
|
|
22
|
+
Phase 2: FAN-OUT (Parallel documentation by domain)
|
|
23
|
+
├─ Agent A: Document auth endpoints
|
|
24
|
+
├─ Agent B: Document user endpoints
|
|
25
|
+
├─ Agent C: Document product endpoints
|
|
26
|
+
└─ Agent D: Document order endpoints
|
|
27
|
+
|
|
28
|
+
Phase 3: REDUCE
|
|
29
|
+
└─ General-purpose agent: Compile into unified OpenAPI/Swagger spec
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Pattern: Request/Response Documentation
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Phase 1: EXPLORE
|
|
36
|
+
└─ Explore agent: Find endpoint handlers and schemas
|
|
37
|
+
|
|
38
|
+
Phase 2: FAN-OUT (Per endpoint group)
|
|
39
|
+
├─ Agent A: Document request schemas, validation
|
|
40
|
+
├─ Agent B: Document response schemas, status codes
|
|
41
|
+
└─ Agent C: Document error responses
|
|
42
|
+
|
|
43
|
+
Phase 3: PIPELINE
|
|
44
|
+
└─ General-purpose agent: Generate examples, test payloads
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Pattern: Interactive Documentation
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Phase 1: PIPELINE (Foundation)
|
|
51
|
+
├─ Explore agent: Extract all endpoints with types
|
|
52
|
+
└─ General-purpose agent: Generate OpenAPI spec
|
|
53
|
+
|
|
54
|
+
Phase 2: FAN-OUT (Enhancement)
|
|
55
|
+
├─ Agent A: Add example requests
|
|
56
|
+
├─ Agent B: Add example responses
|
|
57
|
+
└─ Agent C: Add authentication examples
|
|
58
|
+
|
|
59
|
+
Phase 3: PIPELINE
|
|
60
|
+
└─ General-purpose agent: Setup Swagger UI / Redoc
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Code Documentation
|
|
66
|
+
|
|
67
|
+
### Pattern: Batch JSDoc/Docstring Generation
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
User Request: "Add documentation to the utils module"
|
|
71
|
+
|
|
72
|
+
Phase 1: EXPLORE
|
|
73
|
+
└─ Explore agent: Find all undocumented functions
|
|
74
|
+
|
|
75
|
+
Phase 2: MAP (Parallel documentation)
|
|
76
|
+
├─ Agent A: Document file1.ts functions
|
|
77
|
+
├─ Agent B: Document file2.ts functions
|
|
78
|
+
└─ Agent C: Document file3.ts functions
|
|
79
|
+
|
|
80
|
+
Phase 3: PIPELINE
|
|
81
|
+
└─ General-purpose agent: Verify consistency, generate type docs
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Pattern: Complexity-Driven Documentation
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Phase 1: EXPLORE
|
|
88
|
+
└─ Explore agent: Find complex functions (high cyclomatic complexity)
|
|
89
|
+
|
|
90
|
+
Phase 2: FAN-OUT (Prioritized)
|
|
91
|
+
├─ Agent A: Document most complex function
|
|
92
|
+
├─ Agent B: Document second most complex
|
|
93
|
+
└─ Agent C: Document third most complex
|
|
94
|
+
|
|
95
|
+
Each agent:
|
|
96
|
+
- Explain algorithm/logic
|
|
97
|
+
- Document edge cases
|
|
98
|
+
- Add usage examples
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Pattern: Module Overview Generation
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
Phase 1: EXPLORE
|
|
105
|
+
└─ Explore agent: Map module structure, exports, dependencies
|
|
106
|
+
|
|
107
|
+
Phase 2: PIPELINE
|
|
108
|
+
├─ General-purpose agent: Write module overview
|
|
109
|
+
├─ General-purpose agent: Document public API
|
|
110
|
+
└─ General-purpose agent: Add usage examples
|
|
111
|
+
|
|
112
|
+
Phase 3: FAN-OUT (Internal docs)
|
|
113
|
+
├─ Agent A: Document internal utilities
|
|
114
|
+
└─ Agent B: Document configuration options
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## README Generation
|
|
120
|
+
|
|
121
|
+
### Pattern: Comprehensive README
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
User Request: "Create a README for this project"
|
|
125
|
+
|
|
126
|
+
Phase 1: FAN-OUT (Parallel information gathering)
|
|
127
|
+
├─ Explore agent: Project structure and technologies
|
|
128
|
+
├─ Explore agent: Build and run scripts (package.json, Makefile)
|
|
129
|
+
├─ Explore agent: Environment variables and config
|
|
130
|
+
├─ Explore agent: Test setup and commands
|
|
131
|
+
└─ Explore agent: Existing docs and comments
|
|
132
|
+
|
|
133
|
+
Phase 2: REDUCE
|
|
134
|
+
└─ General-purpose agent: Synthesize into structured README
|
|
135
|
+
|
|
136
|
+
Sections:
|
|
137
|
+
- Overview and purpose
|
|
138
|
+
- Quick start
|
|
139
|
+
- Installation
|
|
140
|
+
- Configuration
|
|
141
|
+
- Usage examples
|
|
142
|
+
- Development setup
|
|
143
|
+
- Testing
|
|
144
|
+
- Contributing
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Pattern: README Update
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Phase 1: FAN-OUT
|
|
151
|
+
├─ Explore agent: Current README content
|
|
152
|
+
├─ Explore agent: Recent changes to codebase
|
|
153
|
+
└─ Explore agent: New dependencies or features
|
|
154
|
+
|
|
155
|
+
Phase 2: PIPELINE
|
|
156
|
+
└─ General-purpose agent: Update README sections, maintain style
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Architecture Documentation
|
|
162
|
+
|
|
163
|
+
### Pattern: C4 Model Documentation
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
User Request: "Document the system architecture"
|
|
167
|
+
|
|
168
|
+
Phase 1: FAN-OUT (Parallel level documentation)
|
|
169
|
+
├─ Agent A: Context diagram (system + external actors)
|
|
170
|
+
├─ Agent B: Container diagram (applications, data stores)
|
|
171
|
+
├─ Agent C: Component diagram (internal components)
|
|
172
|
+
└─ Agent D: Code diagram (critical classes/modules)
|
|
173
|
+
|
|
174
|
+
Phase 2: REDUCE
|
|
175
|
+
└─ General-purpose agent: Compile into architecture doc with diagrams
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Pattern: Decision Record Generation
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Phase 1: EXPLORE
|
|
182
|
+
└─ Explore agent: Find architectural patterns in code
|
|
183
|
+
|
|
184
|
+
Phase 2: FAN-OUT
|
|
185
|
+
├─ Agent A: Document decision 1 (why this database?)
|
|
186
|
+
├─ Agent B: Document decision 2 (why this framework?)
|
|
187
|
+
└─ Agent C: Document decision 3 (why this structure?)
|
|
188
|
+
|
|
189
|
+
Each ADR includes:
|
|
190
|
+
- Context
|
|
191
|
+
- Decision
|
|
192
|
+
- Consequences
|
|
193
|
+
- Alternatives considered
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Pattern: Data Flow Documentation
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
Phase 1: EXPLORE
|
|
200
|
+
└─ Explore agent: Trace data through system
|
|
201
|
+
|
|
202
|
+
Phase 2: PIPELINE
|
|
203
|
+
├─ General-purpose agent: Document ingress points
|
|
204
|
+
├─ General-purpose agent: Document transformations
|
|
205
|
+
├─ General-purpose agent: Document storage
|
|
206
|
+
└─ General-purpose agent: Document egress points
|
|
207
|
+
|
|
208
|
+
Phase 3: REDUCE
|
|
209
|
+
└─ General-purpose agent: Create data flow diagram
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## User Guides
|
|
215
|
+
|
|
216
|
+
### Pattern: Feature-Based Guides
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
User Request: "Write user documentation for the dashboard"
|
|
220
|
+
|
|
221
|
+
Phase 1: EXPLORE
|
|
222
|
+
└─ Explore agent: Map dashboard features and capabilities
|
|
223
|
+
|
|
224
|
+
Phase 2: FAN-OUT (Parallel feature guides)
|
|
225
|
+
├─ Agent A: Guide for feature 1 (with screenshots)
|
|
226
|
+
├─ Agent B: Guide for feature 2
|
|
227
|
+
├─ Agent C: Guide for feature 3
|
|
228
|
+
└─ Agent D: Troubleshooting guide
|
|
229
|
+
|
|
230
|
+
Phase 3: REDUCE
|
|
231
|
+
└─ General-purpose agent: Compile into user manual with TOC
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Pattern: Tutorial Generation
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Phase 1: EXPLORE
|
|
238
|
+
└─ Explore agent: Identify key user workflows
|
|
239
|
+
|
|
240
|
+
Phase 2: PIPELINE (Sequential tutorials)
|
|
241
|
+
├─ General-purpose agent: Getting started tutorial
|
|
242
|
+
├─ General-purpose agent: Basic usage tutorial
|
|
243
|
+
├─ General-purpose agent: Advanced usage tutorial
|
|
244
|
+
└─ General-purpose agent: Best practices guide
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Pattern: FAQ Generation
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
Phase 1: FAN-OUT
|
|
251
|
+
├─ Explore agent: Common patterns in issues/tickets
|
|
252
|
+
├─ Explore agent: Error messages and their causes
|
|
253
|
+
└─ Explore agent: Configuration gotchas
|
|
254
|
+
|
|
255
|
+
Phase 2: REDUCE
|
|
256
|
+
└─ General-purpose agent: Compile FAQ with clear answers
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Documentation Quality Patterns
|
|
262
|
+
|
|
263
|
+
### Pattern: Consistency Audit
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
Phase 1: FAN-OUT
|
|
267
|
+
├─ Agent A: Check terminology consistency
|
|
268
|
+
├─ Agent B: Check formatting consistency
|
|
269
|
+
├─ Agent C: Check example code validity
|
|
270
|
+
└─ Agent D: Check link validity
|
|
271
|
+
|
|
272
|
+
Phase 2: REDUCE
|
|
273
|
+
└─ General-purpose agent: Inconsistency report with fixes
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Pattern: Freshness Check
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Phase 1: FAN-OUT
|
|
280
|
+
├─ Explore agent: Find outdated code examples
|
|
281
|
+
├─ Explore agent: Find references to removed features
|
|
282
|
+
└─ Explore agent: Find mismatched version numbers
|
|
283
|
+
|
|
284
|
+
Phase 2: PIPELINE
|
|
285
|
+
└─ General-purpose agent: Update stale documentation
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## TodoWrite for Documentation
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
TodoWrite([
|
|
294
|
+
{content: "Audit existing documentation", status: "in_progress", activeForm: "Auditing documentation"},
|
|
295
|
+
{content: "Identify documentation gaps", status: "pending", activeForm: "Finding gaps"},
|
|
296
|
+
{content: "Generate missing documentation", status: "pending", activeForm: "Generating docs"},
|
|
297
|
+
{content: "Review for consistency", status: "pending", activeForm: "Reviewing consistency"},
|
|
298
|
+
{content: "Verify examples work", status: "pending", activeForm: "Verifying examples"}
|
|
299
|
+
])
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Output Formats
|
|
303
|
+
|
|
304
|
+
| Doc Type | Format | Tool |
|
|
305
|
+
|----------|--------|------|
|
|
306
|
+
| API docs | OpenAPI/Swagger | YAML/JSON |
|
|
307
|
+
| Code docs | JSDoc/docstrings | Inline |
|
|
308
|
+
| READMEs | Markdown | .md files |
|
|
309
|
+
| Architecture | Markdown + diagrams | Mermaid/PlantUML |
|
|
310
|
+
| User guides | Markdown/HTML | Static site generators |
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# Code Review Orchestration Patterns
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
5
|
+
│ │
|
|
6
|
+
│ Reviews should be thorough, fast, and actionable. │
|
|
7
|
+
│ Parallel analysis. Unified feedback. Clear priorities. │
|
|
8
|
+
│ │
|
|
9
|
+
└─────────────────────────────────────────────────────────────┘
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> **Load when**: PR review, security audit, performance review, architecture review, pre-merge validation
|
|
13
|
+
> **Common patterns**: Multi-Dimensional Analysis, OWASP-Parallel, Layer-by-Layer
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
1. [Pull Request Review](#pull-request-review)
|
|
18
|
+
2. [Security Audit](#security-audit)
|
|
19
|
+
3. [Performance Review](#performance-review)
|
|
20
|
+
4. [Architecture Review](#architecture-review)
|
|
21
|
+
5. [Pre-merge Validation](#pre-merge-validation)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Pull Request Review
|
|
26
|
+
|
|
27
|
+
### Pattern: Multi-Dimensional Analysis
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
User Request: "Review PR #123"
|
|
31
|
+
|
|
32
|
+
Phase 1: FAN-OUT (Parallel analysis dimensions)
|
|
33
|
+
├─ Explore agent: Understand PR context, related issues
|
|
34
|
+
├─ Agent A: Code quality analysis (style, patterns, DRY)
|
|
35
|
+
├─ Agent B: Logic correctness (edge cases, error handling)
|
|
36
|
+
├─ Agent C: Security implications
|
|
37
|
+
└─ Agent D: Performance implications
|
|
38
|
+
|
|
39
|
+
Phase 2: REDUCE (Synthesize)
|
|
40
|
+
└─ General-purpose agent: Aggregate findings, prioritize, format review
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Implementation:**
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
# All in single message for parallelism
|
|
47
|
+
Task(subagent_type="Explore", prompt="Fetch PR #123 details, understand context and related issues")
|
|
48
|
+
Task(subagent_type="general-purpose", prompt="Review code quality: patterns, readability, maintainability")
|
|
49
|
+
Task(subagent_type="general-purpose", prompt="Review logic: correctness, edge cases, error handling")
|
|
50
|
+
Task(subagent_type="general-purpose", prompt="Review security: injection, auth, data exposure")
|
|
51
|
+
Task(subagent_type="general-purpose", prompt="Review performance: complexity, queries, memory")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Pattern: Contextual Deep-Dive
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Phase 1: PIPELINE (Understand)
|
|
58
|
+
├─ Explore agent: Get PR diff, commit messages
|
|
59
|
+
└─ Explore agent: Find related code, understand impact
|
|
60
|
+
|
|
61
|
+
Phase 2: FAN-OUT (File-by-file)
|
|
62
|
+
├─ Agent per changed file (for large PRs)
|
|
63
|
+
|
|
64
|
+
Phase 3: PIPELINE (Consolidate)
|
|
65
|
+
└─ General-purpose agent: Create cohesive review
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Security Audit
|
|
71
|
+
|
|
72
|
+
### Pattern: OWASP-Parallel
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
User Request: "Security audit the authentication module"
|
|
76
|
+
|
|
77
|
+
Phase 1: FAN-OUT (OWASP categories in parallel)
|
|
78
|
+
├─ Agent A: Injection vulnerabilities (SQL, command, XSS)
|
|
79
|
+
├─ Agent B: Authentication/session issues
|
|
80
|
+
├─ Agent C: Access control problems
|
|
81
|
+
├─ Agent D: Cryptographic weaknesses
|
|
82
|
+
├─ Agent E: Data exposure risks
|
|
83
|
+
└─ Agent F: Security misconfiguration
|
|
84
|
+
|
|
85
|
+
Phase 2: REDUCE
|
|
86
|
+
└─ General-purpose agent: Risk-ranked findings with remediation
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Pattern: Attack Surface Mapping
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Phase 1: EXPLORE
|
|
93
|
+
└─ Explore agent: Map all entry points (APIs, forms, file uploads)
|
|
94
|
+
|
|
95
|
+
Phase 2: FAN-OUT (Per entry point)
|
|
96
|
+
├─ Agent per entry point: Analyze input validation, sanitization
|
|
97
|
+
|
|
98
|
+
Phase 3: PIPELINE
|
|
99
|
+
└─ General-purpose agent: Threat model, prioritized vulnerabilities
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Pattern: Dependency Audit
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Phase 1: FAN-OUT
|
|
106
|
+
├─ Agent A: Scan npm/pip dependencies for CVEs
|
|
107
|
+
├─ Agent B: Check for outdated packages
|
|
108
|
+
└─ Agent C: Analyze transitive dependencies
|
|
109
|
+
|
|
110
|
+
Phase 2: REDUCE
|
|
111
|
+
└─ General-purpose agent: Prioritized upgrade plan
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Performance Review
|
|
117
|
+
|
|
118
|
+
### Pattern: Layer-by-Layer
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
User Request: "Find performance bottlenecks"
|
|
122
|
+
|
|
123
|
+
Phase 1: FAN-OUT (Analyze each layer)
|
|
124
|
+
├─ Agent A: Database queries (N+1, missing indexes, slow queries)
|
|
125
|
+
├─ Agent B: API layer (response times, payload sizes)
|
|
126
|
+
├─ Agent C: Frontend (bundle size, render performance)
|
|
127
|
+
└─ Agent D: Infrastructure (caching, connection pooling)
|
|
128
|
+
|
|
129
|
+
Phase 2: REDUCE
|
|
130
|
+
└─ General-purpose agent: Prioritized optimization roadmap
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Pattern: Hot Path Analysis
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Phase 1: EXPLORE
|
|
137
|
+
└─ Explore agent: Identify critical user flows
|
|
138
|
+
|
|
139
|
+
Phase 2: PIPELINE (Per flow)
|
|
140
|
+
└─ General-purpose agent: Trace request lifecycle, find bottlenecks
|
|
141
|
+
|
|
142
|
+
Phase 3: FAN-OUT (Optimization)
|
|
143
|
+
├─ Agent per bottleneck: Implement optimization
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Pattern: Complexity Audit
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Phase 1: MAP
|
|
150
|
+
└─ Explore agent: Find all functions, measure complexity
|
|
151
|
+
|
|
152
|
+
Phase 2: FAN-OUT (High complexity functions)
|
|
153
|
+
├─ Agent A: Analyze function X, suggest optimizations
|
|
154
|
+
├─ Agent B: Analyze function Y, suggest optimizations
|
|
155
|
+
└─ Agent C: Analyze function Z, suggest optimizations
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Architecture Review
|
|
161
|
+
|
|
162
|
+
### Pattern: Multi-Stakeholder
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
User Request: "Review system architecture"
|
|
166
|
+
|
|
167
|
+
Phase 1: FAN-OUT (Perspectives)
|
|
168
|
+
├─ Agent A: Scalability assessment
|
|
169
|
+
├─ Agent B: Maintainability assessment
|
|
170
|
+
├─ Agent C: Security architecture
|
|
171
|
+
├─ Agent D: Cost efficiency
|
|
172
|
+
└─ Agent E: Developer experience
|
|
173
|
+
|
|
174
|
+
Phase 2: REDUCE
|
|
175
|
+
└─ Plan agent: Synthesize into architecture decision record
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Pattern: Dependency Analysis
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Phase 1: EXPLORE
|
|
182
|
+
└─ Explore agent: Map all module dependencies
|
|
183
|
+
|
|
184
|
+
Phase 2: FAN-OUT
|
|
185
|
+
├─ Agent A: Identify circular dependencies
|
|
186
|
+
├─ Agent B: Find coupling hotspots
|
|
187
|
+
└─ Agent C: Assess abstraction boundaries
|
|
188
|
+
|
|
189
|
+
Phase 3: PIPELINE
|
|
190
|
+
└─ Plan agent: Recommend architectural improvements
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Pattern: Standards Compliance
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Phase 1: FAN-OUT
|
|
197
|
+
├─ Agent A: Check against SOLID principles
|
|
198
|
+
├─ Agent B: Check against team style guide
|
|
199
|
+
├─ Agent C: Check against industry patterns
|
|
200
|
+
└─ Agent D: Check against regulatory requirements
|
|
201
|
+
|
|
202
|
+
Phase 2: REDUCE
|
|
203
|
+
└─ General-purpose agent: Compliance report with gaps
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Pre-merge Validation
|
|
209
|
+
|
|
210
|
+
### Pattern: Comprehensive Gate
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
User Request: "Validate PR ready for merge"
|
|
214
|
+
|
|
215
|
+
Phase 1: FAN-OUT (All checks in parallel)
|
|
216
|
+
├─ Background agent: Run full test suite
|
|
217
|
+
├─ Agent A: Verify all review comments addressed
|
|
218
|
+
├─ Agent B: Check for merge conflicts
|
|
219
|
+
├─ Agent C: Validate documentation updated
|
|
220
|
+
└─ Agent D: Confirm CI checks passing
|
|
221
|
+
|
|
222
|
+
Phase 2: REDUCE
|
|
223
|
+
└─ General-purpose agent: Go/no-go recommendation with blockers
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Pattern: Regression Check
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
Phase 1: EXPLORE
|
|
230
|
+
└─ Explore agent: Identify areas affected by changes
|
|
231
|
+
|
|
232
|
+
Phase 2: FAN-OUT
|
|
233
|
+
├─ Agent A: Test affected area 1
|
|
234
|
+
├─ Agent B: Test affected area 2
|
|
235
|
+
└─ Agent C: Integration test critical paths
|
|
236
|
+
|
|
237
|
+
Phase 3: PIPELINE
|
|
238
|
+
└─ General-purpose agent: Regression report
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Review Output Formats
|
|
244
|
+
|
|
245
|
+
### Structured Review Template
|
|
246
|
+
|
|
247
|
+
```markdown
|
|
248
|
+
## Summary
|
|
249
|
+
|
|
250
|
+
[1-2 sentence overview]
|
|
251
|
+
|
|
252
|
+
## Risk Assessment
|
|
253
|
+
|
|
254
|
+
- **Security**: Low/Medium/High
|
|
255
|
+
- **Performance**: Low/Medium/High
|
|
256
|
+
- **Breaking Changes**: Yes/No
|
|
257
|
+
|
|
258
|
+
## Must Fix (Blocking)
|
|
259
|
+
|
|
260
|
+
1. [Critical issue with line reference]
|
|
261
|
+
|
|
262
|
+
## Should Fix (Non-blocking)
|
|
263
|
+
|
|
264
|
+
1. [Important improvement]
|
|
265
|
+
|
|
266
|
+
## Consider (Optional)
|
|
267
|
+
|
|
268
|
+
1. [Nice-to-have suggestion]
|
|
269
|
+
|
|
270
|
+
## Positive Notes
|
|
271
|
+
|
|
272
|
+
- [What was done well]
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Task Management for Reviews
|
|
276
|
+
|
|
277
|
+
For comprehensive reviews, create parallel analysis tasks:
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
# Create review tasks (can run in parallel)
|
|
281
|
+
TaskCreate(subject="Analyze PR context", description="Understand changes, related issues...")
|
|
282
|
+
TaskCreate(subject="Review code quality", description="Patterns, readability, maintainability...")
|
|
283
|
+
TaskCreate(subject="Check security", description="Injection, auth, data exposure...")
|
|
284
|
+
TaskCreate(subject="Assess performance", description="Complexity, queries, memory...")
|
|
285
|
+
TaskCreate(subject="Synthesize review", description="Aggregate findings into review...")
|
|
286
|
+
|
|
287
|
+
# Synthesis blocked by analysis tasks
|
|
288
|
+
TaskUpdate(taskId="5", addBlockedBy=["1", "2", "3", "4"])
|
|
289
|
+
|
|
290
|
+
# Spawn parallel agents for analysis
|
|
291
|
+
Task(subagent_type="general-purpose", prompt="TaskId 1: Analyze PR context...")
|
|
292
|
+
Task(subagent_type="general-purpose", prompt="TaskId 2: Review code quality...")
|
|
293
|
+
Task(subagent_type="general-purpose", prompt="TaskId 3: Check security...")
|
|
294
|
+
Task(subagent_type="general-purpose", prompt="TaskId 4: Assess performance...")
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
─── ◈ Code Review ───────────────────────
|
|
301
|
+
```
|