$npx -y skills add NeoLabHQ/context-engineering-kit --skill analyseAuto-selects best Kaizen method (Gemba Walk, Value Stream, or Muda) for target
| 1 | # Smart Analysis |
| 2 | |
| 3 | Intelligently select and apply the most appropriate Kaizen analysis technique based on what you're analyzing. |
| 4 | |
| 5 | ## Description |
| 6 | Analyzes context and chooses best method: Gemba Walk (code exploration), Value Stream Mapping (workflow/process), or Muda Analysis (waste identification). Guides you through the selected technique. |
| 7 | |
| 8 | ## Usage |
| 9 | `/analyse [target_description]` |
| 10 | |
| 11 | Examples: |
| 12 | - `/analyse authentication implementation` |
| 13 | - `/analyse deployment workflow` |
| 14 | - `/analyse codebase for inefficiencies` |
| 15 | |
| 16 | ## Variables |
| 17 | - TARGET: What to analyze (default: prompt for input) |
| 18 | - METHOD: Override auto-selection (gemba, vsm, muda) |
| 19 | |
| 20 | ## Method Selection Logic |
| 21 | |
| 22 | **Gemba Walk** → When analyzing: |
| 23 | - Code implementation (how feature actually works) |
| 24 | - Gap between documentation and reality |
| 25 | - Understanding unfamiliar codebase areas |
| 26 | - Actual vs. assumed architecture |
| 27 | |
| 28 | **Value Stream Mapping** → When analyzing: |
| 29 | - Workflows and processes (CI/CD, deployment, development) |
| 30 | - Bottlenecks in multi-stage pipelines |
| 31 | - Handoffs between teams/systems |
| 32 | - Time spent in each process stage |
| 33 | |
| 34 | **Muda (Waste Analysis)** → When analyzing: |
| 35 | - Code quality and efficiency |
| 36 | - Technical debt |
| 37 | - Over-engineering or duplication |
| 38 | - Resource utilization |
| 39 | |
| 40 | ## Steps |
| 41 | 1. Understand what's being analyzed |
| 42 | 2. Determine best method (or use specified method) |
| 43 | 3. Explain why this method fits |
| 44 | 4. Guide through the analysis |
| 45 | 5. Present findings with actionable insights |
| 46 | |
| 47 | --- |
| 48 | |
| 49 | ## Method 1: Gemba Walk |
| 50 | |
| 51 | "Go and see" the actual code to understand reality vs. assumptions. |
| 52 | |
| 53 | ### When to Use |
| 54 | - Understanding how feature actually works |
| 55 | - Code archaeology (legacy systems) |
| 56 | - Finding gaps between docs and implementation |
| 57 | - Exploring unfamiliar areas before changes |
| 58 | |
| 59 | ### Process |
| 60 | 1. **Define scope**: What code area to explore |
| 61 | 2. **State assumptions**: What you think it does |
| 62 | 3. **Observe reality**: Read actual code |
| 63 | 4. **Document findings**: |
| 64 | - Entry points |
| 65 | - Actual data flow |
| 66 | - Surprises (differs from assumptions) |
| 67 | - Hidden dependencies |
| 68 | - Undocumented behavior |
| 69 | 5. **Identify gaps**: Documentation vs. reality |
| 70 | 6. **Recommend**: Update docs, refactor, or accept |
| 71 | |
| 72 | ### Example: Authentication System Gemba Walk |
| 73 | |
| 74 | ``` |
| 75 | SCOPE: User authentication flow |
| 76 | |
| 77 | ASSUMPTIONS (Before): |
| 78 | • JWT tokens stored in localStorage |
| 79 | • Single sign-on via OAuth only |
| 80 | • Session expires after 1 hour |
| 81 | • Password reset via email link |
| 82 | |
| 83 | GEMBA OBSERVATIONS (Actual Code): |
| 84 | |
| 85 | Entry Point: /api/auth/login (routes/auth.ts:45) |
| 86 | ├─> AuthService.authenticate() (services/auth.ts:120) |
| 87 | ├─> UserRepository.findByEmail() (db/users.ts:67) |
| 88 | ├─> bcrypt.compare() (services/auth.ts:145) |
| 89 | └─> TokenService.generate() (services/token.ts:34) |
| 90 | |
| 91 | Actual Flow: |
| 92 | 1. Login credentials → POST /api/auth/login |
| 93 | 2. Password hashed with bcrypt (10 rounds) |
| 94 | 3. JWT generated with 24hr expiry (NOT 1 hour!) |
| 95 | 4. Token stored in httpOnly cookie (NOT localStorage) |
| 96 | 5. Refresh token in separate cookie (15 days) |
| 97 | 6. Session data in Redis (30 days TTL) |
| 98 | |
| 99 | SURPRISES: |
| 100 | ✗ OAuth not implemented (commented out code found) |
| 101 | ✗ Password reset is manual (admin intervention) |
| 102 | ✗ Three different session storage mechanisms: |
| 103 | - Redis for session data |
| 104 | - Database for "remember me" |
| 105 | - Cookies for tokens |
| 106 | ✗ Legacy endpoint /auth/legacy still active (no auth!) |
| 107 | ✗ Admin users bypass rate limiting (security issue) |
| 108 | |
| 109 | GAPS: |
| 110 | • Documentation says OAuth, code doesn't have it |
| 111 | • Session expiry inconsistent (docs: 1hr, code: 24hr) |
| 112 | • Legacy endpoint not documented (security risk) |
| 113 | • No mention of "remember me" in docs |
| 114 | |
| 115 | RECOMMENDATIONS: |
| 116 | 1. HIGH: Secure or remove /auth/legacy endpoint |
| 117 | 2. HIGH: Document actual session expiry (24hr) |
| 118 | 3. MEDIUM: Clean up or implement OAuth |
| 119 | 4. MEDIUM: Consolidate session storage (choose one) |
| 120 | 5. LOW: Add rate limiting for admin users |
| 121 | ``` |
| 122 | |
| 123 | ### Example: CI/CD Pipeline Gemba Walk |
| 124 | |
| 125 | ``` |
| 126 | SCOPE: Build and deployment pipeline |
| 127 | |
| 128 | ASSUMPTIONS: |
| 129 | • Automated tests run on every commit |
| 130 | • Deploy to staging automatic |
| 131 | • Production deploy requires approval |
| 132 | |
| 133 | GEMBA OBSERVATIONS: |
| 134 | |
| 135 | Actual Pipeline (.github/workflows/main.yml): |
| 136 | 1. On push to main: |
| 137 | ├─> Lint (2 min) |
| 138 | ├─> Unit tests (5 min) [SKIPPED if "[skip-tests]" in commit] |
| 139 | ├─> Build Docker image (15 min) |
| 140 | └─> Deploy to staging (3 min) |
| 141 | |
| 142 | 2. Manual trigger for production: |
| 143 | ├─> Run integration tests (20 min) [ONLY for production!] |
| 144 | ├─> Security scan (10 min) |
| 145 | └─> Deploy to production (5 min) |
| 146 | |
| 147 | SURPRISES: |
| 148 | ✗ Unit tests can be skipped with commit message flag |
| 149 | ✗ Integration tests ONLY run for production deploy |
| 150 | ✗ Staging deployed without integration tests |
| 151 | ✗ No rollback mechanism (manual kubectl commands) |
| 152 | ✗ Secrets loaded from .env file (not secrets manager) |
| 153 | ✗ Old "hotfix" branch bypasses all checks |
| 154 | |
| 155 | GAPS: |
| 156 | • Staging and production have different test coverage |
| 157 | • Documentation doesn't mention test skip flag |
| 158 | • Rollback process not documented or automated |
| 159 | • Security s |