Skip to content

mark-styx/chester

Repository files navigation

Chester

AI-powered multi-agent coding assistant. Built in Go for speed, portability, and single-binary distribution.

License: MIT


What is Chester?

Chester is a CLI tool that orchestrates specialized AI agents to write code. Instead of a single agent, Chester uses a multi-stage pipeline:

Researcher - Planner - Architect - Executor - QA - Reviewer - EM Sign-off - Documenter

Each stage uses the best-fit model (local or cloud), with quality gates between stages.

$ chester chat "add user authentication with JWT"

--- Planner (claude-sonnet-4.5) ---
  > read_file path="src/main.go"
  > list_directory path="src/"

  Implementation Plan
  1. Create middleware/auth.go
  2. Add login endpoint
  3. Protect existing routes
  4. Add tests

? Approve this plan? [y/N]: y

--- Executor (qwen2.5-coder:32b) ---
  > write_file path="middleware/auth.go"
  > edit_file path="routes/api.go"
                                          42.1s

--- Reviewer (claude-sonnet-4.5) ---
  Score: 8.5/10  PASSED

  Cost: $0.04  (Planner $0.03 + Executor $0.00 + Reviewer $0.01)

Quick Start

Install

# Build from source (requires Go 1.22+)
git clone git@github.com:mark-styx/chester.git
cd chester
make build
./bin/chester --version

# Or install to GOPATH
make install

Configure

# Set your Anthropic API key (required for cloud/hybrid modes)
export ANTHROPIC_API_KEY=sk-ant-...

# Optional: install Ollama for free local execution
# https://ollama.ai
ollama pull qwen2.5-coder:32b

# Optional: create config
mkdir -p ~/.chester
cp config.example.yaml ~/.chester/config.yaml

Use

# Chat - ask questions or build features
chester chat "what does this code do?"
chester chat "add user authentication"

# Modes - control where models run
chester chat "fix the typo" --mode local         # free, private
chester chat "refactor db layer" --mode cloud     # claude only
chester chat "add API endpoint" --mode hybrid     # local exec, cloud review

# Background execution
chester chat "implement test suite" --background
chester status
chester logs -f

# Sessions - persist and resume
chester sessions
chester resume

# Campaigns - autonomous multi-feature execution
chester campaign run northstar.yaml --budget 50
chester campaign status
chester campaign list

How It Works

Four Modes

Mode Pipeline Cost Privacy
hybrid (default) Cloud plans + local executes + cloud reviews ~$0.04/task Code stays local
cloud Single Claude agent, all stages ~$0.30/task Sent to API
local 100% Ollama, no network $0.00 Full privacy
claudecode Claude Code CLI as backend Varies Via Claude Code

Multi-Layer Tool Calling

Chester achieves ~95% tool-calling success with local models via a 4-layer fallback:

  1. Native API - model's built-in tool calling (~20%)
  2. Structured JSON - parse direct JSON output (~30%)
  3. XML Fallback - parse XML-wrapped calls (~10%)
  4. Local Translator - small model translates reasoning to structured calls (~35%)

Review/Improve Cycles

chester chat "add auth" --cycles 3 --target-score 0.9

After each review, the executor re-attempts fixes based on feedback until the target score is met.

Persona Specializations

chester chat "add API endpoint" --spec go_backend
chester chat "build login page" --spec frontend
chester chat "set up CI pipeline" --spec devops

Available: go_backend, rust_backend, python_backend, frontend, ux, qa, architect, pm, devops, data.

Campaign Mode

Run autonomous multi-feature campaigns from a north star document:

# northstar.yaml
campaign:
  name: "v2 release"
  features:
    - name: user-auth
      description: "JWT authentication with refresh tokens"
    - name: rate-limiting
      description: "Per-user rate limiting with Redis"
chester campaign run northstar.yaml --budget 50

Each feature gets its own git worktree for isolation. Supports distributed execution across cluster nodes.


CLI Reference

chester chat [message]        Build features, ask questions
  -s, --session string        Session name
  -y, --yes                   Skip confirmations
  -b, --background            Run in background
  --model string              Override LLM model
  --max-cost float            Cost limit ($)
  --cycles int                Review/improve cycles
  --target-score float        Early-stop score (0.0-1.0)
  --spec string               Persona specialization

chester resume [id]           Resume interrupted session
chester status [id]           Show session status
chester sessions              List all sessions
chester logs [id] [-f]        Tail event journal
chester stop [id]             Stop background session
chester prune [--days N]      Delete old sessions

chester campaign run [file]   Start campaign from north star
chester campaign status [id]  Show campaign status
chester campaign list         List campaigns
chester campaign resume [id]  Resume campaign
chester campaign stop [id]    Pause campaign
chester campaign stats        Campaign metrics

chester review [--staged]     Review code changes
chester undo                  Revert last file change
chester submit [task]         Submit to inbox queue
chester inbox                 List inbox items

chester dogfood [message]     Self-improvement cycles
chester gateway start|stop|status  Manage cluster gateway
chester setup                 Setup wizard
chester completion <shell>    Shell completions

Global flags: --mode, --config, --verbose, --quiet, --json


Configuration

Chester reads ~/.chester/config.yaml. See config.example.yaml for all options.

Key settings:

llm:
  mode: hybrid                    # hybrid | cloud | local | claudecode
  cloud:
    provider: anthropic
    model: claude-sonnet-4-20250514
  local:
    provider: ollama
    host: http://localhost:11434
    default_model: qwen2.5-coder:32b
  role_tiers:                     # per-role cloud/local routing
    planner: local
    executor: local
    reviewer: cloud

agent:
  max_turns: 10
  max_cycles: 1
  cycle_target_score: 0.95
  qa_enabled: true
  two_pass_review: false
  tool_calling:
    use_translator_fallback: true
    translator:
      model: qwen2.5-coder:32b

memory:
  enabled: true
  embedding_model: nomic-embed-text

Project Structure

chester/
  cmd/chester/           CLI entry point (Cobra commands)
  pkg/
    agent/               Agent loop (tool calling + streaming)
    cluster/             Node registry, health, mDNS discovery
    config/              Config loading (viper + YAML)
    gateway/             HTTP + gRPC gateway, job dispatch, SSE
    llm/                 LLM clients (Anthropic, Ollama, Claude Code, fallback)
    memory/              Persistent memory (SQLite + embeddings)
    metrics/             Budget tracking, cluster metrics
    persona/             Composable persona + specializations
    scheduler/           Job scheduling, priority routing
    tool/                Tool system (registry, role-based subsets)
  internal/
    background/          Daemon scheduler, supervisor, retry
    campaign/            Campaign orchestration (legacy, iterative, distributed)
    display/             Terminal UI (lipgloss styling)
    drift/               Anti-drift (scope guard, watchdog, regression)
    inbox/               Intake agent for work item refinement
    orchestrator/        Multi-agent pipeline, QA retry, ship logs
    session/             Session persistence + journal
  agents/                Role-specific agent instruction files
  docs/                  Architecture and design documents

Development

make build              # Build to bin/chester
make install            # Install to $GOPATH/bin
make test               # Fast tests (skips integration)
make test-integration   # Full suite (requires Claude CLI)
make test-coverage      # Tests with coverage report
make check              # go vet + coverage-gated tests
make fmt                # Format code
make clean              # Remove build artifacts

Tech Stack

Component Library
CLI cobra
Terminal styling lipgloss
Config viper
LLM (cloud) Anthropic Messages API (direct HTTP)
LLM (local) Ollama API (direct HTTP)
LLM (Claude Code) Claude Code CLI subprocess

License

MIT - see LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors