On this page

Architecture

How Barbossa works under the hood.


Operating Modes

Barbossa has two operating modes controlled by settings.spec_mode.enabled:

Autonomous Mode (Default)

Five AI agents work in a continuous development pipeline. Engineer implements, Tech Lead reviews, Discovery finds issues, Product suggests features, Auditor monitors health.

Spec Mode

When spec_mode.enabled = true, all autonomous agents are disabled. Only the Spec Generator runs, creating detailed cross-repo product specifications.


System Overview

Barbossa runs AI agents in a Docker container. Each agent has a specific role and runs on a schedule.

+--------------------------------------------------+
|               DOCKER CONTAINER                    |
|                                                   |
|   +------------------------------------------+   |
|   |           Cron Scheduler                 |   |
|   |      (supercronic - runs on schedule)    |   |
|   +------------------------------------------+   |
|                       |                          |
|       +-------+-------+-------+-------+          |
|       |       |       |       |       |          |
|       v       v       v       v       v          |
|   +-------+-------+-------+-------+-------+      |
|   |Discov-|Product|Engine-| Tech |Auditor|      |
|   |  ery  |  Mgr  |  er   | Lead |       |      |
|   +-------+-------+-------+-------+-------+      |
|                       |                          |
|                       v                          |
|              +----------------+                  |
|              |   Claude CLI   |                  |
|              +----------------+                  |
|                       |                          |
+--------------------------------------------------+
                        |
        +---------------+---------------+
        |               |               |
        v               v               v
   +--------+      +--------+      +--------+
   | GitHub |      | Claude |      | Linear |
   |  API   |      |  API   |      |  API   |
   +--------+      +--------+      +--------+
                        |
                        v
                   +--------+
                   |Discord |
                   |Webhook |
                   +--------+

Agent Pipeline

Agents work together in a continuous pipeline:

+------------------------------------------+
|          1. DISCOVERY PHASE              |
|                                          |
|  Discovery        Product Manager        |
|  - Scans code     - Analyzes docs        |
|  - Finds TODOs    - Proposes features    |
|  - Missing tests  - User value focus     |
|           \            /                 |
|            v          v                  |
|          GitHub Issues                   |
|        (labeled "backlog")               |
+------------------------------------------+
                    |
                    v
+------------------------------------------+
|        2. IMPLEMENTATION PHASE           |
|                                          |
|            Engineer Agent                |
|  - Picks highest priority issue          |
|  - Reads CLAUDE.md for context           |
|  - Implements fix/feature                |
|  - Creates PR with "Closes #XX"          |
|                   |                      |
|                   v                      |
|            Pull Request                  |
+------------------------------------------+
                    |
                    v
+------------------------------------------+
|           3. REVIEW PHASE                |
|                                          |
|            Tech Lead Agent               |
|  - Waits for CI to pass                  |
|  - 8-dimension quality review            |
|  - Security, performance, tests          |
|                   |                      |
|          +-------+-------+               |
|          v               v               |
|       APPROVE         REJECT             |
|     (auto-merge)  (request changes)      |
|          |               |               |
|          |               v               |
|          |      Engineer fixes PR        |
|          |      (up to 3 attempts)       |
+------------------------------------------+

Agent Details

Engineer

The workhorse. Picks issues and implements them.

Workflow:
  1. Fetches issues labeled backlog from GitHub/Linear
  2. Sorts by priority (explicit priority labels or creation date)
  3. Creates feature branch: barbossa/{issue-id}-{slug}
  4. Invokes Claude CLI with issue context + CLAUDE.md
  5. Claude implements the fix/feature
  6. Creates PR linking to the issue
Key behaviors:

Tech Lead

Quality gatekeeper. Reviews PRs against strict criteria.

Reviews PRs against 8 quality dimensions (code quality, bloat, integration, UI/UX, tests, security, performance, complexity).

Decisions:

Discovery

Finds technical debt and creates issues.

What it looks for: Deduplication:

Product Manager

Proposes high-value features based on codebase analysis.

Process:
  1. Reads CLAUDE.md to understand product context
  2. Analyzes existing features and patterns
  3. Identifies gaps and opportunities
  4. Creates feature issues with acceptance criteria
Output format:

Auditor

Weekly health check of the entire system.

What it monitors: Output:

Spec Generator (Spec Mode Only)

Cross-repo product specification generator. Only runs when spec_mode.enabled = true.

Workflow:
  1. Loads "products" (groups of linked repositories) from config
  2. Clones/updates all linked repositories
  3. Aggregates context from CLAUDE.md files + product config
  4. Calls Claude to generate detailed, prompt-ready specs
  5. Creates distributed tickets:
Key behaviors:

File Structure

barbossa-engineer/
├── src/barbossa/
│   ├── agents/
│   │   ├── engineer.py        # Main engineer agent
│   │   ├── tech_lead.py       # PR reviewer agent
│   │   ├── discovery.py       # Tech debt finder
│   │   ├── product.py         # Feature suggester
│   │   ├── auditor.py         # Health monitor
│   │   └── spec_generator.py  # Cross-repo spec generator (Spec Mode)
│   ├── utils/
│   │   ├── prompts.py         # Prompt template loader
│   │   ├── issue_tracker.py   # GitHub/Linear abstraction
│   │   ├── linear_client.py   # Linear API wrapper
│   │   └── notifications.py   # Discord webhook notifications
│   └── cli/
│       └── barbossa           # CLI entrypoint
├── prompts/                    # Prompt templates
├── config/
│   └── repositories.json      # Your configuration
├── scripts/
│   ├── validate.py            # Startup validation
│   ├── generate_crontab.py    # Mode-aware schedule generator
│   └── run.sh                 # Agent runner
└── logs/                      # Agent logs

Security Model

Container Isolation

Authentication

What Agents Can Do

ActionAllowedNotes
Read repository codeYesVia git clone
Create branchesYesPrefixed with barbossa/
Create PRsYesOne at a time per repo
Merge PRsYesOnly own PRs, if auto_merge enabled
Create issuesYesDiscovery + Product agents
Delete branchesNoOnly cleans up after merge
Force pushNoNever
Access other reposNoOnly configured repos

Protected Files

Configure do_not_touch in repositories.json:

{
  "do_not_touch": [
    ".env*",
    "src/auth/**",
    "prisma/migrations/"
  ]
}

Agents will never modify these paths.


Scheduling Philosophy

Agents are offset to avoid contention:

TimeAgentWhy
:00EngineerCreates PRs
:30-Buffer
+1hTech LeadReviews PRs created in previous hour
SpreadDiscoveryKeeps backlog stocked
3x/dayProductQuality over quantity
DailyAuditorHealth check

This ensures:


Extending Barbossa

Custom Prompts

Override default prompts by creating files in prompts/:

Adding Repositories

Edit config/repositories.json:

{
  "repositories": [
    { "name": "app-1", "url": "https://github.com/you/app-1.git" },
    { "name": "app-2", "url": "https://github.com/you/app-2.git" }
  ]
}

Restart the container to apply changes.

Linear Integration

See Configuration for Linear setup.