aico
by ram-singh1
README.md
# AI Coding Orchestrator (`aico` V2)
A production-quality local CLI application designed to orchestrate specialized coding agents:
* **Codex CLI** β Lead Software Architect, Core Developer, and Complex Problem Solver.
* **Antigravity / AGY CLI** β Quality Assurance, Reviewer, Regression Tester, and Small-Fix Agent.
* **Extended Agents** β **Claude**, **Gemini**, and **Local LLMs** (via Ollama / OpenAI-compatible endpoints).
`aico` manages state machines, workflow transitions, Git worktree isolation, prompt templating, parallel test execution, AST security scanning, human-in-the-loop approvals, MCP server integration, and comprehensive reporting.
---
## ποΈ Architecture
```
ββββββββββββββββββββββββββ
β USER / CLI β
β (aico) β
βββββββββββββ¬βββββββββββββ
β
TASK RECEIVED
β
βββββββββββββΌβββββββββββββ
β GIT & WORKTREE CHECK β
β Zero-Impact Isolation β
βββββββββββββ¬βββββββββββββ
β
βββββββββββββΌβββββββββββββ
β CODEX CLI β
β β’ Architecture Design β
β β’ Core Implementation β
β β’ Complex Fixes β
βββββββββββββ¬βββββββββββββ
β
βββββββββββββΌβββββββββββββ
β AGY CLI β
β β’ Review & Test Plan β
β β’ Parallel Validation β
β β’ AST Security Audit β
β β’ Issue Classificationβ
βββββββββββββ¬βββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β Issue Classification Branch β
ββββββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ
β β β
PASS SMALL_FIX COMPLEX / ARCH / BUG / SEC
β β β
βΌ βΌ βΌ
PARALLEL VALIDATION AGY FIX CODEX FIX
(Test, Lint, Type, (Local) (Deep Fix)
Build, Security) β β
β βΌ βΌ
βΌ AGY RETEST AGY RETEST
DONE β β
βββββββββββΊβββββββββββββββ
```
---
## π V2 Features & Enhancements
1. **πΏ Zero-Impact Git Worktree Isolation (`--worktree` / `-w`)**:
- Executes all agent actions inside an isolated Git worktree without touching your active editor files or unstaged changes.
- Automatically syncs and merges when the task completes successfully.
2. **β‘ Parallel Quality & Test Engine (`aico test`)**:
- Concurrently executes Unit Tests, Linters (`ruff`/`eslint`), Typecheckers (`mypy`/`tsc`), Builds, and Security Audits in worker thread pools.
3. **π‘οΈ Built-in AST & Static Security Scanner (`aico scan`)**:
- Real-time detection of SQL Injection risks, command injection (`shell=True`), hardcoded JWT secrets, weak cryptography (MD5/SHA1), and unsafe dynamic execution (`eval`/`exec`).
4. **πΆ Human-In-The-Loop (HITL) Mode (`--interactive` / `-i`)**:
- Interactive checkpoint approval before architectural changes or security fixes with direct prompt guidance injection (`[A]pprove`, `[E]dit guidance`, `[R]eject`, `[Q]uit`).
5. **π― Granular Multi-Tier Model Routing**:
- Configure distinct models per phase (e.g. `o3-mini` / `claude-3-7-sonnet` for architecture, `gemini-2.0-flash` for test review, `gpt-4o-mini` for small fixes).
6. **π Model Context Protocol (MCP) Server (`aico mcp`)**:
- Run `aico` as a standard MCP server for seamless integration with Cursor, Antigravity IDE, Claude Desktop, and other MCP clients.
7. **π€ Extended Agent Support**:
- Built-in adapters for **Claude CLI**, **Gemini CLI**, and **Local LLMs** (Ollama / OpenAI-compatible).
---
## π¦ Installation & Setup
```bash
cd /var/www/html/ai-coding-orchestrator
pip install -e .
```
Verify installation:
```bash
aico doctor
```
---
## π» CLI Command Reference
| Command | Description |
| :--- | :--- |
| `aico` | Launch interactive prompt session |
| `aico "task"` | Run a direct task in current working directory |
| `aico run "task"` | Explicit task run |
| `aico run -w "task"` | Run in an isolated **Git worktree** (zero-impact) |
| `aico run -i "task"` | Run with **Interactive Human-In-The-Loop** checkpoints |
| `aico test` | Run parallel test, lint, typecheck, build, and security checks |
| `aico scan` | Run static AST & regex security vulnerability scan |
| `aico mcp` | Start Model Context Protocol (MCP) JSON-RPC stdio server |
| `aico resume` | Resume interrupted task from saved `.ai-orchestrator/state.json` |
| `aico status` | Inspect current task state, iterations, and metrics |
| `aico logs` | View unified logs (`--agent codex`, `--agent agy`) |
| `aico stop` | Abort and cancel active task |
| `aico config show` | View current configuration |
| `aico config set <key> <val>` | Update configuration key |
| `aico doctor` | Run health checks for Codex, AGY, and Git |
---
## βοΈ Configuration (`~/.aico/config.yaml`)
```yaml
codex:
command: "codex"
timeout: 3600
flags: ["exec", "--dangerously-bypass-approvals-and-sandbox"]
model: null
architecture_model: null
implementation_model: null
fix_model: null
agy:
command: "agy"
timeout: 1800
flags: ["--print", "--dangerously-skip-permissions"]
model: null
review_model: null
testing_model: null
fix_model: null
workflow:
max_iterations: 5
max_codex_attempts: 5
max_agy_attempts: 5
auto_resume: false
stop_on_environment_issue: true
interactive: false
require_approval_on_architecture: false
require_approval_on_security: false
git:
enabled: true
create_branch: true
branch_prefix: "ai-orchestrator"
auto_stash_uncommitted: false
use_worktree: false
testing:
run_tests: true
run_lint: true
run_typecheck: true
run_build: true
run_security_scan: true
parallel: true
max_workers: 4
safety:
protect_uncommitted_changes: true
allow_destructive_git: false
```
---
## π Workspace Layout
```
.ai-orchestrator/
βββ state.json # Machine-readable task state and transition history
βββ task.md # Original user task
βββ architecture.md # Architecture design from Codex
βββ final-report.md # Comprehensive post-task markdown report
β
βββ codex/
β βββ prompt.md # Prompt sent to Codex
β βββ result.md # Codex execution summary
β βββ issues.md # Issues addressed
β
βββ agy/
β βββ prompt.md # Prompt sent to AGY
β βββ test-plan.md # Test plan created by AGY
β βββ result.md # AGY validation results
β βββ issues.md # Issues detected
β βββ fixes.md # Small fixes applied
β
βββ logs/
β βββ orchestrator.log # Workflow state transitions
β βββ codex.log # Raw stdout/stderr of Codex
β βββ agy.log # Raw stdout/stderr of AGY
β
βββ worktrees/ # Isolated git worktrees (when enabled)
βββ checkpoints/ # Git snapshots before major stages
```
---
## π§ͺ Test Suite
Run the full test suite covering all V1 and V2 capabilities:
```bash
pytest -v
```
**65 unit & integration tests pass with 100% success rate.**
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues