Host-Setup: Automatische Git-Init und Template-Kopie

- Hook erkennt jetzt auch fehlendes Git-Repository
- Meldet beide Anforderungen (Git + Template) zusammen
- CLAUDE.md erweitert um vollständigen Setup-Workflow
- Initial Commit nach Setup wird automatisch vorgeschlagen

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-01-27 11:30:18 +01:00
parent 9be3ae4937
commit 92b276a422
2 changed files with 99 additions and 6 deletions

View File

@@ -231,6 +231,38 @@ This upfront investment minimizes questions in future sessions and enables faste
## Host Troubleshooting
### Automatische Host-Setup (Hook-gesteuert)
Der Session-Start Hook erkennt automatisch Host-Verzeichnisse unter `~/Nextcloud/hosts/`.
**Wenn du `<HOST_SETUP_REQUIRED>` in der Hook-Ausgabe siehst:**
1. **Frage den User:**
> "Ich habe erkannt, dass für diesen Host noch Setup erforderlich ist. Soll ich das automatisch durchführen?"
> - Git-Repository initialisieren (falls fehlend)
> - Template für Dokumentation kopieren (falls fehlend)
2. **Bei Zustimmung - führe alle fehlenden Schritte aus:**
```bash
# Git initialisieren (falls nicht vorhanden)
git init
# Template kopieren (falls nicht vorhanden)
cp ~/Nextcloud/hosts/_templates/copilot-instructions-template.md ./copilot-instructions.md
```
3. **Dann interaktiv ausfüllen:**
- Frage nach den wichtigsten Infos (IP, Typ, Funktion, Zugang)
- Ersetze die Platzhalter im Template
- Lösche den Template-Hinweis-Block am Anfang
4. **Initial Commit erstellen:**
```bash
git add copilot-instructions.md
git commit -m "Initial: Host-Dokumentation angelegt"
```
### Automatische Erkennung
Wenn du in einem Verzeichnis unter `~/Nextcloud/hosts/` arbeitest:
@@ -254,12 +286,16 @@ Wenn du in einem Verzeichnis unter `~/Nextcloud/hosts/` arbeitest:
└── copilot-instructions-template.md # Master-Template
```
### Neuen Host dokumentieren
### Workflow: Neuen Host anlegen
1. Erstelle Verzeichnis: `mkdir -p ~/Nextcloud/hosts/[kunde]/[hostname]`
2. Kopiere Template: `cp ~/Nextcloud/hosts/_templates/copilot-instructions-template.md ./copilot-instructions.md`
3. Fülle während der Arbeit die relevanten Felder aus
4. Committe die Dokumentation
Der User legt nur den Ordner an:
```bash
mkdir -p ~/Nextcloud/hosts/[kunde]/[hostname]
cd ~/Nextcloud/hosts/[kunde]/[hostname]
claude # Startet Claude Code
```
Claude erkennt automatisch das fehlende Template und bietet Setup an.
### Skills-Referenz