--- inputDocuments: - _bmad-output/planning-artifacts/prd.md - _bmad-output/planning-artifacts/architecture.md - _bmad-output/planning-artifacts/ux-design.md - _bmad-output/planning-artifacts/epics.md - CLAUDE.md - README.md bmadSkill: 'Tech Writer Agent (Paige) β€” /bmad-agent-bmm-tech-writer β†’ [DP] Document Project' bmadWorkflow: '_bmad/bmm/workflows/document-project/workflow.yaml' --- # Projekt-Kontext: CouncilOS **Autor:** Paige (πŸ“š BMAD Tech Writer Agent) **Datum:** 2026-03-12 > Dieses Dokument ist die zentrale Referenz fΓΌr alle KI-Assistenten (Claude Code, Cursor, etc.) und Entwickler, die am Projekt arbeiten. --- ## Was ist CouncilOS? CouncilOS ist eine **visuelle No-Code-Plattform** fΓΌr **zyklische Multi-Agenten-KI-Pipelines**. Nutzer bauen per Drag & Drop einen β€žKI-Rat" aus spezialisierten Agenten, die in Schleifen zusammenarbeiten β€” bis ein Dokument die gewΓΌnschte QualitΓ€t erreicht. **Kern-USP:** Echte Zyklen (Aβ†’Bβ†’Aβ†’Bβ†’...) β€” kein lineares Abarbeiten. --- ## Projekt-Status | Phase | Beschreibung | Status | |-------|-------------|--------| | Phase 1 | LangGraph-Engine Backend | βœ… Abgeschlossen | | Phase 2 | Visueller Canvas Frontend | βœ… Abgeschlossen | | Phase 3 | Frontend-Backend-Integration | βœ… Abgeschlossen | | Phase 4 | Tools & God Mode | βœ… Abgeschlossen | **MVP vollstΓ€ndig implementiert.** 18 Stories, 125 Backend-Tests, 26 Frontend-Tests β€” alle grΓΌn. ### Wichtige Code-QualitΓ€ts-Entscheidungen (Code Review) | Datei | Γ„nderung | BegrΓΌndung | |-------|---------|------------| | `agents/critic_agent.py` | `_parse_critic_response` gibt `(score, feedback)` zurΓΌck β€” kein `verdict` | `APPROVAL_THRESHOLD`-Konstante ist einzige Quelle der Routing-Entscheidung | | `agents/critic_agent.py` | Safety-Valve schreibt keine `feedback_history` beim Auto-Approve | Konsistenz mit normalem Approve-Pfad | | `services/dynamic_graph_builder.py` | `create_web_search_tool()` / `create_pdf_search_tool()` Factory-Pattern | Tools nur binden wenn API-Key konfiguriert | --- ## Verzeichnis-Struktur ``` KI-Konzil/ β”œβ”€β”€ README.md # Deutsches PRD (informell, Original) β”œβ”€β”€ CLAUDE.md # Konventionen fΓΌr KI-Assistenten β”œβ”€β”€ .env.example # Umgebungsvariablen-Template β”œβ”€β”€ docker-compose.yml # Lokale Entwicklungsumgebung β”‚ β”œβ”€β”€ _bmad/ # BMAD-METHOD Framework (v6) β”‚ β”œβ”€β”€ bmm/agents/ # Agent-Personas: pm, architect, dev, sm, qa, ... β”‚ β”œβ”€β”€ bmm/workflows/ # BMAD-Workflows: create-prd, create-architecture, ... β”‚ └── core/ # Core-Tasks und -Workflows β”‚ β”œβ”€β”€ _bmad-output/ # BMAD Skill Output Artifacts β”‚ β”œβ”€β”€ planning-artifacts/ β”‚ β”‚ β”œβ”€β”€ product-brief.md # [Analyst] Produkt-Brief β”‚ β”‚ β”œβ”€β”€ prd.md # [PM] Product Requirements Document β”‚ β”‚ β”œβ”€β”€ architecture.md # [Architect] Architektur-Entscheidungen β”‚ β”‚ β”œβ”€β”€ ux-design.md # [UX Designer] UI/UX Design β”‚ β”‚ β”œβ”€β”€ epics.md # [PM] Epics & Stories β”‚ β”‚ └── implementation-readiness.md # [Architect] Readiness-Check β”‚ └── implementation-artifacts/ β”‚ β”œβ”€β”€ sprint-status.yaml # [SM] Sprint-Status-Tracking β”‚ β”œβ”€β”€ qa-e2e-tests.md # [QA] E2E-Test-Manifest β”‚ └── stories/ # [SM] Individuelle Story-Dateien β”‚ β”œβ”€β”€ backend/ # FastAPI + LangGraph Backend (Python) β”‚ β”œβ”€β”€ main.py # FastAPI-Entrypoint β”‚ β”œβ”€β”€ state.py # CouncilState TypedDict + Konstanten β”‚ β”œβ”€β”€ database.py # Async SQLAlchemy Setup β”‚ β”œβ”€β”€ agents/ # master_agent, critic_agent, writer_agent β”‚ β”œβ”€β”€ api/ # REST-Routes + WebSocket + RunStore β”‚ β”œβ”€β”€ services/ # Graph-Builder, Blueprint-Service, Run-Service β”‚ β”œβ”€β”€ models/ # SQLAlchemy-Modelle β”‚ β”œβ”€β”€ tools/ # Tavily-Web-Suche, PyPDF+ChromaDB β”‚ └── tests/ # pytest-Tests (10 Dateien) β”‚ β”œβ”€β”€ frontend/ # Next.js + React Flow Frontend (TypeScript) β”‚ β”œβ”€β”€ app/ β”‚ β”‚ β”œβ”€β”€ rat-architekt/ # Tab A: Canvas-Builder β”‚ β”‚ β”œβ”€β”€ konferenzzimmer/ # Tab B: Execution-View β”‚ β”‚ β”œβ”€β”€ components/ # React Flow Nodes, Edges, Panels β”‚ β”‚ β”œβ”€β”€ store/ # Zustand State Management β”‚ β”‚ └── utils/ # blueprint-parser, api-client β”‚ └── __tests__/ # Vitest-Tests β”‚ └── docs/ # ZusΓ€tzliche Dokumentation └── test-coverage-analysis.md ``` --- ## Kerndatenstruktur: CouncilState ```python class CouncilState(TypedDict): input_topic: str # Nutzerprompt oder PDF-Inhalt current_draft: str # Aktuelles Dokument feedback_history: Annotated[List[str], operator.add] # APPEND-ONLY route_decision: str # "rework" | "approve" | custom messages: Annotated[list, operator.add] # APPEND-ONLY iteration_count: int # SchleifenzΓ€hler critic_score: Optional[float] # 0–10 run_id: str active_node: str ``` > **Wichtig:** `feedback_history` und `messages` werden **niemals ΓΌberschrieben** β€” nur angehΓ€ngt (`operator.add`-Reducer). --- ## Blueprint-JSON-Kanonisches Format ```json { "version": "1.0", "name": "Mein Rat", "nodes": [ { "id": "node-1", "type": "agent", "name": "Master KI", "system_prompt": "...", "model": "claude-3-5-sonnet-20241022", "tools": { "web_search": false, "pdf_reader": false } } ], "edges": [ { "id": "e-1", "source": "node-1", "target": "node-2", "type": "linear" }, { "id": "e-2", "source": "node-2", "target": "node-1", "type": "conditional", "condition": "rework" } ] } ``` --- ## API-Schnellreferenz | Endpoint | Methode | Beschreibung | |----------|---------|--------------| | `/api/health` | GET | Health-Check | | `/api/councils/` | POST | Blueprint erstellen | | `/api/councils/` | GET | Alle Blueprints | | `/api/councils/{id}` | GET/PUT/DELETE | Blueprint CRUD | | `/api/councils/run` | POST | Phase-1-Run (hartcodiert) | | `/api/councils/{id}/run` | POST | Blueprint-Run (dynamisch) | | `/api/councils/run/{id}` | GET | Run-Status/Ergebnis | | `/api/councils/run/{id}/approve` | POST | God Mode: Genehmigung | | `/api/councils/run/{id}/state` | GET | God Mode: State | | `/api/councils/upload-pdf` | POST | PDF-Upload | | `/api/runs/` | GET | Run-Verlauf | | `WS /ws/council/{id}` | WS | Live-Agent-Events | --- ## Schnellstart (Lokal) ```bash # 1. Umgebungsvariablen setzen cp .env.example .env # β†’ ANTHROPIC_API_KEY, OPENAI_API_KEY, TAVILY_API_KEY eintragen # 2. Alle Services starten docker compose up -d # 3. API testen curl http://localhost:8000/api/health # β†’ {"status": "ok", "service": "CouncilOS API"} # 4. Frontend ΓΆffnen open http://localhost:3000 ``` --- ## Konventionen (Zusammenfassung aus CLAUDE.md) | Bereich | Regel | |---------|-------| | Sprache (Code) | Englisch β€” Variablen, Funktionen, Commits | | Sprache (UI) | Deutsch | | Python-Style | PEP 8, Type Hints mandatory, ruff + black | | Tests | LLMs immer mocken (`@patch("agents.*.ChatAnthropic")`) | | Graph | Zyklen sind First-Class β€” niemals zu DAG vereinfachen | | State | Nur `CouncilState` β€” keine interne Agent-State | | Echtzeit | WebSocket fΓΌr Updates β€” kein Polling | | Human-in-Loop | Nur via LangGraph `interrupt_before` | --- ## BMAD Skill-Referenz | Skill | Kommando | Artefakt | |-------|---------|---------| | πŸ“Š Analyst (Mary) | `/bmad-agent-bmm-analyst` | `product-brief.md` | | πŸ“‹ PM (John) | `/bmad-agent-bmm-pm` | `prd.md`, `epics.md` | | 🎨 UX Designer | `/bmad-agent-bmm-ux-designer` | `ux-design.md` | | πŸ—οΈ Architect (Winston) | `/bmad-agent-bmm-architect` | `architecture.md`, `implementation-readiness.md` | | πŸƒ SM (Bob) | `/bmad-agent-bmm-sm` | `sprint-status.yaml`, `stories/*.md` | | πŸ’» Dev (Amelia) | `/bmad-agent-bmm-dev` | Story-Implementierung | | πŸ§ͺ QA (Quinn) | `/bmad-agent-bmm-qa` | `qa-e2e-tests.md` | | πŸ“š Tech Writer (Paige) | `/bmad-agent-bmm-tech-writer` | `project-context.md` (dieses Dokument) | | πŸ€– BMAD Master | `/bmad-agent-bmad-master` | Orchestrierung |