@kl-c/matrixos 0.1.6 → 0.1.9

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.
Files changed (124) hide show
  1. package/.agents/command/adopt.md +50 -0
  2. package/.agents/command/features.md +35 -0
  3. package/.opencode/command/adopt.md +50 -0
  4. package/.opencode/command/features.md +35 -0
  5. package/dist/cli/config-manager/write-gateway-env.d.ts +7 -0
  6. package/dist/cli/index.js +942 -788
  7. package/dist/cli/install-validators.d.ts +1 -0
  8. package/dist/cli/skills/debugging/references/methodology/02-investigate.md +1 -1
  9. package/dist/cli/skills/refactor/SKILL.md +1 -1
  10. package/dist/cli/skills/superpowers-brainstorming/SKILL.md +162 -0
  11. package/dist/cli/skills/superpowers-brainstorming/SUPERPOWERS_LICENSE +21 -0
  12. package/dist/cli/skills/superpowers-brainstorming/scripts/frame-template.html +213 -0
  13. package/dist/cli/skills/superpowers-brainstorming/scripts/helper.js +167 -0
  14. package/dist/cli/skills/superpowers-brainstorming/scripts/server.cjs +723 -0
  15. package/dist/cli/skills/superpowers-brainstorming/scripts/start-server.sh +209 -0
  16. package/dist/cli/skills/superpowers-brainstorming/scripts/stop-server.sh +120 -0
  17. package/dist/cli/skills/superpowers-brainstorming/spec-document-reviewer-prompt.md +49 -0
  18. package/dist/cli/skills/superpowers-brainstorming/visual-companion.md +291 -0
  19. package/dist/cli/skills/superpowers-receiving-code-review/SKILL.md +216 -0
  20. package/dist/cli/skills/superpowers-receiving-code-review/SUPERPOWERS_LICENSE +21 -0
  21. package/dist/cli/skills/superpowers-systematic-debugging/CREATION-LOG.md +119 -0
  22. package/dist/cli/skills/superpowers-systematic-debugging/SKILL.md +299 -0
  23. package/dist/cli/skills/superpowers-systematic-debugging/SUPERPOWERS_LICENSE +21 -0
  24. package/dist/cli/skills/superpowers-systematic-debugging/condition-based-waiting-example.ts +158 -0
  25. package/dist/cli/skills/superpowers-systematic-debugging/condition-based-waiting.md +115 -0
  26. package/dist/cli/skills/superpowers-systematic-debugging/defense-in-depth.md +122 -0
  27. package/dist/cli/skills/superpowers-systematic-debugging/find-polluter.sh +63 -0
  28. package/dist/cli/skills/superpowers-systematic-debugging/root-cause-tracing.md +169 -0
  29. package/dist/cli/skills/superpowers-systematic-debugging/test-academic.md +14 -0
  30. package/dist/cli/skills/superpowers-systematic-debugging/test-pressure-1.md +58 -0
  31. package/dist/cli/skills/superpowers-systematic-debugging/test-pressure-2.md +68 -0
  32. package/dist/cli/skills/superpowers-systematic-debugging/test-pressure-3.md +69 -0
  33. package/dist/cli/skills/superpowers-writing-skills/SKILL.md +692 -0
  34. package/dist/cli/skills/superpowers-writing-skills/SUPERPOWERS_LICENSE +21 -0
  35. package/dist/cli/skills/superpowers-writing-skills/anthropic-best-practices.md +1150 -0
  36. package/dist/cli/skills/superpowers-writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  37. package/dist/cli/skills/superpowers-writing-skills/graphviz-conventions.dot +172 -0
  38. package/dist/cli/skills/superpowers-writing-skills/persuasion-principles.md +187 -0
  39. package/dist/cli/skills/superpowers-writing-skills/render-graphs.js +168 -0
  40. package/dist/cli/skills/superpowers-writing-skills/testing-skills-with-subagents.md +384 -0
  41. package/dist/cli/types.d.ts +4 -0
  42. package/dist/cli-node/index.js +942 -788
  43. package/dist/config/schema/oh-my-opencode-config.d.ts +7 -0
  44. package/dist/config/schema/watchdog.d.ts +7 -0
  45. package/dist/features/anti-loop/background-registry.d.ts +10 -0
  46. package/dist/features/anti-loop/logger.d.ts +15 -0
  47. package/dist/features/dashboard/frontend/css/style.css +211 -0
  48. package/dist/features/dashboard/frontend/index.html +173 -0
  49. package/dist/features/dashboard/frontend/js/api.js +2 -0
  50. package/dist/features/dashboard/frontend/js/app.js +349 -0
  51. package/dist/features/matrix-inventory/features.d.ts +45 -0
  52. package/dist/hooks/agent-anti-loop/hook.d.ts +21 -26
  53. package/dist/index.js +392 -145
  54. package/dist/oh-my-opencode.schema.json +49 -0
  55. package/dist/plugin/agent-anti-loop.d.ts +8 -5
  56. package/dist/skills/debugging/references/methodology/02-investigate.md +1 -1
  57. package/dist/skills/refactor/SKILL.md +1 -1
  58. package/dist/skills/superpowers-brainstorming/SKILL.md +162 -0
  59. package/dist/skills/superpowers-brainstorming/SUPERPOWERS_LICENSE +21 -0
  60. package/dist/skills/superpowers-brainstorming/scripts/frame-template.html +213 -0
  61. package/dist/skills/superpowers-brainstorming/scripts/helper.js +167 -0
  62. package/dist/skills/superpowers-brainstorming/scripts/server.cjs +723 -0
  63. package/dist/skills/superpowers-brainstorming/scripts/start-server.sh +209 -0
  64. package/dist/skills/superpowers-brainstorming/scripts/stop-server.sh +120 -0
  65. package/dist/skills/superpowers-brainstorming/spec-document-reviewer-prompt.md +49 -0
  66. package/dist/skills/superpowers-brainstorming/visual-companion.md +291 -0
  67. package/dist/skills/superpowers-receiving-code-review/SKILL.md +216 -0
  68. package/dist/skills/superpowers-receiving-code-review/SUPERPOWERS_LICENSE +21 -0
  69. package/dist/skills/superpowers-systematic-debugging/CREATION-LOG.md +119 -0
  70. package/dist/skills/superpowers-systematic-debugging/SKILL.md +299 -0
  71. package/dist/skills/superpowers-systematic-debugging/SUPERPOWERS_LICENSE +21 -0
  72. package/dist/skills/superpowers-systematic-debugging/condition-based-waiting-example.ts +158 -0
  73. package/dist/skills/superpowers-systematic-debugging/condition-based-waiting.md +115 -0
  74. package/dist/skills/superpowers-systematic-debugging/defense-in-depth.md +122 -0
  75. package/dist/skills/superpowers-systematic-debugging/find-polluter.sh +63 -0
  76. package/dist/skills/superpowers-systematic-debugging/root-cause-tracing.md +169 -0
  77. package/dist/skills/superpowers-systematic-debugging/test-academic.md +14 -0
  78. package/dist/skills/superpowers-systematic-debugging/test-pressure-1.md +58 -0
  79. package/dist/skills/superpowers-systematic-debugging/test-pressure-2.md +68 -0
  80. package/dist/skills/superpowers-systematic-debugging/test-pressure-3.md +69 -0
  81. package/dist/skills/superpowers-writing-skills/SKILL.md +692 -0
  82. package/dist/skills/superpowers-writing-skills/SUPERPOWERS_LICENSE +21 -0
  83. package/dist/skills/superpowers-writing-skills/anthropic-best-practices.md +1150 -0
  84. package/dist/skills/superpowers-writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  85. package/dist/skills/superpowers-writing-skills/graphviz-conventions.dot +172 -0
  86. package/dist/skills/superpowers-writing-skills/persuasion-principles.md +187 -0
  87. package/dist/skills/superpowers-writing-skills/render-graphs.js +168 -0
  88. package/dist/skills/superpowers-writing-skills/testing-skills-with-subagents.md +384 -0
  89. package/dist/testing/create-gateway-relay.d.ts +26 -0
  90. package/dist/tui.js +14 -0
  91. package/package.json +2 -1
  92. package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +1 -1
  93. package/packages/shared-skills/skills/refactor/SKILL.md +1 -1
  94. package/packages/shared-skills/skills/superpowers-brainstorming/SKILL.md +162 -0
  95. package/packages/shared-skills/skills/superpowers-brainstorming/SUPERPOWERS_LICENSE +21 -0
  96. package/packages/shared-skills/skills/superpowers-brainstorming/scripts/frame-template.html +213 -0
  97. package/packages/shared-skills/skills/superpowers-brainstorming/scripts/helper.js +167 -0
  98. package/packages/shared-skills/skills/superpowers-brainstorming/scripts/server.cjs +723 -0
  99. package/packages/shared-skills/skills/superpowers-brainstorming/scripts/start-server.sh +209 -0
  100. package/packages/shared-skills/skills/superpowers-brainstorming/scripts/stop-server.sh +120 -0
  101. package/packages/shared-skills/skills/superpowers-brainstorming/spec-document-reviewer-prompt.md +49 -0
  102. package/packages/shared-skills/skills/superpowers-brainstorming/visual-companion.md +291 -0
  103. package/packages/shared-skills/skills/superpowers-receiving-code-review/SKILL.md +216 -0
  104. package/packages/shared-skills/skills/superpowers-receiving-code-review/SUPERPOWERS_LICENSE +21 -0
  105. package/packages/shared-skills/skills/superpowers-systematic-debugging/CREATION-LOG.md +119 -0
  106. package/packages/shared-skills/skills/superpowers-systematic-debugging/SKILL.md +299 -0
  107. package/packages/shared-skills/skills/superpowers-systematic-debugging/SUPERPOWERS_LICENSE +21 -0
  108. package/packages/shared-skills/skills/superpowers-systematic-debugging/condition-based-waiting-example.ts +158 -0
  109. package/packages/shared-skills/skills/superpowers-systematic-debugging/condition-based-waiting.md +115 -0
  110. package/packages/shared-skills/skills/superpowers-systematic-debugging/defense-in-depth.md +122 -0
  111. package/packages/shared-skills/skills/superpowers-systematic-debugging/find-polluter.sh +63 -0
  112. package/packages/shared-skills/skills/superpowers-systematic-debugging/root-cause-tracing.md +169 -0
  113. package/packages/shared-skills/skills/superpowers-systematic-debugging/test-academic.md +14 -0
  114. package/packages/shared-skills/skills/superpowers-systematic-debugging/test-pressure-1.md +58 -0
  115. package/packages/shared-skills/skills/superpowers-systematic-debugging/test-pressure-2.md +68 -0
  116. package/packages/shared-skills/skills/superpowers-systematic-debugging/test-pressure-3.md +69 -0
  117. package/packages/shared-skills/skills/superpowers-writing-skills/SKILL.md +692 -0
  118. package/packages/shared-skills/skills/superpowers-writing-skills/SUPERPOWERS_LICENSE +21 -0
  119. package/packages/shared-skills/skills/superpowers-writing-skills/anthropic-best-practices.md +1150 -0
  120. package/packages/shared-skills/skills/superpowers-writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  121. package/packages/shared-skills/skills/superpowers-writing-skills/graphviz-conventions.dot +172 -0
  122. package/packages/shared-skills/skills/superpowers-writing-skills/persuasion-principles.md +187 -0
  123. package/packages/shared-skills/skills/superpowers-writing-skills/render-graphs.js +168 -0
  124. package/packages/shared-skills/skills/superpowers-writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: receiving-code-review
3
+ description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
4
+ ---
5
+ > **Forked from [obra/superpowers](https://github.com/obra/superpowers) — MIT License, Copyright (c) 2025 Jesse Vincent.**
6
+ > Vendored as a native MaTrixOS skill. The original MIT license text is in `SUPERPOWERS_LICENSE` in this folder.
7
+ > Routing rule: MaTrixOS owns plan/execute/verify (ulw-plan, start-work, review-work). This skill is a complementary aid, invoked on demand.
8
+
9
+ # Code Review Reception
10
+
11
+ ## Overview
12
+
13
+ Code review requires technical evaluation, not emotional performance.
14
+
15
+ **Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
16
+
17
+ ## The Response Pattern
18
+
19
+ ```
20
+ WHEN receiving code review feedback:
21
+
22
+ 1. READ: Complete feedback without reacting
23
+ 2. UNDERSTAND: Restate requirement in own words (or ask)
24
+ 3. VERIFY: Check against codebase reality
25
+ 4. EVALUATE: Technically sound for THIS codebase?
26
+ 5. RESPOND: Technical acknowledgment or reasoned pushback
27
+ 6. IMPLEMENT: One item at a time, test each
28
+ ```
29
+
30
+ ## Forbidden Responses
31
+
32
+ **NEVER:**
33
+ - "You're absolutely right!" (explicit instruction-file violation)
34
+ - "Great point!" / "Excellent feedback!" (performative)
35
+ - "Let me implement that now" (before verification)
36
+
37
+ **INSTEAD:**
38
+ - Restate the technical requirement
39
+ - Ask clarifying questions
40
+ - Push back with technical reasoning if wrong
41
+ - Just start working (actions > words)
42
+
43
+ ## Handling Unclear Feedback
44
+
45
+ ```
46
+ IF any item is unclear:
47
+ STOP - do not implement anything yet
48
+ ASK for clarification on unclear items
49
+
50
+ WHY: Items may be related. Partial understanding = wrong implementation.
51
+ ```
52
+
53
+ **Example:**
54
+ ```
55
+ your human partner: "Fix 1-6"
56
+ You understand 1,2,3,6. Unclear on 4,5.
57
+
58
+ ❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
59
+ ✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
60
+ ```
61
+
62
+ ## Source-Specific Handling
63
+
64
+ ### From your human partner
65
+ - **Trusted** - implement after understanding
66
+ - **Still ask** if scope unclear
67
+ - **No performative agreement**
68
+ - **Skip to action** or technical acknowledgment
69
+
70
+ ### From External Reviewers
71
+ ```
72
+ BEFORE implementing:
73
+ 1. Check: Technically correct for THIS codebase?
74
+ 2. Check: Breaks existing functionality?
75
+ 3. Check: Reason for current implementation?
76
+ 4. Check: Works on all platforms/versions?
77
+ 5. Check: Does reviewer understand full context?
78
+
79
+ IF suggestion seems wrong:
80
+ Push back with technical reasoning
81
+
82
+ IF can't easily verify:
83
+ Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
84
+
85
+ IF conflicts with your human partner's prior decisions:
86
+ Stop and discuss with your human partner first
87
+ ```
88
+
89
+ **your human partner's rule:** "External feedback - be skeptical, but check carefully"
90
+
91
+ ## YAGNI Check for "Professional" Features
92
+
93
+ ```
94
+ IF reviewer suggests "implementing properly":
95
+ grep codebase for actual usage
96
+
97
+ IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
98
+ IF used: Then implement properly
99
+ ```
100
+
101
+ **your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
102
+
103
+ ## Implementation Order
104
+
105
+ ```
106
+ FOR multi-item feedback:
107
+ 1. Clarify anything unclear FIRST
108
+ 2. Then implement in this order:
109
+ - Blocking issues (breaks, security)
110
+ - Simple fixes (typos, imports)
111
+ - Complex fixes (refactoring, logic)
112
+ 3. Test each fix individually
113
+ 4. Verify no regressions
114
+ ```
115
+
116
+ ## When To Push Back
117
+
118
+ Push back when:
119
+ - Suggestion breaks existing functionality
120
+ - Reviewer lacks full context
121
+ - Violates YAGNI (unused feature)
122
+ - Technically incorrect for this stack
123
+ - Legacy/compatibility reasons exist
124
+ - Conflicts with your human partner's architectural decisions
125
+
126
+ **How to push back:**
127
+ - Use technical reasoning, not defensiveness
128
+ - Ask specific questions
129
+ - Reference working tests/code
130
+ - Involve your human partner if architectural
131
+
132
+ **If you're uncomfortable pushing back out loud:** Name that tension, then tell your partner about the issue you've seen. They'll appreciate your honesty.
133
+
134
+ ## Acknowledging Correct Feedback
135
+
136
+ When feedback IS correct:
137
+ ```
138
+ ✅ "Fixed. [Brief description of what changed]"
139
+ ✅ "Good catch - [specific issue]. Fixed in [location]."
140
+ ✅ [Just fix it and show in the code]
141
+
142
+ ❌ "You're absolutely right!"
143
+ ❌ "Great point!"
144
+ ❌ "Thanks for catching that!"
145
+ ❌ "Thanks for [anything]"
146
+ ❌ ANY gratitude expression
147
+ ```
148
+
149
+ **Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
150
+
151
+ **If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
152
+
153
+ ## Gracefully Correcting Your Pushback
154
+
155
+ If you pushed back and were wrong:
156
+ ```
157
+ ✅ "You were right - I checked [X] and it does [Y]. Implementing now."
158
+ ✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
159
+
160
+ ❌ Long apology
161
+ ❌ Defending why you pushed back
162
+ ❌ Over-explaining
163
+ ```
164
+
165
+ State the correction factually and move on.
166
+
167
+ ## Common Mistakes
168
+
169
+ | Mistake | Fix |
170
+ |---------|-----|
171
+ | Performative agreement | State requirement or just act |
172
+ | Blind implementation | Verify against codebase first |
173
+ | Batch without testing | One at a time, test each |
174
+ | Assuming reviewer is right | Check if breaks things |
175
+ | Avoiding pushback | Technical correctness > comfort |
176
+ | Partial implementation | Clarify all items first |
177
+ | Can't verify, proceed anyway | State limitation, ask for direction |
178
+
179
+ ## Real Examples
180
+
181
+ **Performative Agreement (Bad):**
182
+ ```
183
+ Reviewer: "Remove legacy code"
184
+ ❌ "You're absolutely right! Let me remove that..."
185
+ ```
186
+
187
+ **Technical Verification (Good):**
188
+ ```
189
+ Reviewer: "Remove legacy code"
190
+ ✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
191
+ ```
192
+
193
+ **YAGNI (Good):**
194
+ ```
195
+ Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
196
+ ✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
197
+ ```
198
+
199
+ **Unclear Item (Good):**
200
+ ```
201
+ your human partner: "Fix items 1-6"
202
+ You understand 1,2,3,6. Unclear on 4,5.
203
+ ✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
204
+ ```
205
+
206
+ ## GitHub Thread Replies
207
+
208
+ When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
209
+
210
+ ## The Bottom Line
211
+
212
+ **External feedback = suggestions to evaluate, not orders to follow.**
213
+
214
+ Verify. Question. Then implement.
215
+
216
+ No performative agreement. Technical rigor always.
@@ -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.
@@ -0,0 +1,119 @@
1
+ # Creation Log: Systematic Debugging Skill
2
+
3
+ Reference example of extracting, structuring, and bulletproofing a critical skill.
4
+
5
+ ## Source Material
6
+
7
+ Extracted debugging framework from `~/.claude/CLAUDE.md`:
8
+ - 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
9
+ - Core mandate: ALWAYS find root cause, NEVER fix symptoms
10
+ - Rules designed to resist time pressure and rationalization
11
+
12
+ ## Extraction Decisions
13
+
14
+ **What to include:**
15
+ - Complete 4-phase framework with all rules
16
+ - Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
17
+ - Pressure-resistant language ("even if faster", "even if I seem in a hurry")
18
+ - Concrete steps for each phase
19
+
20
+ **What to leave out:**
21
+ - Project-specific context
22
+ - Repetitive variations of same rule
23
+ - Narrative explanations (condensed to principles)
24
+
25
+ ## Structure Following skill-creation/SKILL.md
26
+
27
+ 1. **Rich when_to_use** - Included symptoms and anti-patterns
28
+ 2. **Type: technique** - Concrete process with steps
29
+ 3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
30
+ 4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
31
+ 5. **Phase-by-phase breakdown** - Scannable checklist format
32
+ 6. **Anti-patterns section** - What NOT to do (critical for this skill)
33
+
34
+ ## Bulletproofing Elements
35
+
36
+ Framework designed to resist rationalization under pressure:
37
+
38
+ ### Language Choices
39
+ - "ALWAYS" / "NEVER" (not "should" / "try to")
40
+ - "even if faster" / "even if I seem in a hurry"
41
+ - "STOP and re-analyze" (explicit pause)
42
+ - "Don't skip past" (catches the actual behavior)
43
+
44
+ ### Structural Defenses
45
+ - **Phase 1 required** - Can't skip to implementation
46
+ - **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
47
+ - **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
48
+ - **Anti-patterns section** - Shows exactly what shortcuts look like
49
+
50
+ ### Redundancy
51
+ - Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
52
+ - "NEVER fix symptom" appears 4 times in different contexts
53
+ - Each phase has explicit "don't skip" guidance
54
+
55
+ ## Testing Approach
56
+
57
+ Created 4 validation tests following skills/meta/testing-skills-with-subagents:
58
+
59
+ ### Test 1: Academic Context (No Pressure)
60
+ - Simple bug, no time pressure
61
+ - **Result:** Perfect compliance, complete investigation
62
+
63
+ ### Test 2: Time Pressure + Obvious Quick Fix
64
+ - User "in a hurry", symptom fix looks easy
65
+ - **Result:** Resisted shortcut, followed full process, found real root cause
66
+
67
+ ### Test 3: Complex System + Uncertainty
68
+ - Multi-layer failure, unclear if can find root cause
69
+ - **Result:** Systematic investigation, traced through all layers, found source
70
+
71
+ ### Test 4: Failed First Fix
72
+ - Hypothesis doesn't work, temptation to add more fixes
73
+ - **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
74
+
75
+ **All tests passed.** No rationalizations found.
76
+
77
+ ## Iterations
78
+
79
+ ### Initial Version
80
+ - Complete 4-phase framework
81
+ - Anti-patterns section
82
+ - Flowchart for "fix failed" decision
83
+
84
+ ### Enhancement 1: TDD Reference
85
+ - Added link to skills/testing/test-driven-development
86
+ - Note explaining TDD's "simplest code" ≠ debugging's "root cause"
87
+ - Prevents confusion between methodologies
88
+
89
+ ## Final Outcome
90
+
91
+ Bulletproof skill that:
92
+ - ✅ Clearly mandates root cause investigation
93
+ - ✅ Resists time pressure rationalization
94
+ - ✅ Provides concrete steps for each phase
95
+ - ✅ Shows anti-patterns explicitly
96
+ - ✅ Tested under multiple pressure scenarios
97
+ - ✅ Clarifies relationship to TDD
98
+ - ✅ Ready for use
99
+
100
+ ## Key Insight
101
+
102
+ **Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
103
+
104
+ ## Usage Example
105
+
106
+ When encountering a bug:
107
+ 1. Load skill: skills/debugging/systematic-debugging
108
+ 2. Read overview (10 sec) - reminded of mandate
109
+ 3. Follow Phase 1 checklist - forced investigation
110
+ 4. If tempted to skip - see anti-pattern, stop
111
+ 5. Complete all phases - root cause found
112
+
113
+ **Time investment:** 5-10 minutes
114
+ **Time saved:** Hours of symptom-whack-a-mole
115
+
116
+ ---
117
+
118
+ *Created: 2025-10-03*
119
+ *Purpose: Reference example for skill extraction and bulletproofing*
@@ -0,0 +1,299 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+ > **Forked from [obra/superpowers](https://github.com/obra/superpowers) — MIT License, Copyright (c) 2025 Jesse Vincent.**
6
+ > Vendored as a native MaTrixOS skill. The original MIT license text is in `SUPERPOWERS_LICENSE` in this folder.
7
+ > Routing rule: MaTrixOS owns plan/execute/verify (ulw-plan, start-work, review-work). This skill is a complementary aid, invoked on demand.
8
+
9
+ # Systematic Debugging
10
+
11
+ ## Overview
12
+
13
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
14
+
15
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
16
+
17
+ **Violating the letter of this process is violating the spirit of debugging.**
18
+
19
+ ## The Iron Law
20
+
21
+ ```
22
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
23
+ ```
24
+
25
+ If you haven't completed Phase 1, you cannot propose fixes.
26
+
27
+ ## When to Use
28
+
29
+ Use for ANY technical issue:
30
+ - Test failures
31
+ - Bugs in production
32
+ - Unexpected behavior
33
+ - Performance problems
34
+ - Build failures
35
+ - Integration issues
36
+
37
+ **Use this ESPECIALLY when:**
38
+ - Under time pressure (emergencies make guessing tempting)
39
+ - "Just one quick fix" seems obvious
40
+ - You've already tried multiple fixes
41
+ - Previous fix didn't work
42
+ - You don't fully understand the issue
43
+
44
+ **Don't skip when:**
45
+ - Issue seems simple (simple bugs have root causes too)
46
+ - You're in a hurry (rushing guarantees rework)
47
+ - Manager wants it fixed NOW (systematic is faster than thrashing)
48
+
49
+ ## The Four Phases
50
+
51
+ You MUST complete each phase before proceeding to the next.
52
+
53
+ ### Phase 1: Root Cause Investigation
54
+
55
+ **BEFORE attempting ANY fix:**
56
+
57
+ 1. **Read Error Messages Carefully**
58
+ - Don't skip past errors or warnings
59
+ - They often contain the exact solution
60
+ - Read stack traces completely
61
+ - Note line numbers, file paths, error codes
62
+
63
+ 2. **Reproduce Consistently**
64
+ - Can you trigger it reliably?
65
+ - What are the exact steps?
66
+ - Does it happen every time?
67
+ - If not reproducible → gather more data, don't guess
68
+
69
+ 3. **Check Recent Changes**
70
+ - What changed that could cause this?
71
+ - Git diff, recent commits
72
+ - New dependencies, config changes
73
+ - Environmental differences
74
+
75
+ 4. **Gather Evidence in Multi-Component Systems**
76
+
77
+ **WHEN system has multiple components (CI → build → signing, API → service → database):**
78
+
79
+ **BEFORE proposing fixes, add diagnostic instrumentation:**
80
+ ```
81
+ For EACH component boundary:
82
+ - Log what data enters component
83
+ - Log what data exits component
84
+ - Verify environment/config propagation
85
+ - Check state at each layer
86
+
87
+ Run once to gather evidence showing WHERE it breaks
88
+ THEN analyze evidence to identify failing component
89
+ THEN investigate that specific component
90
+ ```
91
+
92
+ **Example (multi-layer system):**
93
+ ```bash
94
+ # Layer 1: Workflow
95
+ echo "=== Secrets available in workflow: ==="
96
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
97
+
98
+ # Layer 2: Build script
99
+ echo "=== Env vars in build script: ==="
100
+ env | grep IDENTITY || echo "IDENTITY not in environment"
101
+
102
+ # Layer 3: Signing script
103
+ echo "=== Keychain state: ==="
104
+ security list-keychains
105
+ security find-identity -v
106
+
107
+ # Layer 4: Actual signing
108
+ codesign --sign "$IDENTITY" --verbose=4 "$APP"
109
+ ```
110
+
111
+ **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
112
+
113
+ 5. **Trace Data Flow**
114
+
115
+ **WHEN error is deep in call stack:**
116
+
117
+ See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
118
+
119
+ **Quick version:**
120
+ - Where does bad value originate?
121
+ - What called this with bad value?
122
+ - Keep tracing up until you find the source
123
+ - Fix at source, not at symptom
124
+
125
+ ### Phase 2: Pattern Analysis
126
+
127
+ **Find the pattern before fixing:**
128
+
129
+ 1. **Find Working Examples**
130
+ - Locate similar working code in same codebase
131
+ - What works that's similar to what's broken?
132
+
133
+ 2. **Compare Against References**
134
+ - If implementing pattern, read reference implementation COMPLETELY
135
+ - Don't skim - read every line
136
+ - Understand the pattern fully before applying
137
+
138
+ 3. **Identify Differences**
139
+ - What's different between working and broken?
140
+ - List every difference, however small
141
+ - Don't assume "that can't matter"
142
+
143
+ 4. **Understand Dependencies**
144
+ - What other components does this need?
145
+ - What settings, config, environment?
146
+ - What assumptions does it make?
147
+
148
+ ### Phase 3: Hypothesis and Testing
149
+
150
+ **Scientific method:**
151
+
152
+ 1. **Form Single Hypothesis**
153
+ - State clearly: "I think X is the root cause because Y"
154
+ - Write it down
155
+ - Be specific, not vague
156
+
157
+ 2. **Test Minimally**
158
+ - Make the SMALLEST possible change to test hypothesis
159
+ - One variable at a time
160
+ - Don't fix multiple things at once
161
+
162
+ 3. **Verify Before Continuing**
163
+ - Did it work? Yes → Phase 4
164
+ - Didn't work? Form NEW hypothesis
165
+ - DON'T add more fixes on top
166
+
167
+ 4. **When You Don't Know**
168
+ - Say "I don't understand X"
169
+ - Don't pretend to know
170
+ - Ask for help
171
+ - Research more
172
+
173
+ ### Phase 4: Implementation
174
+
175
+ **Fix the root cause, not the symptom:**
176
+
177
+ 1. **Create Failing Test Case**
178
+ - Simplest possible reproduction
179
+ - Automated test if possible
180
+ - One-off test script if no framework
181
+ - MUST have before fixing
182
+ - Use the `superpowers:test-driven-development` skill for writing proper failing tests
183
+
184
+ 2. **Implement Single Fix**
185
+ - Address the root cause identified
186
+ - ONE change at a time
187
+ - No "while I'm here" improvements
188
+ - No bundled refactoring
189
+
190
+ 3. **Verify Fix**
191
+ - Test passes now?
192
+ - No other tests broken?
193
+ - Issue actually resolved?
194
+
195
+ 4. **If Fix Doesn't Work**
196
+ - STOP
197
+ - Count: How many fixes have you tried?
198
+ - If < 3: Return to Phase 1, re-analyze with new information
199
+ - **If ≥ 3: STOP and question the architecture (step 5 below)**
200
+ - DON'T attempt Fix #4 without architectural discussion
201
+
202
+ 5. **If 3+ Fixes Failed: Question Architecture**
203
+
204
+ **Pattern indicating architectural problem:**
205
+ - Each fix reveals new shared state/coupling/problem in different place
206
+ - Fixes require "massive refactoring" to implement
207
+ - Each fix creates new symptoms elsewhere
208
+
209
+ **STOP and question fundamentals:**
210
+ - Is this pattern fundamentally sound?
211
+ - Are we "sticking with it through sheer inertia"?
212
+ - Should we refactor architecture vs. continue fixing symptoms?
213
+
214
+ **Discuss with your human partner before attempting more fixes**
215
+
216
+ This is NOT a failed hypothesis - this is a wrong architecture.
217
+
218
+ ## Red Flags - STOP and Follow Process
219
+
220
+ If you catch yourself thinking:
221
+ - "Quick fix for now, investigate later"
222
+ - "Just try changing X and see if it works"
223
+ - "Add multiple changes, run tests"
224
+ - "Skip the test, I'll manually verify"
225
+ - "It's probably X, let me fix that"
226
+ - "I don't fully understand but this might work"
227
+ - "Pattern says X but I'll adapt it differently"
228
+ - "Here are the main problems: [lists fixes without investigation]"
229
+ - Proposing solutions before tracing data flow
230
+ - **"One more fix attempt" (when already tried 2+)**
231
+ - **Each fix reveals new problem in different place**
232
+
233
+ **ALL of these mean: STOP. Return to Phase 1.**
234
+
235
+ **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
236
+
237
+ ## your human partner's Signals You're Doing It Wrong
238
+
239
+ **Watch for these redirections:**
240
+ - "Is that not happening?" - You assumed without verifying
241
+ - "Will it show us...?" - You should have added evidence gathering
242
+ - "Stop guessing" - You're proposing fixes without understanding
243
+ - "Ultra-think this" - Question fundamentals, not just symptoms
244
+ - "We're stuck?" (frustrated) - Your approach isn't working
245
+
246
+ **When you see these:** STOP. Return to Phase 1.
247
+
248
+ ## Common Rationalizations
249
+
250
+ | Excuse | Reality |
251
+ |--------|---------|
252
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
253
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
254
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
255
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
256
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
257
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
258
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
259
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
260
+
261
+ ## Quick Reference
262
+
263
+ | Phase | Key Activities | Success Criteria |
264
+ |-------|---------------|------------------|
265
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
266
+ | **2. Pattern** | Find working examples, compare | Identify differences |
267
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
268
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
269
+
270
+ ## When Process Reveals "No Root Cause"
271
+
272
+ If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
273
+
274
+ 1. You've completed the process
275
+ 2. Document what you investigated
276
+ 3. Implement appropriate handling (retry, timeout, error message)
277
+ 4. Add monitoring/logging for future investigation
278
+
279
+ **But:** 95% of "no root cause" cases are incomplete investigation.
280
+
281
+ ## Supporting Techniques
282
+
283
+ These techniques are part of systematic debugging and available in this directory:
284
+
285
+ - **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
286
+ - **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
287
+ - **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
288
+
289
+ **Related skills:**
290
+ - **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
291
+ - **superpowers:verification-before-completion** - Verify fix worked before claiming success
292
+
293
+ ## Real-World Impact
294
+
295
+ From debugging sessions:
296
+ - Systematic approach: 15-30 minutes to fix
297
+ - Random fixes approach: 2-3 hours of thrashing
298
+ - First-time fix rate: 95% vs 40%
299
+ - New bugs introduced: Near zero vs common
@@ -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.