kaizen
Manufacturing-fokussierter Continuous Improvement Skill fuer fabrikIQ. Implementiert Lean Manufacturing Prinzipien (5 Whys, Ishikawa, PDCA) fuer systematische Problemloesung und Qualitaetsverbesserung. Aktivieren bei Bug-Analyse, Refactoring, Code Review, Production Incidents.
What this skill does
# Kaizen - Continuous Improvement Skill
Dieser Skill bringt bewaehrte Lean Manufacturing Methoden in die Softwareentwicklung. Entwickelt fuer fabrikIQ, anwendbar auf jedes TypeScript/React Projekt.
## Die 4 Saeulen des Kaizen
### 1. Continuous Improvement (Kaizen)
Kleine, inkrementelle Aenderungen statt Big Bang Refactoring.
**Prinzip**: Jeder Commit sollte den Code minimal besser hinterlassen als vorgefunden.
```typescript
// VORHER: Grosses Refactoring geplant
// "Ich refactore mal schnell die ganze Auth-Logik"
// KAIZEN: Kleine Schritte
// Commit 1: Extrahiere validateToken() aus auth.ts
// Commit 2: Fuege Typen fuer TokenPayload hinzu
// Commit 3: Ersetze any mit unknown + Type Guard
// Commit 4: Schreibe Unit Test fuer validateToken()
```
### 2. Poka-Yoke (Error Proofing)
Fehler durch Design verhindern, nicht durch Disziplin.
**TypeScript Constraints**:
```typescript
// FALSCH: Runtime Check (Fehler moeglich)
function processOrder(status: string) {
if (status !== 'pending' && status !== 'approved') {
throw new Error('Invalid status');
}
}
// POKA-YOKE: Compile-Time Constraint (Fehler unmoeglich)
type OrderStatus = 'pending' | 'approved' | 'shipped' | 'cancelled';
function processOrder(status: OrderStatus) {
// TypeScript verhindert ungueltige Werte
}
```
**Fail-Fast Pattern**:
```typescript
// FALSCH: Spaete Fehlererkennung
async function analyzeData(file: File) {
const data = await parseFile(file); // 10 Sekunden
const result = await geminiAnalyze(data); // 30 Sekunden
if (!data.hasRequiredColumns()) { // Fehler erst nach 40 Sekunden!
throw new Error('Missing columns');
}
}
// POKA-YOKE: Fail-Fast (fruehe Validierung)
async function analyzeData(file: File) {
// Validierung ZUERST (< 1ms)
const preview = await parseFilePreview(file, 10);
if (!preview.hasRequiredColumns()) {
throw new Error('Missing columns'); // Sofort!
}
// Teure Operationen NUR wenn valide
const data = await parseFile(file);
const result = await geminiAnalyze(data);
}
```
### 3. Standardized Work
Konsistente Patterns reduzieren kognitive Last und Fehler.
**API Response Pattern (fabrikIQ Standard)**:
```typescript
// Standard Response Format
interface ApiResponse<T> {
success: boolean;
data?: T;
error?: {
code: string;
message: string;
details?: unknown;
};
meta?: {
timestamp: string;
duration_ms: number;
region: 'fra1'; // DSGVO
};
}
// Alle Endpoints nutzen dieses Format
export async function handler(req: Request): Promise<Response> {
const start = Date.now();
try {
const result = await processRequest(req);
return Response.json({
success: true,
data: result,
meta: {
timestamp: new Date().toISOString(),
duration_ms: Date.now() - start,
region: 'fra1'
}
});
} catch (error) {
return Response.json({
success: false,
error: {
code: error.code ?? 'UNKNOWN_ERROR',
message: error.message
}
}, { status: error.status ?? 500 });
}
}
```
### 4. Just-In-Time (YAGNI)
Implementiere nur was JETZT gebraucht wird.
```typescript
// FALSCH: "Vielleicht brauchen wir das spaeter"
interface User {
id: string;
email: string;
name: string;
// "Fuer spaeter"
avatar?: string;
preferences?: UserPreferences;
notifications?: NotificationSettings;
integrations?: ExternalIntegrations;
analytics?: UserAnalytics;
}
// YAGNI: Nur aktuelle Requirements
interface User {
id: string;
email: string;
name: string;
}
// Erweitern wenn tatsaechlich benoetigt (mit eigenem Commit)
```
---
## Befehle
### /why - 5-Whys Root Cause Analysis
**Trigger**: `/why`, `5 whys`, `root cause`, `warum passiert`
**Anwendung**: Bei Bugs, Production Incidents, wiederkehrenden Problemen
**Workflow**:
1. **Problem definieren** (konkret, messbar)
```
Problem: API Timeout bei SECOM-Dataset (504 nach 60s)
```
2. **5x "Warum?" fragen**
```
Why 1: Warum Timeout?
→ Gemini API braucht >60s fuer Antwort
Why 2: Warum >60s?
→ Prompt enthaelt 590 Spalten x 1567 Zeilen
Why 3: Warum so viele Daten?
→ Kein Column Sampling implementiert
Why 4: Warum kein Sampling?
→ Urspruenglich nur kleine CSVs erwartet
Why 5: Warum nicht angepasst?
→ Keine automatischen Performance-Tests mit grossen Dateien
```
3. **Root Cause identifizieren**
```
Root Cause: Fehlende Performance-Testabdeckung fuer grosse Datasets
```
4. **Countermeasure definieren**
```
Massnahme 1: Column Sampling (MAX_COLUMNS = 50) implementieren
Massnahme 2: Performance-Test mit SECOM in CI/CD hinzufuegen
Massnahme 3: Timeout-Monitoring mit Alerting einrichten
```
**Output-Format**:
```markdown
## 5-Whys Analyse
**Problem**: [Konkrete Beschreibung]
**Datum**: [ISO-8601]
**Betroffene Komponente**: [Datei/Service]
### Analyse
| Level | Frage | Antwort |
|-------|-------|---------|
| Why 1 | Warum [Symptom]? | [Antwort] |
| Why 2 | Warum [Antwort 1]? | [Antwort] |
| Why 3 | Warum [Antwort 2]? | [Antwort] |
| Why 4 | Warum [Antwort 3]? | [Antwort] |
| Why 5 | Warum [Antwort 4]? | [Antwort] |
### Root Cause
[Kernursache in einem Satz]
### Countermeasures
1. **Sofort** (< 1 Tag): [Quick Fix]
2. **Kurzfristig** (< 1 Woche): [Strukturelle Loesung]
3. **Langfristig** (< 1 Monat): [Praevention]
```
---
### /cause-and-effect - Ishikawa Diagram
**Trigger**: `/cause-and-effect`, `/ishikawa`, `/fishbone`, `ursache-wirkung`
**Anwendung**: Bei komplexen Problemen mit mehreren moeglichen Ursachen
**Die 6 M-Kategorien (Manufacturing)**:
1. **Mensch** (People): Skills, Training, Kommunikation
2. **Maschine** (Machine): Hardware, Tools, Infrastructure
3. **Material** (Material): Input-Daten, Dependencies
4. **Methode** (Method): Prozesse, Workflows, Patterns
5. **Messung** (Measurement): Monitoring, Tests, Metriken
6. **Milieu** (Environment): Production, Staging, Local
**Workflow**:
1. **Effekt definieren** (rechts)
```
Effekt: Login schlaegt intermittierend fehl
```
2. **Ursachen nach Kategorie sammeln**
```
MENSCH:
├── Nutzer loescht Cookies manuell
└── Admin aendert Session-TTL ohne Kommunikation
MASCHINE:
├── Vercel Cold Start > Session Check
└── KV Storage Latenz-Spikes
MATERIAL:
├── JWT Secret Rotation nicht synchron
└── OAuth Token abgelaufen
METHODE:
├── Kein Retry bei Session-Validierung
└── Keine Graceful Degradation
MESSUNG:
├── Keine Login-Erfolgsrate-Metrik
└── Kein Alerting bei Auth-Fehlern
MILIEU:
├── Production vs Preview unterschiedliche KV
└── Lokale Entwicklung ohne echte Auth
```
3. **Wahrscheinlichste Ursachen priorisieren**
4. **Validierung planen** (Hypothesen testen)
**Output-Format**:
```
┌─────────────────────────────────────────────────────┐
│ │
┌───────────┐ │ ┌───────────┐ ┌───────────┐ │
│ MENSCH │───┼───│ MASCHINE │ │ MATERIAL │────────────────┤
└───────────┘ │ └───────────┘ └───────────┘ │
│ │ │ │ │
┌────┴────┐ │ ┌────┴────┐ ┌────┴────┐ │
│ Cookies │ │ │ Cold │ │ JWT │ ▼
│ geloescht│ │ │ Start │ │ Rotation│ ┌──────────────┐
└─────────┘ │ └─────────┘ └─────────┘ │ LOGIN │
│ │ FEHLER │
┌───────────┐ │ ┌───────────┐ ┌───────────┐ └──────────────┘
│ METHODE │───┼───│ MESSUNG │ │ MILIEU │────────────────┤
└───────────┘ │ └───────────┘ └───────────┘ │
│ │ │ │ │
┌────┴────┐ │ ┌────┴────┐ ┌────┴────┐ Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.