| Crates.io | miyabi-agent-workflow |
| lib.rs | miyabi-agent-workflow |
| version | 0.1.2 |
| created_at | 2025-11-22 08:16:46.261281+00 |
| updated_at | 2025-11-22 08:16:46.261281+00 |
| description | Miyabi Workflow Agents - PR, Issue, and Deployment automation |
| homepage | |
| repository | https://github.com/ShunsukeHayashi/Miyabi |
| max_upload_size | |
| id | 1945068 |
| size | 183,848 |
GitHub workflow automation agents: PR creation, Issue analysis, and Deployment for the Miyabi framework.
miyabi-agent-workflow provides three specialized agents for automating GitHub-based development workflows:
Key Capabilities:
feat(scope): description formatfeat, fix, refactor, docs, test, ci prefixesfix(auth): login bug)Depends on #123)cargo build --release with error handlingcargo test --all with pass/fail trackingAdd to your Cargo.toml:
[dependencies]
miyabi-agent-workflow = "0.1.0"
Or install the CLI:
cargo install miyabi-cli
use miyabi_agent_workflow::PRAgent;
use miyabi_agent_core::BaseAgent;
use miyabi_types::{AgentConfig, Task, TaskType};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = AgentConfig {
github_token: std::env::var("GITHUB_TOKEN")?,
repo_owner: Some("your-org".to_string()),
repo_name: Some("your-repo".to_string()),
..Default::default()
};
let pr_agent = PRAgent::new(config);
let task = Task {
id: "task-001".to_string(),
title: "Auth: Add Google OAuth support".to_string(),
description: "Implement Google OAuth 2.0 authentication".to_string(),
task_type: TaskType::Feature,
..Default::default()
};
// Generates PR:
// Title: feat(auth): Add Google OAuth support
// Body: Overview, changes, checklist
// Labels: β¨ type:feature, ποΈ state:implementing
let result = pr_agent.execute(&task).await?;
println!("PR created: {:?}", result.data);
Ok(())
}
use miyabi_agent_workflow::IssueAgent;
use miyabi_types::{AgentConfig, Issue};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = AgentConfig::default();
let issue_agent = IssueAgent::new(config);
let issue = Issue {
number: 42,
title: "Critical: Database connection timeout".to_string(),
body: "Users cannot login. Database times out after 5s.".to_string(),
labels: vec!["bug".to_string()],
..Default::default()
};
let analysis = issue_agent.analyze_issue(&issue)?;
// Output:
// Type: Bug
// Severity: Critical
// Impact: System
// Agent: CodeGenAgent
// Duration: 30 minutes
// Labels: ["π type:bug", "π₯ priority:P0-Critical", "π€ agent:codegen"]
println!("Analysis: {:?}", analysis);
Ok(())
}
use miyabi_agent_workflow::{DeploymentAgent, Environment};
use miyabi_agent_core::BaseAgent;
use miyabi_types::{AgentConfig, Task, TaskType};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = AgentConfig {
firebase_staging_project: Some("miyabi-staging".to_string()),
staging_url: Some("https://staging.miyabi.dev".to_string()),
..Default::default()
};
let deploy_agent = DeploymentAgent::new(config);
let task = Task {
id: "deploy-001".to_string(),
title: "Deploy to staging".to_string(),
task_type: TaskType::Deployment,
..Default::default()
};
// Executes:
// 1. cargo build --release
// 2. cargo test --all
// 3. Deploy to staging
// 4. Health check (https://staging.miyabi.dev/health)
// 5. Rollback if health check fails
let result = deploy_agent.execute(&task).await?;
println!("Deployment: {:?}", result.status);
Ok(())
}
IssueAgent integrates with Miyabi's 57-label system across 11 categories:
| Category | Labels | Examples |
|---|---|---|
| Type | 7 | β¨ type:feature, π type:bug, β»οΈ type:refactor |
| Priority | 5 | π₯ priority:P0-Critical, β οΈ priority:P1-High |
| State | 8 | π₯ state:pending, ποΈ state:implementing, β
state:done |
| Agent | 7 | π€ agent:coordinator, π€ agent:codegen, π€ agent:review |
| Phase | 6 | π― phase:planning, ποΈ phase:implementation |
| Size | 5 | π size:XS, π size:S, π size:M, π size:L, π size:XL |
| Impact | 3 | π₯ impact:system, π€ impact:user, π¨ impact:cosmetic |
| Severity | 4 | π₯ severity:critical, β οΈ severity:high |
| Technical | 7 | π§ tech:api, ποΈ tech:db, π¨ tech:ui |
| Business | 3 | πΌ biz:marketing, π° biz:sales, π biz:analytics |
| Meta | 2 | π·οΈ good first issue, π help wanted |
See LABEL_SYSTEM_GUIDE.md for full documentation.
βββββββββββββββββββββββ
β cargo build β β BuildResult
βββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β cargo test β β TestResult
βββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β Deploy (Staging) β β Automatic
βββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β Health Check β β GET /health
βββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β Success / Rollback β
βββββββββββββββββββββββ
PRAgent::execute(task)
βββ generate_pr_title() β feat(scope): description
βββ generate_pr_body() β Markdown body
βββ infer_labels() β [type:feature, state:implementing]
βββ create_pull_request() β GitHub PR
IssueAgent::analyze_issue(issue)
βββ infer_issue_type() β Feature/Bug/Refactor...
βββ assess_severity() β Critical/High/Medium/Low
βββ evaluate_impact() β System/User/Cosmetic
βββ determine_agent() β CodeGenAgent/ReviewAgent...
βββ estimate_duration() β 30-120 minutes
βββ extract_dependencies() β [#123, #456]
βββ generate_labels() β [57-label system]
DeploymentAgent::deploy(task)
βββ execute_build() β cargo build --release
βββ execute_tests() β cargo test --all
βββ deploy_to_environment() β Staging/Production
βββ run_health_check() β GET /health (3 retries)
βββ rollback_if_failed() β git revert + redeploy
miyabi-agent-core, miyabi-types, miyabi-core, miyabi-githubtokio, async-traitoctocrab, reqwestserde, serde_jsonchrono, regex, thiserror, tracing# Run all tests
cargo test --package miyabi-agent-workflow
# Test specific agent
cargo test --package miyabi-agent-workflow pr_agent
cargo test --package miyabi-agent-workflow issue_agent
cargo test --package miyabi-agent-workflow deployment_agent
# Integration tests (requires GitHub token)
GITHUB_TOKEN=ghp_xxx cargo test --package miyabi-agent-workflow --test integration
miyabi-agent-coordinator - Task orchestration and DAG planningmiyabi-agent-codegen - AI-powered code generationmiyabi-agent-review - Code quality review and scoringmiyabi-github - GitHub API client wrappermiyabi-types - Shared type definitionsContributions 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