Add complete Schreibwerkstatt BMAD module

- 7 specialized agents (Dramaturg, Autor, Lektor, Figurenprüfer, Kontinuitätsprüfer, Motivjäger, Stilprüfer)
- Bibel-System (Single Source of Truth)
- State Management per chapter
- Review Pipeline with Human-in-the-Loop
- KI-Muster-Erkennung (Perplexity Gate)
- Export (EPUB, DOCX, Markdown)
- Setup scripts and templates
This commit is contained in:
Kenearos 2026-04-12 15:04:00 +02:00
parent 1f72c07758
commit 22298f1008
35 changed files with 2184 additions and 2 deletions

View file

@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""
Schreibwerkstatt Config Merger
Mergt die Modul-Konfiguration in die BMAD _config/config.yaml
"""
import sys
from pathlib import Path
def merge_config():
"""Mergt Schreibwerkstatt-Config in die BMAD-Konfiguration."""
project_root = Path.cwd()
config_file = project_root / "_config" / "config.yaml"
module_config = Path(__file__).parent.parent / "assets" / "module.yaml"
if not config_file.exists():
print("Keine BMAD _config/config.yaml gefunden — überspringe Merge")
return
if not module_config.exists():
print("Keine module.yaml gefunden")
sys.exit(1)
config_content = config_file.read_text(encoding="utf-8")
module_content = module_config.read_text(encoding="utf-8")
# Prüfe ob Schreibwerkstatt bereits konfiguriert ist
if "schreibwerkstatt" in config_content.lower() or "code: sw" in config_content:
print("Schreibwerkstatt bereits in Konfiguration vorhanden")
return
# Append module config
separator = "\n\n# === Schreibwerkstatt Module ===\n"
config_content += separator + module_content
config_file.write_text(config_content, encoding="utf-8")
print("Schreibwerkstatt-Konfiguration gemergt")
if __name__ == "__main__":
merge_config()

View file

@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""
Schreibwerkstatt Help CSV Merger
Mergt die module-help.csv in die BMAD help.csv
"""
import csv
import sys
from pathlib import Path
def merge_help():
"""Mergt Schreibwerkstatt-Hilfe in die BMAD help.csv."""
project_root = Path.cwd()
bmad_help = project_root / "_config" / "help.csv"
module_help = Path(__file__).parent.parent / "assets" / "module-help.csv"
if not module_help.exists():
print("Keine module-help.csv gefunden")
sys.exit(1)
# Lese Modul-Einträge
with open(module_help, "r", encoding="utf-8") as f:
reader = csv.reader(f)
header = next(reader)
module_rows = list(reader)
if not bmad_help.exists():
# Keine BMAD help.csv — erstelle neue
bmad_help.parent.mkdir(parents=True, exist_ok=True)
with open(bmad_help, "w", encoding="utf-8", newline="") as f:
writer = csv.writer(f)
writer.writerow(header)
writer.writerows(module_rows)
print(f"Help CSV erstellt mit {len(module_rows)} Einträgen")
return
# Lese bestehende Einträge
with open(bmad_help, "r", encoding="utf-8") as f:
reader = csv.reader(f)
existing_header = next(reader)
existing_rows = list(reader)
# Prüfe auf Duplikate (nach canonicalId)
existing_ids = {row[0] for row in existing_rows if row}
new_rows = [row for row in module_rows if row and row[0] not in existing_ids]
if not new_rows:
print("Alle Schreibwerkstatt-Einträge bereits vorhanden")
return
# Append neue Einträge
with open(bmad_help, "a", encoding="utf-8", newline="") as f:
writer = csv.writer(f)
writer.writerows(new_rows)
print(f"{len(new_rows)} neue Einträge hinzugefügt")
if __name__ == "__main__":
merge_help()