Implemented workflow templates based on Anthropic research: - parallel-review.md: Parallel execution of security + performance reviews - evaluator-optimizer.md: Iterative improvement loop (code-skeptic → the-fixer) - chain-of-thought.md: Sequential step decomposition with gates Each template includes: - Pattern overview and implementation - Execution flow diagram - Benefits and configuration - Usage examples Related: Issues #21, #22 - Patterns from research Milestone: #47 Cognitive Enhancement
1.8 KiB
1.8 KiB
Parallel Review Workflow
Implements the Parallelization pattern from Anthropic research.
Overview
Run security and performance reviews in parallel to reduce latency by ~50%.
Pattern
async def parallel_review(code_context):
"""
Parallel execution of independent review agents.
From Anthropic: "Parallelization is effective when divided
subtasks can be parallelized for speed."
"""
tasks = [
Task(subagent_type="security-auditor", prompt=code_context),
Task(subagent_type="performance-engineer", prompt=code_context)
]
results = await asyncio.gather(*tasks)
return aggregate_results(results)
Execution Flow
[Code Complete]
↓
┌─────────────────────────────┐
│ Parallel Execution │
│ ┌───────────┐ ┌──────────┐ │
│ │ Security │ │ Perform- │ │
│ │ Auditor │ │ ance │ │
│ └───────────┘ └──────────┘ │
└─────────────────────────────┘
↓
[Aggregate Results]
↓
[Issues Found?] ──Yes──→ [The Fixer]
↓ No
[Proceed to Release]
Benefits
- Latency Reduction: Reviews run simultaneously
- Independent Analysis: No bias between reviewers
- Faster Feedback: Combined results in one pass
Usage
/workflow parallel-review --issue 42
Configuration
# .kilo/config/parallel-review.yaml
parallel_review:
agents:
- security-auditor
- performance-engineer
timeout_minutes: 15
aggregate_strategy: merge_issues
proceed_on_partial_failure: false
Implementation
See .kilo/commands/workflow.md Step 6 for code.