{
"event": "PreToolUse",
"tool_name": "mcp__mcp-docs__docs_create",
"tool_input": {
"title": "Quality Gates",
"slug": "quality-gates",
"parent_id": 91,
"description": "Automatische Code-Qualitätsprüfung via Claude Code Hooks",
"status": "published",
"content": "<nav class=\"breadcrumb\">\n <a href=\"\/docs\">Dokumentation<\/a> » \n <a href=\"\/docs\/prozesse\">Prozesse<\/a> » \n Quality Gates\n<\/nav>\n\n<h1>Quality Gates<\/h1>\n<p>Automatische Code-Qualitätsprüfung via Claude Code Hooks mit Task-Integration.<\/p>\n\n<table>\n <tr><th>Status<\/th><td>Aktiv<\/td><\/tr>\n <tr><th>Implementiert<\/th><td>2025-12-23<\/td><\/tr>\n <tr><th>Regeln<\/th><td>13 BLOCK + 17 WARN<\/td><\/tr>\n <tr><th>Task-Integration<\/th><td>Automatisch bei Violations<\/td><\/tr>\n<\/table>\n\n<section>\n <h2>Architektur<\/h2>\n <pre><code>\/var\/www\/tools\/ki-protokoll\/claude-hook\/\n├── hook_dispatcher.py ← Stabiler Einstiegspunkt\n├── .env ← DB-Credentials\n└── quality\/\n ├── pre_rules.py ← BLOCK-Regeln (P1-P6, H2-H5)\n ├── post_rules.py ← WARN-Regeln (W1-W6)\n └── task_creator.py ← Violations → ki_dev.tasks<\/code><\/pre>\n<\/section>\n\n<section>\n <h2>Prüfungen<\/h2>\n <table>\n <tr><th>#<\/th><th>Prüfung<\/th><th>Pre-Hook (BLOCK)<\/th><th>Post-Hook (WARN)<\/th><\/tr>\n <tr><td>1<\/td><td>SRP + KISS<\/td><td>P1.1 Header, P1.2 Müllhalden<\/td><td>W1.1-W1.5 Metriken<\/td><\/tr>\n <tr><td>2<\/td><td>MVC + CRUD<\/td><td>P2.1-P2.4 SQL, Trans, echo<\/td><td>W2.1-W2.2 Keywords<\/td><\/tr>\n <tr><td>3<\/td><td>PSR + Types<\/td><td>P3.1-P3.4 strict, NS, Return<\/td><td>W3.1, W3.3 Params<\/td><\/tr>\n <tr><td>4<\/td><td>OOP<\/td><td>P4.1 Public Property<\/td><td>W4.1-W4.4 Anämie<\/td><\/tr>\n <tr><td>5<\/td><td>DRY<\/td><td>-<\/td><td>W5.1-W5.2 Duplikate<\/td><\/tr>\n <tr><td>6<\/td><td>SOLID + DIP<\/td><td>P6.1-P6.2 Layer-Imports<\/td><td>W6.1-W6.2 Interface<\/td><\/tr>\n <\/table>\n<\/section>\n\n<section>\n <h2>Workflow<\/h2>\n <pre><code>Claude schreibt PHP-Datei\n ↓\nPre-Hook prüft Regeln\n ↓\nViolation? → BLOCK + Task erstellen\n ↓\nCode okay? → Datei geschrieben\n ↓\nPost-Hook prüft Warnungen → Tasks erstellen<\/code><\/pre>\n<\/section>\n\n<section>\n <h2>Task-Integration<\/h2>\n <p>Bei jeder Violation wird automatisch ein Task in <code>ki_dev.tasks<\/code> erstellt:<\/p>\n <ul>\n <li><strong>Violation:<\/strong> Datei, Regel, Meldung<\/li>\n <li><strong>Analyse:<\/strong> Was ist die Ursache?<\/li>\n <li><strong>Plan:<\/strong> Checkliste zur Behebung<\/li>\n <li><strong>Umsetzung:<\/strong> Dokumentation nach Abschluss<\/li>\n <\/ul>\n <p><strong>Duplikat-Schutz:<\/strong> Existiert bereits ein offener Task für dieselbe Datei+Regel, wird kein neuer erstellt.<\/p>\n<\/section>\n\n<section>\n <h2>Regeländerungen<\/h2>\n <table>\n <tr><th>Änderung<\/th><th>Claude-Neustart?<\/th><\/tr>\n <tr><td>Regeln in <code>quality\/*.py<\/code><\/td><td>Nein<\/td><\/tr>\n <tr><td><code>settings.json<\/code><\/td><td>Ja<\/td><\/tr>\n <tr><td><code>hook_dispatcher.py<\/code><\/td><td>Ja<\/td><\/tr>\n <\/table>\n<\/section>\n\n<section>\n <h2>Konfiguration (settings.json)<\/h2>\n <pre><code>{\n \"PreToolUse\": [{\n \"matcher\": \"Write\",\n \"hooks\": [{\n \"command\": \"\/var\/www\/tools\/ki-protokoll\/claude-hook\/hook_dispatcher.py pre\",\n \"timeout\": 5\n }]\n }],\n \"PostToolUse\": [{\n \"matcher\": \"Write|Edit\",\n \"hooks\": [{\n \"command\": \"\/var\/www\/tools\/ki-protokoll\/claude-hook\/hook_dispatcher.py post\",\n \"timeout\": 5\n }]\n }]\n}<\/code><\/pre>\n<\/section>\n\n<section>\n <h2>Detaillierte Regel-Dokumentation<\/h2>\n <p>Vollständige Definitionen aller Regeln mit Begründungen:<\/p>\n <p><code>\/var\/www\/dev.campus.systemische-tools.de\/docs\/plan-code-quality-gates.md<\/code><\/p>\n<\/section>"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 99,\n \"parent_id\": 91,\n \"slug\": \"quality-gates\",\n \"path\": \"\/prozesse\/quality-gates\",\n \"title\": \"Quality Gates\",\n \"description\": \"Automatische Code-Qualitätsprüfung via Claude Code Hooks\",\n \"content\": \"<nav class=\\\"breadcrumb\\\">\\n <a href=\\\"\/docs\\\">Dokumentation<\/a> » \\n <a href=\\\"\/docs\/prozesse\\\">Prozesse<\/a> » \\n Quality Gates\\n<\/nav>\\n\\n<h1>Quality Gates<\/h1>\\n<p>Automatische Code-Qualitätsprüfung via Claude Code Hooks mit Task-Integration.<\/p>\\n\\n<table>\\n <tr><th>Status<\/th><td>Aktiv<\/td><\/tr>\\n <tr><th>Implementiert<\/th><td>2025-12-23<\/td><\/tr>\\n <tr><th>Regeln<\/th><td>13 BLOCK + 17 WARN<\/td><\/tr>\\n <tr><th>Task-Integration<\/th><td>Automatisch bei Violations<\/td><\/tr>\\n<\/table>\\n\\n<section>\\n <h2>Architektur<\/h2>\\n <pre><code>\/var\/www\/tools\/ki-protokoll\/claude-hook\/\\n├── hook_dispatcher.py ← Stabiler Einstiegspunkt\\n├── .env ← DB-Credentials\\n└── quality\/\\n ├── pre_rules.py ← BLOCK-Regeln (P1-P6, H2-H5)\\n ├── post_rules.py ← WARN-Regeln (W1-W6)\\n └── task_creator.py ← Violations → ki_dev.tasks<\/code><\/pre>\\n<\/section>\\n\\n<section>\\n <h2>Prüfungen<\/h2>\\n <table>\\n <tr><th>#<\/th><th>Prüfung<\/th><th>Pre-Hook (BLOCK)<\/th><th>Post-Hook (WARN)<\/th><\/tr>\\n <tr><td>1<\/td><td>SRP + KISS<\/td><td>P1.1 Header, P1.2 Müllhalden<\/td><td>W1.1-W1.5 Metriken<\/td><\/tr>\\n <tr><td>2<\/td><td>MVC + CRUD<\/td><td>P2.1-P2.4 SQL, Trans, echo<\/td><td>W2.1-W2.2 Keywords<\/td><\/tr>\\n <tr><td>3<\/td><td>PSR + Types<\/td><td>P3.1-P3.4 strict, NS, Return<\/td><td>W3.1, W3.3 Params<\/td><\/tr>\\n <tr><td>4<\/td><td>OOP<\/td><td>P4.1 Public Property<\/td><td>W4.1-W4.4 Anämie<\/td><\/tr>\\n <tr><td>5<\/td><td>DRY<\/td><td>-<\/td><td>W5.1-W5.2 Duplikate<\/td><\/tr>\\n <tr><td>6<\/td><td>SOLID + DIP<\/td><td>P6.1-P6.2 Layer-Imports<\/td><td>W6.1-W6.2 Interface<\/td><\/tr>\\n <\/table>\\n<\/section>\\n\\n<section>\\n <h2>Workflow<\/h2>\\n <pre><code>Claude schreibt PHP-Datei\\n ↓\\nPre-Hook prüft Regeln\\n ↓\\nViolation? → BLOCK + Task erstellen\\n ↓\\nCode okay? → Datei geschrieben\\n ↓\\nPost-Hook prüft Warnungen → Tasks erstellen<\/code><\/pre>\\n<\/section>\\n\\n<section>\\n <h2>Task-Integration<\/h2>\\n <p>Bei jeder Violation wird automatisch ein Task in <code>ki_dev.tasks<\/code> erstellt:<\/p>\\n <ul>\\n <li><strong>Violation:<\/strong> Datei, Regel, Meldung<\/li>\\n <li><strong>Analyse:<\/strong> Was ist die Ursache?<\/li>\\n <li><strong>Plan:<\/strong> Checkliste zur Behebung<\/li>\\n <li><strong>Umsetzung:<\/strong> Dokumentation nach Abschluss<\/li>\\n <\/ul>\\n <p><strong>Duplikat-Schutz:<\/strong> Existiert bereits ein offener Task für dieselbe Datei+Regel, wird kein neuer erstellt.<\/p>\\n<\/section>\\n\\n<section>\\n <h2>Regeländerungen<\/h2>\\n <table>\\n <tr><th>Änderung<\/th><th>Claude-Neustart?<\/th><\/tr>\\n <tr><td>Regeln in <code>quality\/*.py<\/code><\/td><td>Nein<\/td><\/tr>\\n <tr><td><code>settings.json<\/code><\/td><td>Ja<\/td><\/tr>\\n <tr><td><code>hook_dispatcher.py<\/code><\/td><td>Ja<\/td><\/tr>\\n <\/table>\\n<\/section>\\n\\n<section>\\n <h2>Konfiguration (settings.json)<\/h2>\\n <pre><code>{\\n \\\"PreToolUse\\\": [{\\n \\\"matcher\\\": \\\"Write\\\",\\n \\\"hooks\\\": [{\\n \\\"command\\\": \\\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/hook_dispatcher.py pre\\\",\\n \\\"timeout\\\": 5\\n }]\\n }],\\n \\\"PostToolUse\\\": [{\\n \\\"matcher\\\": \\\"Write|Edit\\\",\\n \\\"hooks\\\": [{\\n \\\"command\\\": \\\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/hook_dispatcher.py post\\\",\\n \\\"timeout\\\": 5\\n }]\\n }]\\n}<\/code><\/pre>\\n<\/section>\\n\\n<section>\\n <h2>Detaillierte Regel-Dokumentation<\/h2>\\n <p>Vollständige Definitionen aller Regeln mit Begründungen:<\/p>\\n <p><code>\/var\/www\/dev.campus.systemische-tools.de\/docs\/plan-code-quality-gates.md<\/code><\/p>\\n<\/section>\",\n \"status\": \"published\",\n \"sort_order\": 0,\n \"depth\": 1,\n \"created_at\": \"2025-12-23T07:47:51\",\n \"updated_at\": \"2025-12-23T07:47:51\"\n },\n \"message\": \"Dokument 'Quality Gates' erstellt mit ID 99\"\n}"
}
]
}