@polderlabs/bizar 10.7.1 → 10.7.2

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 (142) hide show
  1. package/.claude/agents/_shared/AGENT_BASELINE.md +266 -0
  2. package/.claude/agents/_shared/CLAUDE_TOOLS.md +412 -0
  3. package/.claude/agents/_shared/SKILLS.md +109 -0
  4. package/.claude/agents/brand-designer.md +55 -0
  5. package/.claude/agents/exec-assistant.md +34 -0
  6. package/.claude/agents/help-desk.md +44 -0
  7. package/.claude/agents/it-lead.md +53 -0
  8. package/.claude/agents/knowledge-manager.md +49 -0
  9. package/.claude/agents/office-coordinator.md +39 -0
  10. package/.claude/agents/office-greeter.md +53 -0
  11. package/.claude/agents/office-manager.md +287 -0
  12. package/.claude/agents/principal-engineer.md +58 -0
  13. package/.claude/agents/qa-reviewer.md +51 -0
  14. package/.claude/agents/research-analyst.md +53 -0
  15. package/.claude/agents/senior-engineer.md +55 -0
  16. package/.claude/agents/support-tech.md +87 -0
  17. package/.claude/agents/vp-engineering.md +54 -0
  18. package/.claude/commands/audit.md +48 -0
  19. package/.claude/commands/bizar.md +22 -0
  20. package/.claude/commands/cron.md +36 -0
  21. package/.claude/commands/explain.md +17 -0
  22. package/.claude/commands/goal.md +99 -0
  23. package/.claude/commands/init.md +15 -0
  24. package/.claude/commands/learn.md +46 -0
  25. package/.claude/commands/plan.md +35 -0
  26. package/.claude/commands/plow-through.md +50 -0
  27. package/.claude/commands/pr-review.md +49 -0
  28. package/.claude/commands/setup-provider.md +96 -0
  29. package/.claude/commands/spec.md +47 -0
  30. package/.claude/commands/sprint.md +43 -0
  31. package/.claude/commands/tailscale-serve.md +100 -0
  32. package/.claude/commands/team.md +132 -0
  33. package/.claude/commands/test.md +62 -0
  34. package/.claude/commands/validate.md +68 -0
  35. package/.claude/commands/visual-plan.md +24 -0
  36. package/.claude/hooks/README.md +108 -0
  37. package/.claude/hooks/__tests__/pretooluse-editwrite.test.mjs +146 -0
  38. package/.claude/hooks/__tests__/sessionend-recall.test.mjs +256 -0
  39. package/.claude/hooks/__tests__/sessionstart-prime.test.mjs +325 -0
  40. package/.claude/hooks/__tests__/thinking-route.test.mjs +319 -0
  41. package/.claude/hooks/auto-instinct.sh +81 -0
  42. package/.claude/hooks/learning-extract.mjs +92 -0
  43. package/.claude/hooks/post-merge-audit.sh +93 -0
  44. package/.claude/hooks/posttooluse-editwrite.mjs +91 -0
  45. package/.claude/hooks/pretooluse-bash.mjs +87 -0
  46. package/.claude/hooks/pretooluse-editwrite.mjs +117 -0
  47. package/.claude/hooks/sessionend-recall.mjs +384 -0
  48. package/.claude/hooks/sessionstart-prime.mjs +278 -0
  49. package/.claude/hooks/thinking-route.mjs +314 -0
  50. package/.claude/hooks/worker-suggest.mjs +110 -0
  51. package/.claude/settings.json +167 -0
  52. package/.claude/skills/9router/SKILL.md +80 -0
  53. package/.claude/skills/9router-chat/SKILL.md +73 -0
  54. package/.claude/skills/9router-embeddings/SKILL.md +69 -0
  55. package/.claude/skills/9router-image/SKILL.md +86 -0
  56. package/.claude/skills/9router-stt/SKILL.md +79 -0
  57. package/.claude/skills/9router-tts/SKILL.md +80 -0
  58. package/.claude/skills/9router-web-fetch/SKILL.md +99 -0
  59. package/.claude/skills/9router-web-search/SKILL.md +91 -0
  60. package/.claude/skills/agent-browser/SKILL.md +64 -0
  61. package/.claude/skills/bizar/README.md +9 -0
  62. package/.claude/skills/bizar/SKILL.md +447 -0
  63. package/.claude/skills/cpp-coding-standards/README.md +28 -0
  64. package/.claude/skills/cpp-coding-standards/SKILL.md +634 -0
  65. package/.claude/skills/cpp-coding-standards/references/concurrency.md +320 -0
  66. package/.claude/skills/cpp-coding-standards/references/error-handling.md +229 -0
  67. package/.claude/skills/cpp-coding-standards/references/memory-safety.md +216 -0
  68. package/.claude/skills/cpp-coding-standards/references/modern-idioms.md +282 -0
  69. package/.claude/skills/cpp-coding-standards/references/review-checklist.md +96 -0
  70. package/.claude/skills/cpp-testing/README.md +28 -0
  71. package/.claude/skills/cpp-testing/SKILL.md +304 -0
  72. package/.claude/skills/cpp-testing/references/coverage.md +370 -0
  73. package/.claude/skills/cpp-testing/references/framework-compare.md +175 -0
  74. package/.claude/skills/cpp-testing/references/host-test-for-embedded.md +499 -0
  75. package/.claude/skills/cpp-testing/references/mocking.md +364 -0
  76. package/.claude/skills/cpp-testing/references/tdd-workflow.md +308 -0
  77. package/.claude/skills/cubesandbox/SKILL.md +148 -0
  78. package/.claude/skills/de-sloppify/SKILL.md +38 -0
  79. package/.claude/skills/de-sloppify/cleanup.mjs +253 -0
  80. package/.claude/skills/de-sloppify/cleanup.test.mjs +189 -0
  81. package/.claude/skills/embedded-esp-idf/README.md +41 -0
  82. package/.claude/skills/embedded-esp-idf/SKILL.md +439 -0
  83. package/.claude/skills/embedded-esp-idf/references/freertos-patterns.md +214 -0
  84. package/.claude/skills/embedded-esp-idf/references/host-tests.md +164 -0
  85. package/.claude/skills/embedded-esp-idf/references/idf-py-commands.md +157 -0
  86. package/.claude/skills/embedded-esp-idf/references/kconfig.md +159 -0
  87. package/.claude/skills/embedded-esp-idf/references/logging-discipline.md +118 -0
  88. package/.claude/skills/embedded-esp-idf/references/memory-and-iram.md +137 -0
  89. package/.claude/skills/embedded-esp-idf/references/nvs.md +121 -0
  90. package/.claude/skills/embedded-esp-idf/references/packed-structs.md +192 -0
  91. package/.claude/skills/embedded-esp-idf/scripts/idf_env.sh +47 -0
  92. package/.claude/skills/embedded-esp-idf/scripts/size_check.sh +77 -0
  93. package/.claude/skills/glyph/SKILL.md +163 -0
  94. package/.claude/skills/harness-engineering/SKILL.md +142 -0
  95. package/.claude/skills/lightrag/SKILL.md +81 -0
  96. package/.claude/skills/memory-protocol/SKILL.md +105 -0
  97. package/.claude/skills/obsidian/SKILL.md +306 -0
  98. package/.claude/skills/read-the-damn-docs/SKILL.md +113 -0
  99. package/.claude/skills/self-improvement/SKILL.md +64 -0
  100. package/.claude/skills/skillopt/SKILL.md +129 -0
  101. package/.claude/skills/thinking-archetypes/SKILL.md +90 -0
  102. package/.claude/skills/thinking-bayesian/SKILL.md +267 -0
  103. package/.claude/skills/thinking-bounded-rationality/SKILL.md +406 -0
  104. package/.claude/skills/thinking-circle-of-competence/SKILL.md +216 -0
  105. package/.claude/skills/thinking-cynefin/SKILL.md +70 -0
  106. package/.claude/skills/thinking-debiasing/SKILL.md +192 -0
  107. package/.claude/skills/thinking-dual-process/SKILL.md +282 -0
  108. package/.claude/skills/thinking-effectuation/SKILL.md +366 -0
  109. package/.claude/skills/thinking-feedback-loops/SKILL.md +464 -0
  110. package/.claude/skills/thinking-fermi-estimation/SKILL.md +263 -0
  111. package/.claude/skills/thinking-first-principles/SKILL.md +167 -0
  112. package/.claude/skills/thinking-five-whys-plus/SKILL.md +139 -0
  113. package/.claude/skills/thinking-inversion/SKILL.md +195 -0
  114. package/.claude/skills/thinking-jobs-to-be-done/SKILL.md +363 -0
  115. package/.claude/skills/thinking-kepner-tregoe/SKILL.md +154 -0
  116. package/.claude/skills/thinking-leverage-points/SKILL.md +390 -0
  117. package/.claude/skills/thinking-lindy-effect/SKILL.md +331 -0
  118. package/.claude/skills/thinking-map-territory/SKILL.md +111 -0
  119. package/.claude/skills/thinking-margin-of-safety/SKILL.md +330 -0
  120. package/.claude/skills/thinking-model-combination/SKILL.md +406 -0
  121. package/.claude/skills/thinking-model-router/SKILL.md +360 -0
  122. package/.claude/skills/thinking-model-selection/SKILL.md +341 -0
  123. package/.claude/skills/thinking-occams-razor/SKILL.md +129 -0
  124. package/.claude/skills/thinking-ooda/SKILL.md +127 -0
  125. package/.claude/skills/thinking-opportunity-cost/SKILL.md +360 -0
  126. package/.claude/skills/thinking-pre-mortem/SKILL.md +170 -0
  127. package/.claude/skills/thinking-probabilistic/SKILL.md +324 -0
  128. package/.claude/skills/thinking-red-team/SKILL.md +142 -0
  129. package/.claude/skills/thinking-regret-minimization/SKILL.md +335 -0
  130. package/.claude/skills/thinking-reversibility/SKILL.md +326 -0
  131. package/.claude/skills/thinking-scientific-method/SKILL.md +162 -0
  132. package/.claude/skills/thinking-second-order/SKILL.md +184 -0
  133. package/.claude/skills/thinking-socratic/SKILL.md +198 -0
  134. package/.claude/skills/thinking-steel-manning/SKILL.md +332 -0
  135. package/.claude/skills/thinking-systems/SKILL.md +238 -0
  136. package/.claude/skills/thinking-theory-of-constraints/SKILL.md +338 -0
  137. package/.claude/skills/thinking-thought-experiment/SKILL.md +354 -0
  138. package/.claude/skills/thinking-triz/SKILL.md +171 -0
  139. package/.claude/skills/thinking-via-negativa/SKILL.md +358 -0
  140. package/cli/install/postinstall.mjs +54 -28
  141. package/cli/install/postinstall.test.mjs +98 -0
  142. package/package.json +7 -2
@@ -0,0 +1,332 @@
1
+ ---
2
+ name: thinking-steel-manning
3
+ description: Use before rejecting a proposal or when you're inclined to just agree with the user. Build the strongest version of the opposing case first, then engage that — not a weak version.
4
+ ---
5
+
6
+ # Steel-Manning
7
+
8
+ ## Overview
9
+
10
+ Steel-manning is the opposite of straw-manning. Instead of attacking the weakest version of an opposing argument, you construct and address the strongest possible version. This leads to better decisions, more productive debates, and deeper understanding of trade-offs.
11
+
12
+ **Core Principle:** To truly evaluate an idea, argue against its best form. If you can defeat the strongest version, you've actually learned something.
13
+
14
+ ## When to Use
15
+
16
+ - Design reviews
17
+ - Evaluating alternative approaches
18
+ - Conflict resolution
19
+ - Validating your own decisions
20
+ - Code review discussions
21
+ - Architecture debates
22
+ - When you disagree with someone's proposal
23
+ - Before rejecting an idea
24
+
25
+ Decision flow:
26
+
27
+ ```
28
+ Disagreeing with a proposal?
29
+ → Can you state their best argument? → no → STEEL-MAN FIRST
30
+ → Are you attacking a weak version? → yes → CONSTRUCT STRONGER VERSION
31
+ → Have you found the core insight? → no → DIG DEEPER
32
+
33
+ About to agree with the user's plan?
34
+ → Have you stated the strongest case against it? → no → STEEL-MAN THE OPPOSING VIEW FIRST
35
+ ```
36
+
37
+ This skill is the direct counter to **sycophancy** — the pull to validate whatever the user proposed. Before endorsing a plan, construct the best case *against* it; agreement that survives that is worth more than reflexive agreement.
38
+
39
+ ## When NOT to Use
40
+
41
+ - **The matter is settled fact, not a position.** Don't steel-man a factual error, a security anti-pattern, or a violated requirement — correct it. Steel-manning is for genuine trade-offs and judgment calls, not for manufacturing a defense of something wrong.
42
+ - **You already agree for good, stated reasons.** If you've actually weighed it, don't perform a fake debate; say why you agree.
43
+ - **Trivial or fully reversible choices** where the cost of being wrong is near zero — the deliberation isn't worth the budget.
44
+ - **An emergency requiring immediate action** — steel-man the post-incident review, not the live fire.
45
+
46
+ ## Trigger Card
47
+
48
+ Before rejecting a proposal or when you're inclined to just agree with the user:
49
+
50
+ 1. **State the opposing case in its strongest form** — not the version that's easy to knock down. What would its best advocate say?
51
+ 2. **Find what's actually true in it** — even if you reject the conclusion, what valid insight or concern does it surface?
52
+ 3. **Engage that strongest version** — respond to what was actually claimed, not a weak version. If your position still holds, great; if not, update.
53
+
54
+ Skip for trivial or fully reversible choices where the cost of being wrong is near zero. In an emergency, steel-man the post-incident review, not the live fire.
55
+
56
+ ## The Steel-Manning Process
57
+
58
+ ### Step 1: Understand the Original Argument
59
+
60
+ Before improving, understand:
61
+
62
+ ```markdown
63
+ ## Original Proposal
64
+
65
+ Proposal: "We should rewrite the backend in Rust"
66
+
67
+ Stated reasons:
68
+ - Memory safety
69
+ - Better performance
70
+ - Modern language
71
+
72
+ Apparent weaknesses:
73
+ - Team doesn't know Rust
74
+ - Rewrite is risky
75
+ - Current system works
76
+ ```
77
+
78
+ ### Step 2: Identify the Core Insight
79
+
80
+ What's the strongest kernel of truth?
81
+
82
+ ```markdown
83
+ ## Core Insight
84
+
85
+ Behind "rewrite in Rust" is:
86
+ - Concern about memory-related bugs in production
87
+ - Performance problems that are hard to solve in current language
88
+ - Technical debt making changes slow
89
+
90
+ The proposal might be wrong, but the concerns are valid.
91
+ ```
92
+
93
+ ### Step 3: Construct the Strongest Version
94
+
95
+ Build the best possible case:
96
+
97
+ ```markdown
98
+ ## Steel-Manned Argument
99
+
100
+ "Our memory-safety issues have caused 3 major outages this year,
101
+ costing us ~$500K in engineering time and customer trust.
102
+ Our performance problems stem from GC pauses that are fundamental
103
+ to our current runtime. While a rewrite is risky, the incremental
104
+ cost of working around these limitations is growing.
105
+
106
+ A gradual rewrite of performance-critical paths to Rust would:
107
+ - Eliminate a class of bugs (memory safety)
108
+ - Solve GC-related latency issues
109
+ - Attract engineers who want modern tooling
110
+ - Create optionality for high-performance features
111
+
112
+ The risk can be mitigated by:
113
+ - Starting with one isolated service
114
+ - Keeping the team small and focused
115
+ - Maintaining the old system during transition
116
+ - Having clear rollback criteria"
117
+ ```
118
+
119
+ ### Step 4: Address the Steel-Manned Version
120
+
121
+ Now engage with the strongest argument:
122
+
123
+ ```markdown
124
+ ## Response to Steel-Manned Argument
125
+
126
+ The strongest case for Rust addresses real problems. However:
127
+
128
+ Memory safety issues:
129
+ - 2 of 3 outages were logic bugs, not memory bugs
130
+ - Could be addressed with better testing in current language
131
+ - Rust learning curve might introduce new bug classes
132
+
133
+ Performance:
134
+ - GC issues could be addressed with tuning
135
+ - Critical path is <5% of codebase
136
+ - FFI to native code is an option without full rewrite
137
+
138
+ The 6-month investment in Rust might be better spent:
139
+ - 2 months: Performance profiling and GC tuning
140
+ - 2 months: Targeted native extensions for hot paths
141
+ - 2 months: Improved testing/monitoring
142
+
143
+ This addresses the concerns with lower risk.
144
+ ```
145
+
146
+ ### Step 5: Find the Synthesis
147
+
148
+ What's the best answer considering both sides?
149
+
150
+ ```markdown
151
+ ## Synthesis
152
+
153
+ The Rust proposal was right about the problems, less right about the solution.
154
+
155
+ Agreed:
156
+ - Memory safety is a real concern (but smaller than stated)
157
+ - Performance needs improvement (but addressable incrementally)
158
+ - Technical modernization has value (but not at rewrite cost)
159
+
160
+ Plan:
161
+ 1. Address immediate performance with profiling + tuning
162
+ 2. Build one small service in Rust as learning experiment
163
+ 3. Evaluate Rust for future services based on learnings
164
+ 4. Don't rewrite existing system
165
+
166
+ This takes the best of both positions.
167
+ ```
168
+
169
+ ## Steel-Manning Patterns
170
+
171
+ ### In Design Reviews
172
+
173
+ ```markdown
174
+ ## Design Review: Microservices Proposal
175
+
176
+ Weak version to avoid:
177
+ "They just want to use trendy tech"
178
+
179
+ Steel-manned version:
180
+ "The monolith has become a development bottleneck.
181
+ Deploy conflicts are causing delays. Different teams
182
+ need different scaling characteristics. The proposal
183
+ addresses real coordination problems."
184
+
185
+ Now address:
186
+ "The coordination problems are real, but can we solve them
187
+ with modular monolith patterns before taking on distributed
188
+ systems complexity?"
189
+ ```
190
+
191
+ ### In Code Reviews
192
+
193
+ ```markdown
194
+ ## Code Review: Complex Abstraction
195
+
196
+ Weak critique:
197
+ "This is over-engineered"
198
+
199
+ Steel-manned understanding:
200
+ "The author anticipated we'll need to support multiple
201
+ backends. This abstraction makes adding new backends
202
+ trivial. The complexity exists to serve future flexibility."
203
+
204
+ Better critique:
205
+ "I understand this enables multiple backends. Let's
206
+ validate that requirement—if we only ever need one,
207
+ the abstraction adds maintenance burden without benefit."
208
+ ```
209
+
210
+ ### In Conflict Resolution
211
+
212
+ ```markdown
213
+ ## Team Disagreement: Testing Strategy
214
+
215
+ Person A: "We need 100% code coverage"
216
+ Person B: "Code coverage is a vanity metric"
217
+
218
+ Steel-man A:
219
+ "Coverage ensures we think about edge cases and makes
220
+ refactoring safer. Without coverage requirements,
221
+ critical paths go untested."
222
+
223
+ Steel-man B:
224
+ "Coverage without quality gives false confidence.
225
+ Testing getters/setters wastes time better spent on
226
+ integration tests that catch real bugs."
227
+
228
+ Synthesis:
229
+ "Coverage is valuable for complex logic, less valuable
230
+ for trivial code. Let's require coverage for business
231
+ logic modules, but focus on integration tests for
232
+ overall system confidence."
233
+ ```
234
+
235
+ ### In Self-Critique
236
+
237
+ ```markdown
238
+ ## Validating My Own Decision
239
+
240
+ My decision: Use NoSQL for this project
241
+
242
+ Steel-man the opposite:
243
+ "SQL has survived 50 years because relational models
244
+ work for most data. NoSQL solves problems most projects
245
+ don't have. The flexibility of schemaless data becomes
246
+ a bug when requirements solidify. Joins are a feature,
247
+ not a limitation."
248
+
249
+ Now: Does my NoSQL choice survive this critique?
250
+ - Do I actually need schemaless flexibility?
251
+ - Will I regret not having joins?
252
+ - Am I solving a problem I don't have?
253
+ ```
254
+
255
+ ## Steel-Manning Red Flags
256
+
257
+ Signs you're straw-manning instead:
258
+
259
+ | Straw-Man Sign | Example | Fix |
260
+ |----------------|---------|-----|
261
+ | "They just want..." | "They just want to use new tech" | Find the legitimate concern |
262
+ | Attacking messenger | "They're inexperienced" | Address the argument |
263
+ | Cherry-picking worst example | "Remember when X failed?" | Consider best examples |
264
+ | Assuming bad faith | "They don't care about quality" | Assume they want good outcomes |
265
+ | Ignoring strong points | Skipping their best argument | Address strongest point first |
266
+
267
+ ## Steel-Manning Template
268
+
269
+ ```markdown
270
+ # Steel-Man Analysis: [Topic]
271
+
272
+ ## Original Position
273
+ Who: [Person/group]
274
+ Position: [Their stated view]
275
+ Stated reasons: [Their explicit arguments]
276
+
277
+ ## Apparent Weaknesses
278
+ [What seems wrong at first glance]
279
+
280
+ ## Core Insight
281
+ [The legitimate concern or truth behind the position]
282
+
283
+ ## Steel-Manned Version
284
+ [The strongest possible formulation of their argument]
285
+
286
+ "[Write it as if you were advocating for this position]"
287
+
288
+ ## My Response to the Strong Version
289
+ [Now address the steel-manned argument]
290
+
291
+ ## What I Learned
292
+ [How did steel-manning change my understanding?]
293
+
294
+ ## Synthesis
295
+ [Best answer considering both positions]
296
+ ```
297
+
298
+ ## Verification Checklist
299
+
300
+ - [ ] Understood the original argument
301
+ - [ ] Identified the core insight/concern
302
+ - [ ] Constructed the strongest possible version
303
+ - [ ] Addressed the strong version, not a weak one
304
+ - [ ] Found what's legitimate in the opposing view
305
+ - [ ] Considered synthesis of positions
306
+ - [ ] Changed my mind if the steel-man is convincing
307
+
308
+ ## Key Questions
309
+
310
+ - "What's the strongest version of this argument?"
311
+ - "What legitimate concern is behind this?"
312
+ - "Could I argue this position convincingly?"
313
+ - "What would make this position correct?"
314
+ - "Am I attacking the weakest or strongest form?"
315
+ - "If I were advocating for this, what would I say?"
316
+
317
+ ## Rapoport's Rules (Related)
318
+
319
+ Daniel Dennett, channeling Anatol Rapoport, offers rules for criticizing:
320
+
321
+ 1. Attempt to re-express the target's position so clearly that they say "Thanks, I wish I'd thought of putting it that way."
322
+ 2. List any points of agreement (especially if not matters of widespread agreement).
323
+ 3. Mention anything you learned from the target.
324
+ 4. Only then are you permitted to say so much as a word of rebuttal or criticism.
325
+
326
+ This is steel-manning as ethical practice.
327
+
328
+ ## Mill's Wisdom
329
+
330
+ "He who knows only his own side of the case knows little of that."
331
+
332
+ You don't truly understand your position until you can argue the opposition's best case. Steel-manning isn't weakness—it's the path to strong positions that can withstand strong criticism.
@@ -0,0 +1,238 @@
1
+ ---
2
+ name: thinking-systems
3
+ description: Use when debugging across services/an incident where a fix in one place breaks another, or behavior is emergent and no single component explains it. Maps the system and traces causes.
4
+ ---
5
+
6
+ # Systems Thinking
7
+
8
+ ## Overview
9
+ Systems thinking views a problem as part of an interconnected whole rather than isolated components. It focuses on relationships, feedback loops, delays, and emergent properties—behaviors that arise from interactions and can't be predicted from parts alone. Its proven payoff is cross-service/incident debugging, where "obvious" single-component fixes fail.
10
+
11
+ **Core Principle:** The behavior of a system cannot be understood by analyzing components in isolation. Look at connections, feedback, and emergence.
12
+
13
+ ## When to Use
14
+ - Debugging issues that span multiple services/components
15
+ - A fix in one place breaks something in another
16
+ - Behavior is emergent—no single component is at fault, but the whole misbehaves
17
+ - Analyzing incidents and outages with non-obvious causes
18
+ - Performance issues where the slow part isn't the actual cause
19
+
20
+ ```
21
+ Problem spans multiple components? → yes → APPLY SYSTEMS THINKING
22
+ Fix in one place caused issue in another? → yes → APPLY SYSTEMS THINKING
23
+ Behavior seems "emergent" or unexpected? → yes → APPLY SYSTEMS THINKING
24
+ ```
25
+
26
+ ## When NOT to Use
27
+ - A single-component, linear bug (one service, clear stack trace) → just trace and fix it; the systems overhead buys nothing.
28
+ - The cause is already obvious from the recent diff or one log line → fix directly.
29
+ - The work is a contained refactor or feature with no cross-component interactions → skip.
30
+
31
+ ## Systems Debugging Process
32
+ This is the core of the skill—apply it first.
33
+
34
+ ### Step 1: Map the System
35
+ Draw components, connections, and data/control flows:
36
+ ```
37
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
38
+ │ Client │────▶│ API │────▶│ DB │
39
+ └─────────┘ └────┬────┘ └─────────┘
40
+
41
+
42
+ ┌─────────┐
43
+ │ Cache │
44
+ └─────────┘
45
+ ```
46
+
47
+ ### Step 2: Identify Feedback Loops
48
+ For each loop, determine:
49
+ - Is it reinforcing (amplifies change) or balancing (counteracts change)?
50
+ - What's the delay in the loop?
51
+ - What could make it unstable?
52
+
53
+ ```
54
+ Retry Storm Loop (Reinforcing - Dangerous):
55
+ Service slow → Clients retry → More load → Service slower → More retries
56
+ ```
57
+
58
+ ### Step 3: Trace Upstream
59
+ Follow the symptom backward to find originating cause:
60
+ ```
61
+ Symptom: High latency in Service C
62
+ → Service C waiting on Service B
63
+ → Service B waiting on Service A
64
+ → Service A doing full table scan (ROOT CAUSE)
65
+ ```
66
+
67
+ ### Step 4: Look for Interactions
68
+ What happens when components interact under stress?
69
+ - Circuit breakers tripping
70
+ - Cascading timeouts
71
+ - Resource contention
72
+ - Thundering herd
73
+
74
+ ### Step 5: Consider Time Dynamics
75
+ - When did this start?
76
+ - What changed recently (deploys, config, traffic)?
77
+ - Is it periodic? (Cron jobs, cache expiration, batch processes)
78
+ - Is it growing or stabilizing?
79
+
80
+ ## Common System Patterns
81
+
82
+ ### Cascading Failure
83
+ ```
84
+ One component fails → Dependent components overload → They fail
85
+
86
+ ← More traffic to remaining ←
87
+ ```
88
+ **Mitigation:** Circuit breakers, bulkheads, graceful degradation
89
+
90
+ ### Thundering Herd
91
+ ```
92
+ Cache expires → All requests hit backend simultaneously → Overload
93
+ ```
94
+ **Mitigation:** Jittered expiration, cache warming, request coalescing
95
+
96
+ ### Queue Backup
97
+ ```
98
+ Processing rate < Arrival rate → Queue grows → Memory pressure → OOM
99
+ ```
100
+ **Mitigation:** Backpressure, rate limiting, queue bounds
101
+
102
+ ### Resource Contention
103
+ ```
104
+ Multiple processes → Same resource → Lock contention → Serialization
105
+
106
+ Throughput collapses despite available CPU
107
+ ```
108
+ **Mitigation:** Sharding, optimistic locking, resource isolation
109
+
110
+ ## Key Concepts
111
+
112
+ ### 1. Feedback Loops
113
+
114
+ **Reinforcing (Positive) Loops:** Amplify change
115
+ ```
116
+ Technical Debt Loop:
117
+ Deadline pressure → Shortcuts → More bugs → More firefighting
118
+
119
+ ← Less time for quality ←
120
+ ```
121
+
122
+ **Balancing (Negative) Loops:** Counteract change
123
+ ```
124
+ Auto-scaling Loop:
125
+ Load increases → More instances spawn → Load per instance decreases
126
+
127
+ ← Fewer instances needed ←
128
+ ```
129
+
130
+ **Questions to identify loops:**
131
+ - Does this effect feed back into its cause?
132
+ - Is this self-reinforcing or self-correcting?
133
+ - What keeps this system in equilibrium?
134
+
135
+ ### 2. Stocks and Flows
136
+ **Stocks:** Accumulated quantities (users, technical debt, cache size)
137
+ **Flows:** Rates of change (registrations/day, bugs fixed/sprint)
138
+
139
+ ```
140
+ ┌─────────────────────────────────────┐
141
+ │ Inflow → [Stock] → Outflow │
142
+ │ │
143
+ │ New bugs → [Bug Backlog] → Fixes │
144
+ │ Requests → [Queue Depth] → Processed│
145
+ │ Hires → [Team Size] → Attrition │
146
+ └─────────────────────────────────────┘
147
+ ```
148
+
149
+ **Key insight:** Stocks change slowly even when flows change quickly. Queue depth doesn't drop instantly when you add capacity.
150
+
151
+ ### 3. Delays
152
+ Time lags between cause and effect obscure relationships:
153
+ ```
154
+ Code deployed → [Delay: Cache TTL] → Users see change
155
+ Feature shipped → [Delay: Adoption curve] → Metrics change
156
+ New hire starts → [Delay: Ramp-up] → Productivity impact
157
+ ```
158
+
159
+ **Danger:** Acting before feedback arrives leads to overcorrection.
160
+
161
+ ### 4. Non-Linear Relationships
162
+ Small changes can have large effects (and vice versa):
163
+ ```
164
+ Linear assumption: 2x traffic = 2x latency
165
+ Reality: Traffic crosses threshold → 10x latency (queue buildup)
166
+
167
+ Linear assumption: Adding engineer adds capacity
168
+ Reality: Communication overhead grows O(n²)
169
+ ```
170
+
171
+ ### 5. Emergent Properties
172
+ Behaviors that arise from interactions, not individual components:
173
+ - **Distributed system:** No single service is slow, but the system is slow (cascading delays)
174
+ - **Team dynamics:** No individual is toxic, but collaboration is toxic (incentive interactions)
175
+ - **Market behavior:** No actor intends a bubble, but bubble emerges
176
+
177
+ ## Causal Loop Diagram Template
178
+
179
+ ```
180
+ ┌──────────────────────────────────────────────────────────────┐
181
+ │ System: [Name] │
182
+ ├──────────────────────────────────────────────────────────────┤
183
+ │ │
184
+ │ ┌─────────┐ ┌─────────┐ │
185
+ │ │ Factor │──────(+)──────────────▶│ Factor │ │
186
+ │ │ A │ │ B │ │
187
+ │ └─────────┘ └────┬────┘ │
188
+ │ ▲ │ │
189
+ │ │ │ │
190
+ │ (-) (+) │
191
+ │ │ │ │
192
+ │ │ ┌─────────┐ │ │
193
+ │ └─────────│ Factor │◀─────────────┘ │
194
+ │ │ C │ │
195
+ │ └─────────┘ │
196
+ │ │
197
+ │ Legend: (+) = same direction, (-) = opposite direction │
198
+ │ Loop type: Reinforcing / Balancing │
199
+ └──────────────────────────────────────────────────────────────┘
200
+ ```
201
+
202
+ ## Leverage Points
203
+ Once you've located where to intervene, pick the highest-leverage point you can actually move:
204
+
205
+ | Leverage | Example | Impact |
206
+ |----------|---------|--------|
207
+ | Parameters | Timeout values | Low |
208
+ | Buffer sizes | Queue limits | Low-Medium |
209
+ | Feedback loops | Add monitoring | Medium |
210
+ | Information flows | Make metrics visible | Medium-High |
211
+ | Rules | Change retry policy | High |
212
+ | Goals | Redefine SLOs | Very High |
213
+ | Paradigm | Rethink architecture | Transformational |
214
+
215
+ (See `thinking-leverage-points` for Meadows' full 12-level hierarchy.)
216
+
217
+ ## Verification Checklist
218
+ - [ ] Mapped system components and connections
219
+ - [ ] Identified at least one feedback loop
220
+ - [ ] Traced symptom upstream to potential root causes
221
+ - [ ] Considered time delays in the system
222
+ - [ ] Looked for emergent/interaction effects
223
+ - [ ] Identified leverage points for intervention
224
+ - [ ] Considered unintended consequences of fix
225
+
226
+ ## Key Questions
227
+ - "What feeds back into what?"
228
+ - "Where are the delays in this system?"
229
+ - "What happens when this scales 10x?"
230
+ - "What would an observer see vs. what's actually happening?"
231
+ - "If I fix this here, what breaks over there?"
232
+ - "What behavior emerges that no single component intends?"
233
+ - "Where is the smallest change with the largest effect?"
234
+
235
+ ## Meadows' Reminder
236
+ "We can't control systems or figure them out. But we can dance with them."
237
+
238
+ Systems resist simple fixes. Effective intervention requires understanding the whole, finding leverage points, and accepting that you're influencing, not controlling.