@complexthings/superpowers-agent 8.1.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.
Files changed (123) hide show
  1. package/.agents/docs/SUPERPOWERS.md +108 -0
  2. package/.agents/prompts/001-copilot-tool-mapping-do/001-copilot-tool-mapping-do.md +116 -0
  3. package/.agents/prompts/001-copilot-tool-mapping-do/SUMMARY.md +72 -0
  4. package/.agents/prompts/001-copilot-tool-mapping-do/copilot-tool-mapping-do-output.md +83 -0
  5. package/.agents/prompts/001-release-management-do/001-release-management-do.md +161 -0
  6. package/.agents/prompts/001-release-management-do/SUMMARY.md +19 -0
  7. package/.agents/prompts/001-release-management-do/completed/001-release-management-do.md +161 -0
  8. package/.agents/prompts/002-pull-command-do/SUMMARY.md +28 -0
  9. package/.agents/prompts/002-pull-command-do/completed/002-pull-command-do.md +122 -0
  10. package/.agents/prompts/002-pull-command-do/pull-command-do-output.md +174 -0
  11. package/.agents/prompts/command_updates_prompt.md +69 -0
  12. package/.agents/prompts/current_prompt.md +8 -0
  13. package/.agents/prompts/refactor.prompt.md +57 -0
  14. package/.agents/skills/.gitkeep +0 -0
  15. package/.agents/superpowers-agent +355 -0
  16. package/.agents/superpowers-bootstrap.md +42 -0
  17. package/.agents/templates/AGENTS.md.template +40 -0
  18. package/.agents/templates/SUPERPOWERS.md.template +108 -0
  19. package/.agents/templates/TOOLS.md.template +15 -0
  20. package/.github/workflows/main.yaml +32 -0
  21. package/AGENTS.md +60 -0
  22. package/LICENSE +21 -0
  23. package/README.md +724 -0
  24. package/hooks/hooks.json +15 -0
  25. package/hooks/session-start.sh +27 -0
  26. package/package.json +51 -0
  27. package/skills/architecture/ABOUT.md +20 -0
  28. package/skills/architecture/preserving-productive-tensions/SKILL.md +146 -0
  29. package/skills/architecture/preserving-productive-tensions/skill.json +9 -0
  30. package/skills/collaboration/brainstorming/SKILL.md +166 -0
  31. package/skills/collaboration/brainstorming/skill.json +9 -0
  32. package/skills/collaboration/brainstorming/spec-document-reviewer-prompt.md +50 -0
  33. package/skills/collaboration/brainstorming/visual-companion.md +277 -0
  34. package/skills/collaboration/dispatching-parallel-agents/SKILL.md +174 -0
  35. package/skills/collaboration/dispatching-parallel-agents/skill.json +9 -0
  36. package/skills/collaboration/executing-plans/SKILL.md +130 -0
  37. package/skills/collaboration/executing-plans/skill.json +9 -0
  38. package/skills/collaboration/finishing-a-development-branch/SKILL.md +261 -0
  39. package/skills/collaboration/finishing-a-development-branch/skill.json +9 -0
  40. package/skills/collaboration/leveraging-cli-tools/SKILL.md +132 -0
  41. package/skills/collaboration/leveraging-cli-tools/skill.json +9 -0
  42. package/skills/collaboration/receiving-code-review/SKILL.md +233 -0
  43. package/skills/collaboration/receiving-code-review/skill.json +9 -0
  44. package/skills/collaboration/requesting-code-review/SKILL.md +110 -0
  45. package/skills/collaboration/requesting-code-review/code-reviewer.md +146 -0
  46. package/skills/collaboration/requesting-code-review/skill.json +12 -0
  47. package/skills/collaboration/subagent-driven-development/SKILL.md +255 -0
  48. package/skills/collaboration/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  49. package/skills/collaboration/subagent-driven-development/implementer-prompt.md +113 -0
  50. package/skills/collaboration/subagent-driven-development/skill.json +15 -0
  51. package/skills/collaboration/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  52. package/skills/collaboration/using-git-worktrees/SKILL.md +366 -0
  53. package/skills/collaboration/using-git-worktrees/skill.json +9 -0
  54. package/skills/collaboration/writing-plans/SKILL.md +121 -0
  55. package/skills/collaboration/writing-plans/plan-document-reviewer-prompt.md +52 -0
  56. package/skills/collaboration/writing-plans/skill.json +9 -0
  57. package/skills/debugging/defense-in-depth/SKILL.md +380 -0
  58. package/skills/debugging/defense-in-depth/skill.json +9 -0
  59. package/skills/debugging/root-cause-tracing/SKILL.md +361 -0
  60. package/skills/debugging/root-cause-tracing/find-polluter.sh +63 -0
  61. package/skills/debugging/root-cause-tracing/skill.json +12 -0
  62. package/skills/debugging/systematic-debugging/SKILL.md +299 -0
  63. package/skills/debugging/systematic-debugging/condition-based-waiting-example.ts +158 -0
  64. package/skills/debugging/systematic-debugging/condition-based-waiting.md +115 -0
  65. package/skills/debugging/systematic-debugging/defense-in-depth.md +122 -0
  66. package/skills/debugging/systematic-debugging/find-polluter.sh +63 -0
  67. package/skills/debugging/systematic-debugging/root-cause-tracing.md +169 -0
  68. package/skills/debugging/systematic-debugging/skill.json +9 -0
  69. package/skills/debugging/systematic-debugging/test-academic.md +14 -0
  70. package/skills/debugging/systematic-debugging/test-pressure-1.md +58 -0
  71. package/skills/debugging/systematic-debugging/test-pressure-2.md +68 -0
  72. package/skills/debugging/systematic-debugging/test-pressure-3.md +69 -0
  73. package/skills/debugging/verification-before-completion/SKILL.md +143 -0
  74. package/skills/debugging/verification-before-completion/skill.json +9 -0
  75. package/skills/finding-skills/SKILL.md +101 -0
  76. package/skills/finding-skills/skill.json +8 -0
  77. package/skills/meta/create-skill-json/SKILL.md +370 -0
  78. package/skills/meta/create-skill-json/skill.json +9 -0
  79. package/skills/meta/create-skill-json/test-scenarios.md +29 -0
  80. package/skills/meta/creating-prompts/SKILL.md +349 -0
  81. package/skills/meta/creating-prompts/examples/do-example.md +65 -0
  82. package/skills/meta/creating-prompts/examples/plan-example.md +75 -0
  83. package/skills/meta/creating-prompts/examples/refine-example.md +65 -0
  84. package/skills/meta/creating-prompts/examples/research-example.md +63 -0
  85. package/skills/meta/creating-prompts/scripts/get-next-number.sh +27 -0
  86. package/skills/meta/creating-prompts/skill.json +20 -0
  87. package/skills/meta/creating-prompts/templates/do-template.md +59 -0
  88. package/skills/meta/creating-prompts/templates/plan-template.md +58 -0
  89. package/skills/meta/creating-prompts/templates/refine-template.md +54 -0
  90. package/skills/meta/creating-prompts/templates/research-template.md +56 -0
  91. package/skills/meta/using-superpowers/SKILL.md +122 -0
  92. package/skills/meta/using-superpowers/skill.json +5 -0
  93. package/skills/meta/writing-prompts/SKILL.md +345 -0
  94. package/skills/meta/writing-prompts/skill.json +9 -0
  95. package/skills/problem-solving/ABOUT.md +40 -0
  96. package/skills/problem-solving/collision-zone-thinking/SKILL.md +188 -0
  97. package/skills/problem-solving/collision-zone-thinking/references/historical-examples.md +393 -0
  98. package/skills/problem-solving/collision-zone-thinking/skill.json +9 -0
  99. package/skills/problem-solving/inversion-exercise/SKILL.md +174 -0
  100. package/skills/problem-solving/inversion-exercise/skill.json +9 -0
  101. package/skills/problem-solving/meta-pattern-recognition/SKILL.md +116 -0
  102. package/skills/problem-solving/meta-pattern-recognition/skill.json +9 -0
  103. package/skills/problem-solving/scale-game/SKILL.md +222 -0
  104. package/skills/problem-solving/scale-game/skill.json +9 -0
  105. package/skills/problem-solving/simplification-cascades/SKILL.md +113 -0
  106. package/skills/problem-solving/simplification-cascades/skill.json +9 -0
  107. package/skills/problem-solving/when-stuck/SKILL.md +69 -0
  108. package/skills/problem-solving/when-stuck/skill.json +9 -0
  109. package/skills/research/ABOUT.md +20 -0
  110. package/skills/research/tracing-knowledge-lineages/SKILL.md +241 -0
  111. package/skills/research/tracing-knowledge-lineages/skill.json +9 -0
  112. package/skills/setup-skills/SKILL.md +47 -0
  113. package/skills/testing/condition-based-waiting/SKILL.md +359 -0
  114. package/skills/testing/condition-based-waiting/example.ts +158 -0
  115. package/skills/testing/condition-based-waiting/skill.json +12 -0
  116. package/skills/testing/test-driven-development/SKILL.md +434 -0
  117. package/skills/testing/test-driven-development/skill.json +9 -0
  118. package/skills/testing/testing-anti-patterns/SKILL.md +298 -0
  119. package/skills/testing/testing-anti-patterns/skill.json +9 -0
  120. package/skills/testing/verification-before-completion/SKILL.md +246 -0
  121. package/skills/testing/verification-before-completion/skill.json +10 -0
  122. package/skills/using-a-skill/SKILL.md +101 -0
  123. package/skills/using-a-skill/skill.json +8 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "superpowers:meta/writing-prompts",
4
+ "title": "writing-prompts",
5
+ "aliases": [
6
+ "writing-prompts",
7
+ "meta/writing-prompts"
8
+ ]
9
+ }
@@ -0,0 +1,40 @@
1
+ # Problem-Solving Skills - Attribution
2
+
3
+ These skills were derived from agent patterns in the [Amplifier](https://github.com/microsoft/amplifier) project.
4
+
5
+ **Source Repository:**
6
+ - Name: Amplifier
7
+ - URL: https://github.com/microsoft/amplifier
8
+ - Commit: 2adb63f858e7d760e188197c8e8d4c1ef721e2a6
9
+ - Date: 2025-10-10
10
+
11
+ ## Skills Derived from Amplifier Agents
12
+
13
+ **From insight-synthesizer agent:**
14
+ - simplification-cascades - Finding insights that eliminate multiple components
15
+ - collision-zone-thinking - Forcing unrelated concepts together for breakthroughs
16
+ - meta-pattern-recognition - Spotting patterns across 3+ domains
17
+ - inversion-exercise - Flipping assumptions to reveal alternatives
18
+ - scale-game - Testing at extremes to expose fundamental truths
19
+
20
+ **From ambiguity-guardian agent:**
21
+ - (architecture) preserving-productive-tensions - Preserving multiple valid approaches
22
+
23
+ **From knowledge-archaeologist agent:**
24
+ - (research) tracing-knowledge-lineages - Understanding how ideas evolved
25
+
26
+ **Dispatch pattern:**
27
+ - when-stuck - Maps stuck-symptoms to appropriate technique
28
+
29
+ ## What Was Adapted
30
+
31
+ The amplifier agents are specialized long-lived agents with structured JSON output. These skills extract the core problem-solving techniques and adapt them as:
32
+
33
+ - Scannable quick-reference guides (~60 lines each)
34
+ - Symptom-based discovery via when_to_use
35
+ - Immediate application without special tooling
36
+ - Composable through dispatch pattern
37
+
38
+ ## Core Insight
39
+
40
+ Agent capabilities are domain-agnostic patterns. Whether packaged as "amplifier agent" or "superpowers skill", the underlying technique is the same. We extracted the techniques and made them portable.
@@ -0,0 +1,188 @@
1
+ ---
2
+ name: collision-zone-thinking
3
+ description: Force unrelated concepts together to discover emergent properties — "What if we treated X like Y?" Use this skill whenever someone says they're stuck, need a breakthrough idea, want to think outside the box, feel like they've exhausted options in their domain, or need innovation rather than optimization. Also use it when a user asks how a well-known software pattern (circuit breakers, MapReduce, reactive programming, event sourcing) was originally invented — these are all cross-domain collisions. Trigger any time someone needs a novel angle on a hard problem.
4
+ ---
5
+
6
+ # Collision-Zone Thinking
7
+
8
+ ## Overview
9
+
10
+ Revolutionary insights come from forcing unrelated concepts to collide. The cognitive science behind this is real: **bisociation** (Koestler), **conceptual blending** (Fauconnier & Turner), and TRIZ's cross-domain patent analysis all confirm the same mechanism — breakthrough thinking requires connecting two previously separate frames of thought, not finding better answers within a single frame.
11
+
12
+ **Core principle:** Import the *mechanism*, not the metaphor. You're not renaming things. You're borrowing how a different system solves the same structural problem.
13
+
14
+ > For historical evidence that this technique produces real results — Bloom filters, MapReduce, the Actor model, circuit breakers, consistent hashing, event sourcing — see `references/historical-examples.md`.
15
+
16
+ ---
17
+
18
+ ## Quick Reference: High-Yield Domain Pairs
19
+
20
+ | Problem Type | Source Domain | Key Mechanisms to Import |
21
+ |-------------|---------------|--------------------------|
22
+ | Distributed failures | Electrical circuits | Circuit breakers, grounding, load balancing |
23
+ | Service discovery | Ant colonies | Stigmergy, pheromone trails, positive feedback |
24
+ | Caching / memory | Immune system | Memory cells, tolerance, autoimmunity as bugs |
25
+ | Load shedding | Emergency triage | Priority queues, do-not-resuscitate patterns |
26
+ | Code evolution | Natural selection | Fitness landscape, punctuated equilibrium, drift |
27
+ | API design | Linguistics | Syntax vs. semantics, pragmatics, ambiguity |
28
+ | Security / access | Epidemiology | Vectors, quarantine, herd immunity, patient zero |
29
+ | Team structure | Ecology / niches | Keystone species, competitive exclusion, succession |
30
+ | Rate limiting | Fluid dynamics | Backpressure, throttle valves, laminar vs. turbulent |
31
+ | Technical debt | Financial debt | Compound interest, default, debt restructuring |
32
+ | Observability | Neuroscience | Proprioception, signal vs. noise, nociception |
33
+ | Consensus | Democracy / voting | Quorum, veto power, majority vs. supermajority |
34
+ | Data pipelines | Manufacturing | Bottlenecks, WIP limits, buffer overflow, just-in-time |
35
+ | Optimization | Evolution / genetics | Fitness function, mutation, selection pressure |
36
+
37
+ ---
38
+
39
+ ## Process
40
+
41
+ ### 1. Escape the Problem's Frame
42
+ - State the problem in plain language
43
+ - Identify its structural type: optimization? coordination? failure prevention? scaling? discovery?
44
+ - Strip domain-specific vocabulary — find the structural bones
45
+ - Ask: *"What is this problem really about?"*
46
+
47
+ ### 2. Select and Enter the Source Domain
48
+ - Choose a domain that solves the same **structural problem type** (not the same surface domain)
49
+ - Go deep enough to articulate **at least 5 mechanisms** — don't just name the domain, explain how it works
50
+ - Ask: *"How does this system solve this type of problem?"*
51
+
52
+ **Good source domains:** biology, ecology, electrical engineering, fluid dynamics, economics, military strategy, immunology, linguistics, thermodynamics, accounting.
53
+
54
+ **Avoid:** adjacent tech domains (too similar), domains you barely understand (too shallow).
55
+
56
+ ### 3. Collide
57
+ - Force the combination: *"What if we treated [A] like [B]?"*
58
+ - Run it as a simulation — elaborate it forward, don't just state it
59
+ - For each mechanism you listed, ask: *"What would the equivalent be in my domain?"*
60
+ - Note **emergent properties** — things the blend implies that weren't in either input
61
+
62
+ ### 4. Test the Breakdown
63
+ - Find where the metaphor breaks — it always does
64
+ - Ask: *"What does the source domain have that my domain lacks?"* (potential to add)
65
+ - Ask: *"What does my domain have that the source domain lacks?"* (constraints to respect)
66
+ - **Treat the breakdown as signal, not failure.** Where the metaphor stops fitting reveals what's genuinely unique about your domain — and often points to the most important design decision.
67
+
68
+ ### 5. Extract
69
+ - Name the concrete mechanisms you're borrowing
70
+ - Generate at least one testable hypothesis or design change
71
+ - Document breakdown points — they define the insight's scope
72
+
73
+ ---
74
+
75
+ ## Evaluating the Collision
76
+
77
+ | Question | What It Checks |
78
+ |----------|---------------|
79
+ | **Does the structural relationship map, or only the surface?** | Borrowing names is decoration; borrowing mechanisms is insight |
80
+ | **Does the source domain reveal *why*, not just *what*?** | Causal mechanisms are what you're actually importing |
81
+ | **Does the breakdown point reveal something useful?** | Productive breaks expose hidden constraints or design decisions |
82
+
83
+ **Signs a collision is productive:** Emergent properties appear. You discover constraints you hadn't named. The source suggests experiments you wouldn't have thought of. The breakdown reveals a gap worth engineering around.
84
+
85
+ **Signs a collision is superficial:** You're borrowing vocabulary, not mechanisms. You could have had the same insight without the analogy. No emergent structure appears — the blend is flat.
86
+
87
+ ---
88
+
89
+ ## Worked Example 1: Circuit Breakers
90
+
91
+ **Problem:** Complex distributed system with cascading failures
92
+
93
+ **Escape:** This is a *failure propagation* problem — how to prevent one failing component from overloading others.
94
+
95
+ **Source domain activated:** Electrical circuits
96
+ - Mechanism 1: Circuit breakers disconnect on overload
97
+ - Mechanism 2: Fuses provide one-time, non-recoverable protection
98
+ - Mechanism 3: Grounding routes dangerous current safely away
99
+ - Mechanism 4: Load balancing distributes current across paths
100
+ - Mechanism 5: Isolation prevents short-circuit propagation between components
101
+
102
+ **Collision:** *"What if we treated services like electrical circuits?"*
103
+
104
+ **Emergent properties:**
105
+ - Circuit breakers → automatic service disconnection when error rates spike
106
+ - Grounding → dedicated error-sink services that absorb failures
107
+ - Load balancing → traffic redistribution under stress
108
+ - Series vs. parallel circuits → synchronous vs. async dependency graphs
109
+
110
+ **Where it breaks:** Circuits don't have retry logic, state, or dynamic reconfiguration.
111
+
112
+ **What the breakdown reveals:** Distributed systems have *memory* and *intent* that circuits lack — that's why retry logic, exponential backoff, and health checks exist. The breakdown is the specification for the Half-Open state that Michael Nygard invented — an entirely software-native concept with no electrical equivalent.
113
+
114
+ **Insight extracted:** Borrow the three-state model (closed/open/half-open); add retry and health-check logic exactly where the analogy breaks.
115
+
116
+ ---
117
+
118
+ ## Worked Example 2: Event Sourcing
119
+
120
+ **Problem:** Distributed write-heavy systems need audit trails, temporal queries, and consistency — but mutable state makes all three hard.
121
+
122
+ **Escape:** This is a *state history* problem — how to track what happened, when, and be able to reconstruct any past state.
123
+
124
+ **Source domain activated:** Double-entry bookkeeping (accounting, ~1494)
125
+ - Mechanism 1: Transactions are never modified, only appended to the ledger
126
+ - Mechanism 2: Account balance is *derived* from history, not stored directly
127
+ - Mechanism 3: Every change is recorded from two perspectives (debit and credit)
128
+ - Mechanism 4: The complete ledger is the source of truth — summaries are projections
129
+ - Mechanism 5: Audit trail is the data, not a separate system bolted on
130
+
131
+ **Collision:** *"What if we treated our database like a ledger?"*
132
+
133
+ **Emergent properties:**
134
+ - Event store → complete replay of any past state (time travel)
135
+ - Derived projections → different read models from the same event stream
136
+ - Immutable log → audit trail for free, debugging by replay
137
+ - Append-only writes → no write contention on past records
138
+
139
+ **Where it breaks:** Schema evolution is hard (old events must be readable with new schemas), and replaying years of events to reconstruct current state is slow.
140
+
141
+ **What the breakdown reveals:** Bookkeepers solved schema evolution via versioned document formats and transition rules — software systems need the same: event versioning and migration scripts. The "slow replay" breakdown is the specification for snapshot strategies. Both breakdowns have direct solutions.
142
+
143
+ **Insight extracted:** Immutable event logs as primary data; projections as derived views; snapshots for performance; versioned schemas for evolution. This is the event sourcing pattern that underlies Kafka, CQRS, and git.
144
+
145
+ ---
146
+
147
+ ## Common Pitfalls
148
+
149
+ **Surface analogy trap:** Borrowing vocabulary but not mechanisms. "Let's call modules 'genes'" is renaming, not insight. Insight is: *"What would selection pressure mean for code? What would mutation rate mean? What would epistasis mean?"*
150
+
151
+ **Stopping too early:** Generating the collision but not running it. Commit to 5–7 mechanisms before claiming the collision is complete.
152
+
153
+ **Adjacent-domain trap:** Choosing source domains that are too similar — produces incremental thinking, not breakthrough. Physics, biology, and economics produce more insight than other tech systems.
154
+
155
+ **Discarding breakdowns:** Treating metaphor failures as dead ends. Every breakdown is a signal about what's genuinely different in your domain — and that's where the deepest insight lives.
156
+
157
+ ---
158
+
159
+ ## When to Reach for This
160
+
161
+ - "I've tried everything in this domain"
162
+ - Solutions feel incremental, not breakthrough
163
+ - Need innovation, not optimization
164
+ - The problem feels structurally familiar but solutions in this domain have stalled
165
+ - You're asked how a well-known pattern (circuit breakers, MapReduce, event sourcing) was invented
166
+
167
+ ---
168
+
169
+ ## Source Domain Selection Rubric
170
+
171
+ Use this to assess if a domain is worth entering deeply:
172
+
173
+ 1. **Structural richness:** Does it have well-developed causal mechanisms, or just patterns?
174
+ 2. **Surface dissimilarity:** Is it genuinely alien to your problem domain? (More different = more novel)
175
+ 3. **Your familiarity:** Can you articulate 5+ mechanisms, or are you guessing?
176
+ 4. **Validated solutions:** Has this domain solved its problems under real pressure (evolution, markets, physics)?
177
+
178
+ If you can't articulate 5 mechanisms from the source domain, go deeper before colliding.
179
+
180
+ ---
181
+
182
+ ## Reference
183
+
184
+ For 11 historical examples of real cross-domain collisions that became software foundations — with full collision-zone analysis for each — see:
185
+
186
+ `references/historical-examples.md`
187
+
188
+ Use them as templates, as evidence this technique produces real results, or as a starting inventory when you're selecting source domains.
@@ -0,0 +1,393 @@
1
+ # Historical Examples: Cross-Domain Collisions That Became Software Foundations
2
+
3
+ These are real, documented cases where borrowing a mechanism from an unrelated domain produced a breakthrough in software or computer science. Each entry follows the collision-zone format: source domain → target problem → mechanisms imported → emergent properties → where it breaks.
4
+
5
+ Use these as evidence when selecting source domains, as templates for how to run a collision, or as existence proofs that this technique actually works at scale.
6
+
7
+ ---
8
+
9
+ ## Biology & Probabilistic Mathematics
10
+
11
+ ### Bloom Filter (1970, Burton Howard Bloom)
12
+
13
+ **Source domain:** Probabilistic mathematics — asymmetric certainty
14
+ **Target problem:** How to test dictionary membership (500,000 words) without disk access
15
+ **Structural type:** Membership testing with constrained memory
16
+
17
+ **Mechanism imported:**
18
+ The asymmetry of certainty: "definitely not in the set" is provable; "possibly in the set" is not. A bit array with multiple hash functions can eliminate false negatives while tolerating false positives at a controlled rate.
19
+
20
+ **Emergent properties:**
21
+ - Sub-linear space usage: O(n) storage, not O(n × word_length)
22
+ - Tunable false-positive rate: add more bits to lower it
23
+ - Composable: merge two Bloom filters by OR-ing their bit arrays
24
+ - Write-optimized: insertion is O(k) hash operations
25
+
26
+ **Real-world validation:** Cassandra, HBase, Bigtable (false-positive tolerant for SSTable checks), Chrome malicious URL detection, Bitcoin SPV nodes, Medium ("have you read this?" feature)
27
+
28
+ **Where it breaks:**
29
+ - Cannot remove elements (deletion destroys the probabilistic guarantee)
30
+ - False positive rate grows as fill factor increases — requires capacity planning
31
+ - Not suitable for exact membership — introduces error by design
32
+ - Counting variants (counting Bloom filters) exist but are more complex
33
+
34
+ **What the breakdown reveals:** The tradeoff is between certainty and space efficiency. Where you can tolerate "probably yes / definitely no" — and where false positives have low cost — Bloom filters are strictly dominant.
35
+
36
+ ---
37
+
38
+ ### Genetic Algorithms (1970s, John Holland, University of Michigan)
39
+
40
+ **Source domain:** Darwinian evolution — natural selection, genetic inheritance
41
+ **Target problem:** Search and optimization over large, irregular parameter spaces
42
+ **Structural type:** Optimization in unknown fitness landscapes
43
+
44
+ **Mechanisms imported:**
45
+ - Selection pressure: fitter individuals reproduce more
46
+ - Chromosome encoding: candidate solutions as bit strings
47
+ - Crossover (recombination): combine parts of two parent solutions
48
+ - Mutation: random perturbation to prevent local optima
49
+ - Fitness function: the objective being optimized plays the role of the environment
50
+
51
+ **Emergent properties:**
52
+ - Parallelism: population explores multiple search directions simultaneously
53
+ - Implicit parallelism: short, high-fitness bit patterns ("schemata") propagate quickly
54
+ - No gradient required: works on non-differentiable, discontinuous landscapes
55
+ - Self-adaptation: populations can evolve their own mutation rates (evolution strategies)
56
+
57
+ **Real-world validation:** NASA ST5 spacecraft antenna (evolved, not designed), circuit board routing, neural architecture search, drug molecule optimization
58
+
59
+ **Where it breaks:**
60
+ - Fitness function must be hand-crafted — and can be gamed
61
+ - Slower than domain-specific algorithms when those exist
62
+ - Convergence to local optima still happens (premature convergence)
63
+ - No interpretability: you get a solution but not an explanation
64
+ - Epistasis (gene interactions) makes analysis difficult
65
+
66
+ **What the breakdown reveals:** Evolution is a process without a goal — genetic algorithms must supply the goal externally via the fitness function. This is the critical engineering interface: defining what "fit" means is where the domain knowledge lives, not in the algorithm itself.
67
+
68
+ ---
69
+
70
+ ### Artificial Immune Systems (mid-1980s–1990s)
71
+
72
+ **Source domain:** Vertebrate adaptive immune system
73
+ **Target problem:** Anomaly detection and adaptive defense
74
+ **Structural type:** Self/non-self discrimination with memory
75
+
76
+ **Mechanisms imported:**
77
+ - Negative selection: T-cells that react to self are deleted; only non-self-reactive cells survive
78
+ - Clonal selection: cells that successfully detect a threat multiply rapidly
79
+ - Memory cells: successful past detections persist for faster future response
80
+ - Danger theory (Matzinger): the immune system responds to danger signals, not just non-self
81
+
82
+ **Emergent properties:**
83
+ - Self-adapting detection: no pre-enumerated threat list required
84
+ - Distributed: no central detector, detection emerges from population behavior
85
+ - Memory: past exposures improve future detection speed
86
+
87
+ **Real-world validation:** Network intrusion detection (LISYS system), anomaly detection in industrial systems
88
+
89
+ **Where it breaks:**
90
+ - Computational cost: maintaining and cycling a detector population is expensive
91
+ - Self-definition problem: defining "self" in software is non-trivial
92
+ - Largely supplanted by deep learning for anomaly detection after ~2005
93
+ - Danger theory is still controversial in immunology itself
94
+
95
+ **What the breakdown reveals:** The immune system succeeds partly because the body's "self" is stable and well-defined. In software systems, "normal behavior" is a moving target — which is exactly why deep learning approaches (that continuously update) eventually won.
96
+
97
+ ---
98
+
99
+ ## Physics & Thermodynamics
100
+
101
+ ### Simulated Annealing (1983, Kirkpatrick, Gelatt & Vecchi, IBM)
102
+
103
+ **Source domain:** Metallurgical physics — the annealing process for crystallizing metals
104
+ **Target problem:** Combinatorial optimization (circuit placement, traveling salesman)
105
+ **Structural type:** Optimization with many local optima
106
+
107
+ **Mechanisms imported:**
108
+ - Annealing in metallurgy: slowly cooling a heated material allows atoms to find low-energy configurations
109
+ - Temperature controls randomness: at high temperature, the system accepts worse solutions (explores); as temperature drops, it becomes more selective (exploits)
110
+ - Boltzmann acceptance probability: the probability of accepting a worse solution is exp(-ΔE/kT)
111
+
112
+ **Emergent properties:**
113
+ - Escapes local optima: unlike greedy search, accepts worse moves probabilistically
114
+ - Temperature schedule controls the exploration/exploitation tradeoff
115
+ - Parameter-free in principle (though cooling schedule is problem-specific in practice)
116
+
117
+ **Real-world validation:** Chip placement (VLSI), protein folding, schedule optimization; it built on the Metropolis-Hastings algorithm (1953) which used the same physics for Monte Carlo simulation
118
+
119
+ **Where it breaks:**
120
+ - Cooling schedule is highly problem-specific — getting it wrong wastes most of the value
121
+ - No guarantee of finding the global optimum
122
+ - Slow for large problem spaces
123
+ - Has largely been displaced by gradient-based methods where those are applicable
124
+
125
+ **What the breakdown reveals:** Temperature is a proxy for exploration willingness. This generalizes to any algorithm that needs to balance exploration vs. exploitation — the "temperature" concept recurs in modern reinforcement learning (entropy regularization, softmax temperature).
126
+
127
+ ---
128
+
129
+ ## Electrical Engineering
130
+
131
+ ### Circuit Breaker Pattern (2007, Michael Nygard, "Release It!")
132
+
133
+ **Source domain:** Electrical engineering — physical circuit breakers
134
+ **Target problem:** Cascading failures in distributed microservices
135
+ **Structural type:** Failure isolation and propagation prevention
136
+
137
+ **Mechanisms imported:**
138
+ - Three-state model: Closed (normal), Open (tripped), Half-Open (testing recovery)
139
+ - Automatic disconnection on overload (trips when error rate exceeds threshold)
140
+ - Reset by testing: re-attempts at low volume to determine if system recovered
141
+
142
+ **Emergent properties:**
143
+ - Fail-fast: callers get immediate errors instead of waiting for timeout cascades
144
+ - Self-healing: Half-Open state enables automatic recovery detection
145
+ - Observable state: circuit state is a meaningful system health signal
146
+ - Composable: circuit breakers chain — upstream circuits observe downstream trips
147
+
148
+ **Real-world validation:** Netflix Hystrix (2011), Resilience4j, Envoy proxy, AWS SDK
149
+
150
+ **Where it breaks:**
151
+ - Software needs heuristics for "overload" (error rate %, latency p99); electricity has simple physics
152
+ - Half-Open state has no electrical equivalent — Nygard invented it for the software context
153
+ - In sharded systems, a circuit may be open for some shards but closed for others — the pattern doesn't handle partial failures natively
154
+ - Doesn't address the root cause — only prevents spread
155
+
156
+ **What the breakdown reveals:** The Half-Open state is a purely software invention with no electrical counterpart. It exists because software systems have intent and retry semantics that circuits don't — the recovery test is a design decision the electrical world never needed to make.
157
+
158
+ ---
159
+
160
+ ### Reactive Programming
161
+
162
+ **Source domain:** Electrical engineering — analog signal propagation, hardware description languages (Verilog, VHDL)
163
+ **Target problem:** Managing asynchronous data flow and event propagation in software
164
+ **Structural type:** Dataflow computation with time-varying values
165
+
166
+ **Mechanisms imported:**
167
+ - Signals: values that change over time
168
+ - Propagation: when a source changes, downstream computations update automatically
169
+ - Circuit topology: the graph structure of dependencies determines update order
170
+ - Backpressure: when a consumer can't keep up, signal pressure builds up
171
+
172
+ **Emergent properties:**
173
+ - Declarative composition: describe what, not when
174
+ - Automatic propagation: no manual cache invalidation
175
+ - Time as a first-class citizen: streams can be buffered, debounced, throttled
176
+
177
+ **Real-world validation:** ReactiveX/RxJS (the dominant paradigm for async JS), React/SolidJS (UI reactive model), Kafka Streams, spreadsheets (the original reactive computation)
178
+
179
+ **Where it breaks:**
180
+ - Glitches: if two signals feed a computation and both update, intermediate inconsistent states can propagate — requires topological sorting to prevent
181
+ - Memory consumption: infinite streams must be explicitly windowed
182
+ - Cyclic dependencies: most reactive systems forbid cycles, but real systems often have feedback loops
183
+ - Learning curve: thinking in streams is alien to imperative programmers
184
+
185
+ **What the breakdown reveals:** Hardware description languages solved glitches via compile-time topological sort and clock domains. Software reactive systems that skip this analysis (most of them) leave glitch prevention to the developer — which is why `combineLatest` and `zip` exist as workarounds.
186
+
187
+ ---
188
+
189
+ ## Functional Programming / Mathematics
190
+
191
+ ### MapReduce (Google, 2004, Dean & Ghemawat)
192
+
193
+ **Source domain:** Functional programming — Lisp's `map` and `reduce` primitives + assembly-line manufacturing
194
+ **Target problem:** Distributed computation over petabytes of data with commodity hardware
195
+ **Structural type:** Parallelizable batch data processing
196
+
197
+ **Mechanisms imported from FP:**
198
+ - `map`: apply a function to each element independently (parallelizable)
199
+ - `reduce`/`fold`: combine results (aggregatable after independent processing)
200
+ - Referential transparency: pure map functions have no side effects, making distribution safe
201
+
202
+ **Mechanisms imported from manufacturing:**
203
+ - Assembly line: work is divided into stages
204
+ - WIP limits: intermediate results (shuffled key-value pairs) bounded in memory
205
+ - Worker redundancy: failed workers are replaced; work is redistributed
206
+
207
+ **Emergent properties:**
208
+ - Fault tolerance by design: idempotent map tasks can be retried on any worker
209
+ - Data locality: moving computation to data is faster than moving data to computation
210
+ - Linear scalability: adding workers reduces wall-clock time proportionally (for the map stage)
211
+
212
+ **Real-world validation:** Google's internal infrastructure, Apache Hadoop, later Apache Spark
213
+
214
+ **Where it breaks:**
215
+ - Only acyclic dataflow: no loops, no iterative algorithms (PageRank took 30 MapReduce jobs)
216
+ - Disk-heavy: intermediate results are written to disk between stages
217
+ - Batch-only: not suitable for streaming data
218
+ - Google abandoned it internally ~2014 in favor of Flume/Dataflow
219
+
220
+ **What the breakdown reveals:** Map and reduce are mathematically powerful but structurally flat. Real-world analytics requires iteration (machine learning) and stream processing (real-time) — which led directly to Spark (in-memory iteration) and Kafka (streaming). MapReduce's limitations were the exact specification for its successors.
221
+
222
+ ---
223
+
224
+ ## Accounting & Finance
225
+
226
+ ### Event Sourcing / CQRS
227
+
228
+ **Source domain:** Double-entry bookkeeping (~1300s; formalized by Luca Pacioli, 1494)
229
+ **Target problem:** Audit trails, temporal queries, and consistency in distributed write-heavy systems
230
+ **Structural type:** Immutable state history with derived projections
231
+
232
+ **Mechanisms imported:**
233
+ - Immutable ledger entries: transactions are never modified, only appended
234
+ - Balance as a derivation: account balance is computed from history, not stored as mutable state
235
+ - Double-entry: every change is recorded from two perspectives (debit and credit)
236
+ - Audit trail: the complete history is the source of truth
237
+
238
+ **Emergent properties:**
239
+ - Time travel: reconstruct system state at any past point
240
+ - Audit log for free: the event store is the audit trail
241
+ - Projection flexibility: derive different read models from the same event stream
242
+ - Debugging by replay: reproduce bugs by replaying the event sequence
243
+
244
+ **Real-world validation:** Apache Kafka (event log as primary data store), event-driven microservices, CQRS pattern, financial trading systems, git (commit log is an event store)
245
+
246
+ **Where it breaks:**
247
+ - Schema evolution is hard: old events must be interpretable with new schemas
248
+ - Eventual consistency between write model (event store) and read models (projections)
249
+ - Snapshot strategy needed: replaying 10 years of events is slow
250
+ - Storage grows unbounded without archiving strategy
251
+
252
+ **What the breakdown reveals:** Bookkeepers solved the "derived state" problem by never modifying entries — only appending. The insight is that mutability is a choice, not a necessity. The breakdown (schema evolution) is the software equivalent of a legal document format change — and the same solution applies: versioning and migration scripts.
253
+
254
+ ---
255
+
256
+ ## Topology / Pure Mathematics
257
+
258
+ ### Consistent Hashing (1997, Karger et al., MIT / Akamai)
259
+
260
+ **Source domain:** Geometric topology — unit circle, continuous proximity
261
+ **Target problem:** Distributing keys across a cluster of nodes that can join or leave
262
+ **Structural type:** Dynamic load distribution with minimal reshuffling
263
+
264
+ **Mechanisms imported:**
265
+ - Unit circle: map both keys and nodes to positions on a ring (0 to 2^32)
266
+ - Proximity: a key is owned by the nearest node clockwise on the ring
267
+ - Continuity: when a node leaves, only its immediate neighbors are affected
268
+
269
+ **Emergent properties:**
270
+ - O(1/N) key remapping when a node joins/leaves (vs. O(N) for naive modular hashing)
271
+ - Load balancing with virtual nodes: multiple ring positions per physical node
272
+ - Predictable ownership: any node can independently determine key ownership
273
+
274
+ **Real-world validation:** Amazon Dynamo (2007), Apache Cassandra, Riak, Discord's message routing, Akamai CDN (the original application)
275
+
276
+ **Where it breaks:**
277
+ - Non-uniform hash distribution: requires virtual nodes for real load balance
278
+ - Doesn't account for heterogeneous node capacity out of the box
279
+ - Hotspot risk: adjacent keys all route to the same node
280
+ - Consistent hashing is consistent in ownership assignment, not in data consistency (confusing naming)
281
+
282
+ **What the breakdown reveals:** The ring topology treats the address space as a geometric object rather than an arithmetic one. Virtual nodes are the engineering workaround for what is fundamentally a statistical distribution problem — you need enough random points on the ring to approximate uniform coverage.
283
+
284
+ ---
285
+
286
+ ## Architecture & Urban Planning
287
+
288
+ ### Software Design Patterns (GoF, 1994)
289
+
290
+ **Source domain:** Christopher Alexander's architectural pattern language ("A Pattern Language," 1977)
291
+ **Target problem:** Cataloging reusable solutions to recurring object-oriented design problems
292
+ **Structural type:** Knowledge transfer and vocabulary for design decisions
293
+
294
+ **Mechanisms imported:**
295
+ - Pattern as a named, reusable solution to a recurring problem in context
296
+ - Pattern language: patterns connect and reference each other, forming a vocabulary
297
+ - Generative grammar: patterns are rules for generating good designs
298
+ - Context/problem/solution structure: each pattern has a specific applicability domain
299
+
300
+ **Transfer path:** Kent Beck & Ward Cunningham applied Alexander's patterns to Smalltalk OOP at OOPSLA 1987 → Gang of Four (GoF) systematized 23 OO patterns in 1994
301
+
302
+ **Emergent properties:**
303
+ - Shared vocabulary: "use a Factory here" communicates more than the code would
304
+ - Pattern composition: patterns reference and complement each other
305
+ - Codified judgment: captures design wisdom that was previously tacit
306
+ - Documentation standard: the pattern format became the template for communicating design decisions
307
+
308
+ **Real-world validation:** GoF "Design Patterns" is one of the best-selling programming books ever; patterns permeate code review vocabulary across all languages
309
+
310
+ **Where it breaks:**
311
+ - Peter Norvig showed 16 of 23 GoF patterns are invisible or simplified in Lisp — patterns are workarounds for language limitations
312
+ - Patterns are overused: applied where they don't fit, adding complexity without solving a real problem
313
+ - The analogy to architecture is limited: software patterns don't generate buildings, they provide vocabulary
314
+ - Alexander himself was ambivalent about the application to software
315
+
316
+ **What the breakdown reveals:** Patterns expose language weaknesses. In languages with first-class functions, higher-order types, and macros, many GoF patterns collapse into idioms. The "pattern" is often a workaround for a missing abstraction, not a fundamental design principle.
317
+
318
+ ---
319
+
320
+ ## Actor Model (1973, Carl Hewitt, MIT)
321
+
322
+ **Source domain:** General relativity and quantum mechanics — locality, no global state, message-passing as sole interaction
323
+ **Target problem:** Modeling concurrent computation without shared mutable state
324
+ **Structural type:** Distributed, asynchronous, message-based concurrency
325
+
326
+ **Mechanisms imported:**
327
+ - Locality: no action can have instantaneous non-local effects (from relativity)
328
+ - Message-passing: all interaction is via message, no shared memory (from QM)
329
+ - Independent state: each actor encapsulates its own state exclusively
330
+ - Asynchronous: messages are sent without waiting for a response
331
+
332
+ **Emergent properties:**
333
+ - No deadlocks from shared state (though livelock and starvation still possible)
334
+ - Location transparency: actors can move between machines without changing message semantics
335
+ - Supervision hierarchies: actors can supervise child actors and restart them on failure
336
+ - Natural fit for distributed systems: local and remote actors look identical
337
+
338
+ **Real-world validation:** Erlang/OTP (designed for Ericsson telecom systems with 9-nines uptime), Akka (JVM), Orleans (.NET), Twitter's infrastructure
339
+
340
+ **Where it breaks:**
341
+ - No guaranteed message ordering between actors
342
+ - Debugging is difficult: non-deterministic message interleaving
343
+ - A global scheduler still exists — the system isn't truly distributed in the physics sense
344
+ - Actor granularity is a design challenge: too fine = overhead, too coarse = contention
345
+
346
+ **What the breakdown reveals:** Hewitt imported the constraint from physics (no global state, no instantaneous action at a distance) because that constraint is what forces distributed systems to work correctly. The breakdown — that a real scheduler exists — reveals that pure actor systems are an idealization, and real implementations must decide where to allow controlled synchrony.
347
+
348
+ ---
349
+
350
+ ## Summary: What Makes These Transfers Work
351
+
352
+ Looking across all these examples, the successful cross-domain transfers share four properties:
353
+
354
+ | Property | What It Looks Like |
355
+ |----------|-------------------|
356
+ | **Structural isomorphism** | The relational structure of the source domain maps to the target — not just surface labels |
357
+ | **Mechanism import** | A specific causal mechanism (not just a pattern name) is borrowed whole |
358
+ | **Productive breakdown** | The places where the analogy fails reveal genuine design decisions that need to be made |
359
+ | **Emergent properties** | The collision produces capabilities that neither domain had alone |
360
+
361
+ And the common failure mode: importing vocabulary without mechanisms. "Let's treat our services like microorganisms" is not a collision until you ask: what is the immune response? What is horizontal gene transfer? What is a biofilm?
362
+
363
+ ---
364
+
365
+ ## Best Source Domains by Problem Type (Validated)
366
+
367
+ | Problem Type | Best Source Domain | Proof |
368
+ |-------------|-------------------|-------|
369
+ | Optimization over unknown landscape | Evolution / genetics | Genetic algorithms, neural architecture search |
370
+ | Failure isolation | Electrical engineering | Circuit breaker pattern |
371
+ | Membership testing under memory constraints | Probabilistic mathematics | Bloom filters |
372
+ | Distributed computation | Functional programming + manufacturing | MapReduce |
373
+ | Concurrent state management | Physics (relativity/QM) | Actor model |
374
+ | Audit trails and state history | Accounting / double-entry bookkeeping | Event sourcing |
375
+ | Dynamic load distribution | Geometric topology | Consistent hashing |
376
+ | Design vocabulary | Architecture / urban planning | Design patterns |
377
+ | Anomaly / intrusion detection | Immunology | Artificial immune systems |
378
+ | Async data flow | Electronics / signal processing | Reactive programming |
379
+
380
+ ---
381
+
382
+ ## Underexplored Source Domains (High Potential)
383
+
384
+ These have strong structural richness but are underused in software:
385
+
386
+ | Domain | Mechanisms Available | Example Application |
387
+ |--------|---------------------|---------------------|
388
+ | **Epidemiology** | R0, herd immunity, quarantine, vectors, super-spreaders | Viral feature adoption modeling, bug propagation in large codebases |
389
+ | **Ecology / food webs** | Trophic cascades, keystone species, carrying capacity | Dependency graph analysis, team organization |
390
+ | **Fluid dynamics** | Reynolds number, turbulence, boundary layers, viscosity | Network congestion modeling, API throughput |
391
+ | **Game theory** | Nash equilibria, dominant strategies, mechanism design | Incentive-compatible API design, distributed consensus |
392
+ | **Traffic engineering** | Braess's paradox, induced demand, signal timing | Load balancing, CDN routing, microservice mesh design |
393
+ | **Materials science** | Fatigue, creep, brittleness, toughness | Software reliability under sustained load |
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "name": "superpowers:problem-solving/collision-zone-thinking",
4
+ "title": "Collision-Zone Thinking",
5
+ "aliases": [
6
+ "collision-zone-thinking",
7
+ "problem-solving/collision-zone-thinking"
8
+ ]
9
+ }