An open API service indexing awesome lists of open source software.

https://github.com/tang-vu/contribai

Autonomous AI agent that contributes to open source — discovers repos, analyzes code, generates fixes, and submits PRs
https://github.com/tang-vu/contribai

agent ai ai-agent automation autonomous-agent code-analysis code-quality contributions gemini github llm open-source pull-requests python security

Last synced: about 8 hours ago
JSON representation

Autonomous AI agent that contributes to open source — discovers repos, analyzes code, generates fixes, and submits PRs

Awesome Lists containing this project

README

          

# ContribAI

**Autonomous AI agent that discovers, analyzes, and submits
Pull Requests to open source projects on GitHub.**

[![Rust](https://img.shields.io/badge/Rust-1.75+-f74c00?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/)
[![Version](https://img.shields.io/badge/v5.4.0-blue?style=for-the-badge&logo=github&logoColor=white)](https://github.com/tang-vu/ContribAI/releases)
[![License](https://img.shields.io/badge/AGPL--3.0-green?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](LICENSE)
[![Tests](https://img.shields.io/badge/335+_tests-passing-brightgreen?style=for-the-badge&logo=checkmarx&logoColor=white)](#testing)
[![PRs Merged](https://img.shields.io/badge/10_PRs-merged-blueviolet?style=for-the-badge&logo=git&logoColor=white)](HALL_OF_FAME.md)


[**Getting Started**](#-getting-started) · [**Features**](#-features) · [**Commands**](#-commands) · [**Architecture**](#-architecture) · [**Hall of Fame**](HALL_OF_FAME.md)


```
Set it up once. Wake up to merged PRs.
```

---

## 🏆 Track Record

| Metric | |
|:-------|------:|
| **PRs Submitted** | `44+` |
| **PRs Merged** | `10` |
| **Repos Contributed** | `21+` |
| **Languages Analyzed** | `13` |

**Notable Contributions:**

🌍 `Worldmonitor` — 45k ⭐ · 3 merged

🕵️ `Maigret` — 19k ⭐ · 3 merged

🤖 `AI-Research-SKILLs` — 6k ⭐ · 1 merged

📊 `s-tui` — 5k ⭐ · 1 merged

🔍 `HolmesGPT` — 2k ⭐ · 1 merged

> See the full **[Hall of Fame →](HALL_OF_FAME.md)** for every PR with links.

---

## ⚡ How It Works

```
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Discovery │────▶│ Analysis │────▶│ Generator │────▶│ PR + CI │────▶│ Patrol │
│ │ │ │ │ │ │ │ │ │
│ Search repos│ │ 13-lang AST │ │ LLM-powered │ │ Fork, commit│ │ Auto-fix │
│ by language │ │ 17 skills │ │ code gen + │ │ create PR │ │ review │
│ and stars │ │ security, │ │ self-review │ │ sign CLA │ │ feedback │
│ │ │ quality, │ │ + scoring │ │ monitor CI │ │ & reply │
│ │ │ performance │ │ │ │ │ │ │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
```

---

## 🚀 Getting Started

### Install

```bash
# Build from source (recommended)
git clone https://github.com/tang-vu/ContribAI.git && cd ContribAI
cargo install --path crates/contribai-rs

# Or one-line install
curl -fsSL https://raw.githubusercontent.com/tang-vu/ContribAI/main/install.sh | bash
# Windows:
irm https://raw.githubusercontent.com/tang-vu/ContribAI/main/install.ps1 | iex
```

### Configure

```bash
contribai init # Interactive setup wizard
contribai login # Verify auth + switch LLM providers
```

### Run

```bash
contribai hunt # Autonomous: discover → analyze → PR
contribai target # Target a specific repo
contribai analyze # Dry-run analysis (no PRs)
contribai interactive # Browse in ratatui TUI
```

📝 Example config.yaml

```yaml
github:
token: "ghp_your_token" # or set GITHUB_TOKEN env var

llm:
provider: "gemini" # gemini | openai | anthropic | ollama | vertex
model: "gemini-3-flash-preview"
api_key: "your_api_key" # or set GEMINI_API_KEY env var

discovery:
languages: # default: all 15 languages
- python
- javascript
- typescript
- go
- rust
stars_range: [100, 5000]
```

See [`config.yaml.template`](config.yaml.template) for all options.

---

## ✨ Features

### 🔍 Code Analysis
- **13-language AST** via tree-sitter
- Security: SQLi, XSS, resource leaks
- Code quality, complexity, dead code
- Performance bottlenecks
- Documentation gaps
- **17 progressive skills** loaded on-demand

### 🤖 Multi-LLM Support
- **Gemini 3.x** (default) — Flash, Pro, Lite tiers
- OpenAI, Anthropic, Ollama, Vertex AI
- Smart task routing across model tiers
- 5 specialized sub-agents

### 🎯 Hunt Mode
- Multi-round autonomous hunting
- Issue-first strategy
- Cross-file fixes
- Outcome learning per repo

### 👁 PR Patrol
- Monitors PRs for review feedback
- LLM-classifies maintainer comments
- Auto-pushes code fixes
- Auto-replies to questions
- Auto-cleans stale PRs from memory

### 🔌 Integrations
- **MCP Server** — 21 tools for Claude Desktop
- **Web Dashboard** — axum REST API at `:8787`
- **Cron Scheduler** — automated runs
- **Docker** — compose-ready deployment
- **Webhooks** — Slack, Discord, Telegram

### 🛡 Safety
- AI policy detection
- CLA auto-signing
- Quality gate scoring
- Duplicate PR prevention
- Protected file guardrails

### Supported Languages

| Deep AST (tree-sitter) | Fallback Parser |
|:----------------------:|:---------------:|
| Python · JavaScript · TypeScript · Go · Rust · Java | Kotlin → Java |
| C · C++ · Ruby · PHP · C# · HTML · CSS | Swift → Java · Vue/Svelte → HTML |

---

## 📖 Commands

ContribAI ships with **22 commands** accessible via CLI or interactive menu.

🔥 Hunt & Contribute

```bash
contribai hunt # Autonomous discovery + PRs
contribai hunt --dry-run # Analyze only, no PRs
contribai run # Single pipeline run
contribai target # Target specific repo
contribai analyze # Dry-run analysis
contribai solve # Solve open issues
```

📊 Monitor & Stats

```bash
contribai patrol # Respond to PR reviews
contribai status # PR status table
contribai stats # Contribution statistics
contribai leaderboard # Merge rate by repo
contribai system-status # DB, rate limits, scheduler
```

🖥️ Interactive & Config

```bash
contribai # Interactive menu (22 items)
contribai interactive # ratatui TUI browser
contribai init # Setup wizard
contribai login # Interactive auth + provider config
contribai config-list # Show all config
contribai config-get llm.provider # Get config value
contribai config-set llm.provider openai # Set config value
contribai profile security-focused # Named profile
```

🌐 Servers & Tools

```bash
contribai web-server # Dashboard at :8787
contribai schedule # Cron scheduler
contribai mcp-server # MCP stdio server
contribai cleanup # Remove stale forks
contribai notify-test # Test Slack/Discord/Telegram
```

---

## 🏗 Architecture

```
ContribAI/
├── crates/contribai-rs/src/ ← Rust v5.4.0 (primary)
│ ├── cli/ 22 commands + ratatui TUI
│ ├── core/ Config, events, error types
│ ├── github/ REST v3 + GraphQL client
│ ├── analysis/ 13-lang AST + 17 skills
│ ├── generator/ LLM code generation + scoring
│ ├── orchestrator/ Pipeline + SQLite memory (72h TTL)
│ ├── llm/ Multi-provider + 5 sub-agents
│ ├── pr/ PR lifecycle + patrol + CI
│ ├── mcp/ 21-tool MCP server (stdio)
│ ├── web/ axum dashboard + webhooks
│ ├── sandbox/ Docker + local fallback
│ └── tools/ Tool protocol interface

└── python/ Legacy v4.1.0 (reference only)
```

🔧 Tech Stack

| Layer | Technology |
|:------|:-----------|
| Language | **Rust 2021** (primary), Python 3.11+ (legacy) |
| Async | Tokio (full), async/await throughout |
| HTTP | reqwest 0.12 (async, rustls-tls) |
| Database | SQLite (rusqlite, bundled) |
| LLM | Gemini 3.x, OpenAI, Anthropic, Ollama, Vertex AI |
| GitHub | REST API v3 + GraphQL |
| AST | tree-sitter (13 languages) |
| Web | axum 0.7 + tower-http |
| TUI | ratatui + crossterm |
| CLI | clap v4 + dialoguer + colored |
| Tests | 335+ tests (mockall, wiremock, tokio-test) |

See [`docs/system-architecture.md`](docs/system-architecture.md) for the full design.

---

## 🧪 Testing

```bash
cargo test # Run all 335+ tests
cargo test -- --nocapture # With stdout output
cargo test ast_intel # AST module tests only
cargo clippy # Lint check
```

---

## 🔌 MCP Server

Use ContribAI as a tool provider for **Claude Desktop** or **Antigravity IDE**:

```json
{
"mcpServers": {
"contribai": {
"command": "contribai",
"args": ["mcp-server"]
}
}
}
```

> 21 tools available: repo analysis, PR management, GitHub search, issue solving, memory queries, and more.

---

## 🐳 Docker

```bash
docker compose up -d dashboard # Dashboard at :8787
docker compose run --rm runner run # One-shot pipeline run
docker compose up -d dashboard scheduler # Dashboard + cron scheduler
```

---

## 📚 Documentation

| Document | Description |
|:---------|:------------|
| [**Hall of Fame**](HALL_OF_FAME.md) | 10 merged · 14 closed across 21+ repos |
| [**AGENTS.md**](AGENTS.md) | AI agent guide — architecture, patterns, CLI reference |
| [**Deployment Guide**](docs/deployment-guide.md) | Install, Docker, config, all 22 CLI commands |
| [**System Architecture**](docs/system-architecture.md) | Pipeline, middleware, events, LLM routing |
| [**Codebase Summary**](docs/codebase-summary.md) | Module map, tech stack, data structures |
| [**Project Roadmap**](docs/project-roadmap.md) | Version history and future plans |

---

## 📄 License

**AGPL-3.0 + Commons Clause** — see [LICENSE](LICENSE) for details.

---

**Built with Rust 🦀 and LLMs 🤖**

[Releases](https://github.com/tang-vu/ContribAI/releases) · [Issues](https://github.com/tang-vu/ContribAI/issues) · [Hall of Fame](HALL_OF_FAME.md)