Erste Fassung: Claude-Werkzeuge aus dem Vault

.vault-tools (ohne trading-plattform-pruefung und watermarks-remover),
.claude/agents, .claude/skills, .claude/workflows, .claude/settings.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Pascal MichelandClaude Opus 5.5 committed 2026-10-14 11:27:59 +02:00
commit fa1c26b407
137 files changed
+43926

No files matched your search

@@ -0,0 +1,81 @@
"""Setzt eine Ersetzungsliste eines Planers in die Taskdateien ein, alles oder nichts.
Format je Abschnitt (siehe Auftrag an den Planer):
## Ersetzung N — Titel
Datei: <taskdatei>
Alt:
~~~~text
...
~~~~
Neu:
~~~~text
...
~~~~
Jeder Alt-Text muss zum Zeitpunkt seiner Ersetzung genau einmal in der Datei stehen. Bricht beim ersten
Verstoss ab, ohne eine Datei zu schreiben. Mit --pruefen nur pruefen, nicht schreiben.
Aufruf: python ersetzungen_einsetzen.py <planordner> <korrekturdatei> [--pruefen]
"""
import sys
from pathlib import Path
ordner = Path(sys.argv[1])
korrektur = Path(sys.argv[2])
nur_pruefen = "--pruefen" in sys.argv[3:]
zeilen = korrektur.read_text(encoding="utf-8").split("\n")
ersetzungen = []
i = 0
while i < len(zeilen):
if not zeilen[i].startswith("## Ersetzung "):
i += 1
continue
titel = zeilen[i]
i += 1
datei = alt = neu = None
while i < len(zeilen) and not zeilen[i].startswith("## Ersetzung "):
z = zeilen[i]
if z.startswith("Datei:"):
datei = z.split(":", 1)[1].strip().strip("`")
elif z.strip() in ("Alt:", "Neu:"):
art = z.strip()[:-1]
if i + 1 >= len(zeilen) or not zeilen[i + 1].startswith("~~~~"):
sys.exit(f"{titel}: nach {art}: fehlt die Zeile ~~~~text")
j = i + 2
inhalt = []
while j < len(zeilen) and zeilen[j].rstrip() != "~~~~":
inhalt.append(zeilen[j])
j += 1
if j >= len(zeilen):
sys.exit(f"{titel}: {art}-Block ohne schliessende ~~~~")
text = "\n".join(inhalt)
if art == "Alt":
alt = text
else:
neu = text
i = j
i += 1
if datei is None or alt is None or neu is None:
sys.exit(f"{titel}: Datei, Alt oder Neu fehlt")
ersetzungen.append((titel, datei, alt, neu))
texte: dict[str, str] = {}
for titel, datei, alt, neu in ersetzungen:
if datei not in texte:
pfad = ordner / datei
if not pfad.is_file():
sys.exit(f"{titel}: Datei {datei} gibt es nicht")
texte[datei] = pfad.read_text(encoding="utf-8")
n = texte[datei].count(alt)
if n != 1:
sys.exit(f"{titel}: Alt-Text steht {n}-mal in {datei} statt einmal; nichts geschrieben")
texte[datei] = texte[datei].replace(alt, neu)
print(f"ok {titel} ({datei})")
print(f"{len(ersetzungen)} Ersetzungen in {len(texte)} Datei(en) geprueft")
if nur_pruefen:
print("nur geprueft, nichts geschrieben")
else:
for datei, text in texte.items():
(ordner / datei).write_text(text, encoding="utf-8", newline="\n")
print("geschrieben:", ", ".join(sorted(texte)))