Worktree 격리 크로스 모델 에이전트 오케스트레이션
블라인드 분기 검증 및 자동 학습 시스템
curl -fsSL https://raw.githubusercontent.com/project820/be-my-butler/main/install.sh | bash
모든 아키텍처 결정은 이 양보 불가 원칙에 기반합니다.
git worktree를 사용합니다. 공유 상태 없음. index.lock 충돌 없음. 진정한 파일시스템 수준 격리..bmb/와 CLAUDE.md만 읽습니다. 코드를 직접 수정하지 않습니다. 컨텍스트 보호가 최우선 — Lead가 병목입니다.session-prep.md가 다음 세션을 위한 상태를 캡처합니다. 세션 간 컨텍스트가 보존됩니다. 작업은 절대 소실되지 않습니다.council과 verify는 읽기 전용입니다. 더 이상 --full-auto를 남용하지 않습니다.9개의 전문 에이전트가 명확한 역할과 엄격한 경계를 가집니다. 브레인스토밍부터 프로덕션 준비 코드까지.
graph TB User["👤 User"] Lead["🎯 Lead
Opus · Orchestrator"] Consultant["💬 Consultant
Sonnet · Persistent"] Architect["📐 Architect
Opus · Council"] Executor["⚙️ Executor
Opus · Backend"] Frontend["🎨 Frontend
Opus · UI"] Tester["🧪 Tester
Opus · Blind"] Verifier["✅ Verifier
Opus · Blind"] Simplifier["🧹 Simplifier
Opus · Cleanup"] Writer["📝 Writer
Sonnet · Docs"] BMB[".bmb/
Handoffs · Artifacts"] CrossModel["🌐 Cross-Model
Codex / Gemini"] User <-->|"brainstorm
approve"| Lead Lead <-->|"SendMessage
bidirectional"| Consultant Lead -->|"briefing"| Architect Architect <-->|"council
debate"| CrossModel Lead -->|"plan-to-exec"| Executor Lead -->|"plan-to-exec"| Frontend Lead -->|"test request"| Tester Tester -.->|"blind wall"| CrossModel Lead -->|"verify request"| Verifier Verifier -.->|"blind wall"| CrossModel Lead -->|"simplify"| Simplifier Lead -->|"write docs"| Writer Architect -->|"writes"| BMB Executor -->|"writes"| BMB Frontend -->|"writes"| BMB Tester -->|"writes"| BMB Verifier -->|"writes"| BMB Lead -->|"reads only"| BMB classDef opus fill:#1a1030,stroke:#7c3aed,stroke-width:2px,color:#a78bfa classDef sonnet fill:#0a2015,stroke:#16a34a,stroke-width:2px,color:#22c55e classDef cross fill:#1a1500,stroke:#d97706,stroke-width:2px,color:#f59e0b classDef user fill:#0a1628,stroke:#3b82f6,stroke-width:2px,color:#60a5fa classDef storage fill:#111827,stroke:#1e3a5f,stroke-width:2px,color:#8494a7 class Lead,Architect,Executor,Frontend,Tester,Verifier,Simplifier opus class Consultant,Writer sonnet class CrossModel cross class User user class BMB storage
.bmb/만 읽습니다. 코드를 직접 작성하지 않습니다. 씬 지휘자.analytics.db를 쿼리하고, Bird’s Law 심각도(critical/warn/info)로 이벤트를 분류하며, pattern_counts 프로모션 후보를 도출합니다.사용자 의도에서 프로덕션 준비 코드까지. 각 단계를 클릭하면 세부 정보를 볼 수 있습니다.
bmb_learn PRAISE. MODIFY → bmb_learn CORRECTION + 업데이트. NO → 취소.
bmb_learn MISTAKE + 사용자에게 에스컬레이션.
plan-to-exec.md를 읽습니다. Cross-Model Tester는 briefing.md를 읽습니다. 다른 프레이밍, 별도의 worktree, 별도의 타임아웃. 서로의 결과를 읽지 않습니다.
bmb_learn MISTAKE + 분류된 루프백 트리거.
bmb_learn MISTAKE + 되돌리기 + 원본으로 진행.
analytics.db를 쿼리합니다. Bird’s Law 심각도 (critical / warn / info)로 이벤트를 분류합니다. pattern_counts를 교차 참조하여 반복 실패 (≥2회 발생)를 찾아 CLAUDE.md 프로모션 대상을 식별합니다. analyst-report.md 작성 (3–5분 타임아웃; 타임아웃 시 파이프라인 계속).
bmb_learn PRAISE. 재발 ≥2 확인 → CLAUDE.md 프로모션 제안. Git 커밋/푸시. FTS5 인덱싱. 다음 세션을 위한 session-prep.md 생성.
flowchart TD S1["1. Setup
tmux, session, learnings"] S2["2. Brainstorm + Consultant
min 2 rounds"] S3{"3. User Approval"} S4["4. Architecture Council
2-4 debate rounds"] S5["5. Execution
worktree-isolated"] S55["5.5 Merge Worktrees"] S6["6. Blind Testing
divergent framing"] S7["7. Blind Verification
divergent framing"] S8{"8. Reconciliation"} S9["9. Simplify + Re-verify"] S10["10. Docs Update"] S105["10.5 Retrospective Analysis
Bird's Law severity"] S11["11. Cleanup + Session Prep"] S1 --> S2 S2 --> S3 S3 -->|"YES"| S4 S3 -->|"MODIFY"| S2 S3 -->|"NO"| CANCEL["Cancel"] S4 -->|"skip: bugfix/infra"| S5 S4 --> S5 subgraph parallel ["Parallel Worktrees"] direction LR EX["Executor"] FE["Frontend
if detected"] end S5 --> parallel parallel --> S55 S55 --> S6 S6 --> S7 S7 --> S8 S8 -->|"PASS"| S9 S8 -->|"IMPL fail"| S5 S8 -->|"ARCH fail"| S4 S8 -->|"REQ fail"| S2 S8 -->|"ENV fail"| S1 S8 -->|"TEST fail"| S6 S9 --> S10 S10 --> S105 S105 --> S11 classDef decision fill:#1a1500,stroke:#d97706,color:#f59e0b classDef cancel fill:#2a0a0a,stroke:#ef4444,color:#ef4444 classDef step fill:#111827,stroke:#1e3a5f,color:#e8edf5 classDef parallel fill:#0a1628,stroke:#3b82f6,color:#60a5fa classDef analyst fill:#0a2010,stroke:#22c55e,color:#4ade80 class S3,S8 decision class CANCEL cancel class S1,S2,S4,S5,S55,S6,S7,S9,S10,S11 step class EX,FE parallel class S105 analyst
.bmb/ 디렉토리를 통해 에이전트 간에 아티팩트가 어떻게 흐르는지. Lead는 코드를 절대 건드리지 않으며 — 요약만 읽습니다.
flowchart LR User["👤 User"] Lead["🎯 Lead"] Brief["📋 briefing.md"] Arch["📐 Architect"] Plan["📄 plan-to-exec.md"] ExFe["⚙️ Executor
🎨 Frontend"] Merge["🔀 Merge"] Test["🧪 Tester
blind"] Verify["✅ Verifier
blind"] Recon["⚖️ Reconcile"] Simp["🧹 Simplifier"] Write["📝 Writer"] Output["✨ Output"] User -->|"intent"| Lead Lead -->|"brainstorm"| Brief Brief -->|"briefing"| Arch Arch -->|"council"| Plan Plan -->|"instructions"| ExFe ExFe -->|"worktrees"| Merge Merge -->|"merged code"| Test Merge -->|"merged code"| Verify Test -->|"test-summary"| Recon Verify -->|"verify-summary"| Recon Recon -->|"PASS"| Simp Simp -->|"cleaned"| Write Write --> Output classDef artifact fill:#1a2234,stroke:#3b82f6,color:#60a5fa classDef agent fill:#111827,stroke:#1e3a5f,color:#e8edf5 class Brief,Plan artifact class User,Lead,Arch,ExFe,Merge,Test,Verify,Recon,Simp,Write,Output agent
gantt
title Consultant Monitoring (Steps 2–11)
dateFormat X
axisFormat %s
section Brainstorm
Bidirectional with Lead :active, 0, 2
section Approval
Monitor user decision :1, 3
section Council
Observe debate rounds :2, 4
section Execution
Track progress via feed file :3, 6
section Testing
Monitor blind test results :5, 7
section Verification
Monitor blind verify results :6, 8
section Reconciliation
Observe failure classification :7, 9
section Simplify
Track re-verify outcome :8, 10
section Docs
Validate doc consistency :9, 11
section Cleanup
Final session summary :10, 12
결과에 대한 블라인드뿐만 아니라 — 문제 프레이밍 자체가 분기됩니다. 워크스페이스 수준의 블라인드 크로스 모델 검증.
모든 병렬 에이전트는 자체 git worktree를 사용합니다. 공유 상태 없음, index.lock 충돌 없음, 진정한 파일시스템 격리.
gantt
title Worktree Lifecycle per Pipeline Run
dateFormat X
axisFormat Step %s
section Executor
Create worktree :e1, 4, 5
Work in worktree :e2, 5, 6
Merge to main :crit, e3, 6, 7
section Frontend
Create worktree :f1, 4, 5
Work in worktree :f2, 5, 6
Merge to main :crit, f3, 6, 7
section Tester-Claude
Create worktree :tc1, 6, 7
Run tests :tc2, 7, 8
Cleanup :tc3, 8, 9
section Tester-Cross
Create worktree :tx1, 6, 7
Run tests :tx2, 7, 8
Cleanup :tx3, 8, 9
section Verifier-Claude
Create worktree :vc1, 7, 8
Verify :vc2, 8, 9
Cleanup :vc3, 9, 10
section Verifier-Cross
Create worktree :vx1, 7, 8
Verify :vx2, 8, 9
Cleanup :vx3, 9, 10
Council 토론은 Claude ↔ Codex/Gemini 파일 교환을 사용합니다. 프로필 기반 권한으로 필요한 곳에서 읽기 전용을 유지합니다.
sequenceDiagram participant A as Architect
(Claude Opus) participant F as Council Files
(.bmb/council/) participant X as Cross-Model
(Codex / Gemini) Note over A,X: Round 1 — Initial Proposals A->>F: Write claude-proposal.md X->>F: Write cross-proposal.md Note over A,X: Round 2 — Critique A->>F: Read cross-proposal.md A->>F: Write claude-critique.md X->>F: Read claude-proposal.md X->>F: Write cross-critique.md Note over A,X: Round 3 — Synthesis (optional) A->>F: Read cross-critique.md A->>F: Write claude-synthesis.md X->>F: Read claude-critique.md X->>F: Write cross-synthesis.md Note over A,X: Round 4 — Final Decision A->>F: Read all files A->>F: Write plan-to-exec.md ✅ Note right of X: Cross-Model uses
--profile read-only
council과 verify 프로필: 크로스 모델은 코드를 읽고 .bmb/에만 쓸 수 있습니다. 프로덕션 쓰기 불가.test와 exec-assist 프로필: 크로스 모델은 worktree 범위 내에서 테스트 및 헬퍼 코드를 작성할 수 있습니다.bmb-config.sh로 설정 가능. 독립적인 데드라인 추적.Lead의 컨텍스트 윈도우는 공유 자원입니다. 세 개의 레이어가 50% 용량을 초과하지 않도록 보장합니다.
.compressed/*.summary.md만 읽습니다 (최대 300 토큰). 원본 아티팩트는 분쟁 시에만 접근합니다..tool-cache/에 캐시합니다. 요약만 유지: "Modified: auth.ts (47 lines)", "PASS: 12, FAIL: 0".실수, 수정, 성공이 자동으로 기록됩니다. 과거의 함정이 모든 프로젝트의 향후 세션에 주입됩니다.
.bmb/learnings.md — 학습 항목 한 줄, 시간순 추가. 이 프로젝트의 Step 1에서 로드됩니다.~/.claude/bmb-system/learnings-global.md — 동일 형식 + [project_name] 태그. 모든 BMB 프로젝트에서 공유됩니다.6가지 작업 유형, 각각 최적화된 파이프라인 경로를 가집니다. 레시피에 관계없이 Consultant는 항상 존재합니다.
4개의 슬래시 명령어가 다양한 규모에서 BMB 기능을 제공합니다 — 전체 파이프라인부터 집중 브레인스토밍까지.
flowchart LR
Setup["/BMB-setup\n⚙️ Config"]
BMB["/BMB\n🔧 Full Pipeline"]
Brainstorm["/BMB-brainstorm\n💡 Ideation"]
Refactoring["/BMB-refactoring\n🔄 Code Quality"]
Setup -->|"prerequisite"| BMB
Setup -->|"prerequisite"| Brainstorm
Setup -->|"prerequisite"| Refactoring
Brainstorm -.->|"feeds into"| BMB
Refactoring -.->|"standalone"| BMB
style Setup fill:#111827,stroke:#22c55e,color:#e8edf5
style BMB fill:#111827,stroke:#3b82f6,color:#e8edf5,stroke-width:3px
style Brainstorm fill:#111827,stroke:#22d3ee,color:#e8edf5
style Refactoring fill:#111827,stroke:#a78bfa,color:#e8edf5
| 단계 | /BMB | /BMB-brainstorm | /BMB-refactoring |
|---|---|---|---|
| 설정 / 구성 | ✓ | ✓ | — |
| Consultant 세션 | ✓ | ✓ | — |
| 브레인스토밍 / 분석 | ✓ | ✓ | ✓ 병렬 |
| Council 토론 | ✓ | — | ✓ 종합 |
| 아키텍처 계획 | ✓ | — | — |
| 실행 (Worktree) | ✓ | — | ✓ |
| 테스팅 | ✓ | — | — |
| 검증 (블라인드) | ✓ | — | ✓ 리뷰 |
| 수정 사이클 | ✓ | — | ✓ |
| 간소화 | ✓ | — | — |
| 병합 / 정리 | ✓ | ✓ 요약 | ✓ |
파이프라인은 절대 차단되지 않습니다. 모든 실패 모드에는 정의된 폴백이 있습니다.
| 시나리오 | 동작 |
|---|---|
| 크로스 모델 사용 불가 (council) | 단독 설계 (Claude 전용), 세션 로그에 기록 |
| 크로스 모델 사용 불가 (테스팅) | Claude 전용 테스트 결과, 조정에 기록 |
| 크로스 모델 사용 불가 (검증) | Claude 전용 검증, 조정에 기록 |
| Claude 테스터 타임아웃 | 타임아웃 로깅, 크로스 모델 결과로 계속 |
| 크로스 모델 타임아웃 | Claude 전용 결과로 진행 |
| 병합 충돌 | bmb_learn MISTAKE + 사용자에게 에스컬레이션 |
| Simplifier가 테스트 깨뜨림 | bmb_learn MISTAKE + 되돌리기 + 원본으로 진행 |
| Telegram 환경변수 미설정 | 알림 조용히 건너뜀 |
| knowledge.db 없음 | 인덱싱/검색 건너뜀 |
| 프론트엔드 미감지 | Frontend 에이전트 건너뜀, Executor만 사용 |
.bmb/ 디렉토리는 모든 파이프라인 아티팩트의 단일 진실 소스입니다.