@minko-ai/minko 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +577 -2
- package/assets/mascot-preview.png +0 -0
- package/assets/mascot-preview.txt +46 -0
- package/assets/mascot-source.png +0 -0
- package/assets/skills/README.md +21 -0
- package/assets/skills/brainstorming/LICENSE +21 -0
- package/assets/skills/brainstorming/SKILL.md +316 -0
- package/assets/skills/buddhist-method/LICENSE +21 -0
- package/assets/skills/buddhist-method/SKILL.md +137 -0
- package/assets/skills/buddhist-method/references/ariyasacca-debug.md +57 -0
- package/assets/skills/buddhist-method/references/extended-principles.md +100 -0
- package/assets/skills/code-humanizer/LICENSE +21 -0
- package/assets/skills/code-humanizer/SKILL.md +174 -0
- package/assets/skills/code-review/LICENSE +21 -0
- package/assets/skills/code-review/SKILL.md +232 -0
- package/assets/skills/code-review/reference/angular.md +768 -0
- package/assets/skills/code-review/reference/architecture-review-guide.md +472 -0
- package/assets/skills/code-review/reference/c.md +890 -0
- package/assets/skills/code-review/reference/code-quality-universal.md +488 -0
- package/assets/skills/code-review/reference/code-review-best-practices.md +136 -0
- package/assets/skills/code-review/reference/common-bugs-checklist.md +302 -0
- package/assets/skills/code-review/reference/cpp.md +893 -0
- package/assets/skills/code-review/reference/cross-cutting/async-concurrency-patterns.md +515 -0
- package/assets/skills/code-review/reference/cross-cutting/error-handling-principles.md +492 -0
- package/assets/skills/code-review/reference/cross-cutting/n-plus-one-queries.md +309 -0
- package/assets/skills/code-review/reference/cross-cutting/sql-injection-prevention.md +308 -0
- package/assets/skills/code-review/reference/cross-cutting/xss-prevention.md +264 -0
- package/assets/skills/code-review/reference/csharp.md +525 -0
- package/assets/skills/code-review/reference/css-less-sass.md +661 -0
- package/assets/skills/code-review/reference/dart.md +670 -0
- package/assets/skills/code-review/reference/django.md +985 -0
- package/assets/skills/code-review/reference/fastapi.md +580 -0
- package/assets/skills/code-review/reference/go.md +993 -0
- package/assets/skills/code-review/reference/java.md +409 -0
- package/assets/skills/code-review/reference/java8.md +586 -0
- package/assets/skills/code-review/reference/kotlin.md +1018 -0
- package/assets/skills/code-review/reference/nestjs.md +593 -0
- package/assets/skills/code-review/reference/performance-review-guide.md +816 -0
- package/assets/skills/code-review/reference/php.md +684 -0
- package/assets/skills/code-review/reference/python.md +1073 -0
- package/assets/skills/code-review/reference/qt.md +757 -0
- package/assets/skills/code-review/reference/react.md +871 -0
- package/assets/skills/code-review/reference/ruby.md +964 -0
- package/assets/skills/code-review/reference/rust.md +846 -0
- package/assets/skills/code-review/reference/security-review-guide.md +494 -0
- package/assets/skills/code-review/reference/svelte.md +1064 -0
- package/assets/skills/code-review/reference/swift.md +936 -0
- package/assets/skills/code-review/reference/typescript.md +1016 -0
- package/assets/skills/code-review/reference/vue.md +924 -0
- package/assets/skills/code-review/reference/zig.md +440 -0
- package/assets/skills/cyclomatic-complexity/LICENSE +201 -0
- package/assets/skills/cyclomatic-complexity/SKILL.md +69 -0
- package/assets/skills/five-whys/LICENSE +21 -0
- package/assets/skills/five-whys/SKILL.md +247 -0
- package/assets/skills/five-whys/examples/performance-regression.md +161 -0
- package/assets/skills/five-whys/examples/production-incident.md +134 -0
- package/assets/skills/five-whys/references/software-patterns.md +284 -0
- package/assets/skills/five-whys/references/toyota-origins.md +257 -0
- package/assets/skills/systematic-debugging/LICENSE +21 -0
- package/assets/skills/systematic-debugging/SKILL.md +283 -0
- package/assets/skills/test-driven-development/LICENSE +21 -0
- package/assets/skills/test-driven-development/SKILL.md +330 -0
- package/assets/skills/verification-before-completion/LICENSE +21 -0
- package/assets/skills/verification-before-completion/SKILL.md +120 -0
- package/assets/skills/vibe-sec/LICENSE +201 -0
- package/assets/skills/vibe-sec/SKILL.md +758 -0
- package/assets/skills/writing-plans/LICENSE +21 -0
- package/assets/skills/writing-plans/SKILL.md +204 -0
- package/bin/minko.js +2 -2
- package/dist/agent/approvalTokens.js +224 -0
- package/dist/agent/branchLock.js +315 -0
- package/dist/agent/compact.js +182 -0
- package/dist/agent/context.js +183 -0
- package/dist/agent/cron.js +326 -0
- package/dist/agent/hooks.js +211 -0
- package/dist/agent/lanes.js +511 -0
- package/dist/agent/loop.js +337 -0
- package/dist/agent/memory.js +159 -0
- package/dist/agent/permissions.js +71 -0
- package/dist/agent/plan.js +118 -0
- package/dist/agent/prompt.js +120 -0
- package/dist/agent/subagent.js +67 -0
- package/dist/agent/tasks.js +449 -0
- package/dist/agent/transcript.js +62 -0
- package/dist/agent/workerStore.js +172 -0
- package/dist/agent/workerTypes.js +1 -0
- package/dist/agent/workers.js +503 -0
- package/dist/cli/app.js +261 -0
- package/dist/cli/argv.js +206 -0
- package/dist/cli/commandsCommand.js +12 -0
- package/dist/cli/configCommand.js +170 -0
- package/dist/cli/doctorCommand.js +112 -0
- package/dist/cli/exportCommand.js +85 -0
- package/dist/cli/forkCommand.js +24 -0
- package/dist/cli/linkCommand.js +272 -0
- package/dist/cli/loginCommand.js +69 -0
- package/dist/cli/mcpLoginCommand.js +68 -0
- package/dist/cli/pluginCommand.js +113 -0
- package/dist/cli/powerCommand.js +174 -0
- package/dist/cli/promptFooter.js +74 -0
- package/dist/cli/relayCommand.js +38 -0
- package/dist/cli/sandboxCommand.js +31 -0
- package/dist/cli/serveCommand.js +104 -0
- package/dist/cli/statusCommand.js +120 -0
- package/dist/cli/tui.js +1104 -0
- package/dist/commands/registry.js +99 -0
- package/dist/config/paths.js +81 -0
- package/dist/config/store.js +605 -0
- package/dist/index.js +199 -0
- package/dist/link/protocol.js +159 -0
- package/dist/link/relay.js +184 -0
- package/dist/link/server.js +566 -0
- package/dist/link/tunnel.js +90 -0
- package/dist/lsp/client.js +340 -0
- package/dist/lsp/tool.js +177 -0
- package/dist/mcp/client.js +469 -0
- package/dist/mcp/httpClient.js +191 -0
- package/dist/mcp/server.js +206 -0
- package/dist/mcp/tools.js +173 -0
- package/dist/oauth/device.js +111 -0
- package/dist/oauth/store.js +56 -0
- package/dist/plugins/loader.js +291 -0
- package/dist/plugins/market.js +98 -0
- package/dist/providers/anthropic.js +279 -0
- package/dist/providers/factory.js +109 -0
- package/dist/providers/openai.js +182 -0
- package/dist/providers/retry.js +95 -0
- package/dist/providers/sse.js +67 -0
- package/dist/providers/types.js +10 -0
- package/dist/rag/embeddings.js +171 -0
- package/dist/rag/index.js +373 -0
- package/dist/rag/server.js +167 -0
- package/dist/rag/tool.js +148 -0
- package/dist/sandbox/index.js +55 -0
- package/dist/sdk/server.js +150 -0
- package/dist/sdk/session.js +104 -0
- package/dist/session/liveness.js +148 -0
- package/dist/session/recorder.js +49 -0
- package/dist/session/store.js +171 -0
- package/dist/skills/index.js +428 -0
- package/dist/theme.js +30 -0
- package/dist/tools/fs.js +195 -0
- package/dist/tools/notebook.js +109 -0
- package/dist/tools/registry.js +32 -0
- package/dist/tools/search.js +130 -0
- package/dist/tools/shell.js +200 -0
- package/dist/tools/structured.js +83 -0
- package/dist/tools/types.js +1 -0
- package/dist/ui/ansi.js +135 -0
- package/dist/ui/banner.js +103 -0
- package/dist/ui/input.js +49 -0
- package/dist/ui/inputModel.js +113 -0
- package/dist/ui/keyboard.js +142 -0
- package/dist/ui/mascot.js +34 -0
- package/dist/ui/mascotData.js +96 -0
- package/dist/ui/md.js +183 -0
- package/dist/ui/screen.js +49 -0
- package/dist/ui/spinner.js +52 -0
- package/dist/ui/transcript.js +287 -0
- package/dist/util/clipboard.js +53 -0
- package/dist/util/errors.js +50 -0
- package/dist/util/version.js +12 -0
- package/dist/web/fetch.js +168 -0
- package/dist/web/search.js +97 -0
- package/package.json +45 -36
- package/src/agent/loop.ts +0 -159
- package/src/agent/prompt.ts +0 -45
- package/src/cli/app.ts +0 -396
- package/src/cli/argv.ts +0 -139
- package/src/cli/configCommand.ts +0 -175
- package/src/config/paths.ts +0 -20
- package/src/config/store.ts +0 -149
- package/src/index.ts +0 -120
- package/src/providers/anthropic.ts +0 -215
- package/src/providers/openai.ts +0 -158
- package/src/providers/sse.ts +0 -57
- package/src/providers/types.ts +0 -59
- package/src/session/store.ts +0 -125
- package/src/theme.ts +0 -41
- package/src/tools/fs.ts +0 -143
- package/src/tools/registry.ts +0 -19
- package/src/tools/shell.ts +0 -120
- package/src/tools/types.ts +0 -26
- package/src/ui/ansi.ts +0 -110
- package/src/ui/banner.ts +0 -39
- package/src/ui/input.ts +0 -54
- package/src/ui/md.ts +0 -160
- package/src/ui/spinner.ts +0 -58
- package/src/util/errors.ts +0 -48
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# Common Root Cause Patterns in Software
|
|
2
|
+
|
|
3
|
+
Frequently encountered root causes when applying 5-Whys to software problems.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Pattern 1: Missing Error Handling
|
|
8
|
+
|
|
9
|
+
### Typical Chain
|
|
10
|
+
```
|
|
11
|
+
Problem: Service returns 500 error intermittently
|
|
12
|
+
Why 1: Unhandled exception in payment processing
|
|
13
|
+
Why 2: External API returned unexpected format
|
|
14
|
+
Why 3: API version changed without notice
|
|
15
|
+
Why 4: No schema validation on API response
|
|
16
|
+
Why 5: Error handling assumes happy path only
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Root Cause Type
|
|
20
|
+
**Design Gap** - Defensive programming not applied
|
|
21
|
+
|
|
22
|
+
### Countermeasures
|
|
23
|
+
| Type | Action |
|
|
24
|
+
|------|--------|
|
|
25
|
+
| Immediate | Add try-catch, return graceful error |
|
|
26
|
+
| Preventive | Schema validation on all external inputs |
|
|
27
|
+
| Detection | Alert on unexpected response formats |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Pattern 2: Resource Leaks
|
|
32
|
+
|
|
33
|
+
### Typical Chain
|
|
34
|
+
```
|
|
35
|
+
Problem: Application memory grows until OOM
|
|
36
|
+
Why 1: Heap usage increases over time
|
|
37
|
+
Why 2: Objects not garbage collected
|
|
38
|
+
Why 3: References held in static cache
|
|
39
|
+
Why 4: Cache has no eviction policy
|
|
40
|
+
Why 5: Cache designed for small dataset, now large
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Root Cause Type
|
|
44
|
+
**Scaling Assumption** - Design didn't account for growth
|
|
45
|
+
|
|
46
|
+
### Countermeasures
|
|
47
|
+
| Type | Action |
|
|
48
|
+
|------|--------|
|
|
49
|
+
| Immediate | Restart service, add memory |
|
|
50
|
+
| Preventive | LRU cache with size limits |
|
|
51
|
+
| Detection | Memory usage alerts at 80% |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Pattern 3: Race Conditions
|
|
56
|
+
|
|
57
|
+
### Typical Chain
|
|
58
|
+
```
|
|
59
|
+
Problem: Duplicate orders created occasionally
|
|
60
|
+
Why 1: Same order inserted twice
|
|
61
|
+
Why 2: Two requests processed simultaneously
|
|
62
|
+
Why 3: No idempotency key check
|
|
63
|
+
Why 4: Assumed single request per order
|
|
64
|
+
Why 5: No distributed system thinking in design
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Root Cause Type
|
|
68
|
+
**Concurrency Gap** - Single-threaded assumptions in distributed system
|
|
69
|
+
|
|
70
|
+
### Countermeasures
|
|
71
|
+
| Type | Action |
|
|
72
|
+
|------|--------|
|
|
73
|
+
| Immediate | Database unique constraint |
|
|
74
|
+
| Preventive | Idempotency keys required |
|
|
75
|
+
| Detection | Duplicate detection in monitoring |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Pattern 4: Configuration Drift
|
|
80
|
+
|
|
81
|
+
### Typical Chain
|
|
82
|
+
```
|
|
83
|
+
Problem: Feature works in staging, fails in prod
|
|
84
|
+
Why 1: Environment variable missing in prod
|
|
85
|
+
Why 2: Manual deployment missed the variable
|
|
86
|
+
Why 3: No config validation at startup
|
|
87
|
+
Why 4: No infrastructure-as-code for env vars
|
|
88
|
+
Why 5: Config management treated as afterthought
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Root Cause Type
|
|
92
|
+
**Process Gap** - Manual process where automation needed
|
|
93
|
+
|
|
94
|
+
### Countermeasures
|
|
95
|
+
| Type | Action |
|
|
96
|
+
|------|--------|
|
|
97
|
+
| Immediate | Add missing config |
|
|
98
|
+
| Preventive | IaC for all configuration |
|
|
99
|
+
| Detection | Config diff check in CI/CD |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Pattern 5: Cascade Failures
|
|
104
|
+
|
|
105
|
+
### Typical Chain
|
|
106
|
+
```
|
|
107
|
+
Problem: All services down during traffic spike
|
|
108
|
+
Why 1: Database connection pool exhausted
|
|
109
|
+
Why 2: Queries taking 10x longer than normal
|
|
110
|
+
Why 3: Missing index on new query pattern
|
|
111
|
+
Why 4: New feature added query without review
|
|
112
|
+
Why 5: No query performance review in PR process
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Root Cause Type
|
|
116
|
+
**Process Gap** - Missing review step
|
|
117
|
+
|
|
118
|
+
### Countermeasures
|
|
119
|
+
| Type | Action |
|
|
120
|
+
|------|--------|
|
|
121
|
+
| Immediate | Add index, restart services |
|
|
122
|
+
| Preventive | Query review checklist in PR |
|
|
123
|
+
| Detection | Query latency alerts |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Pattern 6: Security Vulnerabilities
|
|
128
|
+
|
|
129
|
+
### Typical Chain
|
|
130
|
+
```
|
|
131
|
+
Problem: SQL injection found in production
|
|
132
|
+
Why 1: User input directly in SQL query
|
|
133
|
+
Why 2: Using string concatenation for queries
|
|
134
|
+
Why 3: Developer unaware of parameterized queries
|
|
135
|
+
Why 4: No security training for new developers
|
|
136
|
+
Why 5: Security not part of onboarding process
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Root Cause Type
|
|
140
|
+
**Knowledge Gap** - Training/onboarding deficiency
|
|
141
|
+
|
|
142
|
+
### Countermeasures
|
|
143
|
+
| Type | Action |
|
|
144
|
+
|------|--------|
|
|
145
|
+
| Immediate | Fix query, audit similar code |
|
|
146
|
+
| Preventive | Security training mandatory |
|
|
147
|
+
| Detection | Static analysis in CI |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Pattern 7: Dependency Failures
|
|
152
|
+
|
|
153
|
+
### Typical Chain
|
|
154
|
+
```
|
|
155
|
+
Problem: Build failed after weekend
|
|
156
|
+
Why 1: npm install fails
|
|
157
|
+
Why 2: Package version no longer exists
|
|
158
|
+
Why 3: Using floating version (^1.0.0)
|
|
159
|
+
Why 4: Lock file not committed
|
|
160
|
+
Why 5: No policy on dependency pinning
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Root Cause Type
|
|
164
|
+
**Policy Gap** - Missing standard/guideline
|
|
165
|
+
|
|
166
|
+
### Countermeasures
|
|
167
|
+
| Type | Action |
|
|
168
|
+
|------|--------|
|
|
169
|
+
| Immediate | Pin version, commit lock file |
|
|
170
|
+
| Preventive | Require lock files in all repos |
|
|
171
|
+
| Detection | CI fails if lock file missing |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Pattern 8: Data Corruption
|
|
176
|
+
|
|
177
|
+
### Typical Chain
|
|
178
|
+
```
|
|
179
|
+
Problem: Users see wrong account balance
|
|
180
|
+
Why 1: Balance calculation includes deleted transactions
|
|
181
|
+
Why 2: Soft delete not filtered in query
|
|
182
|
+
Why 3: New query copied from old one without filter
|
|
183
|
+
Why 4: No standard query patterns/repository layer
|
|
184
|
+
Why 5: Each feature writes raw SQL independently
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Root Cause Type
|
|
188
|
+
**Architecture Gap** - Missing abstraction layer
|
|
189
|
+
|
|
190
|
+
### Countermeasures
|
|
191
|
+
| Type | Action |
|
|
192
|
+
|------|--------|
|
|
193
|
+
| Immediate | Fix query, audit similar |
|
|
194
|
+
| Preventive | Repository pattern with standard filters |
|
|
195
|
+
| Detection | Data consistency checks |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Root Cause Categories Summary
|
|
200
|
+
|
|
201
|
+
| Category | Description | Typical Fix |
|
|
202
|
+
|----------|-------------|-------------|
|
|
203
|
+
| **Design Gap** | Missing consideration in design | Redesign component |
|
|
204
|
+
| **Process Gap** | Manual where automation needed | Automate process |
|
|
205
|
+
| **Knowledge Gap** | Team missing skill/awareness | Training, documentation |
|
|
206
|
+
| **Policy Gap** | No standard/guideline exists | Create and enforce policy |
|
|
207
|
+
| **Architecture Gap** | Missing abstraction/pattern | Refactor architecture |
|
|
208
|
+
| **Scaling Assumption** | Design didn't anticipate growth | Redesign for scale |
|
|
209
|
+
| **Concurrency Gap** | Single-thread thinking in distributed | Add synchronization |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Anti-Patterns in 5-Whys
|
|
214
|
+
|
|
215
|
+
### Anti-Pattern 1: The Blame Game
|
|
216
|
+
```
|
|
217
|
+
❌ Wrong:
|
|
218
|
+
Why 5: Developer didn't test properly
|
|
219
|
+
|
|
220
|
+
✓ Right:
|
|
221
|
+
Why 5: No automated test coverage for this scenario
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Anti-Pattern 2: The Vendor Excuse
|
|
225
|
+
```
|
|
226
|
+
❌ Wrong:
|
|
227
|
+
Why 5: Third-party API is unreliable
|
|
228
|
+
|
|
229
|
+
✓ Right:
|
|
230
|
+
Why 5: No retry/fallback for external dependencies
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Anti-Pattern 3: The Resource Excuse
|
|
234
|
+
```
|
|
235
|
+
❌ Wrong:
|
|
236
|
+
Why 5: We don't have time to do it right
|
|
237
|
+
|
|
238
|
+
✓ Right:
|
|
239
|
+
Why 5: Technical debt not prioritized in planning
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Anti-Pattern 4: The Complexity Excuse
|
|
243
|
+
```
|
|
244
|
+
❌ Wrong:
|
|
245
|
+
Why 5: The system is too complex
|
|
246
|
+
|
|
247
|
+
✓ Right:
|
|
248
|
+
Why 5: No documentation/tests for complex interactions
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Template for Software Issues
|
|
254
|
+
|
|
255
|
+
```markdown
|
|
256
|
+
## 5-Whys: [Issue Title]
|
|
257
|
+
|
|
258
|
+
### Problem
|
|
259
|
+
- **Symptom:** [What users/monitoring saw]
|
|
260
|
+
- **Time:** [When detected]
|
|
261
|
+
- **Duration:** [How long]
|
|
262
|
+
- **Impact:** [Users/revenue affected]
|
|
263
|
+
|
|
264
|
+
### Analysis
|
|
265
|
+
|
|
266
|
+
| Why | Question | Answer | Evidence |
|
|
267
|
+
|-----|----------|--------|----------|
|
|
268
|
+
| 1 | Why did [symptom]? | | Logs/metrics |
|
|
269
|
+
| 2 | Why did [Why1]? | | Code/config |
|
|
270
|
+
| 3 | Why did [Why2]? | | History/commits |
|
|
271
|
+
| 4 | Why did [Why3]? | | Process/docs |
|
|
272
|
+
| 5 | Why did [Why4]? | | Policy/culture |
|
|
273
|
+
|
|
274
|
+
### Root Cause
|
|
275
|
+
- **Category:** [Design/Process/Knowledge/Policy/Architecture]
|
|
276
|
+
- **Statement:** [One sentence]
|
|
277
|
+
|
|
278
|
+
### Actions
|
|
279
|
+
| Priority | Action | Owner | Status |
|
|
280
|
+
|----------|--------|-------|--------|
|
|
281
|
+
| P0 | [Immediate fix] | | |
|
|
282
|
+
| P1 | [Prevention] | | |
|
|
283
|
+
| P2 | [Detection] | | |
|
|
284
|
+
```
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# 5-Whys: Toyota Origins and Principles
|
|
2
|
+
|
|
3
|
+
The history and core principles of 5-Whys from the Toyota Production System.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Historical Background
|
|
8
|
+
|
|
9
|
+
### Origin
|
|
10
|
+
The 5-Whys technique was developed by **Sakichi Toyoda** (founder of Toyota Industries) and later refined by **Taiichi Ohno** as a critical component of the Toyota Production System (TPS) in the 1950s.
|
|
11
|
+
|
|
12
|
+
### The Famous Example
|
|
13
|
+
|
|
14
|
+
Taiichi Ohno's classic example from the factory floor:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Problem: The robot stopped working
|
|
18
|
+
|
|
19
|
+
Why 1: Why did the robot stop?
|
|
20
|
+
→ The circuit has overloaded, causing a fuse to blow.
|
|
21
|
+
|
|
22
|
+
Why 2: Why is the circuit overloaded?
|
|
23
|
+
→ There was insufficient lubrication on the bearings, so they locked up.
|
|
24
|
+
|
|
25
|
+
Why 3: Why was there insufficient lubrication?
|
|
26
|
+
→ The oil pump on the robot is not circulating sufficient oil.
|
|
27
|
+
|
|
28
|
+
Why 4: Why is the pump not circulating sufficient oil?
|
|
29
|
+
→ The pump intake is clogged with metal shavings.
|
|
30
|
+
|
|
31
|
+
Why 5: Why is the intake clogged with metal shavings?
|
|
32
|
+
→ There is no filter on the pump.
|
|
33
|
+
|
|
34
|
+
Root Cause: No filter on the oil pump intake
|
|
35
|
+
Solution: Install a filter on the oil pump
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Key Insight:** Without 5-Whys, the "fix" would have been replacing the fuse—and the robot would fail again.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Core Principles from Toyota
|
|
43
|
+
|
|
44
|
+
### Principle 1: Go and See (Genchi Genbutsu)
|
|
45
|
+
|
|
46
|
+
**Definition:** Go to the actual place, see the actual situation, understand the actual facts.
|
|
47
|
+
|
|
48
|
+
**Application to 5-Whys:**
|
|
49
|
+
- Don't analyze from reports alone
|
|
50
|
+
- Verify each "why" with direct observation
|
|
51
|
+
- Evidence must be firsthand, not hearsay
|
|
52
|
+
|
|
53
|
+
**Software Equivalent:**
|
|
54
|
+
- Read the actual logs, not summaries
|
|
55
|
+
- Check the actual code, not just the description
|
|
56
|
+
- Verify in the actual environment where the problem occurred
|
|
57
|
+
|
|
58
|
+
### Principle 2: Respect for People
|
|
59
|
+
|
|
60
|
+
**Definition:** Problems are process problems, not people problems.
|
|
61
|
+
|
|
62
|
+
**Application to 5-Whys:**
|
|
63
|
+
- Never stop at "human error" as root cause
|
|
64
|
+
- Ask "why did the process allow this error?"
|
|
65
|
+
- Build systems that make errors impossible or obvious
|
|
66
|
+
|
|
67
|
+
**The Toyota Philosophy:**
|
|
68
|
+
> "Blame the process, not the person. Every defect is a gift—it reveals a weakness in our process that we can improve."
|
|
69
|
+
|
|
70
|
+
### Principle 3: Continuous Improvement (Kaizen)
|
|
71
|
+
|
|
72
|
+
**Definition:** Small, incremental improvements every day.
|
|
73
|
+
|
|
74
|
+
**Application to 5-Whys:**
|
|
75
|
+
- Each root cause found is an improvement opportunity
|
|
76
|
+
- Document learnings for future reference
|
|
77
|
+
- Share findings across teams
|
|
78
|
+
|
|
79
|
+
### Principle 4: Build Quality In (Jidoka)
|
|
80
|
+
|
|
81
|
+
**Definition:** Stop and fix problems when they occur, don't pass them on.
|
|
82
|
+
|
|
83
|
+
**Application to 5-Whys:**
|
|
84
|
+
- Address root causes immediately
|
|
85
|
+
- Prevention > detection > reaction
|
|
86
|
+
- Make problems visible
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## The "5" in 5-Whys
|
|
91
|
+
|
|
92
|
+
### Why Specifically Five?
|
|
93
|
+
|
|
94
|
+
**Short Answer:** Five is a guideline, not a rule.
|
|
95
|
+
|
|
96
|
+
**Ohno's Observation:**
|
|
97
|
+
> "By asking 'why' five times, the nature of the problem as well as its solution becomes clear."
|
|
98
|
+
|
|
99
|
+
**The Reality:**
|
|
100
|
+
- Some problems need only 3 whys
|
|
101
|
+
- Some need 7 or more
|
|
102
|
+
- Stop when you reach an actionable root cause
|
|
103
|
+
|
|
104
|
+
### Signs You've Gone Deep Enough
|
|
105
|
+
|
|
106
|
+
| Signal | Example |
|
|
107
|
+
|--------|---------|
|
|
108
|
+
| Reached a process/policy | "No code review requirement" |
|
|
109
|
+
| Found a missing control | "No input validation" |
|
|
110
|
+
| Hit a design decision | "Chose eventual consistency" |
|
|
111
|
+
| Discovered a trade-off | "Prioritized speed over testing" |
|
|
112
|
+
|
|
113
|
+
### Signs You Need to Go Deeper
|
|
114
|
+
|
|
115
|
+
| Signal | Example |
|
|
116
|
+
|--------|---------|
|
|
117
|
+
| Answer is still a symptom | "The server was slow" |
|
|
118
|
+
| Answer is blame | "Developer made a mistake" |
|
|
119
|
+
| Answer is vague | "Something went wrong" |
|
|
120
|
+
| Problem will recur if unchanged | "Bad data was entered" |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Toyota vs. Software Context
|
|
125
|
+
|
|
126
|
+
### Similarities
|
|
127
|
+
|
|
128
|
+
| Toyota Factory | Software System |
|
|
129
|
+
|----------------|-----------------|
|
|
130
|
+
| Assembly line stops | Production incident |
|
|
131
|
+
| Defective part | Bug in code |
|
|
132
|
+
| Machine breakdown | Service outage |
|
|
133
|
+
| Quality inspection | Testing/monitoring |
|
|
134
|
+
| Process variation | Configuration drift |
|
|
135
|
+
|
|
136
|
+
### Key Differences
|
|
137
|
+
|
|
138
|
+
| Aspect | Toyota Factory | Software |
|
|
139
|
+
|--------|----------------|----------|
|
|
140
|
+
| **Visibility** | Physical, observable | Abstract, logged |
|
|
141
|
+
| **Reproducibility** | High | Variable (race conditions) |
|
|
142
|
+
| **Root cause location** | Usually nearby | Could be anywhere in stack |
|
|
143
|
+
| **Fix deployment** | Immediate | Requires release process |
|
|
144
|
+
| **Evidence** | Physical inspection | Logs, metrics, traces |
|
|
145
|
+
|
|
146
|
+
### Adaptations for Software
|
|
147
|
+
|
|
148
|
+
1. **Distributed Systems Complexity**
|
|
149
|
+
- Multiple services may contribute to one problem
|
|
150
|
+
- Need to trace across service boundaries
|
|
151
|
+
- Consider timing and ordering of events
|
|
152
|
+
|
|
153
|
+
2. **Non-Determinism**
|
|
154
|
+
- Some bugs don't reproduce reliably
|
|
155
|
+
- May need statistical evidence
|
|
156
|
+
- "Why does this happen 5% of the time?"
|
|
157
|
+
|
|
158
|
+
3. **Remote Evidence Gathering**
|
|
159
|
+
- Can't physically "go and see"
|
|
160
|
+
- Rely on observability (logs, metrics, traces)
|
|
161
|
+
- Need good instrumentation
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Toyota's 5-Whys Best Practices
|
|
166
|
+
|
|
167
|
+
### Practice 1: Write It Down
|
|
168
|
+
|
|
169
|
+
Toyota engineers document every 5-Whys analysis. Benefits:
|
|
170
|
+
- Forces clear thinking
|
|
171
|
+
- Creates reference for future problems
|
|
172
|
+
- Enables pattern recognition across incidents
|
|
173
|
+
|
|
174
|
+
### Practice 2: Do It Together
|
|
175
|
+
|
|
176
|
+
At Toyota, 5-Whys is a team activity:
|
|
177
|
+
- Multiple perspectives catch blind spots
|
|
178
|
+
- Shared understanding of the problem
|
|
179
|
+
- Collective ownership of the solution
|
|
180
|
+
|
|
181
|
+
### Practice 3: Verify Before Moving On
|
|
182
|
+
|
|
183
|
+
Each "why" must be verified before proceeding:
|
|
184
|
+
- "How do we know this is true?"
|
|
185
|
+
- "What evidence supports this?"
|
|
186
|
+
- "Have we seen this directly?"
|
|
187
|
+
|
|
188
|
+
### Practice 4: Focus on Process
|
|
189
|
+
|
|
190
|
+
Toyota's hierarchy of root causes:
|
|
191
|
+
1. **Best:** Fix the process/system
|
|
192
|
+
2. **Good:** Add a check/validation
|
|
193
|
+
3. **Acceptable:** Add training/documentation
|
|
194
|
+
4. **Avoid:** Rely on human vigilance
|
|
195
|
+
|
|
196
|
+
### Practice 5: Follow Through
|
|
197
|
+
|
|
198
|
+
Analysis without action is waste:
|
|
199
|
+
- Assign owners to countermeasures
|
|
200
|
+
- Set deadlines
|
|
201
|
+
- Verify effectiveness
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Common Mistakes Toyota Warns Against
|
|
206
|
+
|
|
207
|
+
### Mistake 1: Jumping to Solutions
|
|
208
|
+
|
|
209
|
+
> "The most dangerous kind of waste is the waste we do not recognize." — Shigeo Shingo
|
|
210
|
+
|
|
211
|
+
Wait until 5-Whys is complete before proposing solutions.
|
|
212
|
+
|
|
213
|
+
### Mistake 2: Stopping at Symptoms
|
|
214
|
+
|
|
215
|
+
If your root cause could be preceded by "because," you haven't gone deep enough.
|
|
216
|
+
|
|
217
|
+
### Mistake 3: Single-Cause Thinking
|
|
218
|
+
|
|
219
|
+
Real problems often have multiple contributing factors. Use branching when needed.
|
|
220
|
+
|
|
221
|
+
### Mistake 4: Accepting "Human Error"
|
|
222
|
+
|
|
223
|
+
> "Every human error is a process error in disguise." — Toyota principle
|
|
224
|
+
|
|
225
|
+
Always ask: "Why did the process allow this error?"
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## The Toyota Way Summary
|
|
230
|
+
|
|
231
|
+
| Principle | 5-Whys Application |
|
|
232
|
+
|-----------|-------------------|
|
|
233
|
+
| **Challenge** | Question every assumption |
|
|
234
|
+
| **Kaizen** | Every problem is an improvement opportunity |
|
|
235
|
+
| **Genchi Genbutsu** | Base analysis on facts, not opinions |
|
|
236
|
+
| **Respect** | Fix processes, don't blame people |
|
|
237
|
+
| **Teamwork** | Analyze together, own together |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Applying Toyota Wisdom to Software
|
|
242
|
+
|
|
243
|
+
**Before starting 5-Whys:**
|
|
244
|
+
- Gather all available evidence (logs, metrics, traces)
|
|
245
|
+
- Involve people who were there when it happened
|
|
246
|
+
- Create a timeline of events
|
|
247
|
+
|
|
248
|
+
**During 5-Whys:**
|
|
249
|
+
- Verify each level with evidence
|
|
250
|
+
- Branch when multiple causes contribute
|
|
251
|
+
- Keep asking until you reach process/design
|
|
252
|
+
|
|
253
|
+
**After 5-Whys:**
|
|
254
|
+
- Document the analysis
|
|
255
|
+
- Assign owners to countermeasures
|
|
256
|
+
- Share learnings with the team
|
|
257
|
+
- Verify fixes are effective
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jesse Vincent
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|