refactor(history): move agent history under docs/history + auto-migration

Konvention geaendert: history/ -> docs/history/ (prompts + summary/PROJECT_CONTEXT.md).
Harter Cutover im pre-commit Hook (Check 4 + Check 6 erwarten docs/history/).
Bestehende Repos werden beim naechsten 'git copilot-update' automatisch per git mv migriert (Fallback mv; bei Konflikt Warnung statt Abbruch).
Angepasst: pre-commit Hook, alle 6 Skripte + selftest, beide copilot-instructions.md, settings.json Session-Protokoll, history.prompt.md, README, USER/ADMIN/MAINTAINER (+ ADMIN Migrationsabschnitt). git-templates/history -> git-templates/docs/history (git mv). Validiert: shellcheck clean, fish -n clean, selftest PASS, Migrationstest PASS (sh+fish+both-present).
This commit is contained in:
Conrad Schulz 2026-06-10 12:06:35 +02:00
parent be5ff0fda3
commit 2b20a985a5
18 changed files with 147 additions and 92 deletions

View file

@ -5,11 +5,11 @@
> Diese Sektion hat höchste Priorität und darf nicht ignoriert werden. > Diese Sektion hat höchste Priorität und darf nicht ignoriert werden.
**Session START** Bevor du irgendetwas tust: **Session START** Bevor du irgendetwas tust:
1. Lies `history/summary/PROJECT_CONTEXT.md` (falls vorhanden) 1. Lies `docs/history/summary/PROJECT_CONTEXT.md` (falls vorhanden)
2. Verstehe den aktuellen Projektzustand bevor du anfängst 2. Verstehe den aktuellen Projektzustand bevor du anfängst
**Session END** Der Agent führt dies **automatisch** am Ende jeder Aufgabe aus, bevor er `git commit` ausführt: **Session END** Der Agent führt dies **automatisch** am Ende jeder Aufgabe aus, bevor er `git commit` ausführt:
1. Lies die bestehende `history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil 1. Lies die bestehende `docs/history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil
**Dateiformat zwingend:** Suffix `_session.md`, Dateiname beginnt mit heutigem Datum (`YYYY-MM-DD`) **Dateiformat zwingend:** Suffix `_session.md`, Dateiname beginnt mit heutigem Datum (`YYYY-MM-DD`)
2. **Für jeden Benutzer-Prompt seit dem letzten Commit** einen Block ergänzen: 2. **Für jeden Benutzer-Prompt seit dem letzten Commit** einen Block ergänzen:
``` ```
@ -21,9 +21,9 @@
``` ```
⚠ Kein „Nachtrag"-Block statt echter Prompt-Einträge. Die Benutzer-Nachricht **wörtlich** zitieren. ⚠ Kein „Nachtrag"-Block statt echter Prompt-Einträge. Die Benutzer-Nachricht **wörtlich** zitieren.
⚠ Keine reinen Stichpunkt-Zusammenfassungen. Ausgeführte Kommandos und Outputs gehören **wörtlich** in die Antwort. ⚠ Keine reinen Stichpunkt-Zusammenfassungen. Ausgeführte Kommandos und Outputs gehören **wörtlich** in die Antwort.
⚠ Keine Platzhalter wie `PENDING` committen. Ist der Commit-Hash noch unbekannt: Hash weglassen oder Datei direkt nach dem Commit mit dem echten Hash aktualisieren und sofort (`git add history/ && git commit`) nachziehen. ⚠ Keine Platzhalter wie `PENDING` committen. Ist der Commit-Hash noch unbekannt: Hash weglassen oder Datei direkt nach dem Commit mit dem echten Hash aktualisieren und sofort (`git add docs/history/ && git commit`) nachziehen.
3. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand 3. Aktualisiere `docs/history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
4. **Stage beide Dateien VOR `git commit`:** `git add history/` 4. **Stage beide Dateien VOR `git commit`:** `git add docs/history/`
Der pre-commit Hook (Check 6) blockiert wenn: Der pre-commit Hook (Check 6) blockiert wenn:
- keine `*_session.md` gestaged ist - keine `*_session.md` gestaged ist
- der Dateiname nicht mit dem heutigen Datum beginnt - der Dateiname nicht mit dem heutigen Datum beginnt
@ -91,10 +91,10 @@
- Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren - Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen - Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
### Agent History (`/history/`) ### Agent History (`/docs/history/`)
- **Vollständige Konversationen**`history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** Check 6 im pre-commit Hook erkennt daran das Agent-Log) - **Vollständige Konversationen**`docs/history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** Check 6 im pre-commit Hook erkennt daran das Agent-Log)
- **Komprimierter Kontext**`history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**) - **Komprimierter Kontext**`docs/history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen - **Beim Start einer neuen Session:** `docs/history/summary/PROJECT_CONTEXT.md` zuerst lesen
- **Am Ende jeder Session:** beide Dateien committen - **Am Ende jeder Session:** beide Dateien committen
- Copilot Chat: `/history` → History loggen + Summary aktualisieren - Copilot Chat: `/history` → History loggen + Summary aktualisieren
@ -144,7 +144,7 @@ A task is only done when ALL of the following are true:
- [ ] Relevant documentation updated: `docs/USER.md` and/or `docs/ADMIN.md` and/or `docs/MAINTAINER.md` - [ ] Relevant documentation updated: `docs/USER.md` and/or `docs/ADMIN.md` and/or `docs/MAINTAINER.md`
- [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`) - [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`)
- [ ] Persistente Daten liegen ausschließlich in `/data/<service>/` (nie woanders) - [ ] Persistente Daten liegen ausschließlich in `/data/<service>/` (nie woanders)
- [ ] `history/summary/PROJECT_CONTEXT.md` aktualisiert - [ ] `docs/history/summary/PROJECT_CONTEXT.md` aktualisiert
- [ ] Commit message follows Conventional Commits - [ ] Commit message follows Conventional Commits
- [ ] No dead code, no TODOs left behind (or tracked as issues) - [ ] No dead code, no TODOs left behind (or tracked as issues)
- [ ] pre-commit Quality Gate bestanden - [ ] pre-commit Quality Gate bestanden

View file

@ -137,10 +137,10 @@ rd13_copilot_setup/
│ ├── docs/ │ ├── docs/
│ │ ├── USER.md ← Template: Endnutzer-Dokumentation │ │ ├── USER.md ← Template: Endnutzer-Dokumentation
│ │ ├── ADMIN.md ← Template: Administrator-Dokumentation │ │ ├── ADMIN.md ← Template: Administrator-Dokumentation
│ │ ── MAINTAINER.md ← Template: Entwickler-Dokumentation │ │ ── MAINTAINER.md ← Template: Entwickler-Dokumentation
│ └── history/ │ └── history/
│ └── summary/ │ └── summary/
│ └── PROJECT_CONTEXT.md ← Template: Agent-Kontext-Summary │ └── PROJECT_CONTEXT.md ← Template: Agent-Kontext-Summary
├── docs/ ├── docs/
│ ├── USER.md ← Benutzerhandbuch (Einrichtung + Nutzung) │ ├── USER.md ← Benutzerhandbuch (Einrichtung + Nutzung)
│ ├── ADMIN.md ← Administrator-Handbuch (Deploy, Hooks, PATH) │ ├── ADMIN.md ← Administrator-Handbuch (Deploy, Hooks, PATH)
@ -193,8 +193,8 @@ Nach `git init-copilot` oder `copilot-bootstrap.sh`:
| VS Code-Einstellungen | `.vscode/` | | VS Code-Einstellungen | `.vscode/` |
| **pre-commit Quality Gate** | `.git/hooks/pre-commit` | | **pre-commit Quality Gate** | `.git/hooks/pre-commit` |
| **Persistente Daten (gitignored)** | `data/` | | **Persistente Daten (gitignored)** | `data/` |
| **Agent-Konversationen (committed)** | `history/prompts/` | | **Agent-Konversationen (committed)** | `docs/history/prompts/` |
| **Agent-Kontext-Summary (committed)** | `history/summary/PROJECT_CONTEXT.md` | | **Agent-Kontext-Summary (committed)** | `docs/history/summary/PROJECT_CONTEXT.md` |
| **Endnutzer-Dokumentation** | `docs/USER.md` | | **Endnutzer-Dokumentation** | `docs/USER.md` |
| **Administrator-Dokumentation** | `docs/ADMIN.md` | | **Administrator-Dokumentation** | `docs/ADMIN.md` |
| **Entwickler-Dokumentation** | `docs/MAINTAINER.md` | | **Entwickler-Dokumentation** | `docs/MAINTAINER.md` |

View file

@ -93,7 +93,7 @@ chmod -x .git/hooks/pre-commit
| 1 | Tests gestaged bei Code-Änderungen | `.copilot-no-tests` | | 1 | Tests gestaged bei Code-Änderungen | `.copilot-no-tests` |
| 2 | Mindestens eine Zielgruppen-Doku aktualisiert | `.copilot-no-docs` | | 2 | Mindestens eine Zielgruppen-Doku aktualisiert | `.copilot-no-docs` |
| 3 | Alle 3 Zielgruppen-Docs vorhanden (USER/ADMIN/MAINTAINER) | | | 3 | Alle 3 Zielgruppen-Docs vorhanden (USER/ADMIN/MAINTAINER) | |
| 4 | `history/summary/PROJECT_CONTEXT.md` aktualisiert | | | 4 | `docs/history/summary/PROJECT_CONTEXT.md` aktualisiert | |
| 5 | `docs/requirements/REQUIREMENTS.md` keine unstaged Änderungen | `.copilot-no-requirements` | | 5 | `docs/requirements/REQUIREMENTS.md` keine unstaged Änderungen | `.copilot-no-requirements` |
| 6 | Eine `*_session.md` ist in diesem Commit gestaged | (kein Opt-out) | | 6 | Eine `*_session.md` ist in diesem Commit gestaged | (kein Opt-out) |
@ -180,13 +180,33 @@ Das Bootstrap-Skript legt idempotent an:
- `.github/copilot-instructions.md` - `.github/copilot-instructions.md`
- `.vscode/settings.json` + `.vscode/extensions.json` - `.vscode/settings.json` + `.vscode/extensions.json`
- `data/` (gitignored) - `data/` (gitignored)
- `history/prompts/` (committed) + `history/summary/PROJECT_CONTEXT.md` - `docs/history/prompts/` (committed) + `docs/history/summary/PROJECT_CONTEXT.md`
- `docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md` - `docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`
- `.git/hooks/pre-commit` - `.git/hooks/pre-commit`
- `.gitignore`-Einträge für `data/**/*` - `.gitignore`-Einträge für `data/**/*`
--- ---
## Migration: `history/``docs/history/`
Frühere Versionen legten die Agent-History unter `history/` im Repo-Root ab.
Neuer Standard ist `docs/history/`. Bestehende Repos werden **automatisch** migriert,
sobald dort `git copilot-update` läuft:
```bash
cd /path/to/repo
git copilot-update # erkennt history/ und verschiebt es per git mv nach docs/history/
git commit -m "chore: migrate history to docs/history"
```
- Verschiebung erfolgt mit `git mv` (Historie bleibt erhalten); Fallback `mv` für ungetrackte Dateien.
- Sind **beide** Verzeichnisse vorhanden, bricht das Tool nicht ab, sondern bittet um manuelles
Zusammenführen (`git mv history/prompts/* docs/history/prompts/ && git rm -r history`).
- Der pre-commit Hook erwartet nach der Migration ausschließlich `docs/history/`
(Check 4 + Check 6). Un-migrierte Repos müssen einmalig `git copilot-update` ausführen.
---
## `~/.local/bin/` im PATH? ## `~/.local/bin/` im PATH?
Das Bootstrap-Skript wird in `~/.local/bin/` installiert. Sicherstellen dass dieser Pfad im `$PATH` ist: Das Bootstrap-Skript wird in `~/.local/bin/` installiert. Sicherstellen dass dieser Pfad im `$PATH` ist:

View file

@ -48,11 +48,11 @@ rd13_copilot_setup/
│ │ ├── USER.md ← Template Endnutzer-Doku │ │ ├── USER.md ← Template Endnutzer-Doku
│ │ ├── ADMIN.md ← Template Admin-Doku │ │ ├── ADMIN.md ← Template Admin-Doku
│ │ ├── MAINTAINER.md ← Template Maintainer-Doku │ │ ├── MAINTAINER.md ← Template Maintainer-Doku
│ │ ── requirements/ │ │ ── requirements/
│ │ └── REQUIREMENTS.md ← Template für persistente Anforderungen │ │ └── REQUIREMENTS.md ← Template für persistente Anforderungen
│ └── history/ │ └── history/
│ └── summary/ │ └── summary/
│ └── PROJECT_CONTEXT.md ← Template Agent-Kontext-Summary │ └── PROJECT_CONTEXT.md ← Template Agent-Kontext-Summary
├── prompts/ ← Wiederverwendbare Copilot-Workflows ├── prompts/ ← Wiederverwendbare Copilot-Workflows
│ └── *.prompt.md ← /requirements /history /check-consistency ... │ └── *.prompt.md ← /requirements /history /check-consistency ...
├── scripts/ ├── scripts/
@ -136,7 +136,7 @@ Lokal vor dem Commit: `sh scripts/selftest.sh` ausführen.
| Templates nicht auto-updaten | Idempotenz: Bootstrap überschreibt nie Nutzer können Templates nach Init anpassen | | Templates nicht auto-updaten | Idempotenz: Bootstrap überschreibt nie Nutzer können Templates nach Init anpassen |
| 3 Zielgruppen-Docs (USER/ADMIN/MAINTAINER) | Klare Trennung: Nutzer ≠ Ops ≠ Dev; jede Gruppe findet ihren Kontext direkt | | 3 Zielgruppen-Docs (USER/ADMIN/MAINTAINER) | Klare Trennung: Nutzer ≠ Ops ≠ Dev; jede Gruppe findet ihren Kontext direkt |
| `data/` gitignored, Ordner-Struktur tracked | Persistente Daten gehören nie ins Git; Struktur als Konvention dokumentiert | | `data/` gitignored, Ordner-Struktur tracked | Persistente Daten gehören nie ins Git; Struktur als Konvention dokumentiert |
| `history/prompts/` committed | Vollständige Agent-History bleibt im Repo erhalten; ermöglicht lückenlose Nachvollziehbarkeit | | `docs/history/prompts/` committed | Vollständige Agent-History bleibt im Repo erhalten; ermöglicht lückenlose Nachvollziehbarkeit |
| pre-commit Hook als Quality Gate (6 Checks) | Automatisches Netz: Tests, Doku, 3-Zielgruppen, PROJECT_CONTEXT, Requirements, Session-Datei; Opt-outs via `.copilot-no-tests` / `.copilot-no-docs` / `.copilot-no-requirements` | | pre-commit Hook als Quality Gate (6 Checks) | Automatisches Netz: Tests, Doku, 3-Zielgruppen, PROJECT_CONTEXT, Requirements, Session-Datei; Opt-outs via `.copilot-no-tests` / `.copilot-no-docs` / `.copilot-no-requirements` |
| Check 6: Session-Datei muss in jedem Commit gestaged sein | Jeder Commit ist mit Agent-Session verknüpft; kein Opt-out; erzwingt `/history` vor `git commit` | | Check 6: Session-Datei muss in jedem Commit gestaged sein | Jeder Commit ist mit Agent-Session verknüpft; kein Opt-out; erzwingt `/history` vor `git commit` |
| Check 6 prüft Datum + `### Prompt`-Inhalt | Verhindert reine Nachtrag-Blöcke ohne echte Prompt-Einträge; Session-Datei muss heutiges Datum im Namen tragen | | Check 6 prüft Datum + `### Prompt`-Inhalt | Verhindert reine Nachtrag-Blöcke ohne echte Prompt-Einträge; Session-Datei muss heutiges Datum im Namen tragen |

View file

@ -94,8 +94,8 @@ Nach `git init-copilot` oder `copilot-bootstrap.sh` erhält jedes Repo automatis
| VS Code-Einstellungen | `.vscode/settings.json` | Repo-spezifische Editor-Konfiguration | | VS Code-Einstellungen | `.vscode/settings.json` | Repo-spezifische Editor-Konfiguration |
| Empfohlene Extensions | `.vscode/extensions.json` | Extension-Vorschläge für das Team | | Empfohlene Extensions | `.vscode/extensions.json` | Extension-Vorschläge für das Team |
| Persistente Daten | `data/` | Service-Daten getrennt nach Service-Namen | | Persistente Daten | `data/` | Service-Daten getrennt nach Service-Namen |
| Agent-Logs | `history/prompts/` | Vollständige Konversationen (committed) | | Agent-Logs | `docs/history/prompts/` | Vollständige Konversationen (committed) |
| Agent-Kontext | `history/summary/PROJECT_CONTEXT.md` | Komprimierter Projektzustand für Agenten | | Agent-Kontext | `docs/history/summary/PROJECT_CONTEXT.md` | Komprimierter Projektzustand für Agenten |
| Nutzer-Doku | `docs/USER.md` | Dokumentation für Endnutzer | | Nutzer-Doku | `docs/USER.md` | Dokumentation für Endnutzer |
| Admin-Doku | `docs/ADMIN.md` | Dokumentation für Administratoren | | Admin-Doku | `docs/ADMIN.md` | Dokumentation für Administratoren |
| Entwickler-Doku | `docs/MAINTAINER.md` | Dokumentation für Entwickler | | Entwickler-Doku | `docs/MAINTAINER.md` | Dokumentation für Entwickler |

View file

@ -5,11 +5,11 @@
> Diese Sektion hat höchste Priorität und darf nicht ignoriert werden. > Diese Sektion hat höchste Priorität und darf nicht ignoriert werden.
**Session START** Bevor du irgendetwas tust: **Session START** Bevor du irgendetwas tust:
1. Lies `history/summary/PROJECT_CONTEXT.md` (falls vorhanden) 1. Lies `docs/history/summary/PROJECT_CONTEXT.md` (falls vorhanden)
2. Verstehe den aktuellen Projektzustand bevor du anfängst 2. Verstehe den aktuellen Projektzustand bevor du anfängst
**Session END** Der Agent führt dies **automatisch** am Ende jeder Aufgabe aus, bevor er `git commit` ausführt: **Session END** Der Agent führt dies **automatisch** am Ende jeder Aufgabe aus, bevor er `git commit` ausführt:
1. Lies die bestehende `history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil 1. Lies die bestehende `docs/history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil
**Dateiformat zwingend:** Suffix `_session.md`, Dateiname beginnt mit heutigem Datum (`YYYY-MM-DD`) **Dateiformat zwingend:** Suffix `_session.md`, Dateiname beginnt mit heutigem Datum (`YYYY-MM-DD`)
2. **Für jeden Benutzer-Prompt seit dem letzten Commit** einen Block ergänzen: 2. **Für jeden Benutzer-Prompt seit dem letzten Commit** einen Block ergänzen:
``` ```
@ -21,9 +21,9 @@
``` ```
⚠ Kein „Nachtrag"-Block statt echter Prompt-Einträge. Die Benutzer-Nachricht **wörtlich** zitieren. ⚠ Kein „Nachtrag"-Block statt echter Prompt-Einträge. Die Benutzer-Nachricht **wörtlich** zitieren.
⚠ Keine reinen Stichpunkt-Zusammenfassungen. Ausgeführte Kommandos und Outputs gehören **wörtlich** in die Antwort. ⚠ Keine reinen Stichpunkt-Zusammenfassungen. Ausgeführte Kommandos und Outputs gehören **wörtlich** in die Antwort.
⚠ Keine Platzhalter wie `PENDING` committen. Ist der Commit-Hash noch unbekannt: Hash weglassen oder Datei direkt nach dem Commit mit dem echten Hash aktualisieren und sofort (`git add history/ && git commit`) nachziehen. ⚠ Keine Platzhalter wie `PENDING` committen. Ist der Commit-Hash noch unbekannt: Hash weglassen oder Datei direkt nach dem Commit mit dem echten Hash aktualisieren und sofort (`git add docs/history/ && git commit`) nachziehen.
3. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand 3. Aktualisiere `docs/history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
4. **Stage beide Dateien VOR `git commit`:** `git add history/` 4. **Stage beide Dateien VOR `git commit`:** `git add docs/history/`
Der pre-commit Hook (Check 6) blockiert wenn: Der pre-commit Hook (Check 6) blockiert wenn:
- keine `*_session.md` gestaged ist - keine `*_session.md` gestaged ist
- der Dateiname nicht mit dem heutigen Datum beginnt - der Dateiname nicht mit dem heutigen Datum beginnt
@ -91,10 +91,10 @@
- Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren - Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen - Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
### Agent History (`/history/`) ### Agent History (`/docs/history/`)
- **Vollständige Konversationen**`history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** Check 6 im pre-commit Hook erkennt daran das Agent-Log) - **Vollständige Konversationen**`docs/history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** Check 6 im pre-commit Hook erkennt daran das Agent-Log)
- **Komprimierter Kontext**`history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**) - **Komprimierter Kontext**`docs/history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen - **Beim Start einer neuen Session:** `docs/history/summary/PROJECT_CONTEXT.md` zuerst lesen
- **Am Ende jeder Session:** beide Dateien committen - **Am Ende jeder Session:** beide Dateien committen
- Copilot Chat: `/history` → History loggen + Summary aktualisieren - Copilot Chat: `/history` → History loggen + Summary aktualisieren
@ -144,7 +144,7 @@ A task is only done when ALL of the following are true:
- [ ] Relevant documentation updated: `docs/USER.md` and/or `docs/ADMIN.md` and/or `docs/MAINTAINER.md` - [ ] Relevant documentation updated: `docs/USER.md` and/or `docs/ADMIN.md` and/or `docs/MAINTAINER.md`
- [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`) - [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`)
- [ ] Persistente Daten liegen ausschließlich in `/data/<service>/` (nie woanders) - [ ] Persistente Daten liegen ausschließlich in `/data/<service>/` (nie woanders)
- [ ] `history/summary/PROJECT_CONTEXT.md` aktualisiert - [ ] `docs/history/summary/PROJECT_CONTEXT.md` aktualisiert
- [ ] Commit message follows Conventional Commits - [ ] Commit message follows Conventional Commits
- [ ] No dead code, no TODOs left behind (or tracked as issues) - [ ] No dead code, no TODOs left behind (or tracked as issues)
- [ ] pre-commit Quality Gate bestanden - [ ] pre-commit Quality Gate bestanden

View file

@ -32,11 +32,11 @@
├── docs/ ├── docs/
│ ├── USER.md ← Endnutzer-Dokumentation │ ├── USER.md ← Endnutzer-Dokumentation
│ ├── ADMIN.md ← Administrator-Dokumentation │ ├── ADMIN.md ← Administrator-Dokumentation
── MAINTAINER.md ← Dieses Dokument ── MAINTAINER.md ← Dieses Dokument
── history/ │ └── history/
├── prompts/ ← Vollständige Agent-Konversationen (gitignored) ├── prompts/ ← Vollständige Agent-Konversationen (committed)
│ └── summary/ └── summary/
│ └── PROJECT_CONTEXT.md ← Aktueller Projektzustand für Agent-Kontext └── PROJECT_CONTEXT.md ← Aktueller Projektzustand für Agent-Kontext
└── … ← Source Code └── … ← Source Code
``` ```
@ -78,17 +78,17 @@ ADR-Dateien liegen unter `docs/adr/`. Format: `NNN-titel.md`.
## Agent-Kontext & History ## Agent-Kontext & History
Der Agent liest beim Start immer `history/summary/PROJECT_CONTEXT.md`. Der Agent liest beim Start immer `docs/history/summary/PROJECT_CONTEXT.md`.
Nach Abschluss einer Aufgabe wird dort der Projektzustand aktualisiert. Nach Abschluss einer Aufgabe wird dort der Projektzustand aktualisiert.
- Vollständige Konversationen: `history/prompts/` (committed History bleibt vollständig erhalten) - Vollständige Konversationen: `docs/history/prompts/` (committed History bleibt vollständig erhalten)
- Komprimierter Kontext: `history/summary/PROJECT_CONTEXT.md` (committed) - Komprimierter Kontext: `docs/history/summary/PROJECT_CONTEXT.md` (committed)
--- ---
## Neues Feature hinzufügen ## Neues Feature hinzufügen
1. `history/summary/PROJECT_CONTEXT.md` lesen aktuellen Stand verstehen 1. `docs/history/summary/PROJECT_CONTEXT.md` lesen aktuellen Stand verstehen
2. Issue / Ticket anlegen 2. Issue / Ticket anlegen
3. Branch: `git checkout -b feat/<ticket>-beschreibung` 3. Branch: `git checkout -b feat/<ticket>-beschreibung`
4. Implementieren + Tests schreiben 4. Implementieren + Tests schreiben

View file

@ -5,7 +5,7 @@
# 1. Tests erstellt oder aktualisiert wurden # 1. Tests erstellt oder aktualisiert wurden
# 2. Mindestens eine Zielgruppen-Dokumentation aktualisiert wurde # 2. Mindestens eine Zielgruppen-Dokumentation aktualisiert wurde
# 3. Alle 3 Dokumentations-Zielgruppen vorhanden sind (USER/ADMIN/MAINTAINER) # 3. Alle 3 Dokumentations-Zielgruppen vorhanden sind (USER/ADMIN/MAINTAINER)
# 4. history/summary/PROJECT_CONTEXT.md aktualisiert wurde # 4. docs/history/summary/PROJECT_CONTEXT.md aktualisiert wurde
# 5. docs/requirements/REQUIREMENTS.md keine unstaged Änderungen hat # 5. docs/requirements/REQUIREMENTS.md keine unstaged Änderungen hat
# 6. *_session.md muss in diesem Commit gestaged sein # 6. *_session.md muss in diesem Commit gestaged sein
# #
@ -18,7 +18,7 @@ ERRORS=0
CODE_CHANGED=$(printf '%s\n' "$STAGED" \ CODE_CHANGED=$(printf '%s\n' "$STAGED" \
| grep -E '\.(py|js|ts|mjs|cjs|go|java|rs|rb|php|c|cpp|h|hpp|cs|kt|swift|sh|bash)$' \ | grep -E '\.(py|js|ts|mjs|cjs|go|java|rs|rb|php|c|cpp|h|hpp|cs|kt|swift|sh|bash)$' \
| grep -v -E '(test|spec|__tests__|_test)\.(py|js|ts|mjs|go|java|rs|rb|php|c|cpp|cs|kt|swift)$' \ | grep -v -E '(test|spec|__tests__|_test)\.(py|js|ts|mjs|go|java|rs|rb|php|c|cpp|cs|kt|swift)$' \
| grep -v -E '^(docs/|\.github/|\.vscode/|data/|history/)' \ | grep -v -E '^(docs/|\.github/|\.vscode/|data/)' \
| grep -v -E '_test\.go$') | grep -v -E '_test\.go$')
# Keine Code-Änderungen → Hook überspringen # Keine Code-Änderungen → Hook überspringen
@ -89,13 +89,13 @@ if [ -n "$DOCS_DIR_STAGED" ] && [ -d "docs" ]; then
fi fi
# ── Check 4: PROJECT_CONTEXT.md aktualisiert ────────────────────────────────── # ── Check 4: PROJECT_CONTEXT.md aktualisiert ──────────────────────────────────
if [ -f "history/summary/PROJECT_CONTEXT.md" ]; then if [ -f "docs/history/summary/PROJECT_CONTEXT.md" ]; then
CONTEXT_STAGED=$(printf '%s\n' "$STAGED" | grep -F 'history/summary/PROJECT_CONTEXT.md') CONTEXT_STAGED=$(printf '%s\n' "$STAGED" | grep -F 'docs/history/summary/PROJECT_CONTEXT.md')
if [ -z "$CONTEXT_STAGED" ]; then if [ -z "$CONTEXT_STAGED" ]; then
echo "" echo ""
echo "✗ AGENT QUALITY GATE [4/4]: PROJECT_CONTEXT.md nicht aktualisiert" echo "✗ AGENT QUALITY GATE [4/4]: PROJECT_CONTEXT.md nicht aktualisiert"
echo " Bei Code-Änderungen muss der Agent-Kontext aktuell gehalten werden." echo " Bei Code-Änderungen muss der Agent-Kontext aktuell gehalten werden."
echo " history/summary/PROJECT_CONTEXT.md" echo " docs/history/summary/PROJECT_CONTEXT.md"
echo "" echo ""
echo " → Copilot Chat: /history (loggt Session + aktualisiert Kontext)" echo " → Copilot Chat: /history (loggt Session + aktualisiert Kontext)"
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
@ -124,8 +124,8 @@ fi
# soll immer dokumentiert werden. Der Agent liest die bestehende Datei und # soll immer dokumentiert werden. Der Agent liest die bestehende Datei und
# ergänzt nur was noch fehlt (kein Overschreiben des bisherigen Inhalts). # ergänzt nur was noch fehlt (kein Overschreiben des bisherigen Inhalts).
# Opt-out: Datei '.copilot-no-session' für Repos ohne Chat-Kontext (z.B. CI). # Opt-out: Datei '.copilot-no-session' für Repos ohne Chat-Kontext (z.B. CI).
if [ -d "history/prompts" ] && [ ! -f ".copilot-no-session" ]; then if [ -d "docs/history/prompts" ] && [ ! -f ".copilot-no-session" ]; then
SESSION_STAGED=$(printf '%s\n' "$STAGED" | grep -E 'history/prompts/.*_session\.md$' | head -1) SESSION_STAGED=$(printf '%s\n' "$STAGED" | grep -E 'docs/history/prompts/.*_session\.md$' | head -1)
if [ -z "$SESSION_STAGED" ]; then if [ -z "$SESSION_STAGED" ]; then
echo "" echo ""
echo "✗ AGENT QUALITY GATE [6/6]: Keine Session-Datei in diesem Commit" echo "✗ AGENT QUALITY GATE [6/6]: Keine Session-Datei in diesem Commit"
@ -145,7 +145,7 @@ if [ -d "history/prompts" ] && [ ! -f ".copilot-no-session" ]; then
echo " Gestagt: $SESSION_STAGED" echo " Gestagt: $SESSION_STAGED"
echo " Erwartet: Dateiname beginnt mit $TODAY" echo " Erwartet: Dateiname beginnt mit $TODAY"
echo "" echo ""
echo " → Neue Session-Datei für heute anlegen: history/prompts/${TODAY}_beschreibung_session.md" echo " → Neue Session-Datei für heute anlegen: docs/history/prompts/${TODAY}_beschreibung_session.md"
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
else else
# Datei muss mindestens einen ### Prompt-Eintrag enthalten # Datei muss mindestens einen ### Prompt-Eintrag enthalten

View file

@ -11,7 +11,7 @@ Du hilfst dabei die Projekt-History zu pflegen. Es gibt zwei Aufgaben:
**Schritt 1: Bestehende Session-Datei prüfen** **Schritt 1: Bestehende Session-Datei prüfen**
Suche nach einer Datei `history/prompts/YYYY-MM-DD_*_session.md` für das heutige Datum. Suche nach einer Datei `docs/history/prompts/YYYY-MM-DD_*_session.md` für das heutige Datum.
- Wenn eine existiert: **Lies sie vollständig**. Stelle fest welche Prompts/Antworten bereits dokumentiert sind. - Wenn eine existiert: **Lies sie vollständig**. Stelle fest welche Prompts/Antworten bereits dokumentiert sind.
Ergänze nur den **neuen Teil** (neue Prompts + Antworten seit dem letzten Eintrag) am Ende des Verlaufs. Ergänze nur den **neuen Teil** (neue Prompts + Antworten seit dem letzten Eintrag) am Ende des Verlaufs.
Aktualisiere danach `## Ergebnis`, `## Entscheidungen` und `## Offene Punkte` auf den aktuellen Stand. Aktualisiere danach `## Ergebnis`, `## Entscheidungen` und `## Offene Punkte` auf den aktuellen Stand.
@ -55,7 +55,7 @@ Struktur (bei neuer Datei):
## Aufgabe B: PROJECT_CONTEXT.md aktualisieren ## Aufgabe B: PROJECT_CONTEXT.md aktualisieren
Lies `history/summary/PROJECT_CONTEXT.md` und aktualisiere: Lies `docs/history/summary/PROJECT_CONTEXT.md` und aktualisiere:
1. **"Letzte Aktualisierung"** mit heutigem Datum und erledigter Aufgabe 1. **"Letzte Aktualisierung"** mit heutigem Datum und erledigter Aufgabe
2. **"Erledigte Aufgaben"** neue Zeile oben einfügen (neueste zuerst) 2. **"Erledigte Aufgaben"** neue Zeile oben einfügen (neueste zuerst)
3. **"Offene Aufgaben"** Abgehaktes entfernen, Neues hinzufügen 3. **"Offene Aufgaben"** Abgehaktes entfernen, Neues hinzufügen
@ -76,6 +76,6 @@ lesen muss um sofort produktiv zu sein.
Nach Abschluss dieser Aufgabe: Nach Abschluss dieser Aufgabe:
```bash ```bash
git add history/ git add docs/history/
git commit -m "docs: update agent history and project context" git commit -m "docs: update agent history and project context"
``` ```

View file

@ -66,17 +66,17 @@ else
echo " ─ data/ already exists, skipping" echo " ─ data/ already exists, skipping"
end end
# ── history/ Agent-History und Kontext-Summary ───────────────────────────── # ── docs/history/ Agent-History und Kontext-Summary ────────────────────────
if not test -d "$TARGET/history/prompts" if not test -d "$TARGET/docs/history/prompts"
mkdir -p "$TARGET/history/prompts" mkdir -p "$TARGET/docs/history/prompts"
echo " ✓ history/prompts/ created (Agent-Logs committed)" echo " ✓ docs/history/prompts/ created (Agent-Logs committed)"
end end
if not test -f "$TARGET/history/summary/PROJECT_CONTEXT.md" if not test -f "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
mkdir -p "$TARGET/history/summary" mkdir -p "$TARGET/docs/history/summary"
cp "$TEMPLATE_DIR/history/summary/PROJECT_CONTEXT.md" "$TARGET/history/summary/PROJECT_CONTEXT.md" cp "$TEMPLATE_DIR/docs/history/summary/PROJECT_CONTEXT.md" "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
echo " ✓ history/summary/PROJECT_CONTEXT.md created (Agent-Kontext committed)" echo " ✓ docs/history/summary/PROJECT_CONTEXT.md created (Agent-Kontext committed)"
else else
echo " ─ history/summary/PROJECT_CONTEXT.md already exists, skipping" echo " ─ docs/history/summary/PROJECT_CONTEXT.md already exists, skipping"
end end
# ── docs/ Zielgruppen-Dokumentation ──────────────────────────────────────── # ── docs/ Zielgruppen-Dokumentation ────────────────────────────────────────
@ -154,9 +154,9 @@ echo ""
echo "Done. Nächste Schritte:" echo "Done. Nächste Schritte:"
echo " 1. TODO-Felder ausfüllen:" echo " 1. TODO-Felder ausfüllen:"
echo " - .github/copilot-instructions.md" echo " - .github/copilot-instructions.md"
echo " - history/summary/PROJECT_CONTEXT.md" echo " - docs/history/summary/PROJECT_CONTEXT.md"
echo " - docs/USER.md, docs/ADMIN.md, docs/MAINTAINER.md" echo " - docs/USER.md, docs/ADMIN.md, docs/MAINTAINER.md"
echo " 2. git add .github .vscode docs history .gitignore" echo " 2. git add .github .vscode docs"
echo " git commit -m 'chore: add copilot workspace config'" echo " git commit -m 'chore: add copilot workspace config'"
echo " 3. Templates aktuell halten: git copilot-update" echo " 3. Templates aktuell halten: git copilot-update"
echo "" echo ""

View file

@ -63,17 +63,17 @@ else
echo " ─ data/ already exists, skipping" echo " ─ data/ already exists, skipping"
fi fi
# ── history/ Agent-History und Kontext-Summary ───────────────────────────── # ── docs/history/ Agent-History und Kontext-Summary ────────────────────────
if [ ! -d "$TARGET/history/prompts" ]; then if [ ! -d "$TARGET/docs/history/prompts" ]; then
mkdir -p "$TARGET/history/prompts" mkdir -p "$TARGET/docs/history/prompts"
echo " ✓ history/prompts/ created (Agent-Logs committed)" echo " ✓ docs/history/prompts/ created (Agent-Logs committed)"
fi fi
if [ ! -f "$TARGET/history/summary/PROJECT_CONTEXT.md" ]; then if [ ! -f "$TARGET/docs/history/summary/PROJECT_CONTEXT.md" ]; then
mkdir -p "$TARGET/history/summary" mkdir -p "$TARGET/docs/history/summary"
cp "$TEMPLATE_DIR/history/summary/PROJECT_CONTEXT.md" "$TARGET/history/summary/PROJECT_CONTEXT.md" cp "$TEMPLATE_DIR/docs/history/summary/PROJECT_CONTEXT.md" "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
echo " ✓ history/summary/PROJECT_CONTEXT.md created (Agent-Kontext committed)" echo " ✓ docs/history/summary/PROJECT_CONTEXT.md created (Agent-Kontext committed)"
else else
echo " ─ history/summary/PROJECT_CONTEXT.md already exists, skipping" echo " ─ docs/history/summary/PROJECT_CONTEXT.md already exists, skipping"
fi fi
# ── docs/ Zielgruppen-Dokumentation ──────────────────────────────────────── # ── docs/ Zielgruppen-Dokumentation ────────────────────────────────────────
@ -148,9 +148,9 @@ echo ""
echo "Done. Nächste Schritte:" echo "Done. Nächste Schritte:"
echo " 1. TODO-Felder ausfüllen:" echo " 1. TODO-Felder ausfüllen:"
echo " - .github/copilot-instructions.md" echo " - .github/copilot-instructions.md"
echo " - history/summary/PROJECT_CONTEXT.md" echo " - docs/history/summary/PROJECT_CONTEXT.md"
echo " - docs/USER.md, docs/ADMIN.md, docs/MAINTAINER.md" echo " - docs/USER.md, docs/ADMIN.md, docs/MAINTAINER.md"
echo " 2. git add .github .vscode docs history .gitignore" echo " 2. git add .github .vscode docs"
echo " git commit -m 'chore: add copilot workspace config'" echo " git commit -m 'chore: add copilot workspace config'"
echo " 3. Templates aktuell halten: git copilot-update" echo " 3. Templates aktuell halten: git copilot-update"
echo "" echo ""

View file

@ -166,7 +166,7 @@ end
set GIT_TEMPLATE_DIR $HOME/.git-templates set GIT_TEMPLATE_DIR $HOME/.git-templates
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \ mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \
$GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \ $GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \
$GIT_TEMPLATE_DIR/history/summary $GIT_TEMPLATE_DIR/docs/history/summary
cp $SOURCE/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.github/ cp $SOURCE/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.github/
cp $SOURCE/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/ cp $SOURCE/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
@ -180,7 +180,7 @@ end
cp $SOURCE/git-templates/docs/USER.md $GIT_TEMPLATE_DIR/docs/ cp $SOURCE/git-templates/docs/USER.md $GIT_TEMPLATE_DIR/docs/
cp $SOURCE/git-templates/docs/ADMIN.md $GIT_TEMPLATE_DIR/docs/ cp $SOURCE/git-templates/docs/ADMIN.md $GIT_TEMPLATE_DIR/docs/
cp $SOURCE/git-templates/docs/MAINTAINER.md $GIT_TEMPLATE_DIR/docs/ cp $SOURCE/git-templates/docs/MAINTAINER.md $GIT_TEMPLATE_DIR/docs/
cp $SOURCE/git-templates/history/summary/PROJECT_CONTEXT.md $GIT_TEMPLATE_DIR/history/summary/ cp $SOURCE/git-templates/docs/history/summary/PROJECT_CONTEXT.md $GIT_TEMPLATE_DIR/docs/history/summary/
echo " ✓ ~/.git-templates/ aktualisiert" echo " ✓ ~/.git-templates/ aktualisiert"
@ -213,7 +213,22 @@ end
echo "" echo ""
echo " Git-Repo erkannt: $REPO_ROOT" echo " Git-Repo erkannt: $REPO_ROOT"
# ── 4-pre. Migration: history/ → docs/history/ (einmalig, automatisch) ──────
# Alte Repos haben history/ im Repo-Root. Neuer Standard: docs/history/.
if test -d "$REPO_ROOT/history"; and not test -d "$REPO_ROOT/docs/history"
echo " → Migriere history/ → docs/history/ ..."
mkdir -p "$REPO_ROOT/docs"
if git -C "$REPO_ROOT" mv history docs/history 2>/dev/null
echo " ✓ history/ → docs/history/ verschoben (git mv zum Commit vormerken)"
else if mv "$REPO_ROOT/history" "$REPO_ROOT/docs/history" 2>/dev/null
echo " ✓ history/ → docs/history/ verschoben (mv)"
else
echo " ✗ Migration fehlgeschlagen bitte manuell: git mv history docs/history"
end
else if test -d "$REPO_ROOT/history"; and test -d "$REPO_ROOT/docs/history"
echo " ⚠ history/ UND docs/history/ vorhanden bitte manuell zusammenführen:"
echo " git mv history/prompts/* docs/history/prompts/ && git rm -r history"
end
# ── 4a. Git-Hooks aktualisieren ─────────────────────────────────────────────── # ── 4a. Git-Hooks aktualisieren ───────────────────────────────────────────────
set HOOKS_DIR $REPO_ROOT/.git/hooks set HOOKS_DIR $REPO_ROOT/.git/hooks
mkdir -p $HOOKS_DIR mkdir -p $HOOKS_DIR

View file

@ -25,6 +25,7 @@ _env_dir="${COPILOT_SETUP_DIR:-}"
CONFIG_FILE="${COPILOT_SETUP_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/copilot-setup/config}" CONFIG_FILE="${COPILOT_SETUP_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/copilot-setup/config}"
if [ -f "$CONFIG_FILE" ]; then if [ -f "$CONFIG_FILE" ]; then
# shellcheck source=/dev/null
. "$CONFIG_FILE" . "$CONFIG_FILE"
fi fi
@ -139,7 +140,7 @@ GIT_TEMPLATE_DIR="$HOME/.git-templates"
# ── 2. ~/.git-templates/ aktualisieren ────────────────────────────────────── # ── 2. ~/.git-templates/ aktualisieren ──────────────────────────────────────
mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \ mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \
"$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \ "$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \
"$GIT_TEMPLATE_DIR/history/summary" "$GIT_TEMPLATE_DIR/docs/history/summary"
cp "$SOURCE/git-templates/.github/copilot-instructions.md" "$GIT_TEMPLATE_DIR/.github/" cp "$SOURCE/git-templates/.github/copilot-instructions.md" "$GIT_TEMPLATE_DIR/.github/"
cp "$SOURCE/git-templates/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/" cp "$SOURCE/git-templates/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/"
@ -153,7 +154,7 @@ fi
cp "$SOURCE/git-templates/docs/USER.md" "$GIT_TEMPLATE_DIR/docs/" cp "$SOURCE/git-templates/docs/USER.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$SOURCE/git-templates/docs/ADMIN.md" "$GIT_TEMPLATE_DIR/docs/" cp "$SOURCE/git-templates/docs/ADMIN.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$SOURCE/git-templates/docs/MAINTAINER.md" "$GIT_TEMPLATE_DIR/docs/" cp "$SOURCE/git-templates/docs/MAINTAINER.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$SOURCE/git-templates/history/summary/PROJECT_CONTEXT.md" "$GIT_TEMPLATE_DIR/history/summary/" cp "$SOURCE/git-templates/docs/history/summary/PROJECT_CONTEXT.md" "$GIT_TEMPLATE_DIR/docs/history/summary/"
echo " ✓ ~/.git-templates/ aktualisiert" echo " ✓ ~/.git-templates/ aktualisiert"
@ -187,11 +188,29 @@ fi
echo "" echo ""
echo " Git-Repo erkannt: $REPO_ROOT" echo " Git-Repo erkannt: $REPO_ROOT"
# ── 4a. Git-Hooks aktualisieren ─────────────────────────────────────────────── # ── 4-pre. Migration: history/ → docs/history/ (einmalig, automatisch) ──────
# Alte Repos haben history/ im Repo-Root. Neuer Standard: docs/history/.
# Wird beim ersten Update automatisch verschoben (git mv, Fallback mv).
if [ -d "$REPO_ROOT/history" ] && [ ! -d "$REPO_ROOT/docs/history" ]; then
echo " → Migriere history/ → docs/history/ ..."
mkdir -p "$REPO_ROOT/docs"
if git -C "$REPO_ROOT" mv history docs/history 2>/dev/null; then
echo " ✓ history/ → docs/history/ verschoben (git mv zum Commit vormerken)"
elif mv "$REPO_ROOT/history" "$REPO_ROOT/docs/history" 2>/dev/null; then
echo " ✓ history/ → docs/history/ verschoben (mv)"
else
echo " ✗ Migration fehlgeschlagen bitte manuell: git mv history docs/history"
fi
elif [ -d "$REPO_ROOT/history" ] && [ -d "$REPO_ROOT/docs/history" ]; then
echo " ⚠ history/ UND docs/history/ vorhanden bitte manuell zusammenführen:"
echo " git mv history/prompts/* docs/history/prompts/ && git rm -r history"
fi
# ── 4a. Git-Hooks aktualisieren ──────────────────────────────────────
HOOKS_DIR="$REPO_ROOT/.git/hooks" HOOKS_DIR="$REPO_ROOT/.git/hooks"
mkdir -p "$HOOKS_DIR" mkdir -p "$HOOKS_DIR"
HOOKS_UPDATED=0 HOOKS_UPDATED=0
# shellcheck disable=SC2043 # bewusst erweiterbar: weitere Hook-Namen koennen ergaenzt werden
for hook in pre-commit; do for hook in pre-commit; do
if [ -f "$SOURCE/git-templates/hooks/$hook" ]; then if [ -f "$SOURCE/git-templates/hooks/$hook" ]; then
cp "$SOURCE/git-templates/hooks/$hook" "$HOOKS_DIR/$hook" cp "$SOURCE/git-templates/hooks/$hook" "$HOOKS_DIR/$hook"

View file

@ -83,7 +83,7 @@ end
set GIT_TEMPLATE_DIR $HOME/.git-templates set GIT_TEMPLATE_DIR $HOME/.git-templates
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \ mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \
$GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \ $GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \
$GIT_TEMPLATE_DIR/history/summary $GIT_TEMPLATE_DIR/docs/history/summary
cp $REPO_DIR/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.github/ cp $REPO_DIR/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.github/
cp $REPO_DIR/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/ cp $REPO_DIR/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
cp $REPO_DIR/git-templates/.vscode/extensions.json $GIT_TEMPLATE_DIR/.vscode/ cp $REPO_DIR/git-templates/.vscode/extensions.json $GIT_TEMPLATE_DIR/.vscode/
@ -92,7 +92,7 @@ chmod +x $GIT_TEMPLATE_DIR/hooks/pre-commit
cp $REPO_DIR/git-templates/docs/USER.md $GIT_TEMPLATE_DIR/docs/ cp $REPO_DIR/git-templates/docs/USER.md $GIT_TEMPLATE_DIR/docs/
cp $REPO_DIR/git-templates/docs/ADMIN.md $GIT_TEMPLATE_DIR/docs/ cp $REPO_DIR/git-templates/docs/ADMIN.md $GIT_TEMPLATE_DIR/docs/
cp $REPO_DIR/git-templates/docs/MAINTAINER.md $GIT_TEMPLATE_DIR/docs/ cp $REPO_DIR/git-templates/docs/MAINTAINER.md $GIT_TEMPLATE_DIR/docs/
cp $REPO_DIR/git-templates/history/summary/PROJECT_CONTEXT.md $GIT_TEMPLATE_DIR/history/summary/ cp $REPO_DIR/git-templates/docs/history/summary/PROJECT_CONTEXT.md $GIT_TEMPLATE_DIR/docs/history/summary/
echo " ✓ git-templates deployed → $GIT_TEMPLATE_DIR" echo " ✓ git-templates deployed → $GIT_TEMPLATE_DIR"
# init.templateDir bewusst NICHT global setzen (sonst erbt jeder git init/clone den Gate). # init.templateDir bewusst NICHT global setzen (sonst erbt jeder git init/clone den Gate).
set CURRENT_TPL (git config --global --get init.templateDir 2>/dev/null) set CURRENT_TPL (git config --global --get init.templateDir 2>/dev/null)

View file

@ -81,7 +81,7 @@ done
GIT_TEMPLATE_DIR="$HOME/.git-templates" GIT_TEMPLATE_DIR="$HOME/.git-templates"
mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \ mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \
"$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \ "$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \
"$GIT_TEMPLATE_DIR/history/summary" "$GIT_TEMPLATE_DIR/docs/history/summary"
cp "$REPO_DIR/git-templates/.github/copilot-instructions.md" "$GIT_TEMPLATE_DIR/.github/" cp "$REPO_DIR/git-templates/.github/copilot-instructions.md" "$GIT_TEMPLATE_DIR/.github/"
cp "$REPO_DIR/git-templates/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/" cp "$REPO_DIR/git-templates/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/"
cp "$REPO_DIR/git-templates/.vscode/extensions.json" "$GIT_TEMPLATE_DIR/.vscode/" cp "$REPO_DIR/git-templates/.vscode/extensions.json" "$GIT_TEMPLATE_DIR/.vscode/"
@ -90,7 +90,7 @@ chmod +x "$GIT_TEMPLATE_DIR/hooks/pre-commit"
cp "$REPO_DIR/git-templates/docs/USER.md" "$GIT_TEMPLATE_DIR/docs/" cp "$REPO_DIR/git-templates/docs/USER.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$REPO_DIR/git-templates/docs/ADMIN.md" "$GIT_TEMPLATE_DIR/docs/" cp "$REPO_DIR/git-templates/docs/ADMIN.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$REPO_DIR/git-templates/docs/MAINTAINER.md" "$GIT_TEMPLATE_DIR/docs/" cp "$REPO_DIR/git-templates/docs/MAINTAINER.md" "$GIT_TEMPLATE_DIR/docs/"
cp "$REPO_DIR/git-templates/history/summary/PROJECT_CONTEXT.md" "$GIT_TEMPLATE_DIR/history/summary/" cp "$REPO_DIR/git-templates/docs/history/summary/PROJECT_CONTEXT.md" "$GIT_TEMPLATE_DIR/docs/history/summary/"
echo " ✓ git-templates deployed → $GIT_TEMPLATE_DIR" echo " ✓ git-templates deployed → $GIT_TEMPLATE_DIR"
# init.templateDir wird bewusst NICHT global gesetzt sonst wuerde jeder # init.templateDir wird bewusst NICHT global gesetzt sonst wuerde jeder
# 'git init'/'git clone' (auch fremde Repos) automatisch den Quality Gate erben. # 'git init'/'git clone' (auch fremde Repos) automatisch den Quality Gate erben.
@ -131,6 +131,7 @@ if [[ "$CURRENT_INIT_ALIAS" == *copilot-bootstrap* ]]; then
echo " ✓ alter invasiver 'git init'-Alias entfernt" echo " ✓ alter invasiver 'git init'-Alias entfernt"
fi fi
# Opt-in: explizites 'git init-copilot' macht git init + bootstrap. # Opt-in: explizites 'git init-copilot' macht git init + bootstrap.
# shellcheck disable=SC2016 # Alias absichtlich literal git expandiert zur Laufzeit
git config --global alias.init-copilot '!f() { dir=.; for a in "$@"; do case "$a" in -*) ;; *) dir="$a" ;; esac; done; "$(git --exec-path)/git-init" "$@" && "$HOME/.local/bin/copilot-bootstrap.sh" "$dir"; }; f' git config --global alias.init-copilot '!f() { dir=.; for a in "$@"; do case "$a" in -*) ;; *) dir="$a" ;; esac; done; "$(git --exec-path)/git-init" "$@" && "$HOME/.local/bin/copilot-bootstrap.sh" "$dir"; }; f'
echo " ✓ git alias 'init-copilot' gesetzt (opt-in: git init + copilot-bootstrap)" echo " ✓ git alias 'init-copilot' gesetzt (opt-in: git init + copilot-bootstrap)"
git config --global alias.copilot-update '!~/.local/bin/copilot-update.sh' git config --global alias.copilot-update '!~/.local/bin/copilot-update.sh'

View file

@ -13,7 +13,7 @@ trap 'rm -rf "$WORK"' EXIT
build_template() { build_template() {
tpl="$1" tpl="$1"
mkdir -p "$tpl/.github" "$tpl/.vscode" "$tpl/hooks" "$tpl/docs" "$tpl/history/summary" mkdir -p "$tpl/.github" "$tpl/.vscode" "$tpl/hooks" "$tpl/docs" "$tpl/docs/history/summary"
echo "framework" > "$tpl/.github/copilot-instructions.md" echo "framework" > "$tpl/.github/copilot-instructions.md"
echo '{}' > "$tpl/.vscode/settings.json" echo '{}' > "$tpl/.vscode/settings.json"
echo '{}' > "$tpl/.vscode/extensions.json" echo '{}' > "$tpl/.vscode/extensions.json"
@ -22,7 +22,7 @@ build_template() {
for d in USER ADMIN MAINTAINER; do for d in USER ADMIN MAINTAINER; do
echo "$d" > "$tpl/docs/$d.md" echo "$d" > "$tpl/docs/$d.md"
done done
echo ctx > "$tpl/history/summary/PROJECT_CONTEXT.md" echo ctx > "$tpl/docs/history/summary/PROJECT_CONTEXT.md"
} }
assert_file() { assert_file() {
@ -50,7 +50,7 @@ run_case() {
assert_file "$target/docs/USER.md" assert_file "$target/docs/USER.md"
assert_file "$target/docs/ADMIN.md" assert_file "$target/docs/ADMIN.md"
assert_file "$target/docs/MAINTAINER.md" assert_file "$target/docs/MAINTAINER.md"
assert_file "$target/history/summary/PROJECT_CONTEXT.md" assert_file "$target/docs/history/summary/PROJECT_CONTEXT.md"
assert_file "$target/.git/hooks/pre-commit" assert_file "$target/.git/hooks/pre-commit"
assert_file "$target/.git/hooks/post-commit" assert_file "$target/.git/hooks/post-commit"
assert_file "$target/data/.gitkeep" assert_file "$target/data/.gitkeep"

View file

@ -36,7 +36,7 @@
"text": "Responses: short and precise. No padding, no repetition. Code comments in English. Chat explanations can be in German." "text": "Responses: short and precise. No padding, no repetition. Code comments in English. Chat explanations can be in German."
}, },
{ {
"text": "MANDATORY Agent Session Protocol: (1) START: If the file history/summary/PROJECT_CONTEXT.md exists in the repo, read it FIRST before doing anything else. (2) END: After completing any meaningful task, you MUST create a log file in history/prompts/YYYY-MM-DD_short-title.md documenting what was done, and update history/summary/PROJECT_CONTEXT.md with the current project state. This is not optional and must not be skipped. If the user ends the session without asking for it, do it anyway and stage the files." "text": "MANDATORY Agent Session Protocol: (1) START: If the file docs/history/summary/PROJECT_CONTEXT.md exists in the repo, read it FIRST before doing anything else. (2) END: After completing any meaningful task, you MUST create a log file in docs/history/prompts/YYYY-MM-DD_short-title.md documenting what was done, and update docs/history/summary/PROJECT_CONTEXT.md with the current project state. This is not optional and must not be skipped. If the user ends the session without asking for it, do it anyway and stage the files."
} }
], ],
// Commit-Messages immer als Conventional Commits // Commit-Messages immer als Conventional Commits