Intelligently select and apply the most appropriate Kaizen analysis technique based on what you're analyzing.
Description
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.
Usage
/analyse [target_description]
Examples:
/analyse authentication implementation
/analyse deployment workflow
/analyse codebase for inefficiencies
Variables
TARGET: What to analyze (default: prompt for input)
Identify seven types of waste in code and development processes.
When to Use
Code quality audits
Technical debt assessment
Process efficiency improvements
Identifying over-engineering
The 7 Types of Waste (Applied to Software)
1. Overproduction
Building more than needed
Features no one uses
Overly complex solutions
Premature optimization
Unnecessary abstractions
2. Waiting
Idle time
Build/test/deploy time
Code review delays
Waiting for dependencies
Blocked by other teams
3. Transportation
Moving things around
Unnecessary data transformations
API layers with no value add
Copying data between systems
Repeated serialization/deserialization
4. Over-processing
Doing more than necessary
Excessive logging
Redundant validations
Over-normalized databases
Unnecessary computation
5. Inventory
Work in progress
Unmerged branches
Half-finished features
Untriaged bugs
Undeployed code
6. Motion
Unnecessary movement
Context switching
Meetings without purpose
Manual deployments
Repetitive tasks
7. Defects
Rework and bugs
Production bugs
Technical debt
Flaky tests
Incomplete features
Process
Define scope
Codebase area or process
Examine for each waste type
Quantify impact
(time, complexity, cost)
Prioritize by impact
Propose elimination strategies
Example: API Codebase Waste Analysis
SCOPE: REST API backend (50K LOC)
1. OVERPRODUCTION
Found:
• 15 API endpoints with zero usage (last 90 days)
• Generic "framework" built for "future flexibility" (unused)
• Premature microservices split (2 services, could be 1)
• Feature flags for 12 features (10 fully rolled out, flags kept)
Impact: 8K LOC maintained for no reason
Recommendation: Delete unused endpoints, remove stale flags
2. WAITING
Found:
• CI pipeline: 45 min (slow Docker builds)
• PR review time: avg 2 days
• Deployment to staging: manual, takes 1 hour
Impact: 2.5 days wasted per feature
Recommendation: Cache Docker layers, PR review SLA, automate staging
3. TRANSPORTATION
Found:
• Data transformed 4 times between DB and API response:
DB → ORM → Service → DTO → Serializer
• Request/response logged 3 times (middleware, handler, service)
• Files uploaded → S3 → CloudFront → Local cache (unnecessary)
Impact: 200ms avg response time overhead
Recommendation: Reduce transformation layers, consolidate logging
4. OVER-PROCESSING
Found:
• Every request validates auth token (even cached)
• Database queries fetch all columns (SELECT *)
• JSON responses include full object graphs (nested 5 levels)
• Logs every database query in production (verbose)
Impact: 40% higher database load, 3x log storage
Recommendation: Cache auth checks, selective fields, trim responses
5. INVENTORY
Found:
• 23 open PRs (8 abandoned, 6+ months old)
• 5 feature branches unmerged (completed but not deployed)
• 147 open bugs (42 duplicates, 60 not reproducible)
• 12 hotfix commits not backported to main
Impact: Context overhead, merge conflicts, lost work
Recommendation: Close stale PRs, bug triage, deploy pending features
6. MOTION
Found:
• Developers switch between 4 tools for one deployment
• Manual database migrations (error-prone, slow)
• Environment config spread across 6 files
• Copy-paste secrets to .env files
Impact: 30min per deployment, frequent mistakes
Recommendation: Unified deployment tool, automate migrations
7. DEFECTS
Found:
• 12 production bugs per month
• 15% flaky test rate (wasted retry time)
• Technical debt in auth module (refactor needed)
• Incomplete error handling (crashes instead of graceful)
Impact: Customer complaints, rework, downtime
Recommendation: Stabilize tests, refactor auth, add error boundaries
───────────────────────────────────────
SUMMARY
Total Waste Identified:
• Code: 8K LOC doing nothing
• Time: 2.5 days per feature
• Performance: 200ms overhead per request
• Effort: 30min per deployment
Priority Fixes (by impact):
1. HIGH: Automate deployments (reduces Motion + Waiting)
2. HIGH: Fix flaky tests (reduces Defects)
3. MEDIUM: Remove unused code (reduces Overproduction)
4. MEDIUM: Optimize data transformations (reduces Transportation)
5. LOW: Triage bug backlog (reduces Inventory)
Estimated Recovery:
• 20% faster feature delivery
• 50% fewer production issues
• 30% less operational overhead
Notes
Method selection is contextual—choose what fits best
Can combine methods (Gemba Walk → Muda Analysis)
Start with Gemba Walk when unfamiliar with area
Use VSM for process optimization
Use Muda for efficiency and cleanup
All methods should lead to actionable improvements
Document findings for organizational learning
Consider using
/analyse-problem
(A3) for comprehensive documentation of findings