omgkit 2.1.1 → 2.3.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/databases/mongodb/SKILL.md +81 -28
- package/plugin/skills/databases/prisma/SKILL.md +87 -32
- package/plugin/skills/databases/redis/SKILL.md +80 -27
- package/plugin/skills/devops/aws/SKILL.md +80 -26
- package/plugin/skills/devops/github-actions/SKILL.md +84 -32
- package/plugin/skills/devops/kubernetes/SKILL.md +94 -32
- package/plugin/skills/devops/performance-profiling/SKILL.md +59 -863
- package/plugin/skills/frameworks/django/SKILL.md +158 -24
- package/plugin/skills/frameworks/express/SKILL.md +153 -33
- package/plugin/skills/frameworks/fastapi/SKILL.md +153 -34
- package/plugin/skills/frameworks/laravel/SKILL.md +146 -33
- package/plugin/skills/frameworks/nestjs/SKILL.md +137 -25
- package/plugin/skills/frameworks/rails/SKILL.md +594 -28
- package/plugin/skills/frameworks/react/SKILL.md +94 -962
- package/plugin/skills/frameworks/spring/SKILL.md +528 -35
- package/plugin/skills/frameworks/vue/SKILL.md +147 -25
- package/plugin/skills/frontend/accessibility/SKILL.md +145 -36
- package/plugin/skills/frontend/frontend-design/SKILL.md +114 -29
- package/plugin/skills/frontend/responsive/SKILL.md +131 -28
- package/plugin/skills/frontend/shadcn-ui/SKILL.md +133 -43
- package/plugin/skills/frontend/tailwindcss/SKILL.md +105 -37
- package/plugin/skills/frontend/threejs/SKILL.md +110 -35
- package/plugin/skills/languages/javascript/SKILL.md +195 -34
- package/plugin/skills/methodology/brainstorming/SKILL.md +98 -30
- package/plugin/skills/methodology/defense-in-depth/SKILL.md +83 -37
- package/plugin/skills/methodology/dispatching-parallel-agents/SKILL.md +92 -31
- package/plugin/skills/methodology/executing-plans/SKILL.md +117 -28
- package/plugin/skills/methodology/finishing-development-branch/SKILL.md +111 -32
- package/plugin/skills/methodology/problem-solving/SKILL.md +65 -311
- package/plugin/skills/methodology/receiving-code-review/SKILL.md +76 -27
- package/plugin/skills/methodology/requesting-code-review/SKILL.md +93 -22
- package/plugin/skills/methodology/root-cause-tracing/SKILL.md +75 -40
- package/plugin/skills/methodology/sequential-thinking/SKILL.md +75 -224
- package/plugin/skills/methodology/systematic-debugging/SKILL.md +81 -35
- package/plugin/skills/methodology/test-driven-development/SKILL.md +120 -26
- package/plugin/skills/methodology/testing-anti-patterns/SKILL.md +88 -35
- package/plugin/skills/methodology/token-optimization/SKILL.md +73 -34
- package/plugin/skills/methodology/verification-before-completion/SKILL.md +128 -28
- package/plugin/skills/methodology/writing-plans/SKILL.md +105 -20
- package/plugin/skills/omega/omega-architecture/SKILL.md +178 -40
- package/plugin/skills/omega/omega-coding/SKILL.md +247 -41
- package/plugin/skills/omega/omega-sprint/SKILL.md +208 -46
- package/plugin/skills/omega/omega-testing/SKILL.md +253 -42
- package/plugin/skills/omega/omega-thinking/SKILL.md +263 -51
- package/plugin/skills/security/better-auth/SKILL.md +83 -34
- package/plugin/skills/security/oauth/SKILL.md +118 -35
- package/plugin/skills/security/owasp/SKILL.md +112 -35
- package/plugin/skills/testing/playwright/SKILL.md +141 -38
- package/plugin/skills/testing/pytest/SKILL.md +137 -38
- package/plugin/skills/testing/vitest/SKILL.md +124 -39
- package/plugin/skills/tools/document-processing/SKILL.md +111 -838
- package/plugin/skills/tools/image-processing/SKILL.md +126 -659
- package/plugin/skills/tools/mcp-development/SKILL.md +85 -758
- package/plugin/skills/tools/media-processing/SKILL.md +118 -735
- package/plugin/stdrules/SKILL_STANDARDS.md +490 -0
|
@@ -1,53 +1,88 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: root-
|
|
3
|
-
description:
|
|
2
|
+
name: tracing-root-causes
|
|
3
|
+
description: AI agent performs systematic root cause analysis using 5 Whys, Fishbone diagrams, and evidence-based investigation. Use when debugging, conducting post-mortems, or investigating incidents.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Root
|
|
6
|
+
# Tracing Root Causes
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
```
|
|
10
|
-
Problem: App crashed
|
|
11
|
-
Why? → Out of memory
|
|
12
|
-
Why? → Memory leak
|
|
13
|
-
Why? → Event listeners not cleaned
|
|
14
|
-
Why? → Missing cleanup in useEffect
|
|
15
|
-
Why? → Developer unaware of cleanup pattern
|
|
16
|
-
Root: Training/documentation gap
|
|
17
|
-
```
|
|
8
|
+
## Quick Start
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
├─ Data
|
|
25
|
-
└─ Dependencies
|
|
26
|
-
```
|
|
10
|
+
1. **Identify Symptom** - Document the observable problem
|
|
11
|
+
2. **Gather Evidence** - Collect logs, metrics, traces around incident
|
|
12
|
+
3. **Apply 5 Whys** - Ask "Why?" iteratively until fundamental cause found
|
|
13
|
+
4. **Map Categories** - Use Fishbone to explore all cause categories
|
|
14
|
+
5. **Document Findings** - Create RCA report with action items
|
|
27
15
|
|
|
28
|
-
##
|
|
29
|
-
1. **Code** - Bug in logic
|
|
30
|
-
2. **Data** - Invalid input
|
|
31
|
-
3. **Config** - Wrong settings
|
|
32
|
-
4. **Environment** - System issues
|
|
33
|
-
5. **External** - Third-party failure
|
|
16
|
+
## Features
|
|
34
17
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
| Feature | Description | Guide |
|
|
19
|
+
|---------|-------------|-------|
|
|
20
|
+
| Cause Hierarchy | Symptom -> Proximate -> Root -> Systemic | Fix at deepest level possible |
|
|
21
|
+
| 5 Whys | Iterative "Why?" questioning | Typically 5 iterations to root cause |
|
|
22
|
+
| Fishbone Diagram | Category-based cause exploration | Code, Data, Config, Infra, External, Process |
|
|
23
|
+
| Evidence Gathering | Logs, metrics, traces, reproduction | Timestamp, source, reliability rating |
|
|
24
|
+
| RCA Report | Structured documentation | Timeline, cause chain, action items |
|
|
25
|
+
| Systemic Factors | Why wasn't this caught earlier? | Testing, monitoring, process gaps |
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
[What was observed]
|
|
27
|
+
## Common Patterns
|
|
41
28
|
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
```
|
|
30
|
+
# 5 Whys Example
|
|
31
|
+
Problem: Website down for 2 hours
|
|
32
|
+
|
|
33
|
+
Why #1: Why down? -> Server out of memory
|
|
34
|
+
Why #2: Why out of memory? -> Connections unbounded
|
|
35
|
+
Why #3: Why unbounded? -> Not released after use
|
|
36
|
+
Why #4: Why not released? -> Early return skipped finally
|
|
37
|
+
Why #5: Why not caught? -> No test for cleanup path
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
Root Causes:
|
|
40
|
+
1. Technical: Missing cleanup execution
|
|
41
|
+
2. Systemic: Missing test coverage
|
|
42
|
+
3. Process: Code review missed pattern
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
# Fishbone Categories (Software)
|
|
45
|
+
CODE: Logic errors, race conditions, memory leaks
|
|
46
|
+
DATA: Invalid input, corrupt data, schema mismatch
|
|
47
|
+
CONFIG: Wrong settings, env mismatch, feature flags
|
|
48
|
+
INFRA: Resource exhaustion, network, scaling
|
|
49
|
+
EXTERNAL: Third-party APIs, dependencies, attacks
|
|
50
|
+
PROCESS: Missing tests, review gaps, monitoring blind spots
|
|
51
|
+
```
|
|
50
52
|
|
|
51
|
-
### Prevention
|
|
52
|
-
[How to prevent recurrence]
|
|
53
53
|
```
|
|
54
|
+
# Cause Hierarchy
|
|
55
|
+
SYMPTOM: "App crashed"
|
|
56
|
+
|
|
|
57
|
+
PROXIMATE CAUSE: "Out of memory"
|
|
58
|
+
|
|
|
59
|
+
CONTRIBUTING FACTOR: "No memory limits"
|
|
60
|
+
|
|
|
61
|
+
ROOT CAUSE: "Memory leak in event handlers"
|
|
62
|
+
|
|
|
63
|
+
SYSTEMIC FACTOR: "No memory monitoring"
|
|
64
|
+
|
|
65
|
+
PRINCIPLE: Fix symptoms = problem returns
|
|
66
|
+
Fix root cause = this problem prevented
|
|
67
|
+
Fix systemic = class of problems prevented
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Best Practices
|
|
71
|
+
|
|
72
|
+
| Do | Avoid |
|
|
73
|
+
|----|-------|
|
|
74
|
+
| Gather evidence before forming hypotheses | Jumping to conclusions |
|
|
75
|
+
| Use structured methods consistently | Ad-hoc investigation |
|
|
76
|
+
| Involve multiple perspectives | Single viewpoint |
|
|
77
|
+
| Look for systemic factors | Just fixing immediate cause |
|
|
78
|
+
| Create actionable recommendations | Vague "be more careful" |
|
|
79
|
+
| Verify fixes prevent recurrence | Assuming fix works |
|
|
80
|
+
| Share learnings across team | Siloing knowledge |
|
|
81
|
+
| Investigate near-misses too | Only investigating failures |
|
|
82
|
+
|
|
83
|
+
## Related Skills
|
|
84
|
+
|
|
85
|
+
- `debugging-systematically` - Four-phase debugging process
|
|
86
|
+
- `solving-problems` - 5-phase problem-solving framework
|
|
87
|
+
- `thinking-sequentially` - Numbered thought chains
|
|
88
|
+
- `verifying-before-completion` - Ensure fix completeness
|
|
@@ -1,260 +1,111 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: thinking-sequentially
|
|
3
|
+
description: AI agent structures complex reasoning through numbered thought sequences with explicit dependencies. Use when facing multi-step problems, complex debugging, or architectural decisions.
|
|
4
4
|
category: methodology
|
|
5
5
|
triggers:
|
|
6
|
-
-
|
|
6
|
+
- sequential thinking
|
|
7
7
|
- step by step
|
|
8
|
-
- think through
|
|
9
8
|
- reasoning chain
|
|
10
|
-
-
|
|
9
|
+
- thought process
|
|
10
|
+
- complex problem
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
Master the art of **structured reasoning** through numbered thought sequences. This skill enables systematic problem decomposition, dependency tracking, and clear reasoning chains for complex challenges.
|
|
13
|
+
# Thinking Sequentially
|
|
16
14
|
|
|
17
15
|
## Purpose
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- Problems have multiple interdependent components
|
|
22
|
-
- Solutions require building on previous insights
|
|
23
|
-
- Team communication needs clear reasoning trails
|
|
24
|
-
- Debugging requires systematic elimination
|
|
25
|
-
- Decisions need documented justification
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
### 1. Numbered Thought Chains
|
|
30
|
-
```
|
|
31
|
-
THOUGHT 1: Identify the core problem
|
|
32
|
-
- What exactly is failing?
|
|
33
|
-
- What is the expected behavior?
|
|
34
|
-
|
|
35
|
-
THOUGHT 2: Establish constraints (depends on THOUGHT 1)
|
|
36
|
-
- What cannot change?
|
|
37
|
-
- What resources are available?
|
|
38
|
-
|
|
39
|
-
THOUGHT 3: Generate hypotheses (depends on THOUGHT 1, 2)
|
|
40
|
-
- Hypothesis A: Configuration issue
|
|
41
|
-
- Hypothesis B: Data corruption
|
|
42
|
-
- Hypothesis C: Race condition
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 2. Dependency Tracking
|
|
46
|
-
```
|
|
47
|
-
[THOUGHT 4] ← depends on [THOUGHT 2, 3]
|
|
48
|
-
This ensures we don't proceed without establishing prerequisites.
|
|
49
|
-
Mark dependencies explicitly to enable:
|
|
50
|
-
- Parallel thinking on independent thoughts
|
|
51
|
-
- Clear revision paths when assumptions change
|
|
52
|
-
- Better collaboration handoffs
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 3. Revision and Backtracking
|
|
56
|
-
```
|
|
57
|
-
REVISION: Updating THOUGHT 3 based on new evidence
|
|
58
|
-
- Original: Assumed single-threaded execution
|
|
59
|
-
- New insight: System uses worker threads
|
|
60
|
-
- Impact: Hypothesis C (race condition) now most likely
|
|
61
|
-
|
|
62
|
-
BACKTRACK: Returning to THOUGHT 2
|
|
63
|
-
- Constraint we missed: 100ms timeout requirement
|
|
64
|
-
- This invalidates THOUGHT 5-7, need to restart from here
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 4. Checkpoint Summaries
|
|
68
|
-
```
|
|
69
|
-
=== CHECKPOINT after THOUGHT 10 ===
|
|
70
|
-
KEY FINDINGS:
|
|
71
|
-
1. Root cause identified: Memory leak in cache layer
|
|
72
|
-
2. Two viable solutions identified
|
|
73
|
-
3. Solution A preferred (lower risk)
|
|
74
|
-
|
|
75
|
-
OPEN QUESTIONS:
|
|
76
|
-
- Performance impact of Solution A?
|
|
77
|
-
- Rollback strategy needed?
|
|
78
|
-
|
|
79
|
-
NEXT STEPS:
|
|
80
|
-
- THOUGHT 11: Benchmark Solution A
|
|
81
|
-
- THOUGHT 12: Design rollback procedure
|
|
82
|
-
===================================
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 5. Visual Thought Mapping
|
|
86
|
-
```
|
|
87
|
-
[THOUGHT 1: Problem Definition]
|
|
88
|
-
|
|
|
89
|
-
+------------+------------+
|
|
90
|
-
| |
|
|
91
|
-
[THOUGHT 2: Constraints] [THOUGHT 3: Context]
|
|
92
|
-
| |
|
|
93
|
-
+------------+------------+
|
|
94
|
-
|
|
|
95
|
-
[THOUGHT 4: Hypotheses]
|
|
96
|
-
/ | \
|
|
97
|
-
/ | \
|
|
98
|
-
[T5: H1] [T6: H2] [T7: H3]
|
|
99
|
-
|
|
|
100
|
-
[THOUGHT 8: Solution]
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Use Cases
|
|
104
|
-
|
|
105
|
-
### Complex Algorithm Design
|
|
106
|
-
```
|
|
107
|
-
THOUGHT 1: Define the problem space
|
|
108
|
-
- Input: Unsorted array of N integers
|
|
109
|
-
- Output: K largest elements
|
|
110
|
-
- Constraint: O(N log K) time complexity
|
|
111
|
-
|
|
112
|
-
THOUGHT 2: Evaluate known approaches
|
|
113
|
-
- Full sort: O(N log N) - too slow
|
|
114
|
-
- Min-heap of size K: O(N log K) - meets requirement
|
|
115
|
-
- QuickSelect: O(N) average - better but unstable
|
|
17
|
+
Structure complex reasoning through numbered thought sequences:
|
|
116
18
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
19
|
+
- Decompose multi-step problems into traceable chains
|
|
20
|
+
- Track dependencies between insights explicitly
|
|
21
|
+
- Create checkpoints for periodic review
|
|
22
|
+
- Enable revision when assumptions change
|
|
23
|
+
- Support parallel hypothesis exploration
|
|
120
24
|
|
|
121
|
-
|
|
122
|
-
- Initialize min-heap with first K elements
|
|
123
|
-
- For remaining elements, compare with heap root
|
|
124
|
-
- If larger, replace root and heapify
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### System Architecture Decisions
|
|
128
|
-
```
|
|
129
|
-
THOUGHT 1: Identify scaling bottleneck
|
|
130
|
-
- Database reads: 10,000 QPS
|
|
131
|
-
- Current capacity: 2,000 QPS
|
|
132
|
-
- Gap: 5x improvement needed
|
|
133
|
-
|
|
134
|
-
THOUGHT 2: List scaling options
|
|
135
|
-
- Read replicas
|
|
136
|
-
- Caching layer
|
|
137
|
-
- Database sharding
|
|
138
|
-
- Query optimization
|
|
139
|
-
|
|
140
|
-
THOUGHT 3: Evaluate trade-offs (depends on THOUGHT 1, 2)
|
|
141
|
-
| Option | Complexity | Time | Cost |
|
|
142
|
-
|-----------------|------------|------|-------|
|
|
143
|
-
| Read replicas | Low | 1w | $500 |
|
|
144
|
-
| Caching | Medium | 2w | $200 |
|
|
145
|
-
| Sharding | High | 4w | $1000 |
|
|
146
|
-
| Query optimize | Low | 3d | $0 |
|
|
147
|
-
|
|
148
|
-
THOUGHT 4: Recommendation
|
|
149
|
-
- Immediate: Query optimization (quick win)
|
|
150
|
-
- Short-term: Caching layer
|
|
151
|
-
- Long-term: Read replicas as traffic grows
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Debugging Multi-Component Issues
|
|
155
|
-
```
|
|
156
|
-
THOUGHT 1: Reproduce the issue
|
|
157
|
-
- Steps: Login → Dashboard → Click "Export"
|
|
158
|
-
- Result: 500 error after 30 seconds
|
|
159
|
-
- Frequency: 100% reproducible
|
|
160
|
-
|
|
161
|
-
THOUGHT 2: Identify affected components
|
|
162
|
-
- Frontend: React dashboard
|
|
163
|
-
- API: Node.js Express server
|
|
164
|
-
- Database: PostgreSQL
|
|
165
|
-
- External: S3 for file storage
|
|
166
|
-
|
|
167
|
-
THOUGHT 3: Isolate the failure point (depends on THOUGHT 2)
|
|
168
|
-
- Frontend logs: Request sent successfully
|
|
169
|
-
- API logs: Request received, DB query started
|
|
170
|
-
- DB logs: Query completed in 2 seconds
|
|
171
|
-
- API logs: S3 upload started... [timeout]
|
|
172
|
-
|
|
173
|
-
FINDING: Issue is S3 upload timeout
|
|
25
|
+
## Quick Start
|
|
174
26
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
ROOT CAUSE: Cross-region upload with large file
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Best Practices
|
|
27
|
+
1. **Define** - State the problem clearly as THOUGHT 1
|
|
28
|
+
2. **Decompose** - Break into numbered thoughts with dependencies
|
|
29
|
+
3. **Track** - Mark dependencies explicitly: "depends on THOUGHT 2"
|
|
30
|
+
4. **Checkpoint** - Summarize every 5-10 thoughts
|
|
31
|
+
5. **Revise** - Update thoughts when assumptions change, invalidate dependents
|
|
32
|
+
6. **Branch** - Explore parallel hypotheses when needed
|
|
185
33
|
|
|
186
|
-
|
|
187
|
-
- **Number every thought explicitly** - Enables reference and revision
|
|
188
|
-
- **Mark dependencies clearly** - "This depends on THOUGHT 3"
|
|
189
|
-
- **Allow revision** - "REVISION: Updating THOUGHT 2 based on..."
|
|
190
|
-
- **Summarize at checkpoints** - Every 5-10 thoughts
|
|
191
|
-
- **Time-box thoughts** - Prevent infinite exploration
|
|
34
|
+
## Features
|
|
192
35
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
36
|
+
| Feature | Description | Guide |
|
|
37
|
+
|---------|-------------|-------|
|
|
38
|
+
| Numbered Chains | Explicit THOUGHT 1, 2, 3... with IDs | Number every insight, never skip |
|
|
39
|
+
| Dependencies | Mark what each thought relies on | `[THOUGHT 4] <- depends on [2, 3]` |
|
|
40
|
+
| Checkpoints | Periodic summaries of findings | Every 5-10 thoughts, list key findings |
|
|
41
|
+
| Revisions | Update previous thoughts with new data | Mark original as revised, create new |
|
|
42
|
+
| Branching | Explore multiple hypotheses in parallel | Create named branches, select winner |
|
|
43
|
+
| Visual Maps | Diagram thought relationships | ASCII diagrams for complex chains |
|
|
199
44
|
|
|
200
|
-
|
|
45
|
+
## Common Patterns
|
|
201
46
|
|
|
202
|
-
**Problem Analysis Template:**
|
|
203
47
|
```
|
|
48
|
+
# Problem Analysis Pattern
|
|
204
49
|
THOUGHT 1: Problem statement
|
|
205
50
|
THOUGHT 2: Success criteria
|
|
206
51
|
THOUGHT 3: Constraints
|
|
207
|
-
THOUGHT 4: Assumptions (validate
|
|
52
|
+
THOUGHT 4: Assumptions (validate!)
|
|
208
53
|
THOUGHT 5-N: Solution exploration
|
|
209
|
-
CHECKPOINT
|
|
210
|
-
```
|
|
54
|
+
=== CHECKPOINT ===
|
|
211
55
|
|
|
212
|
-
|
|
213
|
-
```
|
|
56
|
+
# Decision Making Pattern
|
|
214
57
|
THOUGHT 1: Decision to make
|
|
215
58
|
THOUGHT 2: Options identified
|
|
216
59
|
THOUGHT 3-N: Evaluate each option
|
|
217
60
|
THOUGHT N+1: Comparison matrix
|
|
218
|
-
THOUGHT N+2: Recommendation
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Related Skills
|
|
61
|
+
THOUGHT N+2: Recommendation
|
|
222
62
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
63
|
+
# Investigation Pattern
|
|
64
|
+
THOUGHT 1: What we observed
|
|
65
|
+
THOUGHT 2: What we expected
|
|
66
|
+
THOUGHT 3: Gap analysis
|
|
67
|
+
THOUGHT 4-N: Hypothesis testing
|
|
68
|
+
=== CHECKPOINT: Root cause ===
|
|
69
|
+
```
|
|
228
70
|
|
|
229
|
-
|
|
71
|
+
```
|
|
72
|
+
# Visual thought mapping
|
|
73
|
+
[THOUGHT 1: Problem]
|
|
74
|
+
|
|
|
75
|
+
+----------+----------+
|
|
76
|
+
| |
|
|
77
|
+
[THOUGHT 2] [THOUGHT 3]
|
|
78
|
+
| |
|
|
79
|
+
+----------+----------+
|
|
80
|
+
|
|
|
81
|
+
[THOUGHT 4: Synthesis]
|
|
82
|
+
```
|
|
230
83
|
|
|
231
|
-
|
|
232
|
-
# Feature: User Authentication Redesign
|
|
84
|
+
## Use Cases
|
|
233
85
|
|
|
234
|
-
|
|
86
|
+
- Multi-step debugging requiring traceable reasoning chains
|
|
87
|
+
- Architectural decisions with complex trade-off analysis
|
|
88
|
+
- Code review requiring systematic examination of multiple concerns
|
|
89
|
+
- Root cause analysis with hypothesis tracking
|
|
90
|
+
- Complex refactoring requiring dependency-aware planning
|
|
235
91
|
|
|
236
|
-
|
|
237
|
-
- Session timeout too aggressive (15 min)
|
|
238
|
-
- No "remember me" option
|
|
239
|
-
- MFA required on every login
|
|
92
|
+
## Best Practices
|
|
240
93
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
94
|
+
| Do | Avoid |
|
|
95
|
+
|----|-------|
|
|
96
|
+
| Number every thought explicitly | Skipping numbers for "obvious" thoughts |
|
|
97
|
+
| Mark dependencies clearly | Hiding dependencies in prose |
|
|
98
|
+
| Summarize at checkpoints | Exceeding 20 thoughts without checkpoint |
|
|
99
|
+
| Allow revision with reason | Deleting invalid thoughts (strike through) |
|
|
100
|
+
| Time-box each thought | Infinite exploration without bounds |
|
|
101
|
+
| Branch for parallel exploration | Branching more than 3 levels deep |
|
|
102
|
+
| Validate assumptions early | Proceeding with invalidated dependencies |
|
|
245
103
|
|
|
246
|
-
|
|
247
|
-
- Must maintain SOC2 compliance
|
|
248
|
-
- Cannot increase session beyond 24h
|
|
249
|
-
- MFA must protect financial transactions
|
|
104
|
+
## Related Skills
|
|
250
105
|
|
|
251
|
-
|
|
252
|
-
- Implement "remember device" (30 days)
|
|
253
|
-
- Step-up MFA only for sensitive actions
|
|
254
|
-
- Extend session to 60 min with activity
|
|
106
|
+
See also these related skill documents for complementary techniques:
|
|
255
107
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
```
|
|
108
|
+
- **writing-plans** - Structure plans as numbered thought sequences
|
|
109
|
+
- **debugging-systematically** - Apply sequential debugging steps
|
|
110
|
+
- **tracing-root-causes** - Use numbered investigation chains
|
|
111
|
+
- **brainstorming-ideas** - Generate options in thought steps
|
|
@@ -1,50 +1,96 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: debugging-systematically
|
|
3
|
+
description: AI agent follows a 5-phase debugging process with reproduction, isolation, hypothesis testing, and root cause resolution. Use when investigating bugs, troubleshooting issues, or hunting errors.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Debugging Systematically
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Quick Start
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
10
|
+
1. **Reproduce** - Create reliable reproduction steps, document environment
|
|
11
|
+
2. **Isolate** - Binary search to narrow down, create minimal repro case
|
|
12
|
+
3. **Hypothesize** - Generate 3+ theories with evidence and test cost
|
|
13
|
+
4. **Test** - Design tests to prove/disprove each hypothesis
|
|
14
|
+
5. **Fix & Verify** - Write failing test first, implement fix, verify green
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
- What's the smallest case?
|
|
17
|
-
- Which component fails?
|
|
18
|
-
- When did it start?
|
|
16
|
+
## Features
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
| Feature | Description | Guide |
|
|
19
|
+
|---------|-------------|-------|
|
|
20
|
+
| Reproduction | Consistent steps to trigger bug | Exact steps, environment, frequency |
|
|
21
|
+
| Isolation | Narrow down problem area | Binary search code, git bisect |
|
|
22
|
+
| Hypothesis Ranking | Prioritize theories to test | Evidence strength x (1/test cost) |
|
|
23
|
+
| Strategic Logging | Add targeted debug output | `[DEBUG][Service][method]` format |
|
|
24
|
+
| Git Bisect | Find regression commit | `git bisect start`, mark good/bad |
|
|
25
|
+
| Regression Tests | Prevent bug from returning | Write failing test before fixing |
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
- Test each hypothesis
|
|
28
|
-
- Use binary search for large codebases
|
|
29
|
-
- Add logging strategically
|
|
27
|
+
## Common Patterns
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
```
|
|
30
|
+
# Reproduction Template
|
|
31
|
+
Environment:
|
|
32
|
+
OS: [version]
|
|
33
|
+
Node: [version]
|
|
34
|
+
Browser: [version]
|
|
35
|
+
|
|
36
|
+
Steps:
|
|
37
|
+
1. [Step 1]
|
|
38
|
+
2. [Step 2]
|
|
39
|
+
3. Observe: [Error]
|
|
40
|
+
|
|
41
|
+
Frequency: 100% | Intermittent (~50%)
|
|
42
|
+
First observed: [date]
|
|
43
|
+
Last known good: [commit/version]
|
|
44
|
+
|
|
45
|
+
# Isolation via Binary Search
|
|
46
|
+
function problematic() {
|
|
47
|
+
// BLOCK A
|
|
48
|
+
await stepA1();
|
|
49
|
+
await stepA2();
|
|
50
|
+
|
|
51
|
+
// BLOCK B
|
|
52
|
+
await stepB1();
|
|
53
|
+
await stepB2();
|
|
54
|
+
|
|
55
|
+
// Comment out BLOCK B
|
|
56
|
+
// Still fails? Bug in BLOCK A
|
|
57
|
+
// Works now? Bug in BLOCK B
|
|
58
|
+
}
|
|
35
59
|
|
|
36
|
-
|
|
37
|
-
```bash
|
|
60
|
+
# Git Bisect
|
|
38
61
|
git bisect start
|
|
39
62
|
git bisect bad HEAD
|
|
40
|
-
git bisect good
|
|
63
|
+
git bisect good v2.0.0
|
|
64
|
+
# Git checks out middle, test and mark
|
|
65
|
+
git bisect good # or: git bisect bad
|
|
66
|
+
# Repeat until culprit found
|
|
67
|
+
git bisect reset
|
|
41
68
|
```
|
|
42
69
|
|
|
43
|
-
## Output
|
|
44
|
-
```markdown
|
|
45
|
-
## Debug Report
|
|
46
|
-
- Problem: [Description]
|
|
47
|
-
- Root Cause: [Actual cause]
|
|
48
|
-
- Fix: [What changed]
|
|
49
|
-
- Prevention: [How to prevent]
|
|
50
70
|
```
|
|
71
|
+
# Hypothesis Template
|
|
72
|
+
| # | Hypothesis | Evidence | Test Cost | Priority |
|
|
73
|
+
|---|------------|----------|-----------|----------|
|
|
74
|
+
| H1 | Missing index | Seq scan in EXPLAIN | Low | 1st |
|
|
75
|
+
| H2 | N+1 query | Loop in code | Low | 2nd |
|
|
76
|
+
| H3 | Memory leak | Gradual increase | High | 3rd |
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Best Practices
|
|
80
|
+
|
|
81
|
+
| Do | Avoid |
|
|
82
|
+
|----|-------|
|
|
83
|
+
| Always reproduce before debugging | Debugging without reproduction |
|
|
84
|
+
| Write down hypotheses before testing | Testing multiple hypotheses at once |
|
|
85
|
+
| Use binary search for large codebases | Random code changes |
|
|
86
|
+
| Write failing test before fixing | Assuming cause without evidence |
|
|
87
|
+
| Document the debugging session | Ignoring intermittent bugs |
|
|
88
|
+
| Add logging strategically | Keeping debug code in production |
|
|
89
|
+
| Check for related issues | Fixing symptoms instead of root cause |
|
|
90
|
+
|
|
91
|
+
## Related Skills
|
|
92
|
+
|
|
93
|
+
- `solving-problems` - 5-phase problem-solving framework
|
|
94
|
+
- `tracing-root-causes` - 5 Whys and Fishbone analysis
|
|
95
|
+
- `avoiding-testing-anti-patterns` - Prevent flaky tests
|
|
96
|
+
- `verifying-before-completion` - Ensure fix is complete
|