P-0000: AGENTS.md-Vorlage im Skill (#1028), Uhrzeit statt Platzhalter, Branch-Vorschlag bei der Umstellung, Plugin 0.3.1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Automatische Vorprüfung des Plugins (Tests skill2plugin.1 bis .4), vor dem Lauf in echter Installation (bestand2plugin.1 bis .3).
|
||||
"""Automatische Vorprüfung des Plugins (Tests skill2plugin.1 bis .5), vor dem Lauf in echter Installation (bestand2plugin.1 bis .3).
|
||||
|
||||
Aufruf: python3 skill/tests/skill2plugin.py (aus dem Projektordner)
|
||||
Ausgabe je Test `- id: ✓|✗ Notiz`, Exit-Code 1 wenn einer ✗ ist.
|
||||
@ -83,6 +83,35 @@ def main():
|
||||
melde("skill2plugin.4", ok, "init.sh legt ohne Git-Repo eines an, mit OHNE_GIT=1 nicht" if ok else "Git-Verhalten von init.sh falsch")
|
||||
finally:
|
||||
shutil.rmtree(base, ignore_errors=True)
|
||||
# .5 init.sh legt AGENTS.md und CLAUDE.md an, überschreibt nichts, lässt keinen Platzhalter "(Tageszeit)"
|
||||
base = tempfile.mkdtemp(prefix="skill2plugin-")
|
||||
try:
|
||||
d = os.path.join(base, "p")
|
||||
os.makedirs(d)
|
||||
eigene = "# eigene Regeln\n"
|
||||
open(os.path.join(d, "CLAUDE.md"), "w", encoding="utf-8").write(eigene)
|
||||
p1 = subprocess.run(["bash", os.path.join(SKILL, "scripts", "init.sh"), "T", d, "P-0007"], capture_output=True, text=True)
|
||||
agents = open(os.path.join(d, "AGENTS.md"), encoding="utf-8").read() if os.path.exists(os.path.join(d, "AGENTS.md")) else ""
|
||||
claude_bleibt = open(os.path.join(d, "CLAUDE.md"), encoding="utf-8").read() == eigene
|
||||
d2 = os.path.join(base, "q")
|
||||
subprocess.run(["bash", os.path.join(SKILL, "scripts", "init.sh"), "T", d2, "P-0007"], capture_output=True)
|
||||
c2 = open(os.path.join(d2, "CLAUDE.md"), encoding="utf-8").read()
|
||||
rm = open(os.path.join(d2, "ROADMAP.md"), encoding="utf-8").read()
|
||||
lint = subprocess.run([sys.executable, "-I", os.path.join(SKILL, "scripts", "check_format.py"), os.path.join(d2, "ROADMAP.md")], capture_output=True, text=True)
|
||||
fehler = []
|
||||
if "(P-0007)" not in agents.splitlines()[0]:
|
||||
fehler.append("AGENTS.md ohne Projekt-ID")
|
||||
if not claude_bleibt:
|
||||
fehler.append("vorhandene CLAUDE.md überschrieben")
|
||||
if c2.strip() != "@AGENTS.md":
|
||||
fehler.append("neue CLAUDE.md ist nicht '@AGENTS.md'")
|
||||
if "Tageszeit" in rm:
|
||||
fehler.append("Platzhalter (Tageszeit) steht noch im Kopf")
|
||||
if lint.returncode != 0:
|
||||
fehler.append("check_format.py meldet Fehler")
|
||||
melde("skill2plugin.5", not fehler, "init.sh legt AGENTS.md und CLAUDE.md (@AGENTS.md) an, überschreibt keine vorhandene CLAUDE.md, Zeit statt (Tageszeit), Prüfskript OK" if not fehler else "; ".join(fehler))
|
||||
finally:
|
||||
shutil.rmtree(base, ignore_errors=True)
|
||||
sys.exit(0 if all(alle) else 1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user