Compare commits
8 commits
114bb5b22b
...
5dc89f01a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dc89f01a7 | ||
|
|
2b20a985a5 | ||
|
|
be5ff0fda3 | ||
|
|
afd5b38ca9 | ||
|
|
deca872ab2 | ||
|
|
9e14a5fe90 | ||
|
|
5890bff4e0 | ||
|
|
80b6248fe3 |
27 changed files with 1057 additions and 236 deletions
20
.github/copilot-instructions.md
vendored
20
.github/copilot-instructions.md
vendored
|
|
@ -5,11 +5,11 @@
|
|||
> Diese Sektion hat höchste Priorität und darf nicht ignoriert werden.
|
||||
|
||||
**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
|
||||
|
||||
**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`)
|
||||
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.
|
||||
⚠ 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.
|
||||
3. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
4. **Stage beide Dateien VOR `git commit`:** `git add history/`
|
||||
⚠ 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 `docs/history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
4. **Stage beide Dateien VOR `git commit`:** `git add docs/history/`
|
||||
Der pre-commit Hook (Check 6) blockiert wenn:
|
||||
- keine `*_session.md` gestaged ist
|
||||
- der Dateiname nicht mit dem heutigen Datum beginnt
|
||||
|
|
@ -91,10 +91,10 @@
|
|||
- Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren
|
||||
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
|
||||
|
||||
### Agent History (`/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)
|
||||
- **Komprimierter Kontext** → `history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
### Agent History (`/docs/history/`)
|
||||
- **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** → `docs/history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `docs/history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
- **Am Ende jeder Session:** beide Dateien committen
|
||||
- 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`
|
||||
- [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`)
|
||||
- [ ] 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
|
||||
- [ ] No dead code, no TODOs left behind (or tracked as issues)
|
||||
- [ ] pre-commit Quality Gate bestanden
|
||||
|
|
|
|||
39
.github/workflows/ci.yml
vendored
Normal file
39
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
shell:
|
||||
name: Lint & self-test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: ShellCheck (POSIX/bash scripts + git hooks)
|
||||
run: |
|
||||
shellcheck --version
|
||||
shellcheck scripts/*.sh \
|
||||
git-templates/hooks/pre-commit \
|
||||
git-templates/hooks/post-merge \
|
||||
git-templates/hooks/post-commit
|
||||
|
||||
- name: Install fish
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq fish
|
||||
|
||||
- name: Fish syntax check
|
||||
run: |
|
||||
for f in scripts/*.fish; do
|
||||
echo "fish -n $f"
|
||||
fish -n "$f"
|
||||
done
|
||||
|
||||
- name: Self-test (bootstrap dry-run, sh + fish)
|
||||
run: sh scripts/selftest.sh
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,6 +1,9 @@
|
|||
.env
|
||||
*.local
|
||||
|
||||
# Windows Mark-of-the-Web / NTFS ADS cruft (entsteht beim Download/Entpacken auf NTFS)
|
||||
*:Zone.Identifier
|
||||
|
||||
# Persistente Service-Daten (nie committen!)
|
||||
data/**/*
|
||||
|
||||
|
|
|
|||
59
README.md
59
README.md
|
|
@ -8,7 +8,7 @@ Dieses Repo enthält alle Konfigurationsdateien die nötig sind um GitHub Copilo
|
|||
|
||||
- **User-Level Settings** – Copilot-Flags und Senior-Dev-Grundverhalten (per Settings Sync auf alle Geräte)
|
||||
- **Prompt Files** – 10 wiederverwendbare Agent-Workflows (`/requirements`, `/new-feature`, `/architecture`, etc.)
|
||||
- **Git-Templates** – automatisch in jedes neue Repo kopiert via `git init` (per Git-Alias)
|
||||
- **Git-Templates** – per Opt-in in ein Repo kopiert (`git init-copilot` oder `copilot-bootstrap.sh`)
|
||||
- **Bootstrap-Skript** – bestehende und geclonte Repos in Sekunden ausstatten (POSIX sh, läuft überall)
|
||||
- **Update-Mechanismus** – Templates und Prompts in allen Repos mit einem Befehl aktuell halten: `git copilot-update`
|
||||
|
||||
|
|
@ -24,19 +24,39 @@ git copilot-update
|
|||
```
|
||||
|
||||
Was das macht:
|
||||
1. **Setup-Repo pullen** – `~/.copilot-setup/` (SSH, HTTP-Fallback zu `http://192.168.178.6:8083/cschulz/rd13_copilot_setup`)
|
||||
1. **Setup-Quelle holen** – aus konfiguriertem Remote oder lokalem Klon (`COPILOT_SETUP_DIR`); offline nutzbar
|
||||
2. **Globale Templates updaten** – `~/.git-templates/` + VS Code Prompt-Dateien
|
||||
3. **Repo-lokale Hooks updaten** – `.git/hooks/pre-commit`
|
||||
4. **`copilot-instructions.md`** – nur überschreiben wenn noch TODO-Platzhalter enthalten (Backup `.bak` wird angelegt)
|
||||
|
||||
Die Remote-Quelle ist **nicht** fest verdrahtet. Konfiguration (Vorrang: Env > Config-Datei):
|
||||
|
||||
| Variable | Zweck |
|
||||
|---|---|
|
||||
| `COPILOT_SETUP_REMOTE_SSH` | SSH-URL des Setup-Repos |
|
||||
| `COPILOT_SETUP_REMOTE_HTTP` | HTTP-URL (Fallback) |
|
||||
| `COPILOT_SETUP_DIR` | Lokaler Klon/Arbeitskopie (Offline-Betrieb) |
|
||||
| `COPILOT_SETUP_CONFIG` | Alternativer Pfad zur Config-Datei |
|
||||
|
||||
Config-Datei (sh-Syntax) unter `~/.config/copilot-setup/config`:
|
||||
|
||||
```sh
|
||||
COPILOT_SETUP_REMOTE_SSH="ssh://git@host:22/you/rd13_copilot_setup.git"
|
||||
COPILOT_SETUP_REMOTE_HTTP="https://host/you/rd13_copilot_setup.git"
|
||||
```
|
||||
|
||||
Ist keine Quelle erreichbar, endet `git copilot-update` **ohne Fehler** (graceful skip) –
|
||||
es gibt dann nichts zu aktualisieren.
|
||||
|
||||
> **Empfehlung:** In jedem Repo nach einem `git pull` auf dem Setup-Repo ausführen,
|
||||
> oder wenn ein neues Feature-Prompt oder eine Hook-Verbesserung verfügbar ist.
|
||||
|
||||
### Auto-Update für das Setup-Repo selbst
|
||||
### Opt-in: Auto-Deploy für das Setup-Repo selbst
|
||||
|
||||
Nach `deploy.sh` ist im Setup-Repo selbst ein `post-merge` Hook aktiv:
|
||||
Standardmäßig setzt `deploy.sh` **keine** automatischen Hooks. Wer will, dass nach jedem
|
||||
`git pull` im Setup-Repo automatisch neu deployt wird:
|
||||
```bash
|
||||
git pull # im Setup-Repo → deploy.sh läuft automatisch → alle Templates sofort aktuell
|
||||
bash scripts/deploy.sh --with-self-update-hook # installiert post-merge Auto-Deploy
|
||||
```
|
||||
|
||||
### Opt-in: Auto-Update in anderen Repos nach git pull
|
||||
|
|
@ -62,7 +82,13 @@ bash scripts/deploy.sh # macOS (bash)
|
|||
fish scripts/deploy.fish # Linux mit fish
|
||||
```
|
||||
|
||||
Das Skript legt alles an den richtigen Orten ab.
|
||||
Das Skript legt alles an den richtigen Orten ab. Es ist **nicht-invasiv**: es überschreibt
|
||||
weder den globalen `git init` noch setzt es `init.templateDir` (fremde `git init`/`git clone`
|
||||
bleiben unberührt). Für Auto-Bootstrap eines neuen Repos gibt es den Opt-in-Alias:
|
||||
|
||||
```bash
|
||||
git init-copilot mein-neues-repo # = git init + copilot-bootstrap
|
||||
```
|
||||
|
||||
### Bestehende oder geclonte Repos ausstatten
|
||||
|
||||
|
|
@ -99,7 +125,7 @@ rd13_copilot_setup/
|
|||
│ ├── done-check.prompt.md /done-check – Definition of Done Checkliste
|
||||
│ ├── docker.prompt.md /docker – Docker/Compose-Aufgaben
|
||||
│ └── history.prompt.md /history – Agent-History loggen + Kontext aktualisieren
|
||||
├── git-templates/ ← Wird via git config --global init.templateDir gesetzt
|
||||
├── git-templates/ ← Quelle für ~/.git-templates (kein globales init.templateDir)
|
||||
│ ├── .github/
|
||||
│ │ └── copilot-instructions.md ← Template mit TODO-Feldern + Konventionen
|
||||
│ ├── .vscode/
|
||||
|
|
@ -111,10 +137,10 @@ rd13_copilot_setup/
|
|||
│ ├── docs/
|
||||
│ │ ├── USER.md ← Template: Endnutzer-Dokumentation
|
||||
│ │ ├── ADMIN.md ← Template: Administrator-Dokumentation
|
||||
│ │ └── MAINTAINER.md ← Template: Entwickler-Dokumentation
|
||||
│ └── history/
|
||||
│ └── summary/
|
||||
│ └── PROJECT_CONTEXT.md ← Template: Agent-Kontext-Summary
|
||||
│ │ ├── MAINTAINER.md ← Template: Entwickler-Dokumentation
|
||||
│ │ └── history/
|
||||
│ │ └── summary/
|
||||
│ │ └── PROJECT_CONTEXT.md ← Template: Agent-Kontext-Summary
|
||||
├── docs/
|
||||
│ ├── USER.md ← Benutzerhandbuch (Einrichtung + Nutzung)
|
||||
│ ├── ADMIN.md ← Administrator-Handbuch (Deploy, Hooks, PATH)
|
||||
|
|
@ -159,7 +185,7 @@ rd13_copilot_setup/
|
|||
|
||||
## Was jedes Repo automatisch bekommt
|
||||
|
||||
Nach `git init` (via Alias) oder `copilot-bootstrap.sh`:
|
||||
Nach `git init-copilot` oder `copilot-bootstrap.sh`:
|
||||
|
||||
| Was | Wo |
|
||||
|---|---|
|
||||
|
|
@ -167,8 +193,8 @@ Nach `git init` (via Alias) oder `copilot-bootstrap.sh`:
|
|||
| VS Code-Einstellungen | `.vscode/` |
|
||||
| **pre-commit Quality Gate** | `.git/hooks/pre-commit` |
|
||||
| **Persistente Daten (gitignored)** | `data/` |
|
||||
| **Agent-Konversationen (committed)** | `history/prompts/` |
|
||||
| **Agent-Kontext-Summary (committed)** | `history/summary/PROJECT_CONTEXT.md` |
|
||||
| **Agent-Konversationen (committed)** | `docs/history/prompts/` |
|
||||
| **Agent-Kontext-Summary (committed)** | `docs/history/summary/PROJECT_CONTEXT.md` |
|
||||
| **Endnutzer-Dokumentation** | `docs/USER.md` |
|
||||
| **Administrator-Dokumentation** | `docs/ADMIN.md` |
|
||||
| **Entwickler-Dokumentation** | `docs/MAINTAINER.md` |
|
||||
|
|
@ -194,9 +220,10 @@ Nach `git init` (via Alias) oder `copilot-bootstrap.sh`:
|
|||
|
||||
## Neues Repo einrichten – Checkliste
|
||||
|
||||
Nach `git init` (mit eingerichtetem Alias) passiert alles **automatisch**.
|
||||
Mit dem Opt-in-Alias `git init-copilot <pfad>` passiert alles **automatisch**
|
||||
(= `git init` + `copilot-bootstrap.sh`). Der Standard-`git init` bleibt unberührt.
|
||||
|
||||
Nach `git clone` oder ohne Alias:
|
||||
Nach `git clone` oder für ein bestehendes Repo:
|
||||
|
||||
```bash
|
||||
# Option A: Bootstrap-Skript (empfohlen)
|
||||
|
|
|
|||
|
|
@ -30,19 +30,27 @@ fish scripts/deploy.fish # fish (Linux)
|
|||
|
||||
| Schritt | Was | Ziel |
|
||||
|---|---|---|
|
||||
| 1 | VS Code User-dir ermitteln | plattformspezifisch (Server / lokal / macOS) |
|
||||
| 1 | VS Code User-dir ermitteln | Server / Insiders / VSCodium / Cursor / Flatpak / macOS / Windows-WSL |
|
||||
| 2 | `settings.json` deployen | `~/.vscode-server/data/User/` (oder Äquivalent) |
|
||||
| 3 | Prompt Files deployen | `~/.vscode-server/data/User/prompts/` |
|
||||
| 4 | Git-Templates deployen | `~/.git-templates/` inkl. Hooks, Docs, History-Template |
|
||||
| 5 | Bootstrap-Skript installieren | `~/.local/bin/copilot-bootstrap.sh` |
|
||||
| 6 | Git-Alias setzen | `~/.gitconfig` → `git init` ruft Bootstrap automatisch auf |
|
||||
| 5 | Bootstrap- + Update-Skripte installieren | `~/.local/bin/` |
|
||||
| 6 | Git-Aliase setzen | `~/.gitconfig` → `git init-copilot` (opt-in) + `git copilot-update` |
|
||||
|
||||
> **Nicht-invasiv:** `deploy.sh` setzt **kein** globales `init.templateDir` und überschreibt
|
||||
> **nicht** den Standard-`git init`. Fremde `git init`/`git clone` bleiben unberührt.
|
||||
> Auto-Bootstrap nur über den expliziten Alias `git init-copilot <pfad>`.
|
||||
> Optional installiert `bash scripts/deploy.sh --with-self-update-hook` den
|
||||
> post-merge Auto-Deploy für das Setup-Repo selbst.
|
||||
|
||||
---
|
||||
|
||||
## Git-Templates verwalten
|
||||
|
||||
Die Templates unter `git-templates/` werden beim Deployen nach `~/.git-templates/` kopiert.
|
||||
Sie werden bei **jedem** `git init` automatisch in neue Repos kopiert (via `init.templateDir`).
|
||||
Von dort nutzen sie `copilot-bootstrap.sh` und `git copilot-update`. Sie werden **nicht**
|
||||
automatisch bei jedem `git init` kopiert (kein globales `init.templateDir` mehr) – das
|
||||
geschieht nur per Opt-in: `git init-copilot <pfad>` oder `copilot-bootstrap.sh <pfad>`.
|
||||
|
||||
**Struktur nach Deploy:**
|
||||
```
|
||||
|
|
@ -85,7 +93,7 @@ chmod -x .git/hooks/pre-commit
|
|||
| 1 | Tests gestaged bei Code-Änderungen | `.copilot-no-tests` |
|
||||
| 2 | Mindestens eine Zielgruppen-Doku aktualisiert | `.copilot-no-docs` |
|
||||
| 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` |
|
||||
| 6 | Eine `*_session.md` ist in diesem Commit gestaged | – (kein Opt-out) |
|
||||
|
||||
|
|
@ -117,7 +125,7 @@ git copilot-update
|
|||
|
||||
| Schritt | Was | Besonderheit |
|
||||
|---|---|---|
|
||||
| 0 | Setup-Repo Cache aktualisieren (`~/.copilot-setup/`) | SSH, HTTP-Fallback |
|
||||
| 0 | Setup-Quelle holen (`~/.copilot-setup/` oder `COPILOT_SETUP_DIR`) | Remote o. lokaler Klon; offline = graceful skip |
|
||||
| 1b | **Script selbst aktualisieren** (`~/.local/bin/copilot-update.sh`) | startet neue Version via `exec` |
|
||||
| 2 | `~/.git-templates/` aktualisieren | Hooks, Docs, History-Template |
|
||||
| 3 | VS Code Prompt-Dateien aktualisieren | `~/.vscode-server/.../prompts/` |
|
||||
|
|
@ -131,6 +139,34 @@ git copilot-update
|
|||
|
||||
---
|
||||
|
||||
## Setup-Quelle konfigurieren (Remote / Offline)
|
||||
|
||||
`git copilot-update` braucht eine Quelle. Reihenfolge: **Umgebungsvariable > Config-Datei**.
|
||||
Ist nichts erreichbar, endet der Befehl **ohne Fehler** (graceful skip) – dann gibt es
|
||||
schlicht nichts zu aktualisieren.
|
||||
|
||||
| Variable | Zweck |
|
||||
|---|---|
|
||||
| `COPILOT_SETUP_REMOTE_SSH` | SSH-URL des Setup-Repos |
|
||||
| `COPILOT_SETUP_REMOTE_HTTP` | HTTP-URL (Fallback) |
|
||||
| `COPILOT_SETUP_DIR` | Lokaler Klon/Arbeitskopie – Offline-Betrieb ohne Netz |
|
||||
| `COPILOT_SETUP_CONFIG` | Alternativer Pfad zur Config-Datei |
|
||||
|
||||
Config-Datei (sh-Syntax) unter `~/.config/copilot-setup/config`
|
||||
(bzw. `$XDG_CONFIG_HOME/copilot-setup/config`):
|
||||
|
||||
```sh
|
||||
COPILOT_SETUP_REMOTE_SSH="ssh://git@dein-host:22/you/rd13_copilot_setup.git"
|
||||
COPILOT_SETUP_REMOTE_HTTP="https://dein-host/you/rd13_copilot_setup.git"
|
||||
# Alternativ rein lokal/offline:
|
||||
# COPILOT_SETUP_DIR="$HOME/dotfiles/copilot-setup"
|
||||
```
|
||||
|
||||
> Die fish-Variante **sourcet** die Datei nicht, sondern parst `KEY="value"` selbst –
|
||||
> dieselbe Datei funktioniert für beide Shells.
|
||||
|
||||
---
|
||||
|
||||
## Bestehende Repos ausstatten
|
||||
|
||||
```bash
|
||||
|
|
@ -144,13 +180,33 @@ Das Bootstrap-Skript legt idempotent an:
|
|||
- `.github/copilot-instructions.md`
|
||||
- `.vscode/settings.json` + `.vscode/extensions.json`
|
||||
- `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`
|
||||
- `.git/hooks/pre-commit`
|
||||
- `.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?
|
||||
|
||||
Das Bootstrap-Skript wird in `~/.local/bin/` installiert. Sicherstellen dass dieser Pfad im `$PATH` ist:
|
||||
|
|
@ -172,7 +228,8 @@ fish_add_path ~/.local/bin
|
|||
| Problem | Ursache | Lösung |
|
||||
|---|---|---|
|
||||
| `copilot-bootstrap.sh: command not found` | `~/.local/bin` nicht im PATH | Siehe "PATH" oben |
|
||||
| `git init` ruft Bootstrap nicht auf | Git-Alias nicht gesetzt | `deploy.sh` erneut ausführen |
|
||||
| `git init-copilot` nicht gefunden | Git-Alias nicht gesetzt | `deploy.sh` erneut ausführen |
|
||||
| `git copilot-update`: „Keine Setup-Quelle" | Remote nicht konfiguriert/erreichbar | `COPILOT_SETUP_REMOTE_*` oder `COPILOT_SETUP_DIR` setzen (s. Abschnitt oben) |
|
||||
| Hook schlägt fehl: Tests fehlen | Code geändert ohne Tests | `/write-tests` in Copilot Chat, oder `.copilot-no-tests` anlegen |
|
||||
| Hook schlägt fehl: Doku fehlt | Code geändert ohne Doku-Update | Docs aktualisieren, oder `.copilot-no-docs` anlegen |
|
||||
| Hook schlägt fehl: Session fehlt | `*_session.md` nicht gestaged | Copilot Chat → `/history`, dann `git add history/` |
|
||||
|
|
|
|||
|
|
@ -48,41 +48,44 @@ rd13_copilot_setup/
|
|||
│ │ ├── USER.md ← Template Endnutzer-Doku
|
||||
│ │ ├── ADMIN.md ← Template Admin-Doku
|
||||
│ │ ├── MAINTAINER.md ← Template Maintainer-Doku
|
||||
│ │ └── requirements/
|
||||
│ │ └── REQUIREMENTS.md ← Template für persistente Anforderungen
|
||||
│ └── history/
|
||||
│ └── summary/
|
||||
│ └── PROJECT_CONTEXT.md ← Template Agent-Kontext-Summary
|
||||
│ │ ├── requirements/
|
||||
│ │ │ └── REQUIREMENTS.md ← Template für persistente Anforderungen
|
||||
│ │ └── history/
|
||||
│ │ └── summary/
|
||||
│ │ └── PROJECT_CONTEXT.md ← Template Agent-Kontext-Summary
|
||||
├── prompts/ ← Wiederverwendbare Copilot-Workflows
|
||||
│ └── *.prompt.md ← /requirements /history /check-consistency ...
|
||||
├── scripts/
|
||||
│ ├── deploy.sh ← Bash-Deploy (macOS + Linux)
|
||||
│ ├── deploy.fish ← Fish-Deploy (Linux)
|
||||
│ ├── copilot-bootstrap.sh ← POSIX-sh Bootstrap für einzelne Repos
|
||||
│ ├── copilot-bootstrap.fish ← Fish-Variante (voll funktionsgleich)
|
||||
│ ├── copilot-update.sh ← Aktualisiert Templates + Hooks in Repos
|
||||
│ └── copilot-bootstrap.fish ← Fish-Variante (legacy, optional)
|
||||
│ ├── copilot-update.fish ← Fish-Variante
|
||||
│ └── selftest.sh ← CI/lokaler Bootstrap-Dry-Run (sh+fish)
|
||||
└── user-settings/
|
||||
└── settings.json ← VS Code User-Level Settings (Layer 1)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Wie `git init` automatisiert wird
|
||||
## Wie `git init-copilot` funktioniert (Opt-in)
|
||||
|
||||
Git hat keinen `post-init` Hook – `.github/` und `.vscode/` befinden sich im Working Tree, nicht in `.git/`, weshalb `init.templateDir` allein nicht ausreicht.
|
||||
Git hat keinen `post-init` Hook – `.github/` und `.vscode/` befinden sich im Working Tree, nicht in `.git/`, weshalb `init.templateDir` allein nicht ausreicht. Statt den globalen `git init` zu überschreiben (invasiv – würde auch bei `git clone` fremder Repos greifen), gibt es einen **separaten Opt-in-Alias** `init-copilot`.
|
||||
|
||||
**Lösung: Git-Alias mit Rekursionsschutz**
|
||||
**Git-Alias mit Rekursionsschutz**
|
||||
|
||||
In `~/.gitconfig` (wird von deploy.sh/.fish gesetzt):
|
||||
```ini
|
||||
[alias]
|
||||
init = !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
|
||||
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
|
||||
```
|
||||
|
||||
- `!` → externer Shell-Befehl (via `/bin/sh`), kein Git-Subcommand
|
||||
- `$(git --exec-path)/git-init` → ruft das echte `git-init`-Binary direkt auf, umgeht den Alias → **kein Rekursions-Loop**
|
||||
- Letzte Nicht-Flag-Argument wird als Zielverzeichnis erkannt (`dir=.` als Default)
|
||||
- `$(git --exec-path)/git-init` → ruft das echte `git-init`-Binary direkt auf → **kein Rekursions-Loop**
|
||||
- Letztes Nicht-Flag-Argument wird als Zielverzeichnis erkannt (`dir=.` als Default)
|
||||
- Nach erfolgreichem `git init` wird `copilot-bootstrap.sh` ausgeführt
|
||||
- Der Standard-`git init` bleibt unverändert; frühere invasive `alias.init`/`init.templateDir` werden von deploy.sh gezielt entfernt
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -108,9 +111,18 @@ Dateien unter `git-templates/` bearbeiten → `deploy.sh` ausführen → neue Re
|
|||
|
||||
**Wichtig beim Ändern von `git-templates/hooks/pre-commit`:** Die Datei muss nach dem Deployen ausführbar sein (`chmod +x`). `deploy.sh` erledigt das automatisch.
|
||||
|
||||
## Deploy-Skripte ändern
|
||||
## Shell-Skripte ändern
|
||||
|
||||
`deploy.sh` (bash) ist die Referenzimplementierung. `deploy.fish` sollte immer dieselben Schritte in Fish-Syntax abbilden. Nach Änderungen beide synchron halten.
|
||||
Alle Skripte gibt es paarweise (POSIX/bash + fish) und müssen synchron bleiben:
|
||||
`deploy`, `copilot-bootstrap`, `copilot-update`. Die `.sh`-Variante ist jeweils die
|
||||
Referenz, die `.fish`-Variante bildet dieselben Schritte in Fish-Syntax ab.
|
||||
|
||||
CI (`.github/workflows/ci.yml`) prüft bei jedem Push/PR:
|
||||
- `shellcheck` für alle `*.sh` + git-Hooks
|
||||
- `fish -n` für alle `*.fish`
|
||||
- `scripts/selftest.sh` (Bootstrap-Dry-Run sh+fish gegen isoliertes Fake-HOME)
|
||||
|
||||
Lokal vor dem Commit: `sh scripts/selftest.sh` ausführen.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -124,10 +136,13 @@ Dateien unter `git-templates/` bearbeiten → `deploy.sh` ausführen → neue Re
|
|||
| 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 |
|
||||
| `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` |
|
||||
| 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 |
|
||||
| Kein globales `init.templateDir`, Opt-in `git init-copilot` | Standard-`git init`/`git clone` bleiben unberührt; Quality Gate landet nur in bewusst gewählten Repos |
|
||||
| Remote-Quelle konfigurierbar (env/Config) + Offline-Modus | Keine hartkodierte Infrastruktur; `git copilot-update` läuft auch ohne Netz und endet graceful (exit 0) |
|
||||
| `detect_vscode_user_dir` in jedem Skript dupliziert | Skripte laufen standalone aus `~/.local/bin` → keine gemeinsame Lib sourcebar; bewusst kopiert statt geteilt |
|
||||
|
||||
## Bekannte Fallstricke
|
||||
|
||||
|
|
@ -136,3 +151,5 @@ Dateien unter `git-templates/` bearbeiten → `deploy.sh` ausführen → neue Re
|
|||
| `Syntax error: word unexpected` in `copilot-update.sh` Zeile ~60 | Box-Drawing-Zeichen (`────`) direkt ans `fi` angehängt statt auf eigener Zeile | `fi` allein auf Zeile, Kommentar-Linie separat (`# ──`) |
|
||||
| Self-Update überschreibt manuell deployten Fix | Self-Update holt Version aus Remote-Cache, der noch kaputten Stand hat | Erst committen + pushen, dann manuell deployen: `cp scripts/copilot-update.sh ~/.local/bin/` |
|
||||
| Leerzeile vor `---` in `copilot-instructions.md` wird entfernt | `$(awk ...)` strippt trailing newlines; `printf '%s\n%s\n'` setzt Blöcke direkt zusammen | `printf '%s\n\n%s\n'` verwenden |
|
||||
| `$USER` unbound unter `set -u` | `deploy.sh` nutzt `set -euo pipefail`; `$USER` fehlt in minimalen Envs (`env -i`, CI) | In `detect_vscode_user_dir` `${USER:-}` statt `$USER` |
|
||||
| fish: Funktion ändert Skript-Variable nicht | fish-Funktionen sehen Caller-Locals nicht | `set -g` für Zähler/Flags die eine Funktion schreibt (z. B. `_append_gitignore`) |
|
||||
|
|
|
|||
20
docs/USER.md
20
docs/USER.md
|
|
@ -28,7 +28,7 @@ Das Skript erledigt **einmalig** alles automatisch:
|
|||
| Prompt Files | `~/.vscode-server/data/User/prompts/` |
|
||||
| Git-Templates | `~/.git-templates/` |
|
||||
| Bootstrap-Skript | `~/.local/bin/copilot-bootstrap.sh` |
|
||||
| Git-Alias `init` | `~/.gitconfig` |
|
||||
| Git-Alias `init-copilot` (opt-in) | `~/.gitconfig` |
|
||||
|
||||
### Schritt 3: VS Code Settings Sync aktivieren (optional)
|
||||
|
||||
|
|
@ -41,11 +41,13 @@ Das Skript erledigt **einmalig** alles automatisch:
|
|||
### Neues Repo anlegen
|
||||
|
||||
```bash
|
||||
git init mein-projekt
|
||||
git init-copilot mein-projekt
|
||||
cd mein-projekt
|
||||
```
|
||||
|
||||
Der `git init`-Alias legt automatisch `.github/copilot-instructions.md` und `.vscode/` an. Danach:
|
||||
Der Opt-in-Alias `git init-copilot` macht `git init` **und** Bootstrap in einem Schritt –
|
||||
er legt `.github/copilot-instructions.md`, `.vscode/`, `docs/`, `history/` und den
|
||||
pre-commit Hook an. (Der normale `git init` bleibt unverändert.) Danach:
|
||||
|
||||
1. Die `TODO`-Felder in `.github/copilot-instructions.md` ausfüllen
|
||||
2. Committen:
|
||||
|
|
@ -84,7 +86,7 @@ In GitHub Copilot Chat einfach `/` tippen:
|
|||
|
||||
## Was jedes neue Repo bekommt
|
||||
|
||||
Nach `git init` oder `copilot-bootstrap.sh` erhält jedes Repo automatisch:
|
||||
Nach `git init-copilot` oder `copilot-bootstrap.sh` erhält jedes Repo automatisch:
|
||||
|
||||
| Was | Wo | Zweck |
|
||||
|---|---|---|
|
||||
|
|
@ -92,8 +94,8 @@ Nach `git init` oder `copilot-bootstrap.sh` erhält jedes Repo automatisch:
|
|||
| VS Code-Einstellungen | `.vscode/settings.json` | Repo-spezifische Editor-Konfiguration |
|
||||
| Empfohlene Extensions | `.vscode/extensions.json` | Extension-Vorschläge für das Team |
|
||||
| Persistente Daten | `data/` | Service-Daten getrennt nach Service-Namen |
|
||||
| Agent-Logs | `history/prompts/` | Vollständige Konversationen (committed) |
|
||||
| Agent-Kontext | `history/summary/PROJECT_CONTEXT.md` | Komprimierter Projektzustand für Agenten |
|
||||
| Agent-Logs | `docs/history/prompts/` | Vollständige Konversationen (committed) |
|
||||
| Agent-Kontext | `docs/history/summary/PROJECT_CONTEXT.md` | Komprimierter Projektzustand für Agenten |
|
||||
| Nutzer-Doku | `docs/USER.md` | Dokumentation für Endnutzer |
|
||||
| Admin-Doku | `docs/ADMIN.md` | Dokumentation für Administratoren |
|
||||
| Entwickler-Doku | `docs/MAINTAINER.md` | Dokumentation für Entwickler |
|
||||
|
|
@ -113,8 +115,10 @@ export PATH="$HOME/.local/bin:$PATH" # bash/zsh
|
|||
fish_add_path ~/.local/bin # fish
|
||||
```
|
||||
|
||||
**`git init` legt keine Copilot-Dateien an**
|
||||
Das deploy-Skript wurde noch nicht auf diesem System ausgeführt. Schritt 1+2 wiederholen.
|
||||
**`git init-copilot: command not found` oder keine Copilot-Dateien**
|
||||
Entweder wurde das deploy-Skript noch nicht ausgeführt (Schritt 1+2 wiederholen), oder
|
||||
du hast den normalen `git init` benutzt – nutze `git init-copilot` für Auto-Bootstrap,
|
||||
oder rufe in einem bestehenden Repo `copilot-bootstrap.sh` auf.
|
||||
|
||||
**Der pre-commit Hook blockiert meinen Commit**
|
||||
Der Hook hat Tests, Dokumentation, Session-Datei oder Requirements vermisst. Optionen:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,170 @@
|
|||
# Portabilität & Universalität des Setups – 2026-06-10
|
||||
|
||||
## Aufgabe / Ziel
|
||||
|
||||
Das `rd13_copilot_setup` portabler und universeller machen. Aus der Analyse in
|
||||
`memory.md` wurden 12 Arbeitspakete (WP1–WP12) abgeleitet und einzeln zur
|
||||
Umsetzung freigegeben. **Umgesetzt: WP1–WP7, WP11, WP12.** Ausgeschlossen
|
||||
(auf Wunsch, separat zu besprechen): **WP8, WP9** (settings.json) und **WP10**
|
||||
(Vendor-Naming).
|
||||
|
||||
## Verlauf
|
||||
|
||||
### Prompt 1
|
||||
Nutzer die Memory datei um dieses Repo portabler und universeller zu machen. Identifiziere alle möglichen arbeitsschritte und lass uns einzeln durchgehen was wir implementieren und was nicht.
|
||||
|
||||
### Antwort 1
|
||||
`memory.md` und das gesamte Repo analysiert (Skripte, settings.json, Prompts,
|
||||
git-templates/hooks). Daraus 12 Arbeitspakete abgeleitet und gruppiert:
|
||||
- Sichere Fixes: WP1 (bootstrap.fish `$HOME` + Parität), WP2 (Zone.Identifier + .gitignore)
|
||||
- Parametrisierung: WP3 (Remote konfigurierbar), WP4 (VS-Code-Pfad-Erkennung), WP5 (Offline-Modus)
|
||||
- Invasivität: WP6 (Opt-in `git init-copilot`), WP7 (post-merge opt-in)
|
||||
- settings.json: WP8/WP9
|
||||
- Universalität: WP10 (Vendor-Namen), WP11 (CI), WP12 (Doku)
|
||||
|
||||
Triage-Fragen gestellt (`vscode_askQuestions`), vom Nutzer abgebrochen.
|
||||
|
||||
### Prompt 2
|
||||
bevor ich die fragen beantworte, was sind diese Zone Identifier?
|
||||
|
||||
### Antwort 2
|
||||
Erklärt: `*:Zone.Identifier` sind Windows-Mark-of-the-Web-Metadaten (NTFS
|
||||
Alternate Data Streams, `ZoneId=3` = aus dem Internet). Beim Lesen über den
|
||||
WSL/Linux-Layer werden sie als separate Dateien sichtbar. Reiner Download-Müll,
|
||||
gehören weder committet noch deployt → WP2: löschen + Ignore-Pattern.
|
||||
|
||||
### Prompt 3
|
||||
ok alles implementieren aber nicht WP8,WP8 und WP10. Diese WPs will ich nicht implementiert haben und danach nochmal mit dir sprechen.
|
||||
|
||||
### Antwort 3
|
||||
Scope bestätigt: WP1,2,3,4,5,6,7,11,12 umsetzen; WP8+WP9 (settings.json) und
|
||||
WP10 (Vendor-Naming) ausgeschlossen. Finalen Phasenplan erstellt (Phase 1
|
||||
Hygiene/Bug → Phase 2 Skript-Portabilität → Phase 3 CI → Phase 4 Doku) und in
|
||||
Session-Memory gesichert.
|
||||
|
||||
### Prompt 4
|
||||
Start implementation
|
||||
|
||||
### Antwort 4
|
||||
Repo-Zustand geprüft – zu diesem Zeitpunkt **kein `.git`** (entpackte
|
||||
ZIP-Kopie). Implementierung gestoppt, da kein Versionierungsziel.
|
||||
|
||||
### Prompt 5
|
||||
ok lets then stop right hiere.
|
||||
|
||||
### Antwort 5
|
||||
Gestoppt, nichts geändert. Befund (kein git-Repo) in Session-Memory festgehalten.
|
||||
|
||||
### Prompt 6
|
||||
ok jetzt nochmal implementieren im richtigen repo!
|
||||
|
||||
### Antwort 6
|
||||
Echtes Repo gefunden und verifiziert (`~/workspace/ai-tooling/rd13_copilot_setup`
|
||||
ist jetzt git-Repo, `master`→`origin/master`, volle History, HEAD `114bb5b`).
|
||||
Anschließend alle freigegebenen WPs in 4 Phasen umgesetzt und je Phase committet.
|
||||
|
||||
**Phase 1 – Hygiene & Bug (Commit `80b6248`)**
|
||||
- WP2: `.gitignore` um `*:Zone.Identifier` ergänzt (Dateien existieren im echten Checkout nicht mehr).
|
||||
- WP1: `copilot-bootstrap.fish` neu geschrieben – `/home/rd13server/` → `$HOME`, volle Parität zur `.sh` (`--with-update-hook`, `data/`, `history/`, `docs/`, Hooks, `.gitignore`-Append inkl. Zone.Identifier).
|
||||
- Verifikation:
|
||||
```sh
|
||||
fish -n scripts/copilot-bootstrap.fish # OK
|
||||
# Smoke-Test gegen /tmp-Repo + Fake-Template: alle Dateien erzeugt, idempotent
|
||||
```
|
||||
|
||||
**Phase 2a – copilot-update.{sh,fish} (Commit `5890bff`)**
|
||||
- WP3: Remote-URLs aus `COPILOT_SETUP_REMOTE_SSH/_HTTP` (env) oder Config-Datei
|
||||
`~/.config/copilot-setup/config` (sh sourcet, fish parst `KEY="value"`). Env hat Vorrang.
|
||||
- WP5: Offline-Betrieb (lokaler Klon ohne `.git` nutzbar; Pull-Fehler nutzt Cache);
|
||||
fehlende/unerreichbare Quelle → graceful `exit 0` statt `exit 1`.
|
||||
- WP4: `detect_vscode_user_dir` (Server/Insiders/VSCodium/Cursor/Flatpak/macOS/Windows-WSL).
|
||||
- Verifikation (sh + fish, je 3 Szenarien):
|
||||
```
|
||||
TEST A: no remote, no cache -> graceful exit 0
|
||||
TEST B: offline local source -> templates kopiert, exit 0
|
||||
TEST C: config-file unreachable-> graceful exit 0
|
||||
```
|
||||
|
||||
**Phase 2b – deploy.{sh,fish} (Commit `9e14a5f`)**
|
||||
- WP6: kein globales `init.templateDir`/`git init`-Override mehr; Opt-in-Alias
|
||||
`git init-copilot`; frühere invasive Werte werden gezielt entfernt (guarded unset).
|
||||
- WP7: post-merge Auto-Deploy im Setup-Repo nur mit `--with-self-update-hook`.
|
||||
- WP4: gleiche `detect_vscode_user_dir`; `${USER:-}` gegen `set -u` abgesichert.
|
||||
- Verifikation (isoliertes HOME, kein Eingriff ins echte Repo):
|
||||
```
|
||||
deploy.sh/.fish ohne Flag -> kein alias.init, init-copilot gesetzt, kein init.templateDir, Hook gated
|
||||
--with-self-update-hook (Temp-Repo) -> post-merge hook geschrieben
|
||||
--bogus -> exit 2
|
||||
```
|
||||
|
||||
**Phase 3 – CI (Commit `deca872`)**
|
||||
- WP11: `.github/workflows/ci.yml` (shellcheck + `fish -n` + `scripts/selftest.sh`).
|
||||
- `scripts/selftest.sh`: Bootstrap-Dry-Run sh+fish gegen isoliertes Fake-HOME mit Assertions.
|
||||
- `copilot-bootstrap.sh` propagiert nun ebenfalls `*:Zone.Identifier` (Parität).
|
||||
- shellcheck-Direktiven für bewusste Muster (SC2016, SC1090, SC2043).
|
||||
- Verifikation:
|
||||
```sh
|
||||
/tmp/shellcheck scripts/*.sh git-templates/hooks/* # exit 0
|
||||
sh scripts/selftest.sh # PASS sh + PASS fish
|
||||
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" # YAML OK
|
||||
```
|
||||
|
||||
**Phase 4 – Doku (Commit `afd5b38`)**
|
||||
- WP12: README + USER + ADMIN + MAINTAINER aktualisiert (Env/Config, Offline,
|
||||
`init-copilot`, `--with-self-update-hook`, neue Editionen). Tote IP
|
||||
`192.168.178.6` aus der Doku entfernt. MAINTAINER: CI/selftest + neue Fallstricke.
|
||||
|
||||
### Prompt 7
|
||||
Können wir die history in die docs verschieben und einen migrationspfad für bestehende repos anlegen um alles etwas aufgeräumter zu haben.
|
||||
|
||||
### Antwort 7
|
||||
Konvention `history/` → `docs/history/` umgesetzt (prompts + summary/PROJECT_CONTEXT.md).
|
||||
Nutzer-Entscheidungen (Rückfrage): Migration **automatisch in `copilot-update`**, Hook **harter Cutover** auf `docs/history/`.
|
||||
|
||||
Umgesetzt:
|
||||
- `git-templates/hooks/pre-commit`: Check 4 (`docs/history/summary/PROJECT_CONTEXT.md`), Check 6 (`docs/history/prompts/*_session.md`), `history/` aus CODE_CHANGED-Exclusion entfernt (durch `docs/` abgedeckt).
|
||||
- Alle 6 Skripte: `deploy.{sh,fish}` + `copilot-bootstrap.{sh,fish}` (Template-Pfade `docs/history`), `copilot-update.{sh,fish}` (Template-Pfade + **Auto-Migrations-Block**: `history/` → `docs/history/` via `git mv`, Fallback `mv`; bei beiden vorhanden Warnung statt Abbruch). `selftest.sh` Pfade angepasst.
|
||||
- `git mv git-templates/history → git-templates/docs/history`; „gitignored"-Tippfehler im Template-MAINTAINER korrigiert.
|
||||
- `user-settings/settings.json` (Agent Session Protocol), `prompts/history.prompt.md`, beide `copilot-instructions.md`, `README.md`, `docs/USER/ADMIN/MAINTAINER.md` (+ ADMIN-Migrationsabschnitt).
|
||||
- Dogfood: `git mv history → docs/history` in diesem Repo (alle 7 Dateien mit Rename-Detection).
|
||||
|
||||
Verifikation:
|
||||
```sh
|
||||
/tmp/shellcheck scripts/*.sh git-templates/hooks/* # clean
|
||||
for f in scripts/*.fish; fish -n $f; end # clean
|
||||
python3 /tmp/check_jsonc.py # settings.json (JSONC) OK
|
||||
sh scripts/selftest.sh # PASS sh + fish
|
||||
sh /tmp/migration_test.sh $PWD # PASS sh + fish + both-present
|
||||
```
|
||||
Migrationstest-Ergebnis:
|
||||
```
|
||||
PASS: sh – history/ -> docs/history/ migriert
|
||||
PASS: fish – history/ -> docs/history/ migriert
|
||||
PASS: both-present – Warnung, history/ unangetastet
|
||||
```
|
||||
|
||||
Commits: `2b20a98` (Konvention+Tooling), Dogfood-Move + dieser Log-Eintrag im Folgecommit.
|
||||
|
||||
## Ergebnis
|
||||
|
||||
- Portabilität: 5 Commits (`80b6248`, `5890bff`, `9e14a5f`, `deca872`, `afd5b38`) + History-Commit.
|
||||
- History-Umzug: `history/` → `docs/history/` (Commit `2b20a98` + Dogfood-Folgecommit), inkl. Auto-Migration für bestehende Repos.
|
||||
- Alle Skripte shellcheck-sauber und `fish -n`-sauber; selftest + Migrationstest grün (sh+fish).
|
||||
- Keine hartkodierte Infrastruktur mehr in Skripten; Standard-`git init`/`clone` unberührt.
|
||||
|
||||
## Entscheidungen
|
||||
|
||||
- `detect_vscode_user_dir` bewusst in jedem Skript dupliziert (standalone aus
|
||||
`~/.local/bin` → keine sourcebare Lib).
|
||||
- Remote-Präzedenz: env > Config-Datei; keine Quelle = graceful skip (exit 0).
|
||||
- `init.templateDir`/`alias.init` werden nur entfernt, wenn sie auf unsere
|
||||
Templates/Bootstrap zeigen (kein Eingriff in fremde Konfiguration).
|
||||
- fish liest dieselbe sh-Config-Datei per Parser (sourcet sie nicht).
|
||||
|
||||
## Offene Punkte
|
||||
|
||||
- **WP8/WP9** (settings.json: Absolute-Mode-Widerspruch entschärfen, non-destruktiver
|
||||
Merge) – auf Wunsch zurückgestellt, separat besprechen.
|
||||
- **WP10** (Vendor-neutrale Namen `rd13`/`cschulz`/`rd13server`) – zurückgestellt.
|
||||
- Das **Remote dieses Repos** zeigt weiterhin auf die tote IP
|
||||
`ssh://git@192.168.178.6:2222/...` (bewusst nicht angefasst – separate Entscheidung).
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
## Aktueller Projektstatus
|
||||
|
||||
**Letzte Aktualisierung:** 2026-06-04 – Bekannte Fallstricke in copilot-instructions.md + Leerzeilen-Fix copilot-update
|
||||
**Letzte Aktualisierung:** 2026-06-10 – Agent-History nach `docs/history/` verschoben (+ Auto-Migration für bestehende Repos); zuvor Portabilität (WP1–7,11,12)
|
||||
**Phase:** Produktion / stabil – wird bei Bedarf erweitert
|
||||
|
||||
---
|
||||
|
|
@ -29,6 +29,12 @@ Quality Gate aus.
|
|||
|
||||
| Datum | Aufgabe | Ergebnis | Entscheidungen |
|
||||
|---|---|---|---|
|
||||
| 2026-06-10 | Agent-History → `docs/history/` + Auto-Migration | pre-commit Cutover, alle Skripte, settings/prompt/instructions/docs; `git mv` dieses Repos | `2b20a98` + Dogfood |
|
||||
| 2026-06-10 | WP12 Doku-Portabilität | README/USER/ADMIN/MAINTAINER: env/config, init-copilot, offline; tote IP raus | `afd5b38` |
|
||||
| 2026-06-10 | WP11 CI + selftest | `.github/workflows/ci.yml` (shellcheck+fish -n+selftest), `scripts/selftest.sh` | `deca872` |
|
||||
| 2026-06-10 | WP6/7/4 deploy nicht-invasiv | kein globales init.templateDir/init-Alias; Opt-in init-copilot; post-merge nur mit Flag | `9e14a5f` |
|
||||
| 2026-06-10 | WP3/5/4 update konfigurierbar/offline | Remote via env/config, graceful skip, portable Editor-Erkennung | `5890bff` |
|
||||
| 2026-06-10 | WP1/2 bootstrap.fish Parität + ADS-Ignore | `$HOME` statt `/home/rd13server`; `*:Zone.Identifier` ignoriert | `80b6248` |
|
||||
| 2026-06-02 | Konsistenzprüfung: alle --no-verify Referenzen entfernt | `docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`, beide `copilot-instructions.md`, `pre-commit` Check-Nummerierung `[1/3]→[1/4]` | Opt-outs (.copilot-no-tests/.copilot-no-docs) als Ersatz für --no-verify in Doku |
|
||||
| 2026-06-03 | Check 6 von Block → Warnung umgestellt | `git-templates/hooks/pre-commit` | Zu grob: heute-Prüfung blockiert Folgecommits; besser: Warnung wenn keine `*_session.md` im aktuellen Commit gestaged |
|
||||
| 2026-06-02 | pre-commit Check 6 – Session-Datei erforderlich | `git-templates/hooks/pre-commit` | Wurde als Block implementiert, am Folgetag als zu grob erkannt |
|
||||
|
|
@ -46,6 +52,9 @@ Quality Gate aus.
|
|||
- [ ] `docs/requirements/REQUIREMENTS.md` für dieses Setup-Repo selbst anlegen (aktuell nur Template in git-templates)
|
||||
- [ ] `.github/copilot-instructions.md` TODO-Felder ausfüllen (Stack, Architecture, NFRs dieses Repos)
|
||||
- [ ] Bei Änderungen an `git-templates/` immer `deploy.sh` neu ausführen (oder `git copilot-update` testen)
|
||||
- [ ] **WP8/WP9** (settings.json: Absolute-Mode-Widerspruch entschärfen + non-destruktiver Merge) – zurückgestellt, mit Nutzer besprechen
|
||||
- [ ] **WP10** (Vendor-neutrale Namen rd13/cschulz/rd13server) – zurückgestellt
|
||||
- [ ] Remote **dieses** Repos zeigt auf tote IP `192.168.178.6` – bewusst offen (separate Entscheidung)
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -57,12 +66,18 @@ Quality Gate aus.
|
|||
| `copilot-instructions.md` nur bei TODO überschreiben | User-Content bleibt erhalten; Backup `.bak` wird erstellt | `scripts/copilot-update.sh` |
|
||||
| post-merge Hook in bootstrapped Repos: opt-in | Kein Overhead bei jedem `git pull` in anderen Repos | `scripts/copilot-bootstrap.sh --with-update-hook` |
|
||||
| Setup-Repo selbst: post-merge Hook auto-installed | `deploy.sh` nach jedem `git pull` auf Setup-Repo | `scripts/deploy.sh` Block 7 |
|
||||
| `history/prompts/` committed | Lückenlose Projekt-History im Repo | `docs/MAINTAINER.md` |
|
||||
| `docs/history/prompts/` committed | Lückenlose Projekt-History im Repo | `docs/MAINTAINER.md` |
|
||||
| `data/` gitignored | Persistente Daten: Größe + Sicherheit | `docs/ADMIN.md` |
|
||||
| POSIX sh für Bootstrap | Läuft überall ohne Abhängigkeiten | `docs/MAINTAINER.md` |
|
||||
| Git-Alias statt Fish-Wrapper | Portabel: bash, sh, CI, GUI-Clients | `docs/MAINTAINER.md` |
|
||||
| `.copilot-no-tests` + `.copilot-no-docs` Opt-outs | Pre-commit Check 1 (Tests) und Check 2 (Doku) deaktivierbar für Repos ohne Framework/Doku-Pflicht | `git-templates/hooks/pre-commit` |
|
||||
| Kein `--no-verify` nirgendwo | Quality Gate darf nie umgangen werden; in `copilot-instructions.md` verboten, pre-commit enthält keinen Bypass-Hinweis | `git-templates/hooks/pre-commit`, `.github/copilot-instructions.md` |
|
||||
| Kein globales `init.templateDir`, Opt-in `git init-copilot` | Standard-`git init`/`clone` unberührt; Quality Gate nur in gewählten Repos | `scripts/deploy.{sh,fish}` |
|
||||
| Remote konfigurierbar (env/Config) + Offline-Modus | Keine hartkodierte Infrastruktur; läuft ohne Netz, graceful skip (exit 0) | `scripts/copilot-update.{sh,fish}` |
|
||||
| `detect_vscode_user_dir` dupliziert statt geteilt | Skripte laufen standalone aus `~/.local/bin` → keine sourcebare Lib | alle 4 Skripte |
|
||||
| CI: shellcheck + fish -n + selftest | Verhindert Regressionen in den Shell-Skripten | `.github/workflows/ci.yml`, `scripts/selftest.sh` |
|
||||
| Agent-History unter `docs/history/` | Aufgeräumte Struktur (alles Doku-Artefakte unter docs/); Cutover statt Dual-Pfad | pre-commit, alle Skripte |
|
||||
| Auto-Migration `history/` → `docs/history/` in copilot-update | Bestehende Repos ziehen ohne manuellen Eingriff nach (git mv, Fallback mv) | `scripts/copilot-update.{sh,fish}` |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -70,13 +85,13 @@ Quality Gate aus.
|
|||
|
||||
- **Requirements:** `docs/requirements/REQUIREMENTS.md` (committed, immer aktuell halten!)
|
||||
- **Persistente Daten:** `/data/` (gitignored, nie committen!)
|
||||
- **Agent-Logs (voll):** `/history/prompts/` (committed – vollständige History bleibt erhalten)
|
||||
- **Dieser Kontext:** `/history/summary/PROJECT_CONTEXT.md` (committed)
|
||||
- **Agent-Logs (voll):** `/docs/history/prompts/` (committed – vollständige History bleibt erhalten)
|
||||
- **Dieser Kontext:** `/docs/history/summary/PROJECT_CONTEXT.md` (committed)
|
||||
- **Deploy:** `bash scripts/deploy.sh` oder `fish scripts/deploy.fish`
|
||||
- **Bootstrap einzelnes Repo:** `sh ~/.local/bin/copilot-bootstrap.sh [/pfad/zum/repo]`
|
||||
- **Bootstrap mit Auto-Update-Hook:** `sh ~/.local/bin/copilot-bootstrap.sh --with-update-hook [/pfad]`
|
||||
- **Templates updaten (global + repo-lokal):** `git copilot-update` (in jedem Repo)
|
||||
- **Setup-Repo Cache:** `~/.copilot-setup/` (überschreibbar mit `COPILOT_SETUP_DIR=...`)
|
||||
- **Setup-Quelle:** `COPILOT_SETUP_REMOTE_SSH/_HTTP` oder `COPILOT_SETUP_DIR` (Config: `~/.config/copilot-setup/config`); Cache `~/.copilot-setup/`
|
||||
- **Git-Templates:** `~/.git-templates/` (nach Deploy)
|
||||
- **Prompts:** `~/.vscode-server/data/User/prompts/` (nach Deploy)
|
||||
|
||||
|
|
@ -86,7 +101,7 @@ Quality Gate aus.
|
|||
|
||||
1. Diese Datei gelesen? Gut – du kennst den Stand.
|
||||
2. Neues Feature → `git-templates/` anpassen → `deploy.sh` ausführen → committen
|
||||
3. Nach jeder Session: `history/prompts/YYYY-MM-DD_beschreibung.md` anlegen + diese Datei aktualisieren
|
||||
3. Nach jeder Session: `docs/history/prompts/YYYY-MM-DD_beschreibung_session.md` anlegen + diese Datei aktualisieren
|
||||
|
||||
---
|
||||
|
||||
20
git-templates/.github/copilot-instructions.md
vendored
20
git-templates/.github/copilot-instructions.md
vendored
|
|
@ -5,11 +5,11 @@
|
|||
> Diese Sektion hat höchste Priorität und darf nicht ignoriert werden.
|
||||
|
||||
**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
|
||||
|
||||
**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`)
|
||||
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.
|
||||
⚠ 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.
|
||||
3. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
4. **Stage beide Dateien VOR `git commit`:** `git add history/`
|
||||
⚠ 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 `docs/history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
4. **Stage beide Dateien VOR `git commit`:** `git add docs/history/`
|
||||
Der pre-commit Hook (Check 6) blockiert wenn:
|
||||
- keine `*_session.md` gestaged ist
|
||||
- der Dateiname nicht mit dem heutigen Datum beginnt
|
||||
|
|
@ -91,10 +91,10 @@
|
|||
- Copilot Chat: `/requirements` → Requirements-Workshop starten oder bestehende Requirements aktualisieren
|
||||
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
|
||||
|
||||
### Agent History (`/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)
|
||||
- **Komprimierter Kontext** → `history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
### Agent History (`/docs/history/`)
|
||||
- **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** → `docs/history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `docs/history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
- **Am Ende jeder Session:** beide Dateien committen
|
||||
- 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`
|
||||
- [ ] Alle 3 Zielgruppen-Dokumente vorhanden (`docs/USER.md`, `docs/ADMIN.md`, `docs/MAINTAINER.md`)
|
||||
- [ ] 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
|
||||
- [ ] No dead code, no TODOs left behind (or tracked as issues)
|
||||
- [ ] pre-commit Quality Gate bestanden
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@
|
|||
├── docs/
|
||||
│ ├── USER.md ← Endnutzer-Dokumentation
|
||||
│ ├── ADMIN.md ← Administrator-Dokumentation
|
||||
│ └── MAINTAINER.md ← Dieses Dokument
|
||||
├── history/
|
||||
│ ├── prompts/ ← Vollständige Agent-Konversationen (gitignored)
|
||||
│ ├── MAINTAINER.md ← Dieses Dokument
|
||||
│ └── history/
|
||||
│ ├── prompts/ ← Vollständige Agent-Konversationen (committed)
|
||||
│ └── summary/
|
||||
│ └── PROJECT_CONTEXT.md ← Aktueller Projektzustand für Agent-Kontext
|
||||
└── … ← Source Code
|
||||
|
|
@ -78,17 +78,17 @@ ADR-Dateien liegen unter `docs/adr/`. Format: `NNN-titel.md`.
|
|||
|
||||
## 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.
|
||||
|
||||
- Vollständige Konversationen: `history/prompts/` (committed – History bleibt vollständig erhalten)
|
||||
- Komprimierter Kontext: `history/summary/PROJECT_CONTEXT.md` (committed)
|
||||
- Vollständige Konversationen: `docs/history/prompts/` (committed – History bleibt vollständig erhalten)
|
||||
- Komprimierter Kontext: `docs/history/summary/PROJECT_CONTEXT.md` (committed)
|
||||
|
||||
---
|
||||
|
||||
## 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
|
||||
3. Branch: `git checkout -b feat/<ticket>-beschreibung`
|
||||
4. Implementieren + Tests schreiben
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# 1. Tests erstellt oder aktualisiert wurden
|
||||
# 2. Mindestens eine Zielgruppen-Dokumentation aktualisiert wurde
|
||||
# 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
|
||||
# 6. *_session.md muss in diesem Commit gestaged sein
|
||||
#
|
||||
|
|
@ -18,7 +18,7 @@ ERRORS=0
|
|||
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 -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$')
|
||||
|
||||
# Keine Code-Änderungen → Hook überspringen
|
||||
|
|
@ -89,13 +89,13 @@ if [ -n "$DOCS_DIR_STAGED" ] && [ -d "docs" ]; then
|
|||
fi
|
||||
|
||||
# ── Check 4: PROJECT_CONTEXT.md aktualisiert ──────────────────────────────────
|
||||
if [ -f "history/summary/PROJECT_CONTEXT.md" ]; then
|
||||
CONTEXT_STAGED=$(printf '%s\n' "$STAGED" | grep -F 'history/summary/PROJECT_CONTEXT.md')
|
||||
if [ -f "docs/history/summary/PROJECT_CONTEXT.md" ]; then
|
||||
CONTEXT_STAGED=$(printf '%s\n' "$STAGED" | grep -F 'docs/history/summary/PROJECT_CONTEXT.md')
|
||||
if [ -z "$CONTEXT_STAGED" ]; then
|
||||
echo ""
|
||||
echo "✗ AGENT QUALITY GATE [4/4]: PROJECT_CONTEXT.md nicht aktualisiert"
|
||||
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 " → Copilot Chat: /history (loggt Session + aktualisiert Kontext)"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
|
|
@ -124,8 +124,8 @@ fi
|
|||
# soll immer dokumentiert werden. Der Agent liest die bestehende Datei und
|
||||
# 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).
|
||||
if [ -d "history/prompts" ] && [ ! -f ".copilot-no-session" ]; then
|
||||
SESSION_STAGED=$(printf '%s\n' "$STAGED" | grep -E 'history/prompts/.*_session\.md$' | head -1)
|
||||
if [ -d "docs/history/prompts" ] && [ ! -f ".copilot-no-session" ]; then
|
||||
SESSION_STAGED=$(printf '%s\n' "$STAGED" | grep -E 'docs/history/prompts/.*_session\.md$' | head -1)
|
||||
if [ -z "$SESSION_STAGED" ]; then
|
||||
echo ""
|
||||
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 " Erwartet: Dateiname beginnt mit $TODAY"
|
||||
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))
|
||||
else
|
||||
# Datei muss mindestens einen ### Prompt-Eintrag enthalten
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Du hilfst dabei die Projekt-History zu pflegen. Es gibt zwei Aufgaben:
|
|||
|
||||
**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.
|
||||
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.
|
||||
|
|
@ -55,7 +55,7 @@ Struktur (bei neuer Datei):
|
|||
|
||||
## 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
|
||||
2. **"Erledigte Aufgaben"** – neue Zeile oben einfügen (neueste zuerst)
|
||||
3. **"Offene Aufgaben"** – Abgehaktes entfernen, Neues hinzufügen
|
||||
|
|
@ -76,6 +76,6 @@ lesen muss um sofort produktiv zu sein.
|
|||
|
||||
Nach Abschluss dieser Aufgabe:
|
||||
```bash
|
||||
git add history/
|
||||
git add docs/history/
|
||||
git commit -m "docs: update agent history and project context"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,16 +1,30 @@
|
|||
#!/usr/bin/env fish
|
||||
# copilot-bootstrap.fish
|
||||
# Fügt Copilot-Grundkonfiguration zu einem bestehenden oder neu geklonten Repo hinzu.
|
||||
# Funktions-Parität mit copilot-bootstrap.sh (POSIX-Variante).
|
||||
#
|
||||
# Usage:
|
||||
# fish copilot-bootstrap.fish # aktuelles Verzeichnis
|
||||
# fish copilot-bootstrap.fish /path/to/repo # anderes Verzeichnis
|
||||
# fish copilot-bootstrap.fish --with-update-hook # + post-merge Hook (auto-update nach git pull)
|
||||
|
||||
set TEMPLATE_DIR /home/rd13server/.git-templates
|
||||
set TARGET (test (count $argv) -gt 0; and echo $argv[1]; or echo (pwd))
|
||||
set TEMPLATE_DIR $HOME/.git-templates
|
||||
set WITH_UPDATE_HOOK 0
|
||||
set TARGET .
|
||||
|
||||
for arg in $argv
|
||||
switch $arg
|
||||
case --with-update-hook
|
||||
set WITH_UPDATE_HOOK 1
|
||||
case '-*'
|
||||
# andere Flags ignorieren
|
||||
case '*'
|
||||
set TARGET $arg
|
||||
end
|
||||
end
|
||||
|
||||
if not test -d "$TARGET/.git"
|
||||
echo "Error: $TARGET is not a git repository"
|
||||
echo "Error: $TARGET is not a git repository" >&2
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
|
@ -20,7 +34,7 @@ echo "Bootstrapping Copilot config in: $TARGET"
|
|||
if not test -f "$TARGET/.github/copilot-instructions.md"
|
||||
mkdir -p "$TARGET/.github"
|
||||
cp "$TEMPLATE_DIR/.github/copilot-instructions.md" "$TARGET/.github/copilot-instructions.md"
|
||||
echo " ✓ .github/copilot-instructions.md created (fill in TODO sections)"
|
||||
echo " ✓ .github/copilot-instructions.md created (TODO-Felder ausfüllen)"
|
||||
else
|
||||
echo " ─ .github/copilot-instructions.md already exists, skipping"
|
||||
end
|
||||
|
|
@ -43,7 +57,109 @@ else
|
|||
echo " ─ .vscode/extensions.json already exists, skipping"
|
||||
end
|
||||
|
||||
# ── data/ – Persistente Service-Daten ────────────────────────────────────────
|
||||
if not test -d "$TARGET/data"
|
||||
mkdir -p "$TARGET/data"
|
||||
touch "$TARGET/data/.gitkeep"
|
||||
echo " ✓ data/ created (persistente Service-Daten – gitignored)"
|
||||
else
|
||||
echo " ─ data/ already exists, skipping"
|
||||
end
|
||||
|
||||
# ── docs/history/ – Agent-History und Kontext-Summary ────────────────────────
|
||||
if not test -d "$TARGET/docs/history/prompts"
|
||||
mkdir -p "$TARGET/docs/history/prompts"
|
||||
echo " ✓ docs/history/prompts/ created (Agent-Logs – committed)"
|
||||
end
|
||||
if not test -f "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
|
||||
mkdir -p "$TARGET/docs/history/summary"
|
||||
cp "$TEMPLATE_DIR/docs/history/summary/PROJECT_CONTEXT.md" "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
|
||||
echo " ✓ docs/history/summary/PROJECT_CONTEXT.md created (Agent-Kontext – committed)"
|
||||
else
|
||||
echo " ─ docs/history/summary/PROJECT_CONTEXT.md already exists, skipping"
|
||||
end
|
||||
|
||||
# ── docs/ – Zielgruppen-Dokumentation ────────────────────────────────────────
|
||||
if not test -d "$TARGET/docs"
|
||||
mkdir -p "$TARGET/docs"
|
||||
cp "$TEMPLATE_DIR/docs/USER.md" "$TARGET/docs/USER.md"
|
||||
cp "$TEMPLATE_DIR/docs/ADMIN.md" "$TARGET/docs/ADMIN.md"
|
||||
cp "$TEMPLATE_DIR/docs/MAINTAINER.md" "$TARGET/docs/MAINTAINER.md"
|
||||
echo " ✓ docs/ created with USER.md, ADMIN.md, MAINTAINER.md (TODO-Felder ausfüllen)"
|
||||
else
|
||||
# Fehlende Zielgruppen-Docs ergänzen ohne vorhandene zu überschreiben
|
||||
for doc in USER ADMIN MAINTAINER
|
||||
if not test -f "$TARGET/docs/$doc.md"
|
||||
cp "$TEMPLATE_DIR/docs/$doc.md" "$TARGET/docs/$doc.md"
|
||||
echo " ✓ docs/$doc.md created"
|
||||
else
|
||||
echo " ─ docs/$doc.md already exists, skipping"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# ── Git-Hooks – Quality Gate + History ───────────────────────────────────────
|
||||
mkdir -p "$TARGET/.git/hooks"
|
||||
if not test -f "$TARGET/.git/hooks/pre-commit"
|
||||
cp "$TEMPLATE_DIR/hooks/pre-commit" "$TARGET/.git/hooks/pre-commit"
|
||||
chmod +x "$TARGET/.git/hooks/pre-commit"
|
||||
echo " ✓ .git/hooks/pre-commit installed (Quality Gate: Tests + Docs)"
|
||||
else
|
||||
echo " ─ .git/hooks/pre-commit already exists, skipping"
|
||||
end
|
||||
if not test -f "$TARGET/.git/hooks/post-commit"; and test -f "$TEMPLATE_DIR/hooks/post-commit"
|
||||
cp "$TEMPLATE_DIR/hooks/post-commit" "$TARGET/.git/hooks/post-commit"
|
||||
chmod +x "$TARGET/.git/hooks/post-commit"
|
||||
echo " ✓ .git/hooks/post-commit installed (Auto-History-Log)"
|
||||
end
|
||||
|
||||
# ── post-merge Hook – opt-in: automatisches copilot-update nach git pull ──────
|
||||
if test "$WITH_UPDATE_HOOK" -eq 1
|
||||
if test -f "$TEMPLATE_DIR/hooks/post-merge"
|
||||
if not test -f "$TARGET/.git/hooks/post-merge"
|
||||
cp "$TEMPLATE_DIR/hooks/post-merge" "$TARGET/.git/hooks/post-merge"
|
||||
chmod +x "$TARGET/.git/hooks/post-merge"
|
||||
echo " ✓ .git/hooks/post-merge installed (Copilot-Update nach git pull)"
|
||||
else
|
||||
echo " ─ .git/hooks/post-merge already exists, skipping"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# ── .gitignore – data/ + Windows-ADS ausschließen ───────────────────────────
|
||||
set -g GITIGNORE "$TARGET/.gitignore"
|
||||
set -g GITIGNORE_UPDATED 0
|
||||
|
||||
# set -g, damit die Funktion den Zähler im Skript-Scope ändern kann (fish-Scoping)
|
||||
function _append_gitignore --argument-names pattern comment
|
||||
if not grep -qF "$pattern" "$GITIGNORE" 2>/dev/null
|
||||
printf '\n%s\n%s\n' "$comment" "$pattern" >> "$GITIGNORE"
|
||||
set -g GITIGNORE_UPDATED 1
|
||||
end
|
||||
end
|
||||
|
||||
_append_gitignore "data/**/*" "# Persistente Service-Daten (nie committen!)"
|
||||
_append_gitignore "!data/.gitkeep" ""
|
||||
_append_gitignore "*:Zone.Identifier" "# Windows Mark-of-the-Web / NTFS ADS cruft"
|
||||
|
||||
if test "$GITIGNORE_UPDATED" -eq 1
|
||||
echo " ✓ .gitignore aktualisiert (data/ + Windows-ADS excluded)"
|
||||
else
|
||||
echo " ─ .gitignore already has required entries, skipping"
|
||||
end
|
||||
|
||||
functions -e _append_gitignore
|
||||
|
||||
echo ""
|
||||
echo "Done. Next steps:"
|
||||
echo " 1. Fill in TODO sections in .github/copilot-instructions.md"
|
||||
echo " 2. git add .github .vscode && git commit -m 'chore: add copilot workspace config'"
|
||||
echo "Done. Nächste Schritte:"
|
||||
echo " 1. TODO-Felder ausfüllen:"
|
||||
echo " - .github/copilot-instructions.md"
|
||||
echo " - docs/history/summary/PROJECT_CONTEXT.md"
|
||||
echo " - docs/USER.md, docs/ADMIN.md, docs/MAINTAINER.md"
|
||||
echo " 2. git add .github .vscode docs"
|
||||
echo " git commit -m 'chore: add copilot workspace config'"
|
||||
echo " 3. Templates aktuell halten: git copilot-update"
|
||||
echo ""
|
||||
echo " Hinweis: Git-Hooks (pre-commit, post-commit) werden NICHT automatisch"
|
||||
echo " aktualisiert wenn sie bereits existieren. Neue Hook-Versionen holen mit:"
|
||||
echo " git copilot-update"
|
||||
|
|
|
|||
|
|
@ -63,17 +63,17 @@ else
|
|||
echo " ─ data/ already exists, skipping"
|
||||
fi
|
||||
|
||||
# ── history/ – Agent-History und Kontext-Summary ─────────────────────────────
|
||||
if [ ! -d "$TARGET/history/prompts" ]; then
|
||||
mkdir -p "$TARGET/history/prompts"
|
||||
echo " ✓ history/prompts/ created (Agent-Logs – committed)"
|
||||
# ── docs/history/ – Agent-History und Kontext-Summary ────────────────────────
|
||||
if [ ! -d "$TARGET/docs/history/prompts" ]; then
|
||||
mkdir -p "$TARGET/docs/history/prompts"
|
||||
echo " ✓ docs/history/prompts/ created (Agent-Logs – committed)"
|
||||
fi
|
||||
if [ ! -f "$TARGET/history/summary/PROJECT_CONTEXT.md" ]; then
|
||||
mkdir -p "$TARGET/history/summary"
|
||||
cp "$TEMPLATE_DIR/history/summary/PROJECT_CONTEXT.md" "$TARGET/history/summary/PROJECT_CONTEXT.md"
|
||||
echo " ✓ history/summary/PROJECT_CONTEXT.md created (Agent-Kontext – committed)"
|
||||
if [ ! -f "$TARGET/docs/history/summary/PROJECT_CONTEXT.md" ]; then
|
||||
mkdir -p "$TARGET/docs/history/summary"
|
||||
cp "$TEMPLATE_DIR/docs/history/summary/PROJECT_CONTEXT.md" "$TARGET/docs/history/summary/PROJECT_CONTEXT.md"
|
||||
echo " ✓ docs/history/summary/PROJECT_CONTEXT.md created (Agent-Kontext – committed)"
|
||||
else
|
||||
echo " ─ history/summary/PROJECT_CONTEXT.md already exists, skipping"
|
||||
echo " ─ docs/history/summary/PROJECT_CONTEXT.md already exists, skipping"
|
||||
fi
|
||||
|
||||
# ── docs/ – Zielgruppen-Dokumentation ────────────────────────────────────────
|
||||
|
|
@ -136,9 +136,10 @@ _append_gitignore() {
|
|||
|
||||
_append_gitignore "data/**/*" "# Persistente Service-Daten (nie committen!)"
|
||||
_append_gitignore "!data/.gitkeep" ""
|
||||
_append_gitignore "*:Zone.Identifier" "# Windows Mark-of-the-Web / NTFS ADS cruft"
|
||||
|
||||
if [ "$GITIGNORE_UPDATED" -eq 1 ]; then
|
||||
echo " ✓ .gitignore aktualisiert (data/ excluded)"
|
||||
echo " ✓ .gitignore aktualisiert (data/ + Windows-ADS excluded)"
|
||||
else
|
||||
echo " ─ .gitignore already has required entries, skipping"
|
||||
fi
|
||||
|
|
@ -147,9 +148,9 @@ echo ""
|
|||
echo "Done. Nächste Schritte:"
|
||||
echo " 1. TODO-Felder ausfüllen:"
|
||||
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 " 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 " 3. Templates aktuell halten: git copilot-update"
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -11,44 +11,142 @@
|
|||
# fish ~/.local/bin/copilot-update.fish
|
||||
# git copilot-update (via Alias, ruft copilot-update.sh auf)
|
||||
|
||||
set SETUP_REPO_SSH "ssh://git@192.168.178.6:2222/cschulz/rd13_copilot_setup.git"
|
||||
set SETUP_REPO_HTTP "http://192.168.178.6:8083/cschulz/rd13_copilot_setup.git"
|
||||
# ── Konfiguration laden: env > config-file > leer ─────────────────────────
|
||||
# Env-Variablen (Vorrang):
|
||||
# COPILOT_SETUP_REMOTE_SSH / _HTTP Remote-URLs des Setup-Repos
|
||||
# COPILOT_SETUP_DIR lokaler Klon/Arbeitskopie (Offline)
|
||||
# COPILOT_SETUP_CONFIG alternativer Pfad zur Config-Datei
|
||||
# Config-Datei (sh-Syntax KEY="value", wird geparst): $XDG_CONFIG_HOME/copilot-setup/config
|
||||
# Standalone-Skript -> keine gemeinsame Lib sourcebar; gleiche Aufloesung in deploy.fish.
|
||||
|
||||
if set -q COPILOT_SETUP_DIR
|
||||
# Wert fuer KEY aus sh-style Config lesen (KEY="value" | KEY=value); letzte Definition gewinnt
|
||||
function _cfg_get --argument-names file key
|
||||
test -f "$file"; or return 1
|
||||
set -l line (grep -E "^[[:space:]]*$key=" "$file" 2>/dev/null | tail -n1)
|
||||
test -n "$line"; or return 1
|
||||
set -l val (string replace -r "^[[:space:]]*$key=" '' -- $line)
|
||||
set val (string trim -- $val)
|
||||
set val (string trim --chars '"' -- $val)
|
||||
set val (string trim --chars "'" -- $val)
|
||||
printf '%s' $val
|
||||
end
|
||||
|
||||
# VS Code User-Verzeichnis portabel ueber Editionen/OS ermitteln (identisch zu deploy.fish)
|
||||
function detect_vscode_user_dir
|
||||
for d in \
|
||||
"$HOME/.vscode-server/data/User" \
|
||||
"$HOME/.vscode-server-insiders/data/User" \
|
||||
"$HOME/Library/Application Support/Code/User" \
|
||||
"$HOME/Library/Application Support/Code - Insiders/User" \
|
||||
"$HOME/Library/Application Support/VSCodium/User" \
|
||||
"$HOME/Library/Application Support/Cursor/User" \
|
||||
"$HOME/.config/Code/User" \
|
||||
"$HOME/.config/Code - Insiders/User" \
|
||||
"$HOME/.config/VSCodium/User" \
|
||||
"$HOME/.config/Cursor/User" \
|
||||
"$HOME/.var/app/com.visualstudio.code/config/Code/User" \
|
||||
"/mnt/c/Users/$USER/AppData/Roaming/Code/User" \
|
||||
"/mnt/c/Users/$USER/AppData/Roaming/Code - Insiders/User"
|
||||
if test -d "$d"
|
||||
echo $d
|
||||
return 0
|
||||
end
|
||||
end
|
||||
switch (uname -s)
|
||||
case Darwin
|
||||
echo "$HOME/Library/Application Support/Code/User"
|
||||
case '*'
|
||||
echo "$HOME/.config/Code/User"
|
||||
end
|
||||
end
|
||||
|
||||
# Config-Datei-Pfad bestimmen
|
||||
if set -q COPILOT_SETUP_CONFIG
|
||||
set CONFIG_FILE $COPILOT_SETUP_CONFIG
|
||||
else if set -q XDG_CONFIG_HOME
|
||||
set CONFIG_FILE $XDG_CONFIG_HOME/copilot-setup/config
|
||||
else
|
||||
set CONFIG_FILE $HOME/.config/copilot-setup/config
|
||||
end
|
||||
|
||||
# Remote/Cache aufloesen: env hat Vorrang, sonst Config, sonst Default
|
||||
if set -q COPILOT_SETUP_REMOTE_SSH; and test -n "$COPILOT_SETUP_REMOTE_SSH"
|
||||
set SETUP_REPO_SSH $COPILOT_SETUP_REMOTE_SSH
|
||||
else
|
||||
set SETUP_REPO_SSH (_cfg_get $CONFIG_FILE COPILOT_SETUP_REMOTE_SSH)
|
||||
end
|
||||
|
||||
if set -q COPILOT_SETUP_REMOTE_HTTP; and test -n "$COPILOT_SETUP_REMOTE_HTTP"
|
||||
set SETUP_REPO_HTTP $COPILOT_SETUP_REMOTE_HTTP
|
||||
else
|
||||
set SETUP_REPO_HTTP (_cfg_get $CONFIG_FILE COPILOT_SETUP_REMOTE_HTTP)
|
||||
end
|
||||
|
||||
if set -q COPILOT_SETUP_DIR; and test -n "$COPILOT_SETUP_DIR"
|
||||
set CACHE_DIR $COPILOT_SETUP_DIR
|
||||
else
|
||||
set CACHE_DIR $HOME/.copilot-setup
|
||||
set CACHE_DIR (_cfg_get $CONFIG_FILE COPILOT_SETUP_DIR)
|
||||
test -n "$CACHE_DIR"; or set CACHE_DIR $HOME/.copilot-setup
|
||||
end
|
||||
|
||||
echo "=== Copilot Update ==="
|
||||
|
||||
# ── 1. Setup-Repo Cache aktuell halten ───────────────────────────────────────
|
||||
set HAVE_REMOTE 0
|
||||
if test -n "$SETUP_REPO_SSH"; or test -n "$SETUP_REPO_HTTP"
|
||||
set HAVE_REMOTE 1
|
||||
end
|
||||
|
||||
set SOURCE_OK 0
|
||||
if test -d $CACHE_DIR/.git
|
||||
if test $HAVE_REMOTE -eq 1
|
||||
echo " → Pulling latest from setup repo..."
|
||||
if git -C $CACHE_DIR pull --ff-only --quiet 2>/dev/null
|
||||
echo " ✓ Cache aktualisiert: $CACHE_DIR"
|
||||
else
|
||||
echo " ✗ git pull fehlgeschlagen – versuche neu zu klonen..."
|
||||
rm -rf $CACHE_DIR
|
||||
echo " ⚠ git pull fehlgeschlagen – nutze vorhandenen Cache (offline)"
|
||||
end
|
||||
else
|
||||
echo " ─ Kein Remote konfiguriert – nutze lokalen Klon: $CACHE_DIR"
|
||||
end
|
||||
|
||||
if not test -d $CACHE_DIR/.git
|
||||
set SOURCE_OK 1
|
||||
else if test -d $CACHE_DIR/git-templates
|
||||
echo " ─ Lokale Setup-Quelle ohne .git (Offline-Betrieb): $CACHE_DIR"
|
||||
set SOURCE_OK 1
|
||||
else
|
||||
if test -n "$SETUP_REPO_SSH"
|
||||
echo " → Klone Setup-Repo (SSH)..."
|
||||
if git clone --quiet $SETUP_REPO_SSH $CACHE_DIR 2>/dev/null
|
||||
echo " ✓ Geklont via SSH"
|
||||
set SOURCE_OK 1
|
||||
else
|
||||
echo " ✗ SSH fehlgeschlagen – versuche HTTP-Fallback..."
|
||||
echo " ✗ SSH fehlgeschlagen"
|
||||
end
|
||||
end
|
||||
if test $SOURCE_OK -eq 0; and test -n "$SETUP_REPO_HTTP"
|
||||
echo " → Klone Setup-Repo (HTTP)..."
|
||||
if git clone --quiet $SETUP_REPO_HTTP $CACHE_DIR 2>/dev/null
|
||||
echo " ✓ Geklont via HTTP"
|
||||
set SOURCE_OK 1
|
||||
else
|
||||
echo " ✗ HTTP fehlgeschlagen"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if test $SOURCE_OK -eq 0
|
||||
echo ""
|
||||
echo " ✗ FEHLER: Setup-Repo nicht erreichbar."
|
||||
echo " SSH: $SETUP_REPO_SSH"
|
||||
echo " HTTP: $SETUP_REPO_HTTP"
|
||||
exit 1
|
||||
end
|
||||
echo " ⚠ Keine Setup-Quelle verfuegbar – Update uebersprungen."
|
||||
if test $HAVE_REMOTE -eq 1
|
||||
echo " Remote nicht erreichbar:"
|
||||
test -n "$SETUP_REPO_SSH"; and echo " SSH: $SETUP_REPO_SSH"
|
||||
test -n "$SETUP_REPO_HTTP"; and echo " HTTP: $SETUP_REPO_HTTP"
|
||||
else
|
||||
echo " Kein Remote konfiguriert. Setze COPILOT_SETUP_REMOTE_SSH/_HTTP,"
|
||||
echo " COPILOT_SETUP_DIR (lokaler Klon) oder lege $CONFIG_FILE an."
|
||||
end
|
||||
echo " (Kein Fehler – ohne Quelle gibt es nichts zu aktualisieren.)"
|
||||
exit 0
|
||||
end
|
||||
|
||||
set SOURCE $CACHE_DIR
|
||||
|
|
@ -68,7 +166,7 @@ end
|
|||
set GIT_TEMPLATE_DIR $HOME/.git-templates
|
||||
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \
|
||||
$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/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
|
||||
|
|
@ -82,20 +180,14 @@ end
|
|||
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/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"
|
||||
|
||||
# ── 3. VS Code Prompt-Dateien aktualisieren ───────────────────────────────────
|
||||
if test -d $HOME/.vscode-server/data/User
|
||||
set VSCODE_USER $HOME/.vscode-server/data/User
|
||||
else if test -d "$HOME/Library/Application Support/Code/User"
|
||||
set VSCODE_USER "$HOME/Library/Application Support/Code/User"
|
||||
else
|
||||
set VSCODE_USER $HOME/.config/Code/User
|
||||
end
|
||||
set VSCODE_USER (detect_vscode_user_dir)
|
||||
|
||||
if test -d $VSCODE_USER
|
||||
if test -d "$VSCODE_USER"
|
||||
mkdir -p $VSCODE_USER/prompts
|
||||
set PROMPTS_UPDATED 0
|
||||
for f in $SOURCE/prompts/*.prompt.md
|
||||
|
|
@ -121,7 +213,22 @@ end
|
|||
|
||||
echo ""
|
||||
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 ───────────────────────────────────────────────
|
||||
set HOOKS_DIR $REPO_ROOT/.git/hooks
|
||||
mkdir -p $HOOKS_DIR
|
||||
|
|
|
|||
|
|
@ -11,38 +11,114 @@
|
|||
# copilot-update.sh # aktuelles Verzeichnis (Git-Repo optional)
|
||||
# git copilot-update # via Git-Alias
|
||||
|
||||
SETUP_REPO_SSH="ssh://git@192.168.178.6:2222/cschulz/rd13_copilot_setup.git"
|
||||
SETUP_REPO_HTTP="http://192.168.178.6:8083/cschulz/rd13_copilot_setup.git"
|
||||
# ── Konfiguration laden: env > config-file > leer ─────────────────────────
|
||||
# Env-Variablen (Vorrang):
|
||||
# COPILOT_SETUP_REMOTE_SSH / _HTTP Remote-URLs des Setup-Repos
|
||||
# COPILOT_SETUP_DIR lokaler Klon/Arbeitskopie (Offline)
|
||||
# COPILOT_SETUP_CONFIG alternativer Pfad zur Config-Datei
|
||||
# Config-Datei (sh-Syntax, gesourct): $XDG_CONFIG_HOME/copilot-setup/config
|
||||
# Standalone-Skript -> keine gemeinsame Lib sourcebar; gleiche Aufloesung in
|
||||
# deploy.sh. Bei Aenderungen beide Stellen pflegen.
|
||||
_env_ssh="${COPILOT_SETUP_REMOTE_SSH:-}"
|
||||
_env_http="${COPILOT_SETUP_REMOTE_HTTP:-}"
|
||||
_env_dir="${COPILOT_SETUP_DIR:-}"
|
||||
|
||||
CONFIG_FILE="${COPILOT_SETUP_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/copilot-setup/config}"
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
. "$CONFIG_FILE"
|
||||
fi
|
||||
|
||||
# Env ueberschreibt Werte aus der Config-Datei
|
||||
[ -n "$_env_ssh" ] && COPILOT_SETUP_REMOTE_SSH="$_env_ssh"
|
||||
[ -n "$_env_http" ] && COPILOT_SETUP_REMOTE_HTTP="$_env_http"
|
||||
[ -n "$_env_dir" ] && COPILOT_SETUP_DIR="$_env_dir"
|
||||
|
||||
SETUP_REPO_SSH="${COPILOT_SETUP_REMOTE_SSH:-}"
|
||||
SETUP_REPO_HTTP="${COPILOT_SETUP_REMOTE_HTTP:-}"
|
||||
CACHE_DIR="${COPILOT_SETUP_DIR:-$HOME/.copilot-setup}"
|
||||
|
||||
have_remote() { [ -n "$SETUP_REPO_SSH" ] || [ -n "$SETUP_REPO_HTTP" ]; }
|
||||
|
||||
clone_setup_repo() {
|
||||
if [ -n "$SETUP_REPO_SSH" ]; then
|
||||
echo " → Klone Setup-Repo (SSH)..."
|
||||
if git clone --quiet "$SETUP_REPO_SSH" "$CACHE_DIR" 2>/dev/null; then
|
||||
echo " ✓ Geklont via SSH"; return 0
|
||||
fi
|
||||
echo " ✗ SSH fehlgeschlagen"
|
||||
fi
|
||||
if [ -n "$SETUP_REPO_HTTP" ]; then
|
||||
echo " → Klone Setup-Repo (HTTP)..."
|
||||
if git clone --quiet "$SETUP_REPO_HTTP" "$CACHE_DIR" 2>/dev/null; then
|
||||
echo " ✓ Geklont via HTTP"; return 0
|
||||
fi
|
||||
echo " ✗ HTTP fehlgeschlagen"
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# VS Code User-Verzeichnis portabel ueber Editionen/OS ermitteln.
|
||||
# Identischer Block in deploy.sh (Standalone -> keine Lib sourcebar).
|
||||
detect_vscode_user_dir() {
|
||||
for d in \
|
||||
"$HOME/.vscode-server/data/User" \
|
||||
"$HOME/.vscode-server-insiders/data/User" \
|
||||
"$HOME/Library/Application Support/Code/User" \
|
||||
"$HOME/Library/Application Support/Code - Insiders/User" \
|
||||
"$HOME/Library/Application Support/VSCodium/User" \
|
||||
"$HOME/Library/Application Support/Cursor/User" \
|
||||
"$HOME/.config/Code/User" \
|
||||
"$HOME/.config/Code - Insiders/User" \
|
||||
"$HOME/.config/VSCodium/User" \
|
||||
"$HOME/.config/Cursor/User" \
|
||||
"$HOME/.var/app/com.visualstudio.code/config/Code/User" \
|
||||
"/mnt/c/Users/${USER:-}/AppData/Roaming/Code/User" \
|
||||
"/mnt/c/Users/${USER:-}/AppData/Roaming/Code - Insiders/User"
|
||||
do
|
||||
if [ -d "$d" ]; then
|
||||
printf '%s\n' "$d"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
case "$(uname -s)" in
|
||||
Darwin) printf '%s\n' "$HOME/Library/Application Support/Code/User" ;;
|
||||
*) printf '%s\n' "$HOME/.config/Code/User" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo "=== Copilot Update ==="
|
||||
|
||||
# ── 1. Setup-Repo Cache aktuell halten ───────────────────────────────────────
|
||||
if [ -d "$CACHE_DIR/.git" ]; then
|
||||
if have_remote; then
|
||||
echo " → Pulling latest from setup repo..."
|
||||
if git -C "$CACHE_DIR" pull --ff-only --quiet 2>/dev/null; then
|
||||
echo " ✓ Cache aktualisiert: $CACHE_DIR"
|
||||
else
|
||||
echo " ✗ git pull fehlgeschlagen – versuche neu zu klonen..."
|
||||
rm -rf "$CACHE_DIR"
|
||||
echo " ⚠ git pull fehlgeschlagen – nutze vorhandenen Cache (offline)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "$CACHE_DIR/.git" ]; then
|
||||
echo " → Klone Setup-Repo (SSH)..."
|
||||
if git clone --quiet "$SETUP_REPO_SSH" "$CACHE_DIR" 2>/dev/null; then
|
||||
echo " ✓ Geklont via SSH"
|
||||
else
|
||||
echo " ✗ SSH fehlgeschlagen – versuche HTTP-Fallback..."
|
||||
if git clone --quiet "$SETUP_REPO_HTTP" "$CACHE_DIR" 2>/dev/null; then
|
||||
echo " ✓ Geklont via HTTP"
|
||||
echo " ─ Kein Remote konfiguriert – nutze lokalen Klon: $CACHE_DIR"
|
||||
fi
|
||||
elif [ -d "$CACHE_DIR/git-templates" ]; then
|
||||
echo " ─ Lokale Setup-Quelle ohne .git (Offline-Betrieb): $CACHE_DIR"
|
||||
else
|
||||
if have_remote && clone_setup_repo; then
|
||||
:
|
||||
else
|
||||
echo ""
|
||||
echo " ✗ FEHLER: Setup-Repo nicht erreichbar."
|
||||
echo " SSH: $SETUP_REPO_SSH"
|
||||
echo " HTTP: $SETUP_REPO_HTTP"
|
||||
exit 1
|
||||
echo " ⚠ Keine Setup-Quelle verfuegbar – Update uebersprungen."
|
||||
if have_remote; then
|
||||
echo " Remote nicht erreichbar:"
|
||||
[ -n "$SETUP_REPO_SSH" ] && echo " SSH: $SETUP_REPO_SSH"
|
||||
[ -n "$SETUP_REPO_HTTP" ] && echo " HTTP: $SETUP_REPO_HTTP"
|
||||
else
|
||||
echo " Kein Remote konfiguriert. Setze COPILOT_SETUP_REMOTE_SSH/_HTTP,"
|
||||
echo " COPILOT_SETUP_DIR (lokaler Klon) oder lege $CONFIG_FILE an."
|
||||
fi
|
||||
echo " (Kein Fehler – ohne Quelle gibt es nichts zu aktualisieren.)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -64,7 +140,7 @@ GIT_TEMPLATE_DIR="$HOME/.git-templates"
|
|||
# ── 2. ~/.git-templates/ aktualisieren ──────────────────────────────────────
|
||||
mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \
|
||||
"$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/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/"
|
||||
|
|
@ -78,18 +154,12 @@ fi
|
|||
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/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"
|
||||
|
||||
# ── 3. VS Code Prompt-Dateien aktualisieren ───────────────────────────────────
|
||||
if [ -d "$HOME/.vscode-server/data/User" ]; then
|
||||
VSCODE_USER="$HOME/.vscode-server/data/User"
|
||||
elif [ -d "$HOME/Library/Application Support/Code/User" ]; then
|
||||
VSCODE_USER="$HOME/Library/Application Support/Code/User"
|
||||
else
|
||||
VSCODE_USER="$HOME/.config/Code/User"
|
||||
fi
|
||||
VSCODE_USER="$(detect_vscode_user_dir)"
|
||||
|
||||
if [ -d "$VSCODE_USER" ]; then
|
||||
mkdir -p "$VSCODE_USER/prompts"
|
||||
|
|
@ -118,11 +188,29 @@ fi
|
|||
echo ""
|
||||
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"
|
||||
mkdir -p "$HOOKS_DIR"
|
||||
HOOKS_UPDATED=0
|
||||
|
||||
# shellcheck disable=SC2043 # bewusst erweiterbar: weitere Hook-Namen koennen ergaenzt werden
|
||||
for hook in pre-commit; do
|
||||
if [ -f "$SOURCE/git-templates/hooks/$hook" ]; then
|
||||
cp "$SOURCE/git-templates/hooks/$hook" "$HOOKS_DIR/$hook"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,22 @@
|
|||
#!/usr/bin/env fish
|
||||
# deploy.fish – Copilot-Setup auf Linux mit fish-Shell deployen
|
||||
# Usage: fish scripts/deploy.fish
|
||||
# Usage:
|
||||
# fish scripts/deploy.fish # Standard-Deploy (nicht-invasiv)
|
||||
# fish scripts/deploy.fish --with-self-update-hook # + post-merge Auto-Deploy im Setup-Repo
|
||||
#
|
||||
# Hinweis: Setzt KEINEN globalen 'git init'-Alias und KEIN init.templateDir.
|
||||
# Standard-'git init'/'git clone' bleiben unberuehrt. Opt-in: 'git init-copilot'.
|
||||
|
||||
set WITH_SELF_HOOK 0
|
||||
for arg in $argv
|
||||
switch $arg
|
||||
case --with-self-update-hook
|
||||
set WITH_SELF_HOOK 1
|
||||
case '*'
|
||||
echo "Unbekanntes Argument: $arg" >&2
|
||||
exit 2
|
||||
end
|
||||
end
|
||||
|
||||
set REPO_DIR (dirname (status filename))/..
|
||||
set REPO_DIR (realpath $REPO_DIR)
|
||||
|
|
@ -8,18 +24,37 @@ set REPO_DIR (realpath $REPO_DIR)
|
|||
echo "=== Copilot Setup Deploy (Linux/fish) ==="
|
||||
echo "Source: $REPO_DIR"
|
||||
|
||||
# ── 1. VS Code User-Verzeichnis ermitteln ─────────────────────────────────────
|
||||
# Remote (VS Code Server)
|
||||
if test -d /home/(whoami)/.vscode-server/data/User
|
||||
set VSCODE_USER /home/(whoami)/.vscode-server/data/User
|
||||
# Flatpak
|
||||
else if test -d $HOME/.var/app/com.visualstudio.code/config/Code/User
|
||||
set VSCODE_USER $HOME/.var/app/com.visualstudio.code/config/Code/User
|
||||
# Standard Linux
|
||||
else
|
||||
set VSCODE_USER $HOME/.config/Code/User
|
||||
# VS Code User-Verzeichnis portabel ueber Editionen/OS ermitteln (identisch zu copilot-update.fish)
|
||||
function detect_vscode_user_dir
|
||||
for d in \
|
||||
"$HOME/.vscode-server/data/User" \
|
||||
"$HOME/.vscode-server-insiders/data/User" \
|
||||
"$HOME/Library/Application Support/Code/User" \
|
||||
"$HOME/Library/Application Support/Code - Insiders/User" \
|
||||
"$HOME/Library/Application Support/VSCodium/User" \
|
||||
"$HOME/Library/Application Support/Cursor/User" \
|
||||
"$HOME/.config/Code/User" \
|
||||
"$HOME/.config/Code - Insiders/User" \
|
||||
"$HOME/.config/VSCodium/User" \
|
||||
"$HOME/.config/Cursor/User" \
|
||||
"$HOME/.var/app/com.visualstudio.code/config/Code/User" \
|
||||
"/mnt/c/Users/$USER/AppData/Roaming/Code/User" \
|
||||
"/mnt/c/Users/$USER/AppData/Roaming/Code - Insiders/User"
|
||||
if test -d "$d"
|
||||
echo $d
|
||||
return 0
|
||||
end
|
||||
end
|
||||
switch (uname -s)
|
||||
case Darwin
|
||||
echo "$HOME/Library/Application Support/Code/User"
|
||||
case '*'
|
||||
echo "$HOME/.config/Code/User"
|
||||
end
|
||||
end
|
||||
|
||||
# ── 1. VS Code User-Verzeichnis ermitteln ─────────────────────────────────────
|
||||
set VSCODE_USER (detect_vscode_user_dir)
|
||||
echo "VS Code User dir: $VSCODE_USER"
|
||||
|
||||
# ── 2. User settings.json mergen / anlegen ────────────────────────────────────
|
||||
|
|
@ -48,7 +83,7 @@ end
|
|||
set GIT_TEMPLATE_DIR $HOME/.git-templates
|
||||
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \
|
||||
$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/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
|
||||
cp $REPO_DIR/git-templates/.vscode/extensions.json $GIT_TEMPLATE_DIR/.vscode/
|
||||
|
|
@ -57,10 +92,16 @@ 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/ADMIN.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/
|
||||
git config --global init.templateDir $GIT_TEMPLATE_DIR
|
||||
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 config init.templateDir set"
|
||||
# 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)
|
||||
if test "$CURRENT_TPL" = "$GIT_TEMPLATE_DIR"
|
||||
git config --global --unset init.templateDir
|
||||
echo " ✓ altes globales init.templateDir entfernt (nicht mehr invasiv)"
|
||||
else
|
||||
echo " ─ init.templateDir nicht global gesetzt (gewollt)"
|
||||
end
|
||||
|
||||
# ── 5. Bootstrap- & Update-Skripte ───────────────────────────────────────────
|
||||
mkdir -p $HOME/.local/bin
|
||||
|
|
@ -81,13 +122,21 @@ end
|
|||
|
||||
# ── 6. Git-Aliase: init → auto-bootstrap | copilot-update → updater ──────────
|
||||
# Verwendet git --exec-path um Rekursion zu vermeiden (kein Alias-Loop).
|
||||
git config --global alias.init '!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' gesetzt (führt copilot-bootstrap.sh automatisch aus)"
|
||||
# Kein Override des Standard-'git init' mehr. Frueheren invasiven Alias entfernen.
|
||||
set CURRENT_INIT_ALIAS (git config --global --get alias.init 2>/dev/null)
|
||||
if string match -q '*copilot-bootstrap*' -- "$CURRENT_INIT_ALIAS"
|
||||
git config --global --unset alias.init
|
||||
echo " ✓ alter invasiver 'git init'-Alias entfernt"
|
||||
end
|
||||
# Opt-in: explizites 'git init-copilot' macht git init + bootstrap.
|
||||
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)"
|
||||
git config --global alias.copilot-update '!~/.local/bin/copilot-update.sh'
|
||||
echo " ✓ git alias 'copilot-update' gesetzt (aktualisiert Templates & Prompts)"
|
||||
|
||||
# ── 7. post-merge + post-commit Hook für dieses Setup-Repo ───────────────────
|
||||
set SELF_HOOKS_DIR $REPO_DIR/.git/hooks
|
||||
if test $WITH_SELF_HOOK -eq 1
|
||||
if test -d $SELF_HOOKS_DIR
|
||||
echo '#!/usr/bin/env sh
|
||||
# post-merge – Auto-Deploy nach git pull auf dem Setup-Repo
|
||||
|
|
@ -97,13 +146,14 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/../../scripts" && pwd)"
|
|||
bash "$SCRIPT_DIR/deploy.sh"' > $SELF_HOOKS_DIR/post-merge
|
||||
chmod +x $SELF_HOOKS_DIR/post-merge
|
||||
echo " ✓ post-merge Hook im Setup-Repo installiert (auto-deploy nach git pull)"
|
||||
# post-commit aus git-templates kopieren (History-Logs)
|
||||
cp $REPO_DIR/git-templates/hooks/post-commit $SELF_HOOKS_DIR/post-commit
|
||||
chmod +x $SELF_HOOKS_DIR/post-commit
|
||||
echo " ✓ post-commit Hook im Setup-Repo installiert (History-Logs)"
|
||||
end
|
||||
else
|
||||
echo " ─ post-merge Auto-Deploy nicht installiert (opt-in: --with-self-update-hook)"
|
||||
end
|
||||
|
||||
echo ""
|
||||
echo "=== Done ==="
|
||||
echo "Next: Activate Settings Sync in VS Code (Ctrl+Shift+P → 'Settings Sync: Turn On')"
|
||||
echo " Neues Repo mit Copilot-Setup: git init-copilot [pfad]"
|
||||
echo " Bestehendes Repo ausstatten: copilot-bootstrap.sh [pfad]"
|
||||
echo " Templates aktuell halten: git copilot-update (in jedem Repo)"
|
||||
|
|
|
|||
|
|
@ -1,25 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
# deploy.sh – Copilot-Setup auf macOS oder Linux mit bash deployen
|
||||
# Usage: bash scripts/deploy.sh
|
||||
# Usage:
|
||||
# bash scripts/deploy.sh # Standard-Deploy (nicht-invasiv)
|
||||
# bash scripts/deploy.sh --with-self-update-hook # + post-merge Auto-Deploy im Setup-Repo
|
||||
#
|
||||
# Hinweis: Setzt KEINEN globalen 'git init'-Alias und KEIN init.templateDir.
|
||||
# Standard-'git init'/'git clone' bleiben unberuehrt. Opt-in pro Repo:
|
||||
# git init-copilot [pfad] (Alias wird hier angelegt)
|
||||
# copilot-bootstrap.sh [pfad] (bestehende Repos ausstatten)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
WITH_SELF_HOOK=0
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--with-self-update-hook) WITH_SELF_HOOK=1 ;;
|
||||
*) echo "Unbekanntes Argument: $arg" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
echo "=== Copilot Setup Deploy (bash) ==="
|
||||
echo "Source: $REPO_DIR"
|
||||
|
||||
# ── 1. VS Code User-Verzeichnis ermitteln ─────────────────────────────────────
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
VSCODE_USER="$HOME/Library/Application Support/Code/User"
|
||||
# VS Code Server (Cursor, Codium, etc.)
|
||||
VSCODE_USER_ALT="$HOME/Library/Application Support/Cursor/User"
|
||||
elif [[ -d "$HOME/.vscode-server/data/User" ]]; then
|
||||
# Remote / VS Code Server
|
||||
VSCODE_USER="$HOME/.vscode-server/data/User"
|
||||
else
|
||||
VSCODE_USER="$HOME/.config/Code/User"
|
||||
# VS Code User-Verzeichnis portabel ermitteln (identisch zu copilot-update.sh)
|
||||
detect_vscode_user_dir() {
|
||||
for d in \
|
||||
"$HOME/.vscode-server/data/User" \
|
||||
"$HOME/.vscode-server-insiders/data/User" \
|
||||
"$HOME/Library/Application Support/Code/User" \
|
||||
"$HOME/Library/Application Support/Code - Insiders/User" \
|
||||
"$HOME/Library/Application Support/VSCodium/User" \
|
||||
"$HOME/Library/Application Support/Cursor/User" \
|
||||
"$HOME/.config/Code/User" \
|
||||
"$HOME/.config/Code - Insiders/User" \
|
||||
"$HOME/.config/VSCodium/User" \
|
||||
"$HOME/.config/Cursor/User" \
|
||||
"$HOME/.var/app/com.visualstudio.code/config/Code/User" \
|
||||
"/mnt/c/Users/${USER:-}/AppData/Roaming/Code/User" \
|
||||
"/mnt/c/Users/${USER:-}/AppData/Roaming/Code - Insiders/User"
|
||||
do
|
||||
if [ -d "$d" ]; then
|
||||
printf '%s\n' "$d"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
case "$(uname -s)" in
|
||||
Darwin) printf '%s\n' "$HOME/Library/Application Support/Code/User" ;;
|
||||
*) printf '%s\n' "$HOME/.config/Code/User" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ── 1. VS Code User-Verzeichnis ermitteln ─────────────────────────────────────
|
||||
VSCODE_USER="$(detect_vscode_user_dir)"
|
||||
echo "VS Code User dir: $VSCODE_USER"
|
||||
mkdir -p "$VSCODE_USER"
|
||||
|
||||
|
|
@ -48,7 +81,7 @@ done
|
|||
GIT_TEMPLATE_DIR="$HOME/.git-templates"
|
||||
mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \
|
||||
"$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/.vscode/settings.json" "$GIT_TEMPLATE_DIR/.vscode/"
|
||||
cp "$REPO_DIR/git-templates/.vscode/extensions.json" "$GIT_TEMPLATE_DIR/.vscode/"
|
||||
|
|
@ -57,10 +90,18 @@ 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/ADMIN.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/"
|
||||
git config --global init.templateDir "$GIT_TEMPLATE_DIR"
|
||||
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 config init.templateDir set"
|
||||
# init.templateDir wird bewusst NICHT global gesetzt – sonst wuerde jeder
|
||||
# 'git init'/'git clone' (auch fremde Repos) automatisch den Quality Gate erben.
|
||||
# Frueher gesetzten Wert entfernen, falls er auf unsere Templates zeigt.
|
||||
CURRENT_TPL="$(git config --global --get init.templateDir || true)"
|
||||
if [[ "$CURRENT_TPL" == "$GIT_TEMPLATE_DIR" ]]; then
|
||||
git config --global --unset init.templateDir || true
|
||||
echo " ✓ altes globales init.templateDir entfernt (nicht mehr invasiv)"
|
||||
else
|
||||
echo " ─ init.templateDir nicht global gesetzt (gewollt)"
|
||||
fi
|
||||
|
||||
# ── 5. Bootstrap- & Update-Skripte ───────────────────────────────────────────
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
|
|
@ -83,15 +124,24 @@ fi
|
|||
|
||||
# ── 6. Git-Aliase: init → auto-bootstrap | copilot-update → updater ──────────
|
||||
# Verwendet git --exec-path um Rekursion zu vermeiden (kein Alias-Loop).
|
||||
git config --global alias.init '!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' gesetzt (führt copilot-bootstrap.sh automatisch aus)"
|
||||
# Kein Override des Standard-'git init' mehr. Frueheren invasiven Alias entfernen.
|
||||
CURRENT_INIT_ALIAS="$(git config --global --get alias.init || true)"
|
||||
if [[ "$CURRENT_INIT_ALIAS" == *copilot-bootstrap* ]]; then
|
||||
git config --global --unset alias.init || true
|
||||
echo " ✓ alter invasiver 'git init'-Alias entfernt"
|
||||
fi
|
||||
# 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'
|
||||
echo " ✓ git alias 'init-copilot' gesetzt (opt-in: git init + copilot-bootstrap)"
|
||||
git config --global alias.copilot-update '!~/.local/bin/copilot-update.sh'
|
||||
echo " ✓ git alias 'copilot-update' gesetzt (aktualisiert Templates & Prompts)"
|
||||
|
||||
# ── 7. post-merge Hook für dieses Setup-Repo ─────────────────────────────────
|
||||
# Nach jedem 'git pull' auf dem Setup-Repo selbst wird deploy.sh automatisch
|
||||
# ausgeführt, sodass Templates immer auf dem neuesten Stand sind.
|
||||
# Nur mit --with-self-update-hook: nach jedem 'git pull' auf dem Setup-Repo
|
||||
# wird deploy.sh automatisch erneut ausgeführt.
|
||||
SELF_HOOKS_DIR="$REPO_DIR/.git/hooks"
|
||||
if [[ "$WITH_SELF_HOOK" -eq 1 ]]; then
|
||||
if [[ -d "$SELF_HOOKS_DIR" ]]; then
|
||||
cat > "$SELF_HOOKS_DIR/post-merge" << 'HOOK'
|
||||
#!/usr/bin/env sh
|
||||
|
|
@ -104,8 +154,13 @@ HOOK
|
|||
chmod +x "$SELF_HOOKS_DIR/post-merge"
|
||||
echo " ✓ post-merge Hook im Setup-Repo installiert (auto-deploy nach git pull)"
|
||||
fi
|
||||
else
|
||||
echo " ─ post-merge Auto-Deploy nicht installiert (opt-in: --with-self-update-hook)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Done ==="
|
||||
echo "Next: Activate Settings Sync in VS Code (Cmd+Shift+P → 'Settings Sync: Turn On')"
|
||||
echo " Neues Repo mit Copilot-Setup: git init-copilot [pfad]"
|
||||
echo " Bestehendes Repo ausstatten: copilot-bootstrap.sh [pfad]"
|
||||
echo " Templates aktuell halten: git copilot-update (in jedem Repo)"
|
||||
|
|
|
|||
72
scripts/selftest.sh
Executable file
72
scripts/selftest.sh
Executable file
|
|
@ -0,0 +1,72 @@
|
|||
#!/usr/bin/env sh
|
||||
# selftest.sh – Funktionspruefung fuer copilot-bootstrap.{sh,fish}.
|
||||
#
|
||||
# Baut ein isoliertes Fake-Template-Verzeichnis und ein Ziel-Repo in einem
|
||||
# temporaeren HOME und prueft, dass Bootstrap die erwartete Struktur erzeugt.
|
||||
# Veraendert weder das echte HOME noch ein echtes Repo. Lokal und in CI nutzbar:
|
||||
# sh scripts/selftest.sh
|
||||
set -eu
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
WORK="$(mktemp -d)"
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
|
||||
build_template() {
|
||||
tpl="$1"
|
||||
mkdir -p "$tpl/.github" "$tpl/.vscode" "$tpl/hooks" "$tpl/docs" "$tpl/docs/history/summary"
|
||||
echo "framework" > "$tpl/.github/copilot-instructions.md"
|
||||
echo '{}' > "$tpl/.vscode/settings.json"
|
||||
echo '{}' > "$tpl/.vscode/extensions.json"
|
||||
printf '#!/bin/sh\nexit 0\n' > "$tpl/hooks/pre-commit"
|
||||
printf '#!/bin/sh\nexit 0\n' > "$tpl/hooks/post-commit"
|
||||
for d in USER ADMIN MAINTAINER; do
|
||||
echo "$d" > "$tpl/docs/$d.md"
|
||||
done
|
||||
echo ctx > "$tpl/docs/history/summary/PROJECT_CONTEXT.md"
|
||||
}
|
||||
|
||||
assert_file() {
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "FAIL: erwartete Datei fehlt: $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_case() {
|
||||
label="$1"
|
||||
runner="$2" # sh | fish
|
||||
script="$3"
|
||||
home="$WORK/home_$label"
|
||||
target="$WORK/target_$label"
|
||||
mkdir -p "$home/.git-templates" "$target"
|
||||
build_template "$home/.git-templates"
|
||||
git -C "$target" init -q
|
||||
|
||||
HOME="$home" "$runner" "$REPO_DIR/scripts/$script" "$target" >/dev/null
|
||||
|
||||
assert_file "$target/.github/copilot-instructions.md"
|
||||
assert_file "$target/.vscode/settings.json"
|
||||
assert_file "$target/.vscode/extensions.json"
|
||||
assert_file "$target/docs/USER.md"
|
||||
assert_file "$target/docs/ADMIN.md"
|
||||
assert_file "$target/docs/MAINTAINER.md"
|
||||
assert_file "$target/docs/history/summary/PROJECT_CONTEXT.md"
|
||||
assert_file "$target/.git/hooks/pre-commit"
|
||||
assert_file "$target/.git/hooks/post-commit"
|
||||
assert_file "$target/data/.gitkeep"
|
||||
if ! grep -q ':Zone.Identifier' "$target/.gitignore"; then
|
||||
echo "FAIL: $label – .gitignore enthaelt kein Zone.Identifier-Muster" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "PASS: $label ($script)"
|
||||
}
|
||||
|
||||
run_case sh_bootstrap sh copilot-bootstrap.sh
|
||||
|
||||
if command -v fish >/dev/null 2>&1; then
|
||||
run_case fish_bootstrap fish copilot-bootstrap.fish
|
||||
else
|
||||
echo "SKIP: fish nicht installiert – fish-Bootstrap uebersprungen"
|
||||
fi
|
||||
|
||||
echo "selftest OK"
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
"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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue