Skip to content

Commit d0eb8c8

Browse files
committed
v2.0.2: fix contract bugs, trim bloat, soften overclaims
Contract fixes: - Implementer no longer claims "only agent that modifies code" - Debugger autonomous mode scoped: approval gates still apply - Lessons format adds Agent field for filtering - Rename AGENTS_CONTRACT → BLACKBOX_CONTRACT Claims fixes (via fabric analyze_claims): - "Constant velocity" → "Sustained velocity" - Broaden attribution: Steenberg + Parnas (1972) - Strip "autonomous" from top-level descriptions Repo cleanup: - Delete enhanced/ (orphaned pre-agent prompts) - Delete docs/legacy/ (deprecated commands/skills) - Consolidate 4 redundant doc files into AGENTS.md - Restore README.md, add CLAUDE.md - Bump agent.json to v2.0.2
1 parent 2ce5e5a commit d0eb8c8

31 files changed

+145
-6706
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# CHANGELOG — Black Box Architecture Agents
22

3+
## v2.0.2 — 2026-03-20
4+
5+
### Contract fixes and repo cleanup
6+
7+
| What | Why |
8+
|---|---|
9+
| Fixed implementer claiming "only agent that modifies code" | Debugger also has write access — claim was false |
10+
| Clarified debugger autonomous mode scope | Approval gates (Rule 5) still apply during autonomous fixes — tension was unresolved |
11+
| Added `Agent` field to lessons.md format (Rule 10) | Needed for filtering lessons by agent at session start |
12+
| Bumped agent.json version to 2.0.2 | Was stuck at 2.0.0 despite v2.0.1 changes |
13+
| Deleted `enhanced/` directory | Orphaned pre-agent prompts, no agent referenced them |
14+
| Deleted `docs/legacy/` directory | Commands/skills marked "not recommended" — removed rather than maintaining dead code |
15+
| Consolidated docs: removed WORKFLOWS.md, USAGE.md, INSTALLATION.md, INTEGRATION_EXAMPLES.md | Same 5 workflows described in 4+ files. AGENTS.md is the single source now |
16+
| Restored README.md | Entry point for GitHub visitors was missing |
17+
| Stripped legacy references from AGENTS.md, CONTRIBUTING.md | Removed references to deleted files/directories |
18+
19+
---
20+
321
## v2.0.1 — 2026-02-25
422

523
### Post-review fixes
@@ -36,7 +54,7 @@
3654

3755
---
3856

39-
### 📝 AGENTS_CONTRACT.md
57+
### 📝 BLACKBOX_CONTRACT.md
4058

4159
| What changed | Why |
4260
|---|---|

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## What This Project Is
6+
7+
Black Box Architecture Agents — a system of five coordinated AI agents that help developers maintain and improve software architecture following black-box design principles (Eskil Steenberg's philosophy). This is a **documentation-only project** (no executables, no build system).
8+
9+
## Architecture
10+
11+
```
12+
User Request → arch-orchestrator (Opus, entry point)
13+
├→ arch-analyzer (Sonnet, read-only, maps boundaries/violations)
14+
├→ arch-planner (Opus, read-only, designs modules/roadmaps)
15+
├→ arch-implementer (Sonnet, write access, executes plans)
16+
└→ arch-debugger (Sonnet, write access, isolates/fixes bugs)
17+
```
18+
19+
All agents are governed by `agents/BLACKBOX_CONTRACT.md` (13 global rules). The orchestrator classifies requests and delegates via HANDOFF packets.
20+
21+
**Workflows**: Analysis only | Planning only | Full refactoring (analyze → plan → approve → implement) | Debug & fix | Complete transformation (all agents)
22+
23+
## Key Directories
24+
25+
- `agents/` — Agent specs + `agent.json` registry + `BLACKBOX_CONTRACT.md` shared rules
26+
- `docs/` — AGENTS (system guide), PRINCIPLES (philosophy), EXAMPLES (code), CONTRIBUTING
27+
- `examples/` — Multi-language before/after examples (Python, TypeScript, Go, Rust, PHP, C)
28+
- `tasks/` — Persistent session state: `lessons.md` (self-improvement) + `todo.md` (tracking)
29+
30+
## Critical Conventions
31+
32+
- **Scope discipline**: Touch only what's required. List nearby issues as POTENTIAL FOLLOW-UPS.
33+
- **Approval gates (⛔)**: Hard stops before adding deps, changing APIs/schemas, deleting code, widening permissions.
34+
- **Evidence minimums**: ≥3 file:line references per architectural claim.
35+
- **Commit discipline**: `git add -u` (never `-A`), checkpoint before non-trivial work, atomic commits per changeset.
36+
- **Self-improvement loop**: After corrections, update `tasks/lessons.md` with mistake → rule → agent → date.
37+
- **Session start**: Agents read `tasks/lessons.md` first to apply past learnings.
38+
39+
## Installation (into target projects)
40+
41+
```bash
42+
mkdir -p .claude/agents
43+
cp -r agents/* .claude/agents/
44+
```
45+
46+
## No Build/Test/Lint
47+
48+
Pure documentation project. No commands to run. Validate by reading agent specs and ensuring contract compliance.

README.md

Lines changed: 37 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,61 @@
1-
# Black Box Architecture
1+
# Black Box Architecture Agents
22

3-
> Transform any codebase into modular, maintainable "black boxes".
3+
AI agents for maintaining and improving software architecture using black-box design principles — inspired by [Eskil Steenberg's lecture](https://www.youtube.com/watch?v=sSpULGNHyoI) and rooted in information hiding (Parnas, 1972).
44

5-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6-
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](docs/CONTRIBUTING.md)
5+
Five coordinated specialists — analyze, plan, implement, debug — governed by a shared contract that enforces scope discipline, evidence minimums, approval gates, and a self-improvement loop.
76

8-
AI agents for **Claude Code** that enforce replaceable, modular architecture with built-in approval gates, commit discipline, and a self-improvement loop.
9-
10-
## What This Is
11-
12-
Five coordinated agents that apply [Eskil Steenberg's](https://www.youtube.com/watch?v=sSpULGNHyoI) battle-tested principles:
13-
14-
- **Black box interfaces** - Clean APIs between modules
15-
- **Replaceable components** - If you can't understand it, rewrite it
16-
- **Constant velocity** - Write 5 lines today vs. edit 1 line later
17-
- **Single responsibility** - One module, one person
18-
19-
## Quick Start
7+
## Quick Install
208

219
```bash
22-
# Clone the repository
2310
git clone https://github.com/gl0bal01/black-box-architecture.git
2411

25-
# Install agents + task files for your project
12+
# Project-specific
2613
mkdir -p .claude/agents
2714
cp -r black-box-architecture/agents/* .claude/agents/
28-
mkdir -p tasks
29-
cp -r black-box-architecture/tasks/* tasks/
15+
16+
# Or personal (all projects)
17+
cp -r black-box-architecture/agents/* ~/.claude/agents/
3018
```
3119

3220
## Agents
3321

34-
The agent system follows black box principles itself — specialized agents with clear responsibilities:
35-
36-
| Agent | Role | Model | What it does |
22+
| Agent | Role | Model | Writes Code |
3723
|-------|------|-------|-------------|
38-
| **arch-orchestrator** | Entry point | Opus | Classifies requests, delegates, enforces approval gates, emits PASS/CONCERNS/FAIL/BLOCKED verdict |
39-
| **arch-analyzer** | Analysis | Sonnet | Maps module boundaries, coupling, violations. Read-only. Min 3 `file:line` per claim |
40-
| **arch-planner** | Design | Opus | Designs boundaries, interfaces, phased roadmaps. Simplicity check on non-trivial designs |
41-
| **arch-implementer** | Implementation | Sonnet | Executes approved plans. Atomic commits per changeset. Only agent that modifies code |
42-
| **arch-debugger** | Debugging | Sonnet | Isolates bugs to contract boundaries. Autonomous mode — just fix it. Captures lessons |
43-
44-
### Workflows
45-
46-
| Request | Flow |
47-
|---------|------|
48-
| Analysis only | Analyzer → synthesize |
49-
| Plan only | Planner → request approval |
50-
| Implement approved plan | Implementer |
51-
| Debug | Debugger → optionally Analyzer if architecture unclear |
52-
| Refactor toward black-box | Analyzer → Planner → **APPROVAL** → Implementer |
53-
| New feature | Planner → **APPROVAL** → Implementer |
54-
55-
## What's New in v2.0
56-
57-
- **Self-improvement loop** — agents review `tasks/lessons.md` at session start, update it after corrections. Mistakes don't repeat across sessions
58-
- **Task tracking** — persistent progress in `tasks/todo.md`. Resume work after interruptions
59-
- **Commit discipline**`git add -u` before and after each changeset. Atomic, bisectable history. Never `git add -A`
60-
- **Goal-backward verification** — SUCCESS CRITERIA MET WHEN defines what done looks like, separate from HOW TO VERIFY
61-
- **Quality gate verdicts** — PASS / CONCERNS / FAIL / BLOCKED instead of silent self-assessed checklists
62-
- **Approval gates** — hard stops for deps, public API, schema, deletions, permission widening
63-
- **Session start checklists** — every agent loads lessons and context before working
64-
- **Debugger autonomous mode** — given a bug report, just fix it. Escalate only when genuinely blocked
65-
66-
See [CHANGELOG.md](CHANGELOG.md) for full details.
67-
68-
## Best Daily Workflow
69-
70-
1. Use `arch-orchestrator` for most tasks — it picks the right workflow
71-
2. Concise output by default (5-12 lines). Full reports only when needed
72-
3. Approve any dependency, public API, or schema changes explicitly
73-
4. Check `tasks/lessons.md` periodically — it captures what the agents learned
74-
75-
## How It Works
76-
77-
- A [shared contract](agents/AGENTS_CONTRACT.md) governs all agent behavior (13 rules)
78-
- Agents default to concise outputs and switch to full reports when warranted
79-
- Approval gates prevent risky changes without explicit sign-off
80-
- Every architectural claim requires min 3 `file:line` evidence points
81-
- Agents commit before and after each changeset for safe rollback
82-
- Corrections are captured in `tasks/lessons.md` and reviewed next session
83-
84-
## Core Philosophy
85-
86-
**"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."**
87-
— Eskil Steenberg
88-
89-
1. **Primitive-First Design** - Identify core data types that flow through your system
90-
2. **Black Box Boundaries** - Modules communicate only through documented interfaces
91-
3. **Replaceable Components** - Any module can be rewritten using only its interface
92-
4. **Single Responsibility** - One module = one person can own it
93-
5. **Wrap Dependencies** - Never depend directly on code you don't control
94-
95-
## Documentation
96-
97-
- **[Agent System Guide](docs/AGENTS.md)** - Complete agent documentation
98-
- **[Workflows Guide](docs/WORKFLOWS.md)** - Step-by-step examples for each agent
99-
- **[Integration Examples](docs/INTEGRATION_EXAMPLES.md)** - How agents coordinate
100-
- **[Principles Guide](docs/PRINCIPLES.md)** - Eskil Steenberg's methodology explained
101-
- **[Code Examples](docs/EXAMPLES.md)** - Before/after transformations in multiple languages
102-
- **[Agent Specifications](agents/agent.json)** - Technical specs and policies
103-
- **[Contributing Guide](docs/CONTRIBUTING.md)** - How to contribute
24+
| **arch-orchestrator** | Entry point. Classifies, delegates, synthesizes. | Opus | No |
25+
| **arch-analyzer** | Maps module boundaries, coupling, violations. | Sonnet | No |
26+
| **arch-planner** | Designs modules, interfaces, migration roadmaps. | Opus | No |
27+
| **arch-implementer** | Executes approved plans with commit discipline. | Sonnet | Yes (requires approval) |
28+
| **arch-debugger** | Isolates bugs to contract boundaries, fixes autonomously. | Sonnet | Yes (approval gates apply) |
10429

105-
## Real-World Examples
30+
All agents follow `agents/BLACKBOX_CONTRACT.md` — 13 rules covering scope discipline, evidence requirements, approval gates, commit checkpoints, and self-improvement.
10631

107-
See [`examples/`](examples/) for complete before/after refactoring examples in Python, TypeScript, Go, Rust, C, and PHP.
32+
## Usage
10833

109-
## Legacy Prompts
110-
111-
Skills and commands in `docs/legacy/` are kept for compatibility but are no longer the recommended path. Use agents instead.
34+
```
35+
"Ask arch-orchestrator to analyze UserService and propose black-box boundaries"
36+
"Ask arch-analyzer to find coupling issues in src/services/"
37+
"Ask arch-planner to design a payment processing module"
38+
"Ask arch-implementer to execute the approved refactoring plan"
39+
"Ask arch-debugger to isolate and fix the checkout bug"
40+
```
11241

113-
## Related Resources
42+
## Workflows
11443

115-
- [Eskil Steenberg: Architecting LARGE Software Projects](https://www.youtube.com/watch?v=sSpULGNHyoI) - The foundation of everything here
44+
| Workflow | Agents | Approval Gate |
45+
|----------|--------|---------------|
46+
| Analysis only | Analyzer ||
47+
| Planning only | Planner ||
48+
| Full refactoring | Analyzer → Planner → Implementer | After plan, before implementation |
49+
| Debug & fix | Debugger → (Implementer) | Before non-trivial fixes |
50+
| Complete transformation | All agents in sequence | After plan + between phases |
11651

117-
## Contributing
52+
## Documentation
11853

119-
Contributions welcome! See [CONTRIBUTING.md](docs/CONTRIBUTING.md).
54+
- [Agent System Guide](docs/AGENTS.md) — Architecture, agents, workflows, troubleshooting
55+
- [Black Box Principles](docs/PRINCIPLES.md) — Design philosophy (Steenberg, Parnas)
56+
- [Code Examples](docs/EXAMPLES.md) — Before/after refactorings in 6 languages
57+
- [Contributing](docs/CONTRIBUTING.md) — How to contribute
12058

12159
## License
12260

123-
MIT License - see [LICENSE](LICENSE) for details.
124-
125-
---
61+
MIT
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Shared rules for all agents. Individual agent files contain only role-specific b
77

88
## Operating Goals
99

10-
- **Constant velocity**: make changes that stay easy to edit tomorrow
10+
- **Sustained velocity**: make changes that stay easy to edit tomorrow
1111
- **Smallest correct change**: surgical diffs over "cleanup"
1212
- **Reviewability**: optimize for a human reviewing side-by-side in an IDE
1313
- **Staff engineer bar**: before submitting, ask "would a staff engineer approve this?"
@@ -116,6 +116,7 @@ Format:
116116
## Lesson: [short title]
117117
**Mistake**: what went wrong
118118
**Rule**: what to do instead
119+
**Agent**: which agent this applies to (or "all")
119120
**Date**: YYYY-MM-DD
120121
```
121122

agents/agent.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "black-box-architecture-agents",
3-
"version": "2.0.0",
4-
"description": "Specialized agents for autonomous architectural work. Coordinated system for analysis, planning, implementation, and debugging with self-improvement loop and approval gates.",
3+
"version": "2.0.2",
4+
"description": "Specialized agents for architectural work with human-in-the-loop approval gates. Coordinated system for analysis, planning, implementation, and debugging with self-improvement loop.",
55
"author": "gl0bal01",
66
"license": "MIT",
77
"keywords": [
@@ -68,7 +68,7 @@
6868
},
6969
"implementer": {
7070
"name": "Architecture Implementer",
71-
"description": "Executes approved plans with commit checkpoints and scope discipline.",
71+
"description": "Primary agent for planned code changes. Executes approved plans with commit checkpoints and scope discipline.",
7272
"file": "arch-implementer.md",
7373
"role": "implementation",
7474
"model": "sonnet",
@@ -90,7 +90,7 @@
9090
"can_modify_code": true,
9191
"can_delegate": false,
9292
"may_request_agent": "implementer",
93-
"autonomous_mode": true,
93+
"autonomous_mode": "internal module logic only; approval gates still apply",
9494
"writes_to": "tasks/lessons.md"
9595
}
9696
}
@@ -123,7 +123,7 @@
123123
}
124124
},
125125
"files": {
126-
"contract": "AGENTS_CONTRACT.md",
126+
"contract": "BLACKBOX_CONTRACT.md",
127127
"lessons": "tasks/lessons.md",
128128
"todo": "tasks/todo.md"
129129
},

agents/arch-analyzer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ model: sonnet
99

1010
**Role**: Explore a codebase to map module boundaries, coupling, and black-box violations.
1111

12-
Follows `AGENTS_CONTRACT.md`. Read-only — never modifies code.
12+
Follows `BLACKBOX_CONTRACT.md`. Read-only — never modifies code.
1313

1414
---
1515

@@ -70,4 +70,4 @@ Follows `AGENTS_CONTRACT.md`. Read-only — never modifies code.
7070
**NEXT**
7171
- proceed to Planner? remaining questions?
7272

73-
(Full report only if requested: Appendix A in `AGENTS_CONTRACT.md`)
73+
(Full report only if requested: Appendix A in `BLACKBOX_CONTRACT.md`)

agents/arch-debugger.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ model: sonnet
99

1010
**Role**: Isolate bugs to module/contract boundaries, produce minimal repro, fix without breaking boundaries.
1111

12-
Follows `AGENTS_CONTRACT.md`.
12+
Follows `BLACKBOX_CONTRACT.md`.
1313

1414
---
1515

@@ -69,6 +69,10 @@ When given a bug report: just fix it.
6969
- Fix failing CI tests without being told how
7070
- Only escalate when genuinely blocked (ambiguous contract, approval gate hit)
7171

72+
**Scope of autonomy**: Debugger may freely fix internal module logic.
73+
Contract approval gates (Rule 5) still apply — stop and ask before:
74+
adding deps, changing public APIs, changing schemas, deleting code beyond the fix, or widening permissions.
75+
7276
---
7377

7478
## Output (concise default)
@@ -94,4 +98,4 @@ When given a bug report: just fix it.
9498
**LESSON CAPTURED**
9599
- entry added to `tasks/lessons.md`
96100

97-
(Full report only if requested: Appendix D in `AGENTS_CONTRACT.md`)
101+
(Full report only if requested: Appendix D in `BLACKBOX_CONTRACT.md`)

agents/arch-implementer.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ model: sonnet
99

1010
**Role**: Execute approved plans via small, verifiable changes that preserve black-box boundaries.
1111

12-
Follows `AGENTS_CONTRACT.md`. Only agent that modifies code — requires prior approval.
12+
Follows `BLACKBOX_CONTRACT.md`. Primary agent for planned code changes — requires prior approval.
13+
(Debugger also has write access for autonomous bug fixes.)
1314

1415
---
1516

@@ -92,4 +93,4 @@ Never proceed without explicit approval for:
9293
**BLOCKED** (only if needed)
9394
- exact questions + info required
9495

95-
(Full report only if requested: Appendix C in `AGENTS_CONTRACT.md`)
96+
(Full report only if requested: Appendix C in `BLACKBOX_CONTRACT.md`)

agents/arch-orchestrator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ model: opus
99

1010
**Role**: Coordinate architectural work. Entry point for all black-box architecture requests.
1111

12-
Follows `AGENTS_CONTRACT.md` (shared rules). Contract wins on conflicts.
12+
Follows `BLACKBOX_CONTRACT.md` (shared rules). Contract wins on conflicts.
1313

1414
---
1515

agents/arch-planner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ model: opus
99

1010
**Role**: Design black-box module boundaries and implementation roadmap.
1111

12-
Follows `AGENTS_CONTRACT.md`. Read-only — never modifies code.
12+
Follows `BLACKBOX_CONTRACT.md`. Read-only — never modifies code.
1313

1414
---
1515

@@ -80,4 +80,4 @@ For each module:
8080
- **POTENTIAL CONCERNS**
8181
- **NEXT** (approval request + first implementation step)
8282

83-
(Full plan only if requested: Appendix B in `AGENTS_CONTRACT.md`)
83+
(Full plan only if requested: Appendix B in `BLACKBOX_CONTRACT.md`)

0 commit comments

Comments
 (0)