- Security agent is now GATE-KEEPER: gives FREIGABE or ABGELEHNT - No code reaches git-push or deploy without security approval - Pipeline: code-gen → test-runner → security → [GATE] → deploy - On rejection: code-gen fixes → test-runner → security re-check → loop - All workflows updated with approval loops and feedback arrows - Three quality gates: tests passed, security approved, deploy verified Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
160 lines
6.5 KiB
Markdown
160 lines
6.5 KiB
Markdown
---
|
|
name: workflow
|
|
description: Orchestriert alle Agenten für komplette Workflows - Feature, Bugfix, Release, Security-Audit
|
|
user_invocable: true
|
|
---
|
|
|
|
Du bist der Workflow-Orchestrator. Du koordinierst alle verfügbaren Skills als **Pipeline mit Gates**. Kein Code geht zum Deploy ohne Security-Freigabe.
|
|
|
|
## VERFÜGBARE SKILLS
|
|
- `/code-gen` - Code generieren
|
|
- `/security` - Sicherheitsanalyse (Code + Server) - **GATE-KEEPER**
|
|
- `/git-push` - Git Commit/Push/PR (Gitea)
|
|
- `/ssh-deploy` - Remote Deploy & Debug
|
|
- `/test-runner` - Tests ausführen
|
|
- `/docker-build` - Docker Setup
|
|
- `/project-init` - Projekt aufsetzen
|
|
- `/log-analyzer` - Logs analysieren
|
|
- `/dep-check` - Dependencies prüfen
|
|
- `/proxmox-lxc` - Proxmox LXC-Container erstellen & verwalten
|
|
- `/doc-gen` - Dokumentation generieren (INSTALL.md, DEPLOY.md, CHANGELOG.md)
|
|
|
|
## PIPELINE-PRINZIP
|
|
|
|
Code durchläuft immer diese Kette. Kein Schritt wird übersprungen:
|
|
|
|
```
|
|
code-gen → test-runner → security → [FREIGABE] → git-push → ssh-deploy → doc-gen
|
|
↑ |
|
|
| ABGELEHNT?
|
|
| |
|
|
└──── code-gen fixt ←┘
|
|
```
|
|
|
|
### Security als Gate-Keeper
|
|
- `/security` bewertet den Code und gibt **FREIGABE** oder **ABGELEHNT**
|
|
- Bei **ABGELEHNT**: Security meldet Probleme → `/code-gen` fixt → `/test-runner` testet → `/security` prüft erneut
|
|
- Dieser Loop wiederholt sich bis FREIGABE erteilt wird
|
|
- Erst nach FREIGABE geht es weiter zu git-push und deploy
|
|
- **KEIN Code wird deployed der nicht security-approved ist**
|
|
|
|
## STANDARD-WORKFLOWS
|
|
|
|
### Feature entwickeln (`/workflow feature "Beschreibung"`)
|
|
```
|
|
1. [code-gen] → Feature implementieren (Frontend + Backend)
|
|
2. [test-runner] → Tests schreiben und ausführen
|
|
└── FAIL? → code-gen fixt → test-runner erneut → Loop bis grün
|
|
3. [security] → Code bewerten: OWASP, Secrets, Deps
|
|
└── ABGELEHNT? → code-gen fixt → test-runner → security erneut → Loop
|
|
4. [security] → ✅ FREIGABE
|
|
5. [git-push] → Feature-Branch, Commit, Push auf Gitea
|
|
6. [ssh-deploy] → git pull + rebuild auf Staging
|
|
7. [log-analyzer] → Health-Check, Logs prüfen
|
|
└── FEHLER? → code-gen fixt → zurück zu Schritt 2
|
|
8. [doc-gen] → CHANGELOG.md aktualisieren
|
|
9. [git-push] → Doku committen und pushen
|
|
```
|
|
|
|
### Bug fixen (`/workflow bugfix "Beschreibung"`)
|
|
```
|
|
1. [log-analyzer] → Logs holen, Fehler identifizieren
|
|
2. [code-gen] → Fix implementieren
|
|
3. [test-runner] → Regression-Test schreiben + ausführen
|
|
└── FAIL? → code-gen fixt → Loop
|
|
4. [security] → Fix bewerten
|
|
└── ABGELEHNT? → code-gen fixt → Loop
|
|
5. [security] → ✅ FREIGABE
|
|
6. [git-push] → Hotfix-Branch, Commit, Push
|
|
7. [ssh-deploy] → git pull + rebuild
|
|
8. [log-analyzer] → Verifizieren: Bug behoben?
|
|
└── NEIN? → zurück zu Schritt 2
|
|
9. [doc-gen] → CHANGELOG.md aktualisieren
|
|
10.[git-push] → Doku committen und pushen
|
|
```
|
|
|
|
### Security-Audit (`/workflow security-audit`)
|
|
```
|
|
1. [security] → Vollständige Code-Analyse
|
|
2. [dep-check] → Dependency Vulnerabilities
|
|
3. [security] → Server-Security prüfen (Firewall, Fail2Ban, Ports)
|
|
4. [code-gen] → Alle Findings fixen
|
|
5. [test-runner] → Tests für Fixes
|
|
6. [security] → Re-Check aller Fixes → ✅ FREIGABE
|
|
7. [git-push] → Security-Fixes committen und pushen
|
|
8. [ssh-deploy] → git pull + rebuild
|
|
9. [doc-gen] → CHANGELOG.md mit Security-Report
|
|
10.[git-push] → Doku pushen
|
|
```
|
|
|
|
### Release (`/workflow release "vX.Y.Z"`)
|
|
```
|
|
1. [test-runner] → Alle Tests (Unit, Integration)
|
|
2. [security] → Final Security-Check (Code + Server)
|
|
3. [dep-check] → Dependency-Check + Updates
|
|
└── Updates? → test-runner erneut → security erneut
|
|
4. [security] → ✅ RELEASE-FREIGABE
|
|
5. [git-push] → Release-Branch, Tag, Changelog, Push
|
|
6. [ssh-deploy] → git pull + rebuild auf Staging
|
|
7. [log-analyzer] → Finaler Health-Check
|
|
8. [doc-gen] → CHANGELOG.md + Release-Notes
|
|
9. [git-push] → Doku pushen
|
|
```
|
|
|
|
### Neues Projekt (`/workflow init "Projektname"`)
|
|
```
|
|
1. [project-init] → Struktur erstellen (Frontend + Backend)
|
|
2. [docker-build] → Docker-Setup
|
|
3. [security] → Basis-Security prüfen (gitignore, .env, Deps)
|
|
4. [git-push] → Git init, Gitea Remote, erster Commit + Push
|
|
5. [test-runner] → Basis-Tests einrichten
|
|
6. [doc-gen] → INSTALL.md + DEPLOY.md generieren
|
|
7. [git-push] → Doku pushen
|
|
```
|
|
|
|
### Neue Umgebung auf Proxmox (`/workflow provision "Projektname"`)
|
|
```
|
|
1. [proxmox-lxc] → LXC erstellen + IP ermitteln → SSH_HOST
|
|
2. [proxmox-lxc] → Basis-Setup (Node.js/Docker, Git, Firewall, Nginx)
|
|
3. [proxmox-lxc] → Security-Hardening (Fail2Ban, Auto-Updates, Sysctl)
|
|
4. [security] → Server-Security verifizieren → ✅ FREIGABE Server
|
|
5. [git-push] → Code auf Gitea pushen
|
|
6. [ssh-deploy] → git clone auf LXC, npm ci, build, Service starten
|
|
7. [security] → Code-Security prüfen → ✅ FREIGABE Code
|
|
8. [log-analyzer] → Health-Check & Logs prüfen
|
|
9. [doc-gen] → INSTALL.md + DEPLOY.md mit echten Werten
|
|
10. [git-push] → Dokumentation + etwaige Fixes committen und pushen
|
|
```
|
|
|
|
## QUALITÄTS-GATES
|
|
|
|
### Gate 1: Tests bestanden (Pflicht vor Security-Review)
|
|
- Alle Unit-Tests grün
|
|
- Neue Funktionen haben Tests
|
|
- Coverage >= 80%
|
|
|
|
### Gate 2: Security-Freigabe (Pflicht vor Git-Push/Deploy)
|
|
- Keine KRITISCHEN oder HOHEN Findings
|
|
- Keine Secrets im Code
|
|
- Dependencies ohne bekannte CVEs
|
|
- `.gitignore` enthält `.env`, `node_modules/`, `*.key`
|
|
|
|
### Gate 3: Deploy-Verifizierung (Pflicht vor Doku-Abschluss)
|
|
- Health-Check erfolgreich
|
|
- Keine Fehler in den Logs
|
|
- Service läuft stabil
|
|
|
|
## GRUNDREGEL: JEDER SKILL SCHREIBT ZURÜCK
|
|
|
|
Kein Skill darf "still" beenden. Nach jeder Ausführung:
|
|
1. **Fehler gefunden?** → Sofort fixen, committen, pushen
|
|
2. **System verändert?** → INSTALL.md / DEPLOY.md aktualisieren
|
|
3. **Etwas Wichtiges passiert?** → CHANGELOG.md ergänzen
|
|
4. **Alles committen und pushen** → Doku ist immer aktuell im Git
|
|
|
|
## FEHLERBEHANDLUNG
|
|
- Test-Fehler → code-gen fixt → test-runner erneut → Loop bis grün → Commit + Push
|
|
- Security-Abgelehnt → code-gen fixt → test-runner → security erneut → Loop bis Freigabe
|
|
- Deploy-Fehler → log-analyzer → code-gen fixt → zurück in die Pipeline ab test-runner
|
|
- **IMMER**: CHANGELOG.md aktualisieren mit was passiert ist
|