| Crates.io | miyabi-agent-review |
| lib.rs | miyabi-agent-review |
| version | 0.1.2 |
| created_at | 2025-11-22 08:06:51.548037+00 |
| updated_at | 2025-11-22 08:06:51.548037+00 |
| description | Miyabi Review Agent - Code review, quality scoring, and security scanning |
| homepage | |
| repository | https://github.com/ShunsukeHayashi/Miyabi |
| max_upload_size | |
| id | 1945046 |
| size | 141,215 |
Code review, quality scoring (100-point scale), and security scanning agent for the Miyabi framework.
miyabi-agent-review (ιη§°: γγ γΎγ) is an automated code review agent that performs comprehensive quality analysis on Rust codebases. It integrates cargo clippy, cargo check, cargo-audit, and test coverage tools to generate detailed quality reports with actionable recommendations.
Key Capabilities:
cargo clippy and scores based on warningscargo check and detects compilation errorscargo-audit to detect known vulnerabilitiescargo-tarpaulin)Add to your Cargo.toml:
[dependencies]
miyabi-agent-review = "0.1.0"
Or install the CLI:
cargo install miyabi-cli
use miyabi_agent_review::ReviewAgent;
use miyabi_agent_core::BaseAgent;
use miyabi_types::{AgentConfig, Task, TaskType};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Configure agent
let config = AgentConfig {
device_identifier: "macbook-pro".to_string(),
github_token: std::env::var("GITHUB_TOKEN")?,
repo_owner: Some("your-org".to_string()),
repo_name: Some("your-repo".to_string()),
..Default::default()
};
// Create agent
let reviewer = ReviewAgent::new(config);
// Create task
let task = Task {
id: "task-001".to_string(),
title: "Review PR #123".to_string(),
description: "Review code quality for feature implementation".to_string(),
task_type: TaskType::Feature,
..Default::default()
};
// Execute review
let result = reviewer.execute(&task).await?;
// Check quality score
if let Some(metrics) = result.metrics {
if let Some(score) = metrics.quality_score {
println!("Quality Score: {}/100", score);
if score >= 80 {
println!("β
Code approved for merge!");
} else {
println!("β Code needs improvement");
}
}
}
Ok(())
}
# Review current directory
miyabi agent run review --task-id task-001
# Review specific path
cd /path/to/your/project
miyabi agent run review --task-id task-002
# With custom config
miyabi agent run review --task-id task-003 --config config.toml
{
"score": 87,
"passed": true,
"issues": [
{
"issue_type": "Eslint",
"severity": "Medium",
"message": "unused variable `foo`",
"file": "src/main.rs",
"line": 42,
"score_impact": 5
}
],
"recommendations": [
"Fix clippy warnings to improve code quality",
"Increase test coverage to at least 80%"
],
"breakdown": {
"clippy_score": 90,
"rustc_score": 100,
"security_score": 100,
"test_coverage_score": 75
}
}
The agent integrates cargo-audit to detect known security vulnerabilities:
# Install cargo-audit (required for security scanning)
cargo install cargo-audit
# Review will automatically run security checks
miyabi agent run review --task-id security-check
Security Scoring:
# Run all tests
cargo test --package miyabi-agent-review
# Run with output
cargo test --package miyabi-agent-review -- --nocapture
# Test specific functionality
cargo test --package miyabi-agent-review test_review_agent_creation
Overall Score = Average(Clippy Score, Rustc Score, Security Score, Coverage Score)
100 - (warnings Γ 5) (minimum: 0)100 - (errors Γ 10) (minimum: 0)ReviewAgent
βββ run_clippy() β ClippyResult
βββ run_rustc_check() β RustcResult
βββ run_security_audit() β SecurityResult
βββ calculate_coverage() β CoverageResult
βββ generate_quality_report() β QualityReport
miyabi-agent-core, miyabi-types, miyabi-coretokio, async-traitserde, serde_jsonchrono, regex, thiserror, tracingmiyabi-agent-coordinator - Task orchestration and DAG planningmiyabi-agent-codegen - AI-powered code generationmiyabi-agent-pr - Pull request creation and managementmiyabi-types - Shared type definitionsmiyabi-agent-core - Base agent traits and utilitiesContributions are welcome! Please see CONTRIBUTING.md for guidelines.
Licensed under the MIT License. See LICENSE for details.
Part of the Miyabi Framework - Autonomous AI Development Platform