Skip to content

evilvic/minions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minions

Three autonomous coding agents — Bob, Kevin, and Stuart — that form a complete development pipeline. They run in Apple Containers, use Codex CLI as their coding engine, and interact with GitLab through its API.

Each agent has a "brain" — a Git repository (rules) containing its tasks, guardrails, memory, and configuration. The operator defines tasks, and the agents execute them autonomously within strict permission boundaries.

Motivation

Inspired by Minions: Stripe's one-shot, end-to-end coding agents — but built as a scrappy, self-hosted alternative using shell scripts, Docker containers, and Codex CLI instead of a large internal platform.

The key insight: autonomous agents need structure (tasks, permissions, memory) more than they need sophisticated frameworks. A well-designed rules repo gives an LLM everything it needs to operate safely.

Architecture

┌─────────────-┐     ┌────────────-─---─┐     ┌──────────────┐
│     Bob      │     │      Kevin       │     │   Stuart     │
│  (Analysis)  │────▶│ (Implementation) |────▶│  (Review)    │
└──────┬───────┘     └──────┬──────---─-┘     └──────┬───────┘
       │                    │                        │
       │ creates issues     │ writes code            │ reviews MRs
       │                    │ creates MRs            │ approves/feedback
       ▼                    ▼                        ▼
  ┌────────────────────────────────────────--─────────────┐
  │                      GitLab API                       │
  └──────────────────────────────────────────--───────────┘

Bob — Analysis Agent

  • Analyzes code and creates GitLab issues
  • Output: issue drafts in output/<ID>/issue.md
  • Safety: issues only created after MR approval
  • Single-run: processes one task, then exits

Kevin — Implementation Agent

  • Takes GitLab issues and resolves them with code
  • Auto-syncs assigned issues from GitLab into his task list
  • Creates branches, implements changes, opens MRs
  • Two-phase approval: rules MR first, then code MR
  • Responds to review feedback by re-running Codex

Stuart — Review Agent

  • Reviews open MRs targeting develop
  • Auto-syncs open MRs from GitLab into his task list
  • Autonomy rules: small MRs → acts alone, large MRs → requires approval
  • Runs as a daemon during working hours (Mon-Fri 7:00-18:30)
  • Produces structured reviews (review.json + review.md)

The Rules Repo Pattern

Each agent has a rules/ directory that serves as its centralized brain:

rules/
├── AGENTS.md        # Operating instructions (the agent reads this first)
├── GUARDRAILS.md    # Permissions, prohibited actions, workflow
├── TASKS.md         # Task queue with priorities and status
├── REPOSITORIES.md  # Known repos with access levels
├── MEMORY.md        # Persistent memory across sessions
├── output/          # Task deliverables (issues, reports, reviews)
├── logs/            # Structured activity log (JSONL)
└── docs/            # Operator-provided context (Bob only)

This pattern means the agent's "intelligence" lives in Git, not in the container. You can review what it knows, what it's done, and what it's allowed to do — all through merge requests.

Project Structure

minions/
├── bob/
│   ├── agent/              # Container + orchestration
│   │   ├── .env.example
│   │   ├── container/
│   │   │   ├── Dockerfile
│   │   │   ├── entrypoint.sh
│   │   │   └── agent.sh
│   │   └── README.md
│   └── rules/              # Bob's brain
├── kevin/
│   ├── agent/
│   │   └── ...
│   └── rules/
├── stuart/
│   ├── agent/
│   │   └── ...
│   └── rules/
├── README.md
└── LICENSE

Setup

Prerequisites

  • Docker or Apple Containers
  • A GitLab instance (self-hosted or gitlab.com)
  • A Codex-compatible API (OpenAI, or a proxy like codex-proxy)
  • GitLab personal access tokens for each agent

1. Configure environment

Copy .env.example to .env for each agent and fill in your values:

cp bob/agent/.env.example bob/agent/.env
cp kevin/agent/.env.example kevin/agent/.env
cp stuart/agent/.env.example stuart/agent/.env

2. Create rules repos

Each agent needs its own rules repository on your GitLab instance. Push the contents of each rules/ directory:

cd bob/rules && git init && git add -A && git commit -m "init" && git remote add origin <your-url> && git push -u origin master

3. Build and run

# Build
container build -t bob:latest bob/agent/container/
container build -t kevin:latest kevin/agent/container/
container build -t stuart:latest stuart/agent/container/

# Run (each agent processes tasks independently)
container run --rm --env-file bob/agent/.env bob:latest
container run --rm --env-file kevin/agent/.env kevin:latest
container run --rm --env-file stuart/agent/.env stuart:latest

How It Works

  1. Define tasks — Add entries to an agent's TASKS.md (or let Kevin/Stuart auto-sync from GitLab)
  2. Agent runs — The container starts, clones its rules repo, picks the highest-priority pending task
  3. Codex executes — The agent builds a prompt with full context and runs Codex CLI
  4. Human reviews — The agent creates MRs for approval before taking irreversible actions
  5. Feedback loop — If the reviewer comments, the agent re-runs Codex with feedback and pushes revisions
  6. Completion — Once the MR is merged or closed, the agent updates its task status and exits

Design Decisions

  • Shell scripts over frameworks: The agents are ~500-900 line bash scripts. No Python, no LangChain, no agent framework. Shell is universal in containers, easy to debug, and keeps the moving parts visible.
  • Git as state: All agent state (tasks, memory, output) lives in Git repos. This gives you version history, merge request workflows, and familiar tooling for free.
  • Approval gates: No agent can take irreversible actions (creating issues, pushing code, approving MRs) without human approval via merge request. The rules repo pattern makes this natural.
  • Codex CLI: Using codex exec gives each agent a full coding environment with file access, not just chat. The --dangerously-bypass-approvals-and-sandbox flag is intentional — the container IS the sandbox.

Related Projects

  • codex-proxy — Lightweight proxy that lets Codex CLI work with any OpenAI-compatible API. Used to route agents through a custom model provider.
  • theo — Theo manages the lifecycle of these agents: scheduling runs, monitoring health, and providing an interface for the operator.

License

MIT

About

Three autonomous coding agents that form a development pipeline — analysis, implementation, and code review — using shell scripts, Codex CLI, and GitLab.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors