Architecture

Architecture

Overview

buildcrew is a set of 15 Markdown agent definitions that Claude Code reads as instructions. There is no runtime, no binary, no server β€” just structured prompts.

npx buildcrew
    β”‚
    β–Ό
Copies 15 .md files to .claude/agents/
    β”‚
    β–Ό
Claude Code discovers agents automatically
    β”‚
    β–Ό
User talks to @buildcrew β†’ routes to the right agents

Agent System

How Agents Work in Claude Code

Claude Code looks for agent definitions in .claude/agents/*.md. Each file has:

---
name: agent-name          # How to invoke: @agent-name
description: ...          # What it does
model: sonnet             # Which model to use
tools:                    # Which tools the agent can use
  - Read
  - Write
  - Bash
---
 
# Agent instructions in Markdown

When a user types @agent-name [message], Claude Code loads the Markdown as system instructions and gives the agent access to the listed tools.

Orchestrator Pattern

The key design decision is the orchestrator pattern: one lead agent (buildcrew) that dispatches to specialist agents based on the user's intent.

User message
    β”‚
    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  BUILDCREW   β”‚ ← Reads message, detects mode, dispatches agents
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€ Mode 1 (Feature)  β†’ planner β†’ designer β†’ developer β†’ qa-tester β†’ browser-qa β†’ reviewer
       β”œβ”€β”€ Mode 2 (Audit)    β†’ planner(discovery) β†’ [designer β†’] developer β†’ qa-tester (loop)
       β”œβ”€β”€ Mode 3 (BrowserQA) β†’ browser-qa [β†’ developer β†’ browser-qa]
       β”œβ”€β”€ Mode 4 (Security)  β†’ security-auditor [β†’ developer β†’ security-auditor]
       β”œβ”€β”€ Mode 5 (Debug)     β†’ investigator β†’ qa-tester
       β”œβ”€β”€ Mode 6 (Health)    β†’ health-checker
       β”œβ”€β”€ Mode 7 (Canary)    β†’ canary-monitor
       β”œβ”€β”€ Mode 8 (Review)    β†’ reviewer [β†’ developer β†’ reviewer]
       └── Mode 9 (Ship)      β†’ shipper

The orchestrator auto-detects intent and chains agents β€” no manual skill invocation needed.

Agent Categories

Build Team (create)        Quality Team (verify)       Security & Ops (protect & ship)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ planner  │──────────────▢│ qa-tester   β”‚             β”‚ security-     β”‚
β”‚ designer β”‚               β”‚ browser-qa  β”‚             β”‚   auditor     β”‚
β”‚ developer│◀──────────────│ reviewer    β”‚             β”‚ canary-monitorβ”‚
β”‚          β”‚               β”‚ health-     β”‚             β”‚ shipper       β”‚
β”‚          β”‚               β”‚   checker   β”‚             β”‚               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       
Specialist
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ investigator β”‚  (standalone β€” called by buildcrew for bug investigation)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pipeline System

Agents communicate via files in .claude/pipeline/. Each mode creates its own subdirectory:

.claude/pipeline/
β”œβ”€β”€ {feature-name}/            Feature mode (sequential chain)
β”‚   β”œβ”€β”€ 01-plan.md             ← planner output
β”‚   β”œβ”€β”€ 02-design.md           ← designer output (spec)
β”‚   β”œβ”€β”€ 02-prototype.html      ← designer output (interactive)
β”‚   β”œβ”€β”€ 03-dev-notes.md        ← developer output
β”‚   β”œβ”€β”€ 04-qa-report.md        ← qa-tester output
β”‚   β”œβ”€β”€ 05-browser-qa.md       ← browser-qa output
β”‚   β”œβ”€β”€ 06-review.md           ← reviewer output
β”‚   β”œβ”€β”€ 07-ship.md             ← shipper output
β”‚   └── iteration-log.md       ← buildcrew tracking
β”‚
β”œβ”€β”€ project-audit/             Audit mode
β”‚   β”œβ”€β”€ 00-backlog.md
β”‚   └── iteration-N/
β”‚
β”œβ”€β”€ security-audit/            Security mode
β”‚   └── security-audit.md
β”‚
β”œβ”€β”€ health/                    Health mode
β”‚   └── health-report.md
β”‚
β”œβ”€β”€ canary/                    Canary mode
β”‚   └── canary-report.md
β”‚
β”œβ”€β”€ browser-qa/                Browser QA mode (standalone)
β”‚   └── browser-qa-report.md
β”‚
β”œβ”€β”€ review/                    Review mode (standalone)
β”‚   └── review-report.md
β”‚
└── debug-{bug}/               Debug mode
    └── investigation.md

Handoff Protocol

Each agent:

  1. Reads the previous agent's output file
  2. Does its work
  3. Writes its own output file
  4. The next agent reads that file

This creates an auditable chain where every decision is documented.

Quality Gates

The orchestrator implements quality gates after QA phases:

QA Result
    β”‚
    β”œβ”€β”€ ALL PASS β†’ proceed to next agent (or complete)
    β”‚
    └── FAIL β†’ route back to responsible agent
               β”œβ”€β”€ UI issue β†’ designer
               β”œβ”€β”€ Code bug β†’ developer
               └── Spec unclear β†’ planner

After max iterations (configurable), ship with known issues documented.

Iteration Control

Each mode has a default max iteration count:

ModeDefaultWhat iterates
Feature3QA fail β†’ fix β†’ re-QA
Audit2Scan β†’ fix β†’ re-scan
Browser QA2Test β†’ fix β†’ re-test
Security2Audit β†’ fix β†’ re-audit
Debug3Hypothesis β†’ test β†’ new hypothesis
Review2Review β†’ fix β†’ re-review
Health/Canary/Ship1No iteration

Design Decisions

Why Markdown, not code?

  • Zero dependencies β€” nothing to install, build, or break
  • Transparent β€” users can read and modify agent behavior
  • Portable β€” works on any OS where Claude Code runs
  • Versionable β€” git tracks changes to agent behavior over time

Why a single orchestrator?

  • Users don't need to know which agent to invoke
  • Mode detection from natural language is reliable
  • Enables automatic chaining (Feature β†’ Ship, Canary β†’ Debug)
  • Single entry point reduces cognitive load

Why Playwright MCP instead of a custom binary?

  • Already available in the Claude Code ecosystem
  • No build step, no Bun dependency
  • Same capabilities (~100ms per command, persistent browser)
  • Users may already have it installed

Why numbered pipeline files?

  • Clear execution order
  • Easy to find specific phase output
  • Agents know exactly which file to read/write
  • Git-friendly β€” you can commit pipeline docs as project history