feat: initial agent-swarm-repo template
Some checks failed
gates / quality (push) Has been cancelled

Generelles Git-Repo-Template fuer KI-Agenten-Arbeit (multi-agent swarm pattern).

Enthaelt:
- Rollen-System (Leader, Worker, Reviewer) mit Model-Routing-Matrix (Tier-basiert)
- Zwei komplementaere Loops: Feature-Loop (vorwaerts) + Audit-Loop (rueckwaerts)
- Spike-Gate fuer Research-Items (GO/NO-GO vor Produktionscode)
- Obligatorische Opus-Review-Gate nach jeder Implement-Session
- Drei ausfuehrbare Gates: session-hygiene, ownership (Cross-Edit-Schutz), doc-drift
  -- alle dormant bis zur ersten Initialisierung, dann automatisch aktiv
- Bootstrap: scripts/init.sh + session-prompts/BOOTSTRAP.md
- Worked Example (URL-Shortener-Domaene): Board, Session-Log, Audit-Finding, ADR
- Token-Hygiene (3-Tier: Session-Schnitt / Command-Disziplin / Cache-Disziplin)
- GitHub Actions CI (gates.yml) laeuft auf jedem Push/PR

Muster destilliert aus produktiv-bewaehrten Patterns des ConformalLabpp-Projekts.
This commit is contained in:
2026-06-03 06:35:06 +02:00
commit 696eddb5ef
40 changed files with 1310 additions and 0 deletions

38
scripts/gate-session-hygiene.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Session-Hygiene-Gate (Starter — an Repo anpassen).
set -uo pipefail
fail=0
note(){ echo " - $1"; fail=1; }
# Dormant solange das Template nicht initialisiert ist (scripts/init.sh).
if grep -q '<id / datum>' STATE.md 2>/dev/null; then
echo "[hygiene] Template noch nicht initialisiert (scripts/init.sh) — uebersprungen."
echo "GATE: PASS"; exit 0
fi
echo "[hygiene] pruefe Working Tree..."
[ -z "$(git status --porcelain)" ] || note "Working Tree nicht sauber."
echo "[hygiene] STATE.md im aktuellen Branch aktualisiert?"
base=$(git merge-base HEAD main 2>/dev/null || git rev-parse HEAD~1 2>/dev/null || true)
if [ -n "$base" ]; then
git diff --name-only "$base"...HEAD | grep -q '^STATE.md$' || \
note "STATE.md im aktuellen Branch nicht aktualisiert."
else
git log -1 --name-only --pretty= | grep -q '^STATE.md$' || \
note "STATE.md im letzten Commit nicht angefasst."
fi
echo "[hygiene] Session-Log vorhanden?"
ls sessions/[0-9]*.md >/dev/null 2>&1 || note "Kein Session-Log unter sessions/."
echo "[hygiene] Conventional Commits?"
git log -1 --pretty=%s | grep -Eq '^(feat|fix|docs|test|refactor|chore)(\(.+\))?: ' || \
note "Letzter Commit nicht conventional."
echo "[hygiene] Model-Attribution im letzten Commit?"
git log -1 --pretty=%B | grep -q 'Co-Authored-By: Claude' || \
echo " - Hinweis: letzter Commit ohne 'Co-Authored-By: Claude <Modell>' (Pflicht nur fuer Agenten-Commits)."
if [ "$fail" -ne 0 ]; then echo "GATE: FAIL"; exit 1; fi
echo "GATE: PASS"