From e1f912f248a176091cf8215e1b94d3a69e7938f3 Mon Sep 17 00:00:00 2001 From: Conrad Schulz Date: Sun, 31 May 2026 12:54:13 +0000 Subject: [PATCH] fix: mkdir -p .git/hooks before hook install in bootstrap Also bootstrapped own repo: adds history/, data/, .vscode/, .gitignore --- .github/copilot-instructions.md | 106 +++++++++++++++++++++++++++++ .gitignore | 6 ++ .vscode/extensions.json | 6 ++ .vscode/settings.json | 7 ++ data/.gitkeep | 0 history/summary/PROJECT_CONTEXT.md | 77 +++++++++++++++++++++ scripts/copilot-bootstrap.sh | 1 + 7 files changed, 203 insertions(+) create mode 100644 .github/copilot-instructions.md create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 data/.gitkeep create mode 100644 history/summary/PROJECT_CONTEXT.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..b16864a --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,106 @@ +# GitHub Copilot – Project Instructions + +## Project + + +## Stack + +- Language: +- Framework: +- Database: +- Infrastructure: + +## Architecture + +- Pattern (MVC / Hexagonal / Event-driven / ...): +- Key constraints: +- ADR location: `docs/adr/` + +## Project Structure Conventions + +### Persistent Data (`/data/`) +- **Alle persistenten Service-Daten** gehören in `/data//` (Repo-Root) +- **Nie** Daten-Dateien committen – `/data/` ist vollständig gitignored +- Einen Unterordner pro Service (z.B. `data/postgres/`, `data/redis/`, `data/uploads/`) +- Erforderliche Unterordner in `docs/ADMIN.md` dokumentieren + +### Agent History (`/history/`) +- **Vollständige Konversationen** → `history/prompts/YYYY-MM-DD_beschreibung.md` (**committed – vollständige History bleibt erhalten**) +- **Komprimierter Kontext** → `history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**) +- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen +- **Am Ende jeder Session:** beide Dateien committen +- Copilot Chat: `/history` → History loggen + Summary aktualisieren + +### Documentation (3 Zielgruppen – alle 3 müssen existieren) +| Datei | Zielgruppe | Inhalt | +|---|---|---| +| `docs/USER.md` | Endnutzer | Features, How-To, FAQ – keine technischen Details | +| `docs/ADMIN.md` | Administratoren | Deployment, Konfiguration, Monitoring, Backup | +| `docs/MAINTAINER.md` | Entwickler | Architektur, ADRs, Konventionen, Erweiterung | + +**Regel:** Jede bedeutende Änderung muss mindestens eine dieser Dateien aktualisieren. +Der pre-commit Hook prüft dies automatisch. + +## Conventions + +- Branch naming: `feat/-description`, `fix/-description` +- Commit format: Conventional Commits (`feat|fix|chore|docs|refactor|test|ci`) +- File structure: +- Naming: + +## Engineering Process + +### Before starting any task +1. Clarify requirements – user story + acceptance criteria vorhanden? +2. Impact analysis – welche bestehenden Komponenten sind betroffen? +3. Architecture check – passt die geplante Lösung zur bestehenden Architektur? +4. Test strategy – wie wird das Feature getestet? + +### Definition of Ready (DoR) +A task can only be started when: +- [ ] Acceptance criteria are clear and unambiguous +- [ ] Non-functional requirements defined (performance, security, scalability) +- [ ] Architectural approach agreed upon +- [ ] No unresolved external blockers + +### Definition of Done (DoD) +A task is only done when ALL of the following are true: +- [ ] Code implements the acceptance criteria +- [ ] Unit tests written and passing +- [ ] Integration tests (where applicable) passing +- [ ] No linter / type errors +- [ ] No secrets or credentials in code +- [ ] OWASP Top 10 reviewed +- [ ] 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//` (nie woanders) +- [ ] `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 (oder Bypass bewusst begründet) + +## Testing Strategy + +- Framework: +- Coverage target: ≥ 80% (critical paths: 100%) +- Test pyramid: unit > integration > e2e +- Test location: `tests/` mirroring source structure + +## Security +- No secrets in code or config files – use environment variables +- Validate all inputs at system boundaries +- Principle of least privilege for all permissions +- Dependency vulnerabilities: check before adding new deps + +## Documentation Standards +- Code comments: explain WHY, not WHAT +- Public APIs: always documented +- Architecture decisions: write ADR in `docs/adr/` (template: `docs/adr/000-template.md`) +- CHANGELOG.md: update with every release +- **3-Zielgruppen-Regel:** USER.md (Endnutzer) + ADMIN.md (Ops) + MAINTAINER.md (Dev) – immer alle 3 pflegen + +## Non-Functional Requirements + +- Response time: +- Availability: +- Data retention: diff --git a/.gitignore b/.gitignore index c25e649..9735516 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ .env *.local + +# Persistente Service-Daten (nie committen!) +data/**/* + + +!data/.gitkeep diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..6c5e755 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "github.copilot", + "github.copilot-chat" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a641e7a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + // Repo-specific overrides only. Global Copilot settings are in User/settings.json (Settings Sync). + "editor.rulers": [100], + + // YAML schema validation – adjust to your stack + "yaml.schemas": {} +} diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/history/summary/PROJECT_CONTEXT.md b/history/summary/PROJECT_CONTEXT.md new file mode 100644 index 0000000..4f4ae69 --- /dev/null +++ b/history/summary/PROJECT_CONTEXT.md @@ -0,0 +1,77 @@ +# PROJECT_CONTEXT – [PROJEKT_NAME] + +> Diese Datei ist der **persistente Gedächtnis-Speicher** für alle Agenten. +> Beim Start jeder neuen Agent-Session: **diese Datei zuerst lesen**. +> Nach Abschluss einer Aufgabe: **diesen Stand aktualisieren**. + +--- + +## Aktueller Projektstatus + +**Letzte Aktualisierung:** +**Phase:** + +--- + +## Was ist dieses Projekt? + + + +**Stack:** +**Deployment:** + +--- + +## Erledigte Aufgaben (neueste zuerst) + + + +| Datum | Aufgabe | Ergebnis | Entscheidungen | +|---|---|---|---| +| … | … | … | … | + +--- + +## Offene Aufgaben & bekannte Probleme + + + +- [ ] TODO 1 +- [ ] TODO 2 + +--- + +## Kritische Architekturentscheidungen + + + +| Entscheidung | Begründung | Wo dokumentiert | +|---|---|---| +| … | … | `docs/adr/NNN-…md` | + +--- + +## Wichtige Pfade & Konventionen + +- **Persistente Daten:** `/data//` (gitignored, nie committen!) +- **Agent-Logs (voll):** `/history/prompts/` (committed – vollständige History im Repo) +- **Dieser Kontext:** `/history/summary/PROJECT_CONTEXT.md` (committed) +- **Tests:** `tests/` (Struktur spiegelt Source) +- **Docs:** `docs/USER.md` | `docs/ADMIN.md` | `docs/MAINTAINER.md` + +--- + +## Für den nächsten Agenten: Startpunkt + + + +1. … +2. … + +--- + +## Bekannte Fallstricke / "Don't do this" + + + +- … diff --git a/scripts/copilot-bootstrap.sh b/scripts/copilot-bootstrap.sh index dfcef47..c036129 100644 --- a/scripts/copilot-bootstrap.sh +++ b/scripts/copilot-bootstrap.sh @@ -87,6 +87,7 @@ fi # ── pre-commit Hook – Agent Quality Gate ───────────────────────────────────── if [ ! -f "$TARGET/.git/hooks/pre-commit" ]; then + mkdir -p "$TARGET/.git/hooks" 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)"