omgkit 2.1.0 → 2.2.0
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/package.json +1 -1
- package/plugin/skills/SKILL_STANDARDS.md +743 -0
- package/plugin/skills/databases/mongodb/SKILL.md +797 -28
- package/plugin/skills/databases/postgresql/SKILL.md +494 -18
- package/plugin/skills/databases/prisma/SKILL.md +776 -30
- package/plugin/skills/databases/redis/SKILL.md +885 -25
- package/plugin/skills/devops/aws/SKILL.md +686 -28
- package/plugin/skills/devops/docker/SKILL.md +466 -18
- package/plugin/skills/devops/github-actions/SKILL.md +684 -29
- package/plugin/skills/devops/kubernetes/SKILL.md +621 -24
- package/plugin/skills/frameworks/django/SKILL.md +920 -20
- package/plugin/skills/frameworks/express/SKILL.md +1361 -35
- package/plugin/skills/frameworks/fastapi/SKILL.md +1260 -33
- package/plugin/skills/frameworks/laravel/SKILL.md +1244 -31
- package/plugin/skills/frameworks/nestjs/SKILL.md +1005 -26
- package/plugin/skills/frameworks/nextjs/SKILL.md +407 -44
- package/plugin/skills/frameworks/rails/SKILL.md +594 -28
- package/plugin/skills/frameworks/react/SKILL.md +1006 -32
- package/plugin/skills/frameworks/spring/SKILL.md +528 -35
- package/plugin/skills/frameworks/vue/SKILL.md +1296 -27
- package/plugin/skills/frontend/accessibility/SKILL.md +1108 -34
- package/plugin/skills/frontend/frontend-design/SKILL.md +1304 -26
- package/plugin/skills/frontend/responsive/SKILL.md +847 -21
- package/plugin/skills/frontend/shadcn-ui/SKILL.md +976 -38
- package/plugin/skills/frontend/tailwindcss/SKILL.md +831 -35
- package/plugin/skills/frontend/threejs/SKILL.md +1298 -29
- package/plugin/skills/languages/javascript/SKILL.md +935 -31
- package/plugin/skills/languages/python/SKILL.md +489 -25
- package/plugin/skills/languages/typescript/SKILL.md +379 -30
- package/plugin/skills/methodology/brainstorming/SKILL.md +597 -23
- package/plugin/skills/methodology/defense-in-depth/SKILL.md +832 -34
- package/plugin/skills/methodology/dispatching-parallel-agents/SKILL.md +665 -31
- package/plugin/skills/methodology/executing-plans/SKILL.md +556 -24
- package/plugin/skills/methodology/finishing-development-branch/SKILL.md +595 -25
- package/plugin/skills/methodology/problem-solving/SKILL.md +429 -61
- package/plugin/skills/methodology/receiving-code-review/SKILL.md +536 -24
- package/plugin/skills/methodology/requesting-code-review/SKILL.md +632 -21
- package/plugin/skills/methodology/root-cause-tracing/SKILL.md +641 -30
- package/plugin/skills/methodology/sequential-thinking/SKILL.md +262 -3
- package/plugin/skills/methodology/systematic-debugging/SKILL.md +571 -32
- package/plugin/skills/methodology/test-driven-development/SKILL.md +779 -24
- package/plugin/skills/methodology/testing-anti-patterns/SKILL.md +691 -29
- package/plugin/skills/methodology/token-optimization/SKILL.md +598 -29
- package/plugin/skills/methodology/verification-before-completion/SKILL.md +543 -22
- package/plugin/skills/methodology/writing-plans/SKILL.md +590 -18
- package/plugin/skills/omega/omega-architecture/SKILL.md +838 -39
- package/plugin/skills/omega/omega-coding/SKILL.md +636 -39
- package/plugin/skills/omega/omega-sprint/SKILL.md +855 -48
- package/plugin/skills/omega/omega-testing/SKILL.md +940 -41
- package/plugin/skills/omega/omega-thinking/SKILL.md +703 -50
- package/plugin/skills/security/better-auth/SKILL.md +1065 -28
- package/plugin/skills/security/oauth/SKILL.md +968 -31
- package/plugin/skills/security/owasp/SKILL.md +894 -33
- package/plugin/skills/testing/playwright/SKILL.md +764 -38
- package/plugin/skills/testing/pytest/SKILL.md +873 -36
- package/plugin/skills/testing/vitest/SKILL.md +980 -35
|
@@ -8,6 +8,8 @@ triggers:
|
|
|
8
8
|
- can't figure out
|
|
9
9
|
- problem solving
|
|
10
10
|
- not working
|
|
11
|
+
- help me solve
|
|
12
|
+
- troubleshooting
|
|
11
13
|
---
|
|
12
14
|
|
|
13
15
|
# Problem Solving
|
|
@@ -23,10 +25,33 @@ When you're stuck, random attempts waste time and energy. This skill provides:
|
|
|
23
25
|
- Systematic elimination process
|
|
24
26
|
- Time-boxed investigation phases
|
|
25
27
|
- Clear escalation criteria
|
|
28
|
+
- Evidence-based decision making
|
|
29
|
+
- Team collaboration patterns
|
|
26
30
|
|
|
27
31
|
## The 5-Phase Framework
|
|
28
32
|
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
35
|
+
│ PROBLEM-SOLVING FRAMEWORK │
|
|
36
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌──────────┐ ┌──────────────┐ ┌──────────┐ │
|
|
39
|
+
│ │ DEFINE │───▶│ HYPOTHESIZE │───▶│ TEST │ │
|
|
40
|
+
│ │ (5-10m) │ │ (10-15m) │ │ (boxed) │ │
|
|
41
|
+
│ └──────────┘ └──────────────┘ └─────┬────┘ │
|
|
42
|
+
│ │ │
|
|
43
|
+
│ ┌──────────────────┘ │
|
|
44
|
+
│ ▼ │
|
|
45
|
+
│ ┌──────────┐ ┌──────────┐ │
|
|
46
|
+
│ │ SOLVE │───▶│ PREVENT │ │
|
|
47
|
+
│ │ (impl) │ │(post-fix)│ │
|
|
48
|
+
│ └──────────┘ └──────────┘ │
|
|
49
|
+
│ │
|
|
50
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
29
53
|
### Phase 1: Define (5-10 minutes)
|
|
54
|
+
|
|
30
55
|
```
|
|
31
56
|
BOUNDARY DEFINITION
|
|
32
57
|
==================
|
|
@@ -47,6 +72,7 @@ Success criteria:
|
|
|
47
72
|
```
|
|
48
73
|
|
|
49
74
|
### Phase 2: Hypothesize (10-15 minutes)
|
|
75
|
+
|
|
50
76
|
```
|
|
51
77
|
HYPOTHESIS GENERATION (minimum 3)
|
|
52
78
|
================================
|
|
@@ -69,6 +95,7 @@ RULE: Generate hypotheses BEFORE testing any of them.
|
|
|
69
95
|
```
|
|
70
96
|
|
|
71
97
|
### Phase 3: Test (Time-boxed per hypothesis)
|
|
98
|
+
|
|
72
99
|
```
|
|
73
100
|
HYPOTHESIS TESTING ORDER
|
|
74
101
|
========================
|
|
@@ -87,6 +114,7 @@ STOP when: Hypothesis confirmed OR all eliminated
|
|
|
87
114
|
```
|
|
88
115
|
|
|
89
116
|
### Phase 4: Solve (Implementation)
|
|
117
|
+
|
|
90
118
|
```
|
|
91
119
|
SOLUTION IMPLEMENTATION
|
|
92
120
|
=======================
|
|
@@ -102,6 +130,7 @@ Implementation checklist:
|
|
|
102
130
|
```
|
|
103
131
|
|
|
104
132
|
### Phase 5: Prevent (Post-mortem)
|
|
133
|
+
|
|
105
134
|
```
|
|
106
135
|
PREVENTION ANALYSIS
|
|
107
136
|
===================
|
|
@@ -120,84 +149,188 @@ How do we prevent recurrence?
|
|
|
120
149
|
## Features
|
|
121
150
|
|
|
122
151
|
### 1. Root Cause Hypothesis Generator
|
|
123
|
-
```javascript
|
|
124
|
-
// Common hypothesis categories for software issues:
|
|
125
152
|
|
|
126
|
-
|
|
153
|
+
```typescript
|
|
154
|
+
interface Hypothesis {
|
|
155
|
+
id: string;
|
|
156
|
+
description: string;
|
|
157
|
+
category: HypothesisCategory;
|
|
158
|
+
evidenceFor: string[];
|
|
159
|
+
evidenceAgainst: string[];
|
|
160
|
+
testCost: 'low' | 'medium' | 'high';
|
|
161
|
+
probability: number;
|
|
162
|
+
status: 'pending' | 'confirmed' | 'eliminated' | 'inconclusive';
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type HypothesisCategory =
|
|
166
|
+
| 'data'
|
|
167
|
+
| 'configuration'
|
|
168
|
+
| 'timing'
|
|
169
|
+
| 'resources'
|
|
170
|
+
| 'external'
|
|
171
|
+
| 'code_logic'
|
|
172
|
+
| 'integration';
|
|
173
|
+
|
|
174
|
+
const hypothesisCategories: Record<HypothesisCategory, string[]> = {
|
|
127
175
|
data: [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
176
|
+
'Invalid input data',
|
|
177
|
+
'Data corruption',
|
|
178
|
+
'Missing required data',
|
|
179
|
+
'Encoding/format mismatch',
|
|
180
|
+
'Stale/cached data'
|
|
133
181
|
],
|
|
134
182
|
configuration: [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
183
|
+
'Environment variable missing',
|
|
184
|
+
'Config file incorrect',
|
|
185
|
+
'Feature flag state',
|
|
186
|
+
'Permission misconfiguration',
|
|
187
|
+
'Version mismatch'
|
|
140
188
|
],
|
|
141
189
|
timing: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
190
|
+
'Race condition',
|
|
191
|
+
'Timeout too short',
|
|
192
|
+
'Order of operations',
|
|
193
|
+
'Async/await issue',
|
|
194
|
+
'Deadlock'
|
|
147
195
|
],
|
|
148
196
|
resources: [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
197
|
+
'Memory exhaustion',
|
|
198
|
+
'Disk space',
|
|
199
|
+
'Connection pool depleted',
|
|
200
|
+
'Rate limiting',
|
|
201
|
+
'CPU throttling'
|
|
154
202
|
],
|
|
155
203
|
external: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
204
|
+
'Third-party service down',
|
|
205
|
+
'Network connectivity',
|
|
206
|
+
'DNS resolution',
|
|
207
|
+
'Certificate expiry',
|
|
208
|
+
'API contract change'
|
|
209
|
+
],
|
|
210
|
+
code_logic: [
|
|
211
|
+
'Off-by-one error',
|
|
212
|
+
'Null pointer exception',
|
|
213
|
+
'Type coercion issue',
|
|
214
|
+
'Boundary condition',
|
|
215
|
+
'Logic inversion'
|
|
216
|
+
],
|
|
217
|
+
integration: [
|
|
218
|
+
'Version incompatibility',
|
|
219
|
+
'Protocol mismatch',
|
|
220
|
+
'Authentication failure',
|
|
221
|
+
'Serialization error',
|
|
222
|
+
'Schema drift'
|
|
161
223
|
]
|
|
162
224
|
};
|
|
225
|
+
|
|
226
|
+
class HypothesisEngine {
|
|
227
|
+
private hypotheses: Map<string, Hypothesis> = new Map();
|
|
228
|
+
|
|
229
|
+
generateFromSymptoms(symptoms: string[]): Hypothesis[] {
|
|
230
|
+
const generated: Hypothesis[] = [];
|
|
231
|
+
|
|
232
|
+
for (const category of Object.keys(hypothesisCategories) as HypothesisCategory[]) {
|
|
233
|
+
const templates = hypothesisCategories[category];
|
|
234
|
+
for (const template of templates) {
|
|
235
|
+
if (this.matchesSymptoms(template, symptoms)) {
|
|
236
|
+
generated.push({
|
|
237
|
+
id: `${category}-${generated.length}`,
|
|
238
|
+
description: template,
|
|
239
|
+
category,
|
|
240
|
+
evidenceFor: this.findSupportingEvidence(template, symptoms),
|
|
241
|
+
evidenceAgainst: [],
|
|
242
|
+
testCost: this.estimateTestCost(category),
|
|
243
|
+
probability: 0,
|
|
244
|
+
status: 'pending'
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return this.rankByPriority(generated);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
private matchesSymptoms(template: string, symptoms: string[]): boolean {
|
|
254
|
+
const keywords = template.toLowerCase().split(/\s+/);
|
|
255
|
+
return symptoms.some(s =>
|
|
256
|
+
keywords.some(k => s.toLowerCase().includes(k))
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private findSupportingEvidence(template: string, symptoms: string[]): string[] {
|
|
261
|
+
return symptoms.filter(s =>
|
|
262
|
+
template.toLowerCase().split(/\s+/).some(k =>
|
|
263
|
+
s.toLowerCase().includes(k)
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
private estimateTestCost(category: HypothesisCategory): 'low' | 'medium' | 'high' {
|
|
269
|
+
const costs: Record<HypothesisCategory, 'low' | 'medium' | 'high'> = {
|
|
270
|
+
configuration: 'low',
|
|
271
|
+
data: 'low',
|
|
272
|
+
code_logic: 'medium',
|
|
273
|
+
timing: 'high',
|
|
274
|
+
resources: 'medium',
|
|
275
|
+
external: 'low',
|
|
276
|
+
integration: 'medium'
|
|
277
|
+
};
|
|
278
|
+
return costs[category];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
private rankByPriority(hypotheses: Hypothesis[]): Hypothesis[] {
|
|
282
|
+
return hypotheses.sort((a, b) => {
|
|
283
|
+
// Priority = Evidence × (1 / Cost)
|
|
284
|
+
const costMultiplier = { low: 3, medium: 2, high: 1 };
|
|
285
|
+
const aScore = a.evidenceFor.length * costMultiplier[a.testCost];
|
|
286
|
+
const bScore = b.evidenceFor.length * costMultiplier[b.testCost];
|
|
287
|
+
return bScore - aScore;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
163
291
|
```
|
|
164
292
|
|
|
165
293
|
### 2. Decision Tree Construction
|
|
294
|
+
|
|
166
295
|
```
|
|
167
296
|
START: Error occurs
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
297
|
+
│
|
|
298
|
+
├── Is it reproducible?
|
|
299
|
+
│ │
|
|
300
|
+
│ ├── YES: Proceed to isolation
|
|
301
|
+
│ │
|
|
302
|
+
│ └── NO: Focus on logging/monitoring
|
|
303
|
+
│ │
|
|
304
|
+
│ ├── Add debug logging
|
|
305
|
+
│ ├── Wait for recurrence
|
|
306
|
+
│ └── Analyze patterns
|
|
307
|
+
│
|
|
308
|
+
└── Can you isolate the component?
|
|
309
|
+
│
|
|
310
|
+
├── YES: Deep dive that component
|
|
311
|
+
│
|
|
312
|
+
└── NO: Binary search approach
|
|
313
|
+
│
|
|
314
|
+
├── Disable half the system
|
|
315
|
+
├── Does error persist?
|
|
316
|
+
└── Narrow down iteratively
|
|
188
317
|
```
|
|
189
318
|
|
|
190
319
|
### 3. Risk Assessment Matrix
|
|
320
|
+
|
|
191
321
|
```
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
322
|
+
┌────────────┬─────────────┬────────┬─────────────┬──────────┐
|
|
323
|
+
│ Hypothesis │ Probability │ Impact │ Test Effort │ Priority │
|
|
324
|
+
├────────────┼─────────────┼────────┼─────────────┼──────────┤
|
|
325
|
+
│ H1 │ High │ High │ Low │ 1st │
|
|
326
|
+
│ H2 │ Medium │ High │ Medium │ 2nd │
|
|
327
|
+
│ H3 │ Low │ High │ Low │ 3rd │
|
|
328
|
+
│ H4 │ High │ Low │ High │ 4th │
|
|
329
|
+
└────────────┴─────────────┴────────┴─────────────┴──────────┘
|
|
198
330
|
```
|
|
199
331
|
|
|
200
332
|
### 4. Time-Boxing Templates
|
|
333
|
+
|
|
201
334
|
```
|
|
202
335
|
INVESTIGATION TIME BOX: 2 hours total
|
|
203
336
|
|
|
@@ -210,9 +343,139 @@ Phase 5 (Prevent): 10 min [■■□□□□□□□□□□]
|
|
|
210
343
|
ESCALATION TRIGGER: If no progress after Phase 3, escalate.
|
|
211
344
|
```
|
|
212
345
|
|
|
346
|
+
### 5. Problem Solving State Machine
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
interface ProblemState {
|
|
350
|
+
phase: Phase;
|
|
351
|
+
problem: ProblemDefinition;
|
|
352
|
+
hypotheses: Hypothesis[];
|
|
353
|
+
testResults: TestResult[];
|
|
354
|
+
solution?: Solution;
|
|
355
|
+
prevention?: PreventionPlan;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
type Phase = 'define' | 'hypothesize' | 'test' | 'solve' | 'prevent';
|
|
359
|
+
|
|
360
|
+
interface ProblemDefinition {
|
|
361
|
+
description: string;
|
|
362
|
+
symptoms: string[];
|
|
363
|
+
stepsToReproduce: string[];
|
|
364
|
+
startedWhen: Date;
|
|
365
|
+
affectedScope: string[];
|
|
366
|
+
workingComponents: string[];
|
|
367
|
+
successCriteria: string[];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
interface TestResult {
|
|
371
|
+
hypothesisId: string;
|
|
372
|
+
action: string;
|
|
373
|
+
result: 'confirmed' | 'eliminated' | 'inconclusive';
|
|
374
|
+
evidence: string;
|
|
375
|
+
duration: number;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
interface Solution {
|
|
379
|
+
rootCause: string;
|
|
380
|
+
approach: string;
|
|
381
|
+
implementation: string[];
|
|
382
|
+
sideEffects: string[];
|
|
383
|
+
regressionTest: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface PreventionPlan {
|
|
387
|
+
immediateCause: string;
|
|
388
|
+
contributingFactors: string[];
|
|
389
|
+
systemicIssues: string[];
|
|
390
|
+
codeChanges: string[];
|
|
391
|
+
processChanges: string[];
|
|
392
|
+
monitoring: string[];
|
|
393
|
+
documentation: string[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
class ProblemSolver {
|
|
397
|
+
private state: ProblemState;
|
|
398
|
+
private timeBox: Map<Phase, number>;
|
|
399
|
+
|
|
400
|
+
constructor(problem: ProblemDefinition) {
|
|
401
|
+
this.state = {
|
|
402
|
+
phase: 'define',
|
|
403
|
+
problem,
|
|
404
|
+
hypotheses: [],
|
|
405
|
+
testResults: []
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
this.timeBox = new Map([
|
|
409
|
+
['define', 10 * 60 * 1000], // 10 minutes
|
|
410
|
+
['hypothesize', 15 * 60 * 1000], // 15 minutes
|
|
411
|
+
['test', 60 * 60 * 1000], // 60 minutes
|
|
412
|
+
['solve', 20 * 60 * 1000], // 20 minutes
|
|
413
|
+
['prevent', 10 * 60 * 1000] // 10 minutes
|
|
414
|
+
]);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
transitionTo(phase: Phase): void {
|
|
418
|
+
const validTransitions: Record<Phase, Phase[]> = {
|
|
419
|
+
define: ['hypothesize'],
|
|
420
|
+
hypothesize: ['test', 'define'],
|
|
421
|
+
test: ['solve', 'hypothesize'],
|
|
422
|
+
solve: ['prevent', 'test'],
|
|
423
|
+
prevent: []
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
if (!validTransitions[this.state.phase].includes(phase)) {
|
|
427
|
+
throw new Error(
|
|
428
|
+
`Invalid transition: ${this.state.phase} → ${phase}`
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
this.state.phase = phase;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
addHypothesis(h: Hypothesis): void {
|
|
436
|
+
if (this.state.phase !== 'hypothesize') {
|
|
437
|
+
throw new Error('Can only add hypotheses in hypothesize phase');
|
|
438
|
+
}
|
|
439
|
+
this.state.hypotheses.push(h);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
recordTestResult(result: TestResult): void {
|
|
443
|
+
if (this.state.phase !== 'test') {
|
|
444
|
+
throw new Error('Can only record tests in test phase');
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const hypothesis = this.state.hypotheses.find(
|
|
448
|
+
h => h.id === result.hypothesisId
|
|
449
|
+
);
|
|
450
|
+
if (hypothesis) {
|
|
451
|
+
hypothesis.status = result.result;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
this.state.testResults.push(result);
|
|
455
|
+
|
|
456
|
+
// Auto-transition if confirmed
|
|
457
|
+
if (result.result === 'confirmed') {
|
|
458
|
+
this.transitionTo('solve');
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
shouldEscalate(): boolean {
|
|
463
|
+
const allEliminated = this.state.hypotheses.every(
|
|
464
|
+
h => h.status === 'eliminated'
|
|
465
|
+
);
|
|
466
|
+
const hasConfirmed = this.state.hypotheses.some(
|
|
467
|
+
h => h.status === 'confirmed'
|
|
468
|
+
);
|
|
469
|
+
|
|
470
|
+
return allEliminated && !hasConfirmed;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
```
|
|
474
|
+
|
|
213
475
|
## Use Cases
|
|
214
476
|
|
|
215
477
|
### Stuck on Implementation
|
|
478
|
+
|
|
216
479
|
```
|
|
217
480
|
PROBLEM: Feature works locally but fails in staging
|
|
218
481
|
|
|
@@ -242,6 +505,7 @@ Phase 5 - Prevent:
|
|
|
242
505
|
```
|
|
243
506
|
|
|
244
507
|
### Performance Bottleneck
|
|
508
|
+
|
|
245
509
|
```
|
|
246
510
|
PROBLEM: API response time degraded from 100ms to 2s
|
|
247
511
|
|
|
@@ -270,6 +534,7 @@ Phase 5 - Prevent:
|
|
|
270
534
|
```
|
|
271
535
|
|
|
272
536
|
### Integration Failures
|
|
537
|
+
|
|
273
538
|
```
|
|
274
539
|
PROBLEM: Webhook deliveries failing intermittently
|
|
275
540
|
|
|
@@ -301,6 +566,40 @@ Phase 5 - Prevent:
|
|
|
301
566
|
- Set alerts for size thresholds
|
|
302
567
|
```
|
|
303
568
|
|
|
569
|
+
### Memory Leak Investigation
|
|
570
|
+
|
|
571
|
+
```
|
|
572
|
+
PROBLEM: Node.js service memory grows until crash
|
|
573
|
+
|
|
574
|
+
Phase 1 - Define:
|
|
575
|
+
- Symptoms: Memory increases linearly, crashes at 4GB
|
|
576
|
+
- Frequency: Every 6-8 hours under load
|
|
577
|
+
- Started: After v2.1.0 release
|
|
578
|
+
- Scope: All production instances
|
|
579
|
+
|
|
580
|
+
Phase 2 - Hypothesize:
|
|
581
|
+
H1: Event listener not removed
|
|
582
|
+
H2: Large object retained in closure
|
|
583
|
+
H3: Cache without size limit
|
|
584
|
+
H4: Stream not properly closed
|
|
585
|
+
|
|
586
|
+
Phase 3 - Test:
|
|
587
|
+
H1: Heap snapshot shows listener growth → No
|
|
588
|
+
H2: Check closures in new code → No obvious issues
|
|
589
|
+
H3: Inspect cache sizes → Found it! 10M+ entries
|
|
590
|
+
H4: Check stream handling → OK
|
|
591
|
+
|
|
592
|
+
Phase 4 - Solve:
|
|
593
|
+
- Add LRU eviction to cache (max 100K entries)
|
|
594
|
+
- Add cache stats endpoint for monitoring
|
|
595
|
+
- Implement cache TTL
|
|
596
|
+
|
|
597
|
+
Phase 5 - Prevent:
|
|
598
|
+
- Add memory usage tests
|
|
599
|
+
- Alert when cache exceeds thresholds
|
|
600
|
+
- Document cache sizing guidelines
|
|
601
|
+
```
|
|
602
|
+
|
|
304
603
|
## Best Practices
|
|
305
604
|
|
|
306
605
|
### Do's
|
|
@@ -309,6 +608,8 @@ Phase 5 - Prevent:
|
|
|
309
608
|
- **Time-box each phase** to prevent rabbit holes
|
|
310
609
|
- **Document failed approaches** - they're valuable data
|
|
311
610
|
- **Escalate when time-boxed out** - don't hero-code
|
|
611
|
+
- **Verify root cause** not just symptoms
|
|
612
|
+
- **Add regression tests** for every fix
|
|
312
613
|
|
|
313
614
|
### Don'ts
|
|
314
615
|
- Don't test the first idea that comes to mind
|
|
@@ -316,8 +617,11 @@ Phase 5 - Prevent:
|
|
|
316
617
|
- Don't discard hypotheses without testing
|
|
317
618
|
- Don't fix symptoms without understanding root cause
|
|
318
619
|
- Don't skip the prevention phase
|
|
620
|
+
- Don't assume a fix works without verification
|
|
621
|
+
- Don't forget to document the solution
|
|
319
622
|
|
|
320
623
|
### Escalation Criteria
|
|
624
|
+
|
|
321
625
|
```
|
|
322
626
|
ESCALATE WHEN:
|
|
323
627
|
- [ ] Time box exceeded with no progress
|
|
@@ -334,22 +638,86 @@ ESCALATION FORMAT:
|
|
|
334
638
|
Ask: [specific help needed]"
|
|
335
639
|
```
|
|
336
640
|
|
|
337
|
-
|
|
641
|
+
### Collaboration Patterns
|
|
642
|
+
|
|
643
|
+
```typescript
|
|
644
|
+
interface EscalationRequest {
|
|
645
|
+
problem: string;
|
|
646
|
+
timeInvested: string;
|
|
647
|
+
testedHypotheses: {
|
|
648
|
+
hypothesis: string;
|
|
649
|
+
result: string;
|
|
650
|
+
}[];
|
|
651
|
+
currentStatus: string;
|
|
652
|
+
blocker: string;
|
|
653
|
+
specificAsk: string;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
function formatEscalation(req: EscalationRequest): string {
|
|
657
|
+
return `
|
|
658
|
+
## Escalation: ${req.problem}
|
|
659
|
+
|
|
660
|
+
### Time Invested
|
|
661
|
+
${req.timeInvested}
|
|
662
|
+
|
|
663
|
+
### Hypotheses Tested
|
|
664
|
+
${req.testedHypotheses.map(h =>
|
|
665
|
+
`- **${h.hypothesis}**: ${h.result}`
|
|
666
|
+
).join('\n')}
|
|
667
|
+
|
|
668
|
+
### Current Status
|
|
669
|
+
${req.currentStatus}
|
|
670
|
+
|
|
671
|
+
### Blocker
|
|
672
|
+
${req.blocker}
|
|
673
|
+
|
|
674
|
+
### Specific Ask
|
|
675
|
+
${req.specificAsk}
|
|
676
|
+
`.trim();
|
|
677
|
+
}
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
## References
|
|
338
681
|
|
|
339
682
|
- **systematic-debugging** - Four-phase debugging with 95% fix rate
|
|
340
683
|
- **root-cause-tracing** - Deep investigation techniques
|
|
341
684
|
- **sequential-thinking** - Structure reasoning as numbered thoughts
|
|
342
685
|
- **brainstorming** - Generate more hypotheses
|
|
343
686
|
- **verification-before-completion** - Ensure fix is complete
|
|
687
|
+
- **testing-anti-patterns** - Avoid common testing mistakes
|
|
344
688
|
|
|
345
689
|
## Integration
|
|
346
690
|
|
|
347
691
|
Works seamlessly with debugging workflows:
|
|
692
|
+
|
|
348
693
|
```
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
694
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
695
|
+
│ INTEGRATION FLOW │
|
|
696
|
+
├─────────────────────────────────────────────────────────────┤
|
|
697
|
+
│ │
|
|
698
|
+
│ 1. Bug reported │
|
|
699
|
+
│ ↓ │
|
|
700
|
+
│ problem-solving Phase 1 (Define) │
|
|
701
|
+
│ ↓ │
|
|
702
|
+
│ 2. Reproduce │
|
|
703
|
+
│ ↓ │
|
|
704
|
+
│ systematic-debugging Phase 1 (Reproduce) │
|
|
705
|
+
│ ↓ │
|
|
706
|
+
│ 3. Investigate │
|
|
707
|
+
│ ↓ │
|
|
708
|
+
│ problem-solving Phases 2-3 (Hypothesize, Test) │
|
|
709
|
+
│ ↓ │
|
|
710
|
+
│ 4. Fix │
|
|
711
|
+
│ ↓ │
|
|
712
|
+
│ systematic-debugging Phase 3 (Fix) │
|
|
713
|
+
│ ↓ │
|
|
714
|
+
│ 5. Verify │
|
|
715
|
+
│ ↓ │
|
|
716
|
+
│ verification-before-completion │
|
|
717
|
+
│ ↓ │
|
|
718
|
+
│ 6. Prevent │
|
|
719
|
+
│ ↓ │
|
|
720
|
+
│ problem-solving Phase 5 (Prevent) │
|
|
721
|
+
│ │
|
|
722
|
+
└─────────────────────────────────────────────────────────────┘
|
|
355
723
|
```
|