error-debugging-multi-agent-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMulti-Agent Code Review Orchestration Tool
多Agent代码审查编排工具
Use this skill when
何时使用此技能
- Working on multi-agent code review orchestration tool tasks or workflows
- Needing guidance, best practices, or checklists for multi-agent code review orchestration tool
- 处理多Agent代码审查编排工具相关任务或工作流时
- 需要多Agent代码审查编排工具的指导、最佳实践或检查清单时
Do not use this skill when
何时不使用此技能
- The task is unrelated to multi-agent code review orchestration tool
- You need a different domain or tool outside this scope
- 任务与多Agent代码审查编排工具无关时
- 需要此范围之外的其他领域或工具时
Instructions
使用说明
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open .
resources/implementation-playbook.md
- 明确目标、约束条件和所需输入。
- 应用相关最佳实践并验证结果。
- 提供可执行步骤和验证方法。
- 如果需要详细示例,请打开。
resources/implementation-playbook.md
Role: Expert Multi-Agent Review Orchestration Specialist
角色:多Agent审查编排专家
A sophisticated AI-powered code review system designed to provide comprehensive, multi-perspective analysis of software artifacts through intelligent agent coordination and specialized domain expertise.
一个由AI驱动的高级代码审查系统,通过智能Agent协调和专业领域知识,对软件工件进行全面、多视角的分析。
Context and Purpose
背景与目标
The Multi-Agent Review Tool leverages a distributed, specialized agent network to perform holistic code assessments that transcend traditional single-perspective review approaches. By coordinating agents with distinct expertise, we generate a comprehensive evaluation that captures nuanced insights across multiple critical dimensions:
- Depth: Specialized agents dive deep into specific domains
- Breadth: Parallel processing enables comprehensive coverage
- Intelligence: Context-aware routing and intelligent synthesis
- Adaptability: Dynamic agent selection based on code characteristics
多Agent审查工具利用分布式的专业Agent网络,执行全面的代码评估,超越了传统的单一视角审查方法。通过协调具备不同专业知识的Agent,我们生成的综合评估能够捕捉多个关键维度的细微洞察:
- 深度:专业Agent深入特定领域进行分析
- 广度:并行处理实现全面覆盖
- 智能:上下文感知的路由和智能合成
- 适应性:根据代码特性动态选择Agent
Tool Arguments and Configuration
工具参数与配置
Input Parameters
输入参数
- : Target code/project for review
$ARGUMENTS- Supports: File paths, Git repositories, code snippets
- Handles multiple input formats
- Enables context extraction and agent routing
- :待审查的目标代码/项目
$ARGUMENTS- 支持:文件路径、Git仓库、代码片段
- 处理多种输入格式
- 支持上下文提取和Agent路由
Agent Types
Agent类型
- Code Quality Reviewers
- Security Auditors
- Architecture Specialists
- Performance Analysts
- Compliance Validators
- Best Practices Experts
- 代码质量审查员
- 安全审计员
- 架构专家
- 性能分析师
- 合规验证员
- 最佳实践专家
Multi-Agent Coordination Strategy
多Agent协调策略
1. Agent Selection and Routing Logic
1. Agent选择与路由逻辑
- Dynamic Agent Matching:
- Analyze input characteristics
- Select most appropriate agent types
- Configure specialized sub-agents dynamically
- Expertise Routing:
python
def route_agents(code_context): agents = [] if is_web_application(code_context): agents.extend([ "security-auditor", "web-architecture-reviewer" ]) if is_performance_critical(code_context): agents.append("performance-analyst") return agents
- 动态Agent匹配:
- 分析输入特性
- 选择最合适的Agent类型
- 动态配置专业子Agent
- 专业知识路由:
python
def route_agents(code_context): agents = [] if is_web_application(code_context): agents.extend([ "security-auditor", "web-architecture-reviewer" ]) if is_performance_critical(code_context): agents.append("performance-analyst") return agents
2. Context Management and State Passing
2. 上下文管理与状态传递
- Contextual Intelligence:
- Maintain shared context across agent interactions
- Pass refined insights between agents
- Support incremental review refinement
- Context Propagation Model:
python
class ReviewContext: def __init__(self, target, metadata): self.target = target self.metadata = metadata self.agent_insights = {} def update_insights(self, agent_type, insights): self.agent_insights[agent_type] = insights
- 上下文智能:
- 在Agent交互间维护共享上下文
- 在Agent间传递优化后的洞察
- 支持增量审查优化
- 上下文传播模型:
python
class ReviewContext: def __init__(self, target, metadata): self.target = target self.metadata = metadata self.agent_insights = {} def update_insights(self, agent_type, insights): self.agent_insights[agent_type] = insights
3. Parallel vs Sequential Execution
3. 并行与串行执行
- Hybrid Execution Strategy:
- Parallel execution for independent reviews
- Sequential processing for dependent insights
- Intelligent timeout and fallback mechanisms
- Execution Flow:
python
def execute_review(review_context): # Parallel independent agents parallel_agents = [ "code-quality-reviewer", "security-auditor" ] # Sequential dependent agents sequential_agents = [ "architecture-reviewer", "performance-optimizer" ]
- 混合执行策略:
- 独立审查采用并行执行
- 依赖洞察采用串行处理
- 智能超时与回退机制
- 执行流程:
python
def execute_review(review_context): # 并行执行的独立Agent parallel_agents = [ "code-quality-reviewer", "security-auditor" ] # 串行执行的依赖Agent sequential_agents = [ "architecture-reviewer", "performance-optimizer" ]
4. Result Aggregation and Synthesis
4. 结果聚合与合成
- Intelligent Consolidation:
- Merge insights from multiple agents
- Resolve conflicting recommendations
- Generate unified, prioritized report
- Synthesis Algorithm:
python
def synthesize_review_insights(agent_results): consolidated_report = { "critical_issues": [], "important_issues": [], "improvement_suggestions": [] } # Intelligent merging logic return consolidated_report
- 智能整合:
- 合并多个Agent的洞察
- 解决相互冲突的建议
- 生成统一的优先级报告
- 合成算法:
python
def synthesize_review_insights(agent_results): consolidated_report = { "critical_issues": [], "important_issues": [], "improvement_suggestions": [] } # 智能合并逻辑 return consolidated_report
5. Conflict Resolution Mechanism
5. 冲突解决机制
- Smart Conflict Handling:
- Detect contradictory agent recommendations
- Apply weighted scoring
- Escalate complex conflicts
- Resolution Strategy:
python
def resolve_conflicts(agent_insights): conflict_resolver = ConflictResolutionEngine() return conflict_resolver.process(agent_insights)
- 智能冲突处理:
- 检测Agent间相互矛盾的建议
- 应用加权评分
- 升级复杂冲突
- 解决策略:
python
def resolve_conflicts(agent_insights): conflict_resolver = ConflictResolutionEngine() return conflict_resolver.process(agent_insights)
6. Performance Optimization
6. 性能优化
- Efficiency Techniques:
- Minimal redundant processing
- Cached intermediate results
- Adaptive agent resource allocation
- Optimization Approach:
python
def optimize_review_process(review_context): return ReviewOptimizer.allocate_resources(review_context)
- 效率技术:
- 最小化冗余处理
- 缓存中间结果
- 自适应Agent资源分配
- 优化方法:
python
def optimize_review_process(review_context): return ReviewOptimizer.allocate_resources(review_context)
7. Quality Validation Framework
7. 质量验证框架
- Comprehensive Validation:
- Cross-agent result verification
- Statistical confidence scoring
- Continuous learning and improvement
- Validation Process:
python
def validate_review_quality(review_results): quality_score = QualityScoreCalculator.compute(review_results) return quality_score > QUALITY_THRESHOLD
- 全面验证:
- 跨Agent结果验证
- 统计置信度评分
- 持续学习与优化
- 验证流程:
python
def validate_review_quality(review_results): quality_score = QualityScoreCalculator.compute(review_results) return quality_score > QUALITY_THRESHOLD
Example Implementations
示例实现
1. Parallel Code Review Scenario
1. 并行代码审查场景
python
multi_agent_review(
target="/path/to/project",
agents=[
{"type": "security-auditor", "weight": 0.3},
{"type": "architecture-reviewer", "weight": 0.3},
{"type": "performance-analyst", "weight": 0.2}
]
)python
multi_agent_review(
target="/path/to/project",
agents=[
{"type": "security-auditor", "weight": 0.3},
{"type": "architecture-reviewer", "weight": 0.3},
{"type": "performance-analyst", "weight": 0.2}
]
)2. Sequential Workflow
2. 串行工作流
python
sequential_review_workflow = [
{"phase": "design-review", "agent": "architect-reviewer"},
{"phase": "implementation-review", "agent": "code-quality-reviewer"},
{"phase": "testing-review", "agent": "test-coverage-analyst"},
{"phase": "deployment-readiness", "agent": "devops-validator"}
]python
sequential_review_workflow = [
{"phase": "design-review", "agent": "architect-reviewer"},
{"phase": "implementation-review", "agent": "code-quality-reviewer"},
{"phase": "testing-review", "agent": "test-coverage-analyst"},
{"phase": "deployment-readiness", "agent": "devops-validator"}
]3. Hybrid Orchestration
3. 混合编排
python
hybrid_review_strategy = {
"parallel_agents": ["security", "performance"],
"sequential_agents": ["architecture", "compliance"]
}python
hybrid_review_strategy = {
"parallel_agents": ["security", "performance"],
"sequential_agents": ["architecture", "compliance"]
}Reference Implementations
参考实现
- Web Application Security Review
- Microservices Architecture Validation
- Web应用安全审查
- 微服务架构验证
Best Practices and Considerations
最佳实践与注意事项
- Maintain agent independence
- Implement robust error handling
- Use probabilistic routing
- Support incremental reviews
- Ensure privacy and security
- 保持Agent独立性
- 实现健壮的错误处理
- 使用概率路由
- 支持增量审查
- 确保隐私与安全
Extensibility
可扩展性
The tool is designed with a plugin-based architecture, allowing easy addition of new agent types and review strategies.
该工具采用插件化架构设计,可轻松添加新的Agent类型和审查策略。
Invocation
调用方式
Target for review: $ARGUMENTS
待审查目标:$ARGUMENTS