@complexthings/superpowers-agent 9.2.1 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/claude-handoff/SKILL.md +18 -0
- package/.agents/skills/code-review/SKILL.md +89 -0
- package/.agents/skills/{improve-codebase-architecture → codebase-design}/DEEPENING.md +1 -1
- package/.agents/skills/{improve-codebase-architecture/INTERFACE-DESIGN.md → codebase-design/DESIGN-IT-TWICE.md} +3 -3
- package/.agents/skills/codebase-design/SKILL.md +114 -0
- package/.agents/skills/design-an-interface/SKILL.md +94 -0
- package/.agents/skills/{diagnose → diagnosing-bugs}/SKILL.md +29 -12
- package/.agents/skills/{grill-with-docs → domain-modeling}/CONTEXT-FORMAT.md +1 -4
- package/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/.agents/skills/fable-mode/SKILL.md +95 -0
- package/.agents/skills/git-guardrails-claude-code/SKILL.md +95 -0
- package/.agents/skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
- package/.agents/skills/grill-me/SKILL.md +7 -0
- package/.agents/skills/grill-with-docs/SKILL.md +3 -86
- package/.agents/skills/grilling/SKILL.md +14 -0
- package/.agents/skills/handoff/SKILL.md +2 -1
- package/.agents/skills/i-have-adhd/SKILL.md +120 -0
- package/.agents/skills/implement/SKILL.md +11 -0
- package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +3 -3
- package/.agents/skills/improve-codebase-architecture/SKILL.md +13 -28
- package/.agents/skills/loop-me/SKILL.md +32 -0
- package/.agents/skills/prototype/SKILL.md +1 -1
- package/.agents/skills/qa/SKILL.md +130 -0
- package/.agents/skills/request-refactor-plan/SKILL.md +68 -0
- package/.agents/skills/research/SKILL.md +12 -0
- package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/.agents/skills/scaffold-exercises/SKILL.md +106 -0
- package/.agents/skills/setup-matt-pocock-skills/SKILL.md +11 -9
- package/.agents/skills/setup-matt-pocock-skills/domain.md +2 -2
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +23 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +23 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +11 -0
- package/.agents/skills/skill-creator/LICENSE.txt +202 -0
- package/.agents/skills/skill-creator/SKILL.md +485 -0
- package/.agents/skills/skill-creator/agents/analyzer.md +274 -0
- package/.agents/skills/skill-creator/agents/comparator.md +202 -0
- package/.agents/skills/skill-creator/agents/grader.md +223 -0
- package/.agents/skills/skill-creator/assets/eval_review.html +146 -0
- package/.agents/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.agents/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.agents/skills/skill-creator/references/schemas.md +430 -0
- package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
- package/.agents/skills/skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/.agents/skills/skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
- package/.agents/skills/skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
- package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.agents/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.agents/skills/skill-creator/scripts/improve_description.py +247 -0
- package/.agents/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.agents/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.agents/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.agents/skills/skill-creator/scripts/run_loop.py +328 -0
- package/.agents/skills/skill-creator/scripts/utils.py +47 -0
- package/.agents/skills/tdd/SKILL.md +17 -90
- package/.agents/skills/tdd/tests.md +16 -0
- package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/.agents/skills/teach/SKILL.md +140 -0
- package/.agents/skills/{to-prd → to-spec}/SKILL.md +11 -12
- package/.agents/skills/to-tickets/SKILL.md +114 -0
- package/.agents/skills/triage/AGENT-BRIEF.md +40 -1
- package/.agents/skills/triage/OUT-OF-SCOPE.md +5 -1
- package/.agents/skills/triage/SKILL.md +20 -11
- package/.agents/skills/wayfinder/SKILL.md +127 -0
- package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
- package/.agents/skills/writing-great-skills/SKILL.md +83 -0
- package/.agents/superpowers-agent +103 -222
- package/.agents/superpowers-bootstrap.md +3 -3
- package/.agents/templates/AGENTS.md.template +11 -34
- package/.agents/templates/SUPERPOWERS.md.template +4 -4
- package/.github/copilot-instructions.md +23 -99
- package/.github/hooks/rtk-rewrite.json +22 -0
- package/AGENTS.md +7 -6
- package/README.md +53 -174
- package/package.json +2 -2
- package/skills/collaboration/brainstorming/SKILL.md +39 -139
- package/skills/collaboration/brainstorming/skill.json +2 -2
- package/skills/collaboration/leveraging-cli-tools/SKILL.md +70 -71
- package/skills/collaboration/leveraging-cli-tools/references/copilot-instructions.md +30 -0
- package/skills/collaboration/leveraging-cli-tools/scripts/setup-ponytail.sh +185 -0
- package/skills/collaboration/leveraging-cli-tools/scripts/setup-rtk.sh +217 -0
- package/skills/collaboration/leveraging-cli-tools/skill.json +1 -1
- package/skills/meta/create-skill-json/SKILL.md +4 -4
- package/skills/meta/create-skill-json/skill.json +1 -1
- package/skills/meta/create-skill-json/test-scenarios.md +1 -1
- package/skills/setup-skills/SKILL.md +18 -11
- package/skills/setup-skills/skill.json +8 -0
- package/.agents/skills/caveman/SKILL.md +0 -49
- package/.agents/skills/improve-codebase-architecture/LANGUAGE.md +0 -53
- package/.agents/skills/karpathy-guidelines/SKILL.md +0 -75
- package/.agents/skills/review/SKILL.md +0 -78
- package/.agents/skills/tdd/deep-modules.md +0 -33
- package/.agents/skills/tdd/interface-design.md +0 -31
- package/.agents/skills/tdd/refactoring.md +0 -10
- package/.agents/skills/to-issues/SKILL.md +0 -83
- package/.agents/skills/zoom-out/SKILL.md +0 -7
- package/skills/architecture/ABOUT.md +0 -20
- package/skills/architecture/preserving-productive-tensions/SKILL.md +0 -146
- package/skills/architecture/preserving-productive-tensions/skill.json +0 -9
- package/skills/collaboration/brainstorming/spec-document-reviewer-prompt.md +0 -50
- package/skills/collaboration/brainstorming/visual-companion.md +0 -277
- package/skills/collaboration/dispatching-parallel-agents/SKILL.md +0 -174
- package/skills/collaboration/dispatching-parallel-agents/skill.json +0 -9
- package/skills/collaboration/executing-plans/SKILL.md +0 -130
- package/skills/collaboration/executing-plans/skill.json +0 -9
- package/skills/collaboration/finishing-a-development-branch/SKILL.md +0 -261
- package/skills/collaboration/finishing-a-development-branch/skill.json +0 -9
- package/skills/collaboration/leveraging-cli-tools/scripts/slim.py +0 -167
- package/skills/collaboration/receiving-code-review/SKILL.md +0 -233
- package/skills/collaboration/receiving-code-review/skill.json +0 -9
- package/skills/collaboration/requesting-code-review/SKILL.md +0 -110
- package/skills/collaboration/requesting-code-review/code-reviewer.md +0 -146
- package/skills/collaboration/requesting-code-review/skill.json +0 -12
- package/skills/collaboration/subagent-driven-development/SKILL.md +0 -255
- package/skills/collaboration/subagent-driven-development/code-quality-reviewer-prompt.md +0 -26
- package/skills/collaboration/subagent-driven-development/implementer-prompt.md +0 -113
- package/skills/collaboration/subagent-driven-development/skill.json +0 -15
- package/skills/collaboration/subagent-driven-development/spec-reviewer-prompt.md +0 -61
- package/skills/collaboration/using-git-worktrees/SKILL.md +0 -366
- package/skills/collaboration/using-git-worktrees/skill.json +0 -9
- package/skills/collaboration/writing-plans/SKILL.md +0 -121
- package/skills/collaboration/writing-plans/plan-document-reviewer-prompt.md +0 -52
- package/skills/collaboration/writing-plans/skill.json +0 -9
- package/skills/debugging/defense-in-depth/SKILL.md +0 -380
- package/skills/debugging/defense-in-depth/skill.json +0 -9
- package/skills/debugging/root-cause-tracing/SKILL.md +0 -361
- package/skills/debugging/root-cause-tracing/find-polluter.sh +0 -63
- package/skills/debugging/root-cause-tracing/skill.json +0 -12
- package/skills/debugging/systematic-debugging/SKILL.md +0 -299
- package/skills/debugging/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/skills/debugging/systematic-debugging/condition-based-waiting.md +0 -115
- package/skills/debugging/systematic-debugging/defense-in-depth.md +0 -122
- package/skills/debugging/systematic-debugging/find-polluter.sh +0 -63
- package/skills/debugging/systematic-debugging/root-cause-tracing.md +0 -169
- package/skills/debugging/systematic-debugging/skill.json +0 -9
- package/skills/debugging/systematic-debugging/test-academic.md +0 -14
- package/skills/debugging/systematic-debugging/test-pressure-1.md +0 -58
- package/skills/debugging/systematic-debugging/test-pressure-2.md +0 -68
- package/skills/debugging/systematic-debugging/test-pressure-3.md +0 -69
- package/skills/debugging/verification-before-completion/SKILL.md +0 -143
- package/skills/debugging/verification-before-completion/skill.json +0 -9
- package/skills/finding-skills/SKILL.md +0 -101
- package/skills/finding-skills/skill.json +0 -8
- package/skills/meta/create-agents-md/SKILL.md +0 -182
- package/skills/meta/create-agents-md/skill.json +0 -9
- package/skills/meta/creating-prompts/SKILL.md +0 -349
- package/skills/meta/creating-prompts/examples/do-example.md +0 -65
- package/skills/meta/creating-prompts/examples/plan-example.md +0 -75
- package/skills/meta/creating-prompts/examples/refine-example.md +0 -65
- package/skills/meta/creating-prompts/examples/research-example.md +0 -63
- package/skills/meta/creating-prompts/scripts/get-next-number.sh +0 -27
- package/skills/meta/creating-prompts/skill.json +0 -20
- package/skills/meta/creating-prompts/templates/do-template.md +0 -59
- package/skills/meta/creating-prompts/templates/plan-template.md +0 -58
- package/skills/meta/creating-prompts/templates/refine-template.md +0 -54
- package/skills/meta/creating-prompts/templates/research-template.md +0 -56
- package/skills/meta/using-superpowers/SKILL.md +0 -108
- package/skills/meta/using-superpowers/skill.json +0 -5
- package/skills/meta/writing-prompts/SKILL.md +0 -122
- package/skills/meta/writing-prompts/references/platforms.md +0 -114
- package/skills/meta/writing-prompts/skill.json +0 -9
- package/skills/problem-solving/ABOUT.md +0 -40
- package/skills/problem-solving/collision-zone-thinking/SKILL.md +0 -188
- package/skills/problem-solving/collision-zone-thinking/references/historical-examples.md +0 -393
- package/skills/problem-solving/collision-zone-thinking/skill.json +0 -9
- package/skills/problem-solving/inversion-exercise/SKILL.md +0 -174
- package/skills/problem-solving/inversion-exercise/skill.json +0 -9
- package/skills/problem-solving/meta-pattern-recognition/SKILL.md +0 -116
- package/skills/problem-solving/meta-pattern-recognition/skill.json +0 -9
- package/skills/problem-solving/scale-game/SKILL.md +0 -222
- package/skills/problem-solving/scale-game/skill.json +0 -9
- package/skills/problem-solving/simplification-cascades/SKILL.md +0 -113
- package/skills/problem-solving/simplification-cascades/skill.json +0 -9
- package/skills/problem-solving/when-stuck/SKILL.md +0 -69
- package/skills/problem-solving/when-stuck/skill.json +0 -9
- package/skills/research/ABOUT.md +0 -20
- package/skills/research/tracing-knowledge-lineages/SKILL.md +0 -241
- package/skills/research/tracing-knowledge-lineages/skill.json +0 -9
- package/skills/testing/condition-based-waiting/SKILL.md +0 -359
- package/skills/testing/condition-based-waiting/example.ts +0 -158
- package/skills/testing/condition-based-waiting/skill.json +0 -12
- package/skills/testing/test-driven-development/SKILL.md +0 -434
- package/skills/testing/test-driven-development/skill.json +0 -9
- package/skills/testing/testing-anti-patterns/SKILL.md +0 -298
- package/skills/testing/testing-anti-patterns/skill.json +0 -9
- package/skills/testing/verification-before-completion/SKILL.md +0 -246
- package/skills/testing/verification-before-completion/skill.json +0 -10
- package/skills/using-a-skill/SKILL.md +0 -101
- package/skills/using-a-skill/skill.json +0 -8
- /package/.agents/skills/{diagnose → diagnosing-bugs}/scripts/hitl-loop.template.sh +0 -0
- /package/.agents/skills/{grill-with-docs → domain-modeling}/ADR-FORMAT.md +0 -0
|
@@ -1,393 +0,0 @@
|
|
|
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 |
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: inversion-exercise
|
|
3
|
-
description: Flip core assumptions to reveal hidden constraints and alternative approaches. Use this when stuck on "the only way" to solve a problem, during architecture or design decisions, at code review or project pre-mortems, when a solution feels forced, or anytime assumptions need stress-testing. Inversion bypasses confirmation bias by asking "how would this fail?" instead of "how do we succeed?" — a mental move that surfaces what forward thinking misses. Apply it proactively before major decisions, not just when stuck.
|
|
4
|
-
metadata:
|
|
5
|
-
when_to_use: when stuck on unquestioned assumptions or feeling forced into "the only way" to do something; also proactively before architecture decisions, API design, or project kickoffs
|
|
6
|
-
version: 2.0.0
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Inversion Exercise
|
|
10
|
-
|
|
11
|
-
## Why This Works
|
|
12
|
-
|
|
13
|
-
Carl Jacobi (the mathematician) discovered that many hard problems are easier when restated in inverse form. Charlie Munger applied this principle everywhere: "Invert, always invert."
|
|
14
|
-
|
|
15
|
-
> "All I want to know is where I'm going to die, so I'll never go there." — Charlie Munger
|
|
16
|
-
|
|
17
|
-
The cognitive mechanism: your brain cannot easily generate failure modes when it is focused on success. But it is surprisingly good at generating them when you ask for them directly. Inversion is an *access method* for a different cognitive pathway — one that bypasses optimism bias and confirmation bias.
|
|
18
|
-
|
|
19
|
-
**The practical upshot:** avoiding obvious stupidity is more tractable than seeking brilliance. Most production outages are not caused by missing brilliant features — they're caused by unexamined failure modes.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## The Four Forms of Inversion
|
|
24
|
-
|
|
25
|
-
### 1. Goal Inversion (Pre-Mortem)
|
|
26
|
-
|
|
27
|
-
Instead of "how do we succeed?", ask "how would we fail?"
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
FORWARD: "How do we make this deployment succeed?"
|
|
31
|
-
INVERTED: "Assume it's 6 months from now and this deployment failed badly.
|
|
32
|
-
What happened?"
|
|
33
|
-
|
|
34
|
-
Typical answers: no rollback plan, untested migration, no monitoring alerts,
|
|
35
|
-
deployed on Friday, insufficient load testing
|
|
36
|
-
|
|
37
|
-
These aren't hypotheticals — they're your checklist.
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Gary Klein (HBR 2007) formalized this as the **Failure Pre-mortem**. The grammatical shift from "might fail" to "did fail" grants permission to voice concerns in an environment where optimism is rewarded. It makes it safe to be pessimistic.
|
|
41
|
-
|
|
42
|
-
**Use this at:** project kickoffs, architecture decisions, release planning, code review.
|
|
43
|
-
|
|
44
|
-
### 2. Assumption Inversion (Flip Core Beliefs)
|
|
45
|
-
|
|
46
|
-
Challenge what you believe about how the system works.
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
ASSUMPTION: "Clients must poll for updates"
|
|
50
|
-
INVERTED: "What if the server pushes updates?"
|
|
51
|
-
REVEALS: WebSockets, Server-Sent Events, webhooks
|
|
52
|
-
|
|
53
|
-
ASSUMPTION: "Data must be normalized in tables with strict schemas"
|
|
54
|
-
INVERTED: "What if data were denormalized with flexible schemas?"
|
|
55
|
-
REVEALS: Document stores, key-value stores — each optimized for different patterns
|
|
56
|
-
|
|
57
|
-
ASSUMPTION: "We must make this faster"
|
|
58
|
-
INVERTED: "What if we made this intentionally slower in places?"
|
|
59
|
-
REVEALS: Debounce search (add latency → better results), rate limiting,
|
|
60
|
-
lazy loading (delay → reduce initial load)
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 3. Perspective Inversion (Opposite Stakeholder)
|
|
64
|
-
|
|
65
|
-
View from the opposing party.
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
API DESIGNER: "What do we want to expose?"
|
|
69
|
-
INVERTED: "What does the caller actually need to call?"
|
|
70
|
-
REVEALS: Consumer-driven contracts; Amazon's "write the press release first"
|
|
71
|
-
|
|
72
|
-
CODE AUTHOR: "Does this code work?"
|
|
73
|
-
INVERTED: "Under what conditions would this code fail?"
|
|
74
|
-
REVEALS: Edge cases, race conditions, input assumptions
|
|
75
|
-
|
|
76
|
-
DEFENDER: "How do we secure this system?"
|
|
77
|
-
INVERTED: "If I were an attacker, how would I break in?"
|
|
78
|
-
REVEALS: Threat modeling, red team exercises, STRIDE analysis
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### 4. Process Inversion (Reverse the Sequence)
|
|
82
|
-
|
|
83
|
-
Reverse the order of steps.
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
NORMAL: Write code → write tests to verify it
|
|
87
|
-
INVERTED: Write tests (specification) → write code to satisfy them (TDD)
|
|
88
|
-
REVEALS: Forces you to think about the contract before implementation;
|
|
89
|
-
surfaces design problems earlier; ensures tests test behavior
|
|
90
|
-
|
|
91
|
-
NORMAL: Big batch releases, high-ceremony
|
|
92
|
-
INVERTED: Ship every commit; make deployment boring; test in production
|
|
93
|
-
REVEALS: The pain of releases was caused by their infrequency (CI/CD)
|
|
94
|
-
|
|
95
|
-
NORMAL: A class creates its own dependencies
|
|
96
|
-
INVERTED: A framework provides dependencies to the class (IoC/DI)
|
|
97
|
-
REVEALS: Testable, loosely coupled code; each class only knows interfaces
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## The Process
|
|
103
|
-
|
|
104
|
-
**Step 1: State the goal clearly**
|
|
105
|
-
Write it as a single sentence: "I want X."
|
|
106
|
-
|
|
107
|
-
**Step 2: Flip it**
|
|
108
|
-
"What would *guarantee* NOT-X?" or "What would *make* this fail?"
|
|
109
|
-
|
|
110
|
-
**Step 3: Generate freely on the inverted question**
|
|
111
|
-
Don't filter. List everything. The items that feel uncomfortable to acknowledge are often the most important.
|
|
112
|
-
|
|
113
|
-
**Step 4: Translate back**
|
|
114
|
-
Each item on the inverted list is a design constraint, checklist item, or thing to stop doing. Ask: "If this would cause failure, what does that tell me about what success requires?" The inverted list is often your real answer in disguise.
|
|
115
|
-
|
|
116
|
-
**Step 5: Combine with forward thinking**
|
|
117
|
-
Inversion shows you what to *avoid* and what *constraints* you're operating under. Forward thinking shows you what to *build*. Use both.
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Software Patterns That *Are* Inversion
|
|
122
|
-
|
|
123
|
-
Recognizing these helps you understand *why* they work — and when to reach for them:
|
|
124
|
-
|
|
125
|
-
| Pattern | The Inversion | What It Unlocks |
|
|
126
|
-
|---------|--------------|-----------------|
|
|
127
|
-
| **TDD** | Write proof before code | Tests actually test behavior; design problems surface early |
|
|
128
|
-
| **Dependency Inversion (SOLID)** | High-level doesn't depend on low-level | Abstractions own interfaces; implementations are plugins |
|
|
129
|
-
| **IoC / DI** | Framework calls your code, not vice versa | Testable, loosely coupled, swappable implementations |
|
|
130
|
-
| **Immutability** | State never changes; new values replace old | No shared mutable state bugs; trivially thread-safe |
|
|
131
|
-
| **Result types** | Functions return error-or-value instead of throwing | Errors are explicit in the type system; no surprise exceptions |
|
|
132
|
-
| **Consumer-driven contracts** | Provider doesn't define API shape; consumer does | API always matches real consumer needs |
|
|
133
|
-
| **Pre-mortem** | Assume failure, ask what happened | Surfaces what optimism hides |
|
|
134
|
-
| **Threat modeling** | "How would I attack this?" before building | Catch vulnerabilities at design time, not after breach |
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## When Inversion Is Especially Powerful
|
|
139
|
-
|
|
140
|
-
- **"There's only one way to do this"** — almost always wrong; inversion finds the alternatives
|
|
141
|
-
- **Solution feels forced or fights the system** — you're working against an inverted constraint
|
|
142
|
-
- **Can't articulate *why* the current approach is necessary** — the assumption may not hold
|
|
143
|
-
- **About to make an irreversible decision** — pre-mortem first, always
|
|
144
|
-
- **Building something that "should" be secure, fast, or correct** — invert to find where those properties break
|
|
145
|
-
- **Starting a new project or architecture** — "how would this fail in 12 months?" before a single line of code
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Failure Modes of Inversion
|
|
150
|
-
|
|
151
|
-
**False dichotomies:** Not every problem has a clean opposite. "How do we make users happy?" doesn't cleanly invert. Inversion works best when the domain is genuinely bipolar.
|
|
152
|
-
|
|
153
|
-
**Mistaking the inverted list for a complete solution:** The pre-mortem identifies failure modes, not solutions. "Here's how we'd fail" → "here's our mitigation plan" is additional work.
|
|
154
|
-
|
|
155
|
-
**Over-correcting on the inverted insight:** "Ship less frequently caused problems" doesn't mean "ship every 5 minutes without review." The inversion reveals the direction of improvement, not the optimal point.
|
|
156
|
-
|
|
157
|
-
**Stopping at the inversion:** Inversion gives you the floor (don't do these things). It doesn't give you the ceiling (what excellent looks like). Combine with forward thinking.
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Quick Reference
|
|
162
|
-
|
|
163
|
-
| Want to... | Inversion move |
|
|
164
|
-
|-----------|---------------|
|
|
165
|
-
| Stress-test an architecture | Pre-mortem: "It failed in 12 months — why?" |
|
|
166
|
-
| Design a better API | "What would make this API impossible to use?" |
|
|
167
|
-
| Find security holes | "How would an attacker break this?" |
|
|
168
|
-
| Improve code quality | "Under what conditions does this code fail?" |
|
|
169
|
-
| Improve a process | "What would we do to guarantee this process fails?" |
|
|
170
|
-
| Escape a local maximum | "What assumption am I making that isn't necessarily true?" |
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
> "Spend less time trying to be brilliant and more time trying to avoid obvious stupidity." — Shane Parrish
|