Transform any codebase into modular, maintainable "black boxes".
AI agents for Claude Code that enforce replaceable, modular architecture with built-in approval gates, commit discipline, and a self-improvement loop.
Five coordinated agents that apply Eskil Steenberg's battle-tested principles:
- Black box interfaces - Clean APIs between modules
- Replaceable components - If you can't understand it, rewrite it
- Constant velocity - Write 5 lines today vs. edit 1 line later
- Single responsibility - One module, one person
# Clone the repository
git clone https://github.com/gl0bal01/black-box-architecture.git
# Install agents + task files for your project
mkdir -p .claude/agents
cp -r black-box-architecture/agents/* .claude/agents/
mkdir -p tasks
cp -r black-box-architecture/tasks/* tasks/The agent system follows black box principles itself — specialized agents with clear responsibilities:
| Agent | Role | Model | What it does |
|---|---|---|---|
| arch-orchestrator | Entry point | Opus | Classifies requests, delegates, enforces approval gates, emits PASS/CONCERNS/FAIL/BLOCKED verdict |
| arch-analyzer | Analysis | Sonnet | Maps module boundaries, coupling, violations. Read-only. Min 3 file:line per claim |
| arch-planner | Design | Opus | Designs boundaries, interfaces, phased roadmaps. Simplicity check on non-trivial designs |
| arch-implementer | Implementation | Sonnet | Executes approved plans. Atomic commits per changeset. Only agent that modifies code |
| arch-debugger | Debugging | Sonnet | Isolates bugs to contract boundaries. Autonomous mode — just fix it. Captures lessons |
| Request | Flow |
|---|---|
| Analysis only | Analyzer → synthesize |
| Plan only | Planner → request approval |
| Implement approved plan | Implementer |
| Debug | Debugger → optionally Analyzer if architecture unclear |
| Refactor toward black-box | Analyzer → Planner → APPROVAL → Implementer |
| New feature | Planner → APPROVAL → Implementer |
- Self-improvement loop — agents review
tasks/lessons.mdat session start, update it after corrections. Mistakes don't repeat across sessions - Task tracking — persistent progress in
tasks/todo.md. Resume work after interruptions - Commit discipline —
git add -ubefore and after each changeset. Atomic, bisectable history. Nevergit add -A - Goal-backward verification — SUCCESS CRITERIA MET WHEN defines what done looks like, separate from HOW TO VERIFY
- Quality gate verdicts — PASS / CONCERNS / FAIL / BLOCKED instead of silent self-assessed checklists
- Approval gates — hard stops for deps, public API, schema, deletions, permission widening
- Session start checklists — every agent loads lessons and context before working
- Debugger autonomous mode — given a bug report, just fix it. Escalate only when genuinely blocked
See CHANGELOG.md for full details.
- Use
arch-orchestratorfor most tasks — it picks the right workflow - Concise output by default (5-12 lines). Full reports only when needed
- Approve any dependency, public API, or schema changes explicitly
- Check
tasks/lessons.mdperiodically — it captures what the agents learned
- A shared contract governs all agent behavior (13 rules)
- Agents default to concise outputs and switch to full reports when warranted
- Approval gates prevent risky changes without explicit sign-off
- Every architectural claim requires min 3
file:lineevidence points - Agents commit before and after each changeset for safe rollback
- Corrections are captured in
tasks/lessons.mdand reviewed next session
"It's faster to write 5 lines of code today than to write 1 line today and then have to edit it in the future." — Eskil Steenberg
- Primitive-First Design - Identify core data types that flow through your system
- Black Box Boundaries - Modules communicate only through documented interfaces
- Replaceable Components - Any module can be rewritten using only its interface
- Single Responsibility - One module = one person can own it
- Wrap Dependencies - Never depend directly on code you don't control
- Agent System Guide - Complete agent documentation
- Workflows Guide - Step-by-step examples for each agent
- Integration Examples - How agents coordinate
- Principles Guide - Eskil Steenberg's methodology explained
- Code Examples - Before/after transformations in multiple languages
- Agent Specifications - Technical specs and policies
- Contributing Guide - How to contribute
See examples/ for complete before/after refactoring examples in Python, TypeScript, Go, Rust, C, and PHP.
Skills and commands in docs/legacy/ are kept for compatibility but are no longer the recommended path. Use agents instead.
- Eskil Steenberg: Architecting LARGE Software Projects - The foundation of everything here
Contributions welcome! See CONTRIBUTING.md.
MIT License - see LICENSE for details.