← 返回
未分类 中文

Code Review Expert

Multi-agent code review system using Manager-Worker pattern. Provides comprehensive code analysis from syntax, logic, security, and performance perspectives.
基于 Manager-Worker 模式的多智能体代码审查系统,从语法、逻辑、安全和性能等方面提供全面的代码分析。
banxian87
未分类 clawhub v1.0.0 1 版本 99846.2 Key: 无需
★ 0
Stars
📥 649
下载
💾 2
安装
1
版本
#latest

概述

Code Review Expert

AI-powered code review system that uses multiple specialized agents to analyze your code from different perspectives.


Features

🔍 Multi-Dimensional Analysis

  • Syntax Checker: ESLint standards, code formatting, naming conventions
  • Logic Reviewer: Bug detection, edge cases, error handling
  • Security Scanner: SQL injection, XSS, sensitive data exposure
  • Performance Analyzer: Time complexity, optimization opportunities

📊 Detailed Reports

  • Issue severity ratings (Critical/High/Medium/Low)
  • Line-by-line feedback
  • Concrete fix suggestions
  • Code examples for improvements

🎯 Language Support

  • JavaScript/TypeScript (primary)
  • Python (basic)
  • More languages coming soon

Usage

Basic Review

const reviewer = new CodeReviewExpert();

const code = `
function getUser(userId) {
  const users = db.query('SELECT * FROM users');
  const user = users.find(u => u.id === userId);
  return user.name;
}
`;

const report = await reviewer.review(code);
console.log(report);

Advanced Options

const reviewer = new CodeReviewExpert({
  languages: ['javascript', 'typescript'],
  strictMode: true,  // More rigorous checks
  autoFix: false,    // Auto-generate fixes
  verbose: true
});

const report = await reviewer.review(code, {
  focus: ['security', 'performance'],  // Specific areas
  maxIssues: 10  // Limit issues
});

Example Output

## Code Review Report

### Overview
- File: user-service.js
- Issues Found: 5
- Critical: 1, High: 2, Medium: 1, Low: 1

### 🔴 Critical Issues

1. **SQL Injection Risk** (Line 2)
   ```javascript
   // Problem
   const query = `SELECT * FROM users WHERE id = ${userId}`;
   
   // Fix
   const query = 'SELECT * FROM users WHERE id = ?';
   db.execute(query, [userId]);
   ```

### 🟠 High Priority

2. **Null Pointer Risk** (Line 3)
   - `user` might be undefined
   - Add null check before accessing properties

### Overall Score: 6/10

Architecture

Manager Agent (Coordinator)
    ↓
├─ Syntax Worker (ESLint rules)
├─ Logic Worker (Bug detection)
├─ Security Worker (Vulnerability scan)
└─ Performance Worker (Optimization)
    ↓
Report Aggregator → Final Report

Installation

clawhub install code-review-expert

API Reference

review(code, options)

Review code and return report.

Parameters:

  • code (string): Source code to review
  • options (object): Review options
  • focus: Array of areas to focus on
  • maxIssues: Maximum issues to return
  • includeSuggestions: Include fix suggestions

Returns: Promise

ReviewReport

{
  score: number;           // 0-10
  issues: Issue[];
  summary: string;
  suggestions: string[];
}

License

MIT


Author

AI-Agent


Version

1.0.0


Created

2026-04-02

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 05:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Presentation Maker

banxian87
AI演示生成器,利用思维树组织内容,从大纲快速生成专业幻灯片。
★ 0 📥 401

Task Planner

banxian87
智能任务规划器,采用计划‑解决模式,将目标拆解为可操作步骤并配有时间线和优先级。
★ 0 📥 403

Ai Code Generator

banxian87
AI代码生成器,采用计划‑解决(Plan‑and‑Solve)与ReAct方法,从需求和规格说明生成完整、可运行的代码。
★ 0 📥 412