convez.ai
AgenteAutomaçãoAvançado
PhilipAndreasson

Brick - Loop de Desenvolvimento Multi-Agent Autônomo

PhilipAndreasson/brick

Dev loop autônomo multi-agent local-first com escalação inteligente a Claude

Ver no GitHub
InicialPluginScore · de 0 a 100

Agent autônomo que orquestra um ciclo de desenvolvimento com múltiplos papéis (orchestrator, overseer, worker, smart_local, PO reviewer, wiki updater) rodando localmente em Ollama, escalando para Claude apenas quando necessário. Reduz custos de tokens ao maximizar execução local enquanto mantém qualidade através de gates de type-check e revisão.

Instalação

$npx convez-ai PhilipAndreasson/brick

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
v0.2.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Automação de ciclos de desenvolvimento completos (design → código → review → commit)
  • Redução de custos de API rodando tasks repetitivas em modelos locais antes de escalar
  • CI/CD integrado via GitHub Actions com retry inteligente e auto-healing
  • Desenvolvimento project-agnostic configurável via brick.config.yaml + PROMPT.md

Veredito

Brick é uma abordagem sofisticada e bem-pensada para reduzir custos de API mantendo qualidade através de orchestração local inteligente. Requer infraestrutura Ollama e compreensão de pipelines CI/CD, mas oferece retorno significativo em projetos que toleram automação de ponta a ponta com revisão humana opcional.

README

A tradução para o português deste README ainda está na fila.

Brick

Named after Brick Tamland. Loud, occasionally on fire, surprisingly effective.

Autonomous, multi-agent development loop for Claude Code + local LLMs.

Local-first. Brick runs six roles (orchestrator, overseer, worker, smart_local, PO reviewer, wiki updater) on your local Ollama. Claude is the top escalation tier: it only fires when local exhausts retries. Between the workhorse local models and Claude sits smart_local — a stronger local model that re-attempts hard tasks (repeated worker failures, overseer requeues, or PO rejections) before any Claude tokens are spent.

The philosophy: 1000 monkeys with unlimited compute, not five monkeys with a tight deadline. Local hardware is free; Claude tokens are not. Throw attempts at the problem and let the type-check gate filter out the noise.

Brick runs in a tight loop on your workstation — or in CI via GitHub Actions — and is project-agnostic: everything project-specific lives in your project's brick.config.yaml + PROMPT.md.


Architecture (one diagram)

┌─────────────────────────────────────────────────────────────────────┐
│  brick.sh / brick.ps1  (loop, runs forever)                         │
│                                                                     │
│  At startup: spawn Overseer + N Workers (default = ~ CPU cores)     │
│                                                                     │
│  Each iteration:                                                    │
│    1. git pull --rebase --autostash                                 │
│    2. Idle check — fix_plan.md + tasks/pending + tasks/review       │
│    3. Local orchestrator (Ollama) ← reads PROMPT.md + fix_plan.md   │
│         · picks one actionable item                                 │
│         · emits OVERSEER or WORKER task JSON                        │
│         · moves the line under `## In Progress`                     │
│    4. PO review (local Ollama, then type-check gate)                │
│         · ACCEPT + tsc pass → done/, commit                         │
│         · REJECT or tsc fail → bump local_attempts, requeue         │
│         · After local_attempts ≥ escalation threshold → Claude PO   │
│         · After max_requeue_attempts → tasks/failed/                │
│    5. Wiki update (local Ollama) from `git diff HEAD~1 HEAD`        │
│    6. Sleep, repeat                                                 │
└─────────────────────────────────────────────────────────────────────┘

┌────────────────────────────┐    ┌────────────────────────────┐
│  overseer.py (Ollama)      │    │  runner.py × N (Ollama)    │
│                            │    │                            │
│  Polls tasks/pending/ for  │    │  Polls tasks/worker/       │
│  type:"overseer", expands  │    │  pending/, builds prompts, │
│  into worker sub-tasks,    │    │  hits Ollama, writes code, │
│  reviews completion, hands │    │  self-heals up to 3        │
│  off to PO review via      │    │  attempts (or forever with │
│  tasks/review/.            │    │  retry_forever:true), then │
│                            │    │  escalates to Claude.      │
└────────────────────────────┘    └────────────────────────────┘

Before Claude, every local escalation axis first promotes the work from the workhorse model to smart_local (a stronger local model):

AxisWorkhorse → smart_local after→ Claude after
Worker solvingworker_retries_before_smart (5)10 retries
Overseer plan/reviewoverseer_requeues_before_smart (2)max_requeue_attempts (3)
PO reviewlocal_attempts_before_smart (4)local_attempts_before_claude (10)

Claude only enters the picture once the smart-local tier is also exhausted:

  • PO escalation — local PO has rejected the same review file escalation.local_attempts_before_claude times (default 10).
  • Worker stuck — a single worker has retried 10 times on the same task without success (and the task does not have retry_forever: true).

Windows: brick.ps1 still runs the legacy Claude-orchestrator flow and does not yet implement the local-first ladder or the smart-local tiers. Use brick.sh (Linux/Mac/WSL) for full local-first behavior. See docs/local-llm-stack.md.


Install

One-liner from your project root:

curl -fsSL https://raw.githubusercontent.com/PhilipAndreasson/brick/main/scripts/bootstrap.sh | bash

Pin a specific version:

BRICK_VERSION=v0.1.0 curl -fsSL https://raw.githubusercontent.com/PhilipAndreasson/brick/main/scripts/bootstrap.sh | bash

Or, from a local Brick checkout:

./install.sh /path/to/your/project

The installer drops .brick/bin/{brick,brick.sh,brick.ps1}, .brick/lib/{runner,overseer,config,init,doctor}.py, a VERSION file, and the tasks/ + logs/ trees. It seeds PROMPT.md and fix_plan.md if they are missing, but does not create brick.config.yaml — that's the job of brick init (next step), so model choices stay explicit.

Quickstart

./.brick/bin/brick init      # interactive setup → brick.config.yaml
./.brick/bin/brick doctor    # verify claude / ollama / models / git / jq
$EDITOR PROMPT.md            # describe your stack for the orchestrator
$EDITOR fix_plan.md          # add the first item
./.brick/bin/brick run       # start the loop (Ctrl+C to stop)

Other subcommands:

brick models                              # show current model assignments
brick model                               # arrow-key picker, swap any role
brick model set worker qwen2.5-coder:7b   # direct set, no prompt
brick version                             # print installed Brick version
brick update                              # fetch latest release, preserve config
brick uninstall                           # remove .brick/, prompt before tasks/ + logs/
brick init --non-interactive \
    --orchestrator gemma3:latest \
    --overseer gemma3:latest \
    --worker gemma3:latest \
    --smart-local gpt-oss:20b \
    --po-reviewer gemma3:latest \
    --wiki gemma3:latest \
    --claude-escalation claude-sonnet-4-6

brick model opens a curses TUI: arrow keys to pick the role, then to pick the new model. Ollama options are pulled live from the daemon. Falls back to a numbered prompt if there's no TTY.

Tip: add $PWD/.brick/bin to PATH (or symlink brick into ~/.local/bin) to call brick from anywhere inside the project.


Direct loop invocation (mostly for CI / scripts):

./.brick/bin/brick.sh --max-loops 5    # CI / time-bounded run
./.brick/bin/brick.sh --workers 0      # single Sonnet, no Gemma fleet

Windows: use pwsh ./.brick/bin/brick.ps1 — same flags, but it spawns visible Terminal panes for overseer + workers instead of background log files.


Requirements

  • Claude Code CLI (claude) — for orchestrator + PO + wiki updater
  • Ollama running locally with at least one Gemma-class (or compatible) model pulled — for the overseer + worker fleet. Brick talks to it at http://localhost:11434 (override in providers.ollama.base_url). Pick the model at brick init time; there are no defaults.
  • Python 3.10+ (pyyaml, requests auto-installed on first run)
  • jq — used by brick.sh to manipulate review JSON
  • git

Run brick doctor to verify all of the above.


Config reference

See templates/brick.config.yaml.example for every key with defaults.


Documentation


License

MIT

Ver o original no GitHub

Bom para

Relacionados