@polderlabs/bizar 10.7.1 → 10.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/.claude/agents/_shared/AGENT_BASELINE.md +266 -0
  2. package/.claude/agents/_shared/CLAUDE_TOOLS.md +412 -0
  3. package/.claude/agents/_shared/SKILLS.md +109 -0
  4. package/.claude/agents/brand-designer.md +55 -0
  5. package/.claude/agents/exec-assistant.md +34 -0
  6. package/.claude/agents/help-desk.md +44 -0
  7. package/.claude/agents/it-lead.md +53 -0
  8. package/.claude/agents/knowledge-manager.md +49 -0
  9. package/.claude/agents/office-coordinator.md +39 -0
  10. package/.claude/agents/office-greeter.md +53 -0
  11. package/.claude/agents/office-manager.md +287 -0
  12. package/.claude/agents/principal-engineer.md +58 -0
  13. package/.claude/agents/qa-reviewer.md +51 -0
  14. package/.claude/agents/research-analyst.md +53 -0
  15. package/.claude/agents/senior-engineer.md +55 -0
  16. package/.claude/agents/support-tech.md +87 -0
  17. package/.claude/agents/vp-engineering.md +54 -0
  18. package/.claude/commands/audit.md +48 -0
  19. package/.claude/commands/bizar.md +22 -0
  20. package/.claude/commands/cron.md +36 -0
  21. package/.claude/commands/explain.md +17 -0
  22. package/.claude/commands/goal.md +99 -0
  23. package/.claude/commands/init.md +15 -0
  24. package/.claude/commands/learn.md +46 -0
  25. package/.claude/commands/plan.md +35 -0
  26. package/.claude/commands/plow-through.md +50 -0
  27. package/.claude/commands/pr-review.md +49 -0
  28. package/.claude/commands/setup-provider.md +96 -0
  29. package/.claude/commands/spec.md +47 -0
  30. package/.claude/commands/sprint.md +43 -0
  31. package/.claude/commands/tailscale-serve.md +100 -0
  32. package/.claude/commands/team.md +132 -0
  33. package/.claude/commands/test.md +62 -0
  34. package/.claude/commands/validate.md +68 -0
  35. package/.claude/commands/visual-plan.md +24 -0
  36. package/.claude/hooks/README.md +108 -0
  37. package/.claude/hooks/__tests__/pretooluse-editwrite.test.mjs +146 -0
  38. package/.claude/hooks/__tests__/sessionend-recall.test.mjs +256 -0
  39. package/.claude/hooks/__tests__/sessionstart-prime.test.mjs +325 -0
  40. package/.claude/hooks/__tests__/thinking-route.test.mjs +319 -0
  41. package/.claude/hooks/auto-instinct.sh +81 -0
  42. package/.claude/hooks/learning-extract.mjs +92 -0
  43. package/.claude/hooks/post-merge-audit.sh +93 -0
  44. package/.claude/hooks/posttooluse-editwrite.mjs +91 -0
  45. package/.claude/hooks/pretooluse-bash.mjs +87 -0
  46. package/.claude/hooks/pretooluse-editwrite.mjs +117 -0
  47. package/.claude/hooks/sessionend-recall.mjs +384 -0
  48. package/.claude/hooks/sessionstart-prime.mjs +278 -0
  49. package/.claude/hooks/thinking-route.mjs +314 -0
  50. package/.claude/hooks/worker-suggest.mjs +110 -0
  51. package/.claude/settings.json +167 -0
  52. package/.claude/skills/9router/SKILL.md +80 -0
  53. package/.claude/skills/9router-chat/SKILL.md +73 -0
  54. package/.claude/skills/9router-embeddings/SKILL.md +69 -0
  55. package/.claude/skills/9router-image/SKILL.md +86 -0
  56. package/.claude/skills/9router-stt/SKILL.md +79 -0
  57. package/.claude/skills/9router-tts/SKILL.md +80 -0
  58. package/.claude/skills/9router-web-fetch/SKILL.md +99 -0
  59. package/.claude/skills/9router-web-search/SKILL.md +91 -0
  60. package/.claude/skills/agent-browser/SKILL.md +64 -0
  61. package/.claude/skills/bizar/README.md +9 -0
  62. package/.claude/skills/bizar/SKILL.md +447 -0
  63. package/.claude/skills/cpp-coding-standards/README.md +28 -0
  64. package/.claude/skills/cpp-coding-standards/SKILL.md +634 -0
  65. package/.claude/skills/cpp-coding-standards/references/concurrency.md +320 -0
  66. package/.claude/skills/cpp-coding-standards/references/error-handling.md +229 -0
  67. package/.claude/skills/cpp-coding-standards/references/memory-safety.md +216 -0
  68. package/.claude/skills/cpp-coding-standards/references/modern-idioms.md +282 -0
  69. package/.claude/skills/cpp-coding-standards/references/review-checklist.md +96 -0
  70. package/.claude/skills/cpp-testing/README.md +28 -0
  71. package/.claude/skills/cpp-testing/SKILL.md +304 -0
  72. package/.claude/skills/cpp-testing/references/coverage.md +370 -0
  73. package/.claude/skills/cpp-testing/references/framework-compare.md +175 -0
  74. package/.claude/skills/cpp-testing/references/host-test-for-embedded.md +499 -0
  75. package/.claude/skills/cpp-testing/references/mocking.md +364 -0
  76. package/.claude/skills/cpp-testing/references/tdd-workflow.md +308 -0
  77. package/.claude/skills/cubesandbox/SKILL.md +148 -0
  78. package/.claude/skills/de-sloppify/SKILL.md +38 -0
  79. package/.claude/skills/de-sloppify/cleanup.mjs +253 -0
  80. package/.claude/skills/de-sloppify/cleanup.test.mjs +189 -0
  81. package/.claude/skills/embedded-esp-idf/README.md +41 -0
  82. package/.claude/skills/embedded-esp-idf/SKILL.md +439 -0
  83. package/.claude/skills/embedded-esp-idf/references/freertos-patterns.md +214 -0
  84. package/.claude/skills/embedded-esp-idf/references/host-tests.md +164 -0
  85. package/.claude/skills/embedded-esp-idf/references/idf-py-commands.md +157 -0
  86. package/.claude/skills/embedded-esp-idf/references/kconfig.md +159 -0
  87. package/.claude/skills/embedded-esp-idf/references/logging-discipline.md +118 -0
  88. package/.claude/skills/embedded-esp-idf/references/memory-and-iram.md +137 -0
  89. package/.claude/skills/embedded-esp-idf/references/nvs.md +121 -0
  90. package/.claude/skills/embedded-esp-idf/references/packed-structs.md +192 -0
  91. package/.claude/skills/embedded-esp-idf/scripts/idf_env.sh +47 -0
  92. package/.claude/skills/embedded-esp-idf/scripts/size_check.sh +77 -0
  93. package/.claude/skills/glyph/SKILL.md +163 -0
  94. package/.claude/skills/harness-engineering/SKILL.md +142 -0
  95. package/.claude/skills/lightrag/SKILL.md +81 -0
  96. package/.claude/skills/memory-protocol/SKILL.md +105 -0
  97. package/.claude/skills/obsidian/SKILL.md +306 -0
  98. package/.claude/skills/read-the-damn-docs/SKILL.md +113 -0
  99. package/.claude/skills/self-improvement/SKILL.md +64 -0
  100. package/.claude/skills/skillopt/SKILL.md +129 -0
  101. package/.claude/skills/thinking-archetypes/SKILL.md +90 -0
  102. package/.claude/skills/thinking-bayesian/SKILL.md +267 -0
  103. package/.claude/skills/thinking-bounded-rationality/SKILL.md +406 -0
  104. package/.claude/skills/thinking-circle-of-competence/SKILL.md +216 -0
  105. package/.claude/skills/thinking-cynefin/SKILL.md +70 -0
  106. package/.claude/skills/thinking-debiasing/SKILL.md +192 -0
  107. package/.claude/skills/thinking-dual-process/SKILL.md +282 -0
  108. package/.claude/skills/thinking-effectuation/SKILL.md +366 -0
  109. package/.claude/skills/thinking-feedback-loops/SKILL.md +464 -0
  110. package/.claude/skills/thinking-fermi-estimation/SKILL.md +263 -0
  111. package/.claude/skills/thinking-first-principles/SKILL.md +167 -0
  112. package/.claude/skills/thinking-five-whys-plus/SKILL.md +139 -0
  113. package/.claude/skills/thinking-inversion/SKILL.md +195 -0
  114. package/.claude/skills/thinking-jobs-to-be-done/SKILL.md +363 -0
  115. package/.claude/skills/thinking-kepner-tregoe/SKILL.md +154 -0
  116. package/.claude/skills/thinking-leverage-points/SKILL.md +390 -0
  117. package/.claude/skills/thinking-lindy-effect/SKILL.md +331 -0
  118. package/.claude/skills/thinking-map-territory/SKILL.md +111 -0
  119. package/.claude/skills/thinking-margin-of-safety/SKILL.md +330 -0
  120. package/.claude/skills/thinking-model-combination/SKILL.md +406 -0
  121. package/.claude/skills/thinking-model-router/SKILL.md +360 -0
  122. package/.claude/skills/thinking-model-selection/SKILL.md +341 -0
  123. package/.claude/skills/thinking-occams-razor/SKILL.md +129 -0
  124. package/.claude/skills/thinking-ooda/SKILL.md +127 -0
  125. package/.claude/skills/thinking-opportunity-cost/SKILL.md +360 -0
  126. package/.claude/skills/thinking-pre-mortem/SKILL.md +170 -0
  127. package/.claude/skills/thinking-probabilistic/SKILL.md +324 -0
  128. package/.claude/skills/thinking-red-team/SKILL.md +142 -0
  129. package/.claude/skills/thinking-regret-minimization/SKILL.md +335 -0
  130. package/.claude/skills/thinking-reversibility/SKILL.md +326 -0
  131. package/.claude/skills/thinking-scientific-method/SKILL.md +162 -0
  132. package/.claude/skills/thinking-second-order/SKILL.md +184 -0
  133. package/.claude/skills/thinking-socratic/SKILL.md +198 -0
  134. package/.claude/skills/thinking-steel-manning/SKILL.md +332 -0
  135. package/.claude/skills/thinking-systems/SKILL.md +238 -0
  136. package/.claude/skills/thinking-theory-of-constraints/SKILL.md +338 -0
  137. package/.claude/skills/thinking-thought-experiment/SKILL.md +354 -0
  138. package/.claude/skills/thinking-triz/SKILL.md +171 -0
  139. package/.claude/skills/thinking-via-negativa/SKILL.md +358 -0
  140. package/cli/install/postinstall.mjs +54 -28
  141. package/cli/install/postinstall.test.mjs +98 -0
  142. package/package.json +7 -2
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: thinking-occams-razor
3
+ description: Use when multiple causes could explain a bug — test the fewest-assumption hypothesis first; escalate to complex only when evidence forces it. Skip the full procedure when one step resolves it.
4
+ ---
5
+
6
+ # Occam's Razor
7
+
8
+ ## Overview
9
+
10
+ Occam's Razor states: among competing hypotheses that fit the evidence equally well, prefer the one with the fewest assumptions. This skill operationalizes that principle for debugging: **test the simplest hypothesis first, and escalate to complex explanations only when evidence forces it.**
11
+
12
+ The skill has a **trigger-shrink gate**: if the simplest hypothesis can be tested in one step, just test it — don't run the full enumeration-and-scoring procedure. Reserve the full procedure for situations where multiple hypotheses genuinely compete and the simplest is not obviously testable.
13
+
14
+ **Core Principle:** "Everything should be made as simple as possible, but no simpler." — Einstein
15
+
16
+ ## When to Use
17
+
18
+ - Multiple hypotheses could explain a bug and the simplest is NOT obviously testable in one step
19
+ - You're about to investigate a complex hypothesis without first testing a simpler one
20
+ - Architecture or design decisions where several approaches are viable and differ in complexity
21
+ - Root cause analysis where several causes seem plausible
22
+
23
+ Decision flow:
24
+
25
+ ```
26
+ Multiple explanations exist?
27
+ → No → Use the available explanation
28
+ → Yes → Can the simplest be tested in one step?
29
+ → Yes → JUST TEST IT (trigger-shrink — skip full procedure)
30
+ → No → Do they explain the evidence equally well?
31
+ → No → Prefer the better explanation
32
+ → Yes → RUN FULL OCCAM'S RAZOR PROCEDURE
33
+ ```
34
+
35
+ ## When NOT to Use
36
+
37
+ - **Evidence already points to a specific cause.** Follow the evidence; don't downgrade to a "simpler" hypothesis it contradicts.
38
+ - **The domain is irreducibly complex** (distributed consensus, concurrency, security threat models). The simplest model is wrong; don't oversimplify ("but no simpler").
39
+ - **Only one plausible explanation exists.** There's nothing to compare — just test it.
40
+ - **"Simple" would mean ignoring a known interaction or skipping a load-bearing safeguard.** Local simplicity that creates systemic risk isn't parsimony.
41
+ - **The trigger check resolves it.** If you can test the simplest hypothesis in one step and it's confirmed, you're done — don't enumerate for completeness.
42
+
43
+ ## Trigger Card
44
+
45
+ Before running the full enumeration-and-scoring procedure, ask one question: **"Can I test the simplest hypothesis in one step?"**
46
+
47
+ 1. **Identify the simplest hypothesis** — the one with the fewest assumptions that still explains the evidence.
48
+ 2. **Can you test it in one step?** → Yes → **Just test it.** If confirmed, report and stop. If refuted, move to the next simplest.
49
+ 3. **If it can't be tested in one step** → run the full Occam's Razor procedure (enumerate, count assumptions, verify explanatory power, test in order).
50
+
51
+ If evidence already points to a specific cause, follow the evidence — don't downgrade to a "simpler" hypothesis it contradicts. For irreducibly complex domains (distributed consensus, concurrency), the simplest model is wrong.
52
+
53
+ ## Procedure
54
+
55
+ ### Trigger Check (Fast Path)
56
+
57
+ Before running the full procedure, ask: **"Can I test the simplest hypothesis in one step?"**
58
+
59
+ - Yes → Test it. If confirmed, report and stop. If falsified, move to the next simplest.
60
+ - No → The simplest hypothesis requires non-trivial investigation → run the full procedure below.
61
+
62
+ ### Full Procedure: When the Trigger Check Doesn't Resolve
63
+
64
+ #### Step 1: Enumerate Competing Hypotheses
65
+
66
+ List all plausible explanations for the observed behavior:
67
+
68
+ ```
69
+ Bug: Users intermittently can't log in
70
+
71
+ Hypotheses:
72
+ A. Session token expiration edge case
73
+ B. Race condition in auth service
74
+ C. Database connection pool exhaustion
75
+ D. Complex interaction between CDN cache, load balancer, and session service
76
+ ```
77
+
78
+ #### Step 2: Count Assumptions per Hypothesis
79
+
80
+ | Hypothesis | Assumptions |
81
+ |------------|-------------|
82
+ | A. Token expiration | 1. Token validation has an edge case |
83
+ | B. Race condition | 1. Concurrent requests possible, 2. Shared mutable state exists |
84
+ | C. DB pool exhaustion | 1. Pool is undersized, 2. Connections are leaking |
85
+ | D. Complex interaction | 1. CDN caches auth, 2. LB sticky sessions fail, 3. Session sync delayed |
86
+
87
+ Count each independent assumption: +1 per assumption, +1 per component involved, +2 per external dependency, +2 for timing-dependent behavior, +3 for rare conditions, +5 for "perfect storm" scenarios.
88
+
89
+ #### Step 3: Verify Explanatory Power
90
+
91
+ Ensure simpler hypotheses actually explain the evidence:
92
+
93
+ ```
94
+ Evidence: Failures correlate with high traffic periods
95
+ Hypothesis A (token edge case): Doesn't explain traffic correlation ✗
96
+ Hypothesis C (DB pool exhaustion): Explains traffic correlation ✓ — fewer assumptions than D
97
+ → PREFERRED by Occam's Razor
98
+ ```
99
+
100
+ #### Step 4: Test in Order of Fewest Assumptions
101
+
102
+ Investigate hypotheses from fewest to most assumptions. Do not skip to complex hypotheses until simple ones are ruled out.
103
+
104
+ #### Step 5: Escalate Complexity Only When Evidence Forces It
105
+
106
+ When simple explanations are ruled out with evidence, move to more complex ones. Never escalate on intuition alone.
107
+
108
+ ## Output Contract
109
+
110
+ A completed Occam's Razor analysis produces:
111
+
112
+ 1. **Trigger Check Result** — whether the simplest hypothesis was testable in one step
113
+ 2. **Hypothesis Ranking** — ordered by assumption count, with each hypothesis' assumptions listed
114
+ 3. **Explanatory Power Check** — which hypotheses fit the evidence
115
+ 4. **Test Order and Results** — which hypotheses were tested, in what order, and the outcome
116
+ 5. **Conclusion** — the confirmed hypothesis (or the next to test if unresolved)
117
+
118
+ For trigger-shrink cases, the output may be a single line: "Tested simplest hypothesis X — confirmed/refuted."
119
+
120
+ ## Anti-Patterns
121
+
122
+ | Anti-Pattern | Symptom | Correction |
123
+ |---|---|---|
124
+ | **Oversimplifying irreducible domains** | Applying "simplest" to distributed consensus or security models | "But no simpler" — respect domain complexity |
125
+ | **Complexity bias** | Assuming complex = sophisticated, testing complex hypotheses first | Test fewest-assumption hypotheses first, always |
126
+ | **Trigger inflation** | Running the full enumeration for a one-step test | If the simplest is one-step testable, just test it |
127
+ | **Ignoring explanatory power** | Choosing the simplest hypothesis that doesn't fit the evidence | Fewer assumptions doesn't beat not fitting the data |
128
+ | **Local simplicity, systemic risk** | Choosing a simple local fix that creates fragility elsewhere | Prefer systemic simplicity over local simplicity |
129
+ | **Ritualistic assumption counting** | Spending more time counting assumptions than testing | The point is prioritization, not precision; rough count is enough |
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: thinking-ooda
3
+ description: Use under time pressure (incident, outage, debugging a moving target) when you must act before you have certainty—cycle Observe→Orient→Decide→Act on ~70% confidence, then re-observe.
4
+ ---
5
+
6
+ # OODA Loop
7
+
8
+ ## Overview
9
+ The OODA Loop (Observe, Orient, Decide, Act) is a framework for acting in fast-moving, uncertain situations. The core decision rule: don't wait for certainty—act on the best current understanding, then immediately observe the result and loop again. Speed through the loop beats a perfect plan that arrives too late.
10
+
11
+ **Core Principle:** Act on ~70% confidence for reversible moves, then re-observe. Cycle faster than the situation changes.
12
+
13
+ ## When to Use
14
+ - Incident response and outages
15
+ - Debugging a moving target (intermittent failure, ongoing degradation)
16
+ - Any time-sensitive decision where the situation is still changing
17
+
18
+ ```
19
+ Situation changing rapidly AND need to act before certainty? → yes → APPLY OODA
20
+ → no → use deliberate analysis / a hypothesis differential
21
+ ```
22
+
23
+ ## When NOT to Use
24
+ - The situation is static and you have time → deliberate analysis beats fast looping.
25
+ - The action is irreversible/high-blast-radius → gather more information before acting; 70% confidence isn't enough.
26
+ - You can cheaply and directly localize the cause (read the diff/log) → use `thinking-scientific-method` (hypothesis differential) instead of looping in the dark.
27
+
28
+ ## Trigger Card
29
+
30
+ When under time pressure (incident, outage, debugging a moving target) and you must act before certainty:
31
+
32
+ 1. **Observe** — what is happening right now? Gather the cheapest, highest-signal data available.
33
+ 2. **Orient** — what does it mean given your mental model? Update the model if the data contradicts it.
34
+ 3. **Decide** — pick an action on ~70% confidence. Don't wait for 100%.
35
+ 4. **Act** — execute, then immediately re-observe. The loop is the point; speed beats precision.
36
+
37
+ If the action is irreversible or high-blast-radius, gather more information before acting. If you can cheaply localize the cause (read the diff/log), use `thinking-scientific-method` instead.
38
+
39
+ ## The Four Phases
40
+
41
+ ### 1. OBSERVE — gather current state fast
42
+ - Current metrics, logs, alerts, error rates
43
+ - What changed recently (deploys, config, traffic)
44
+ - Feedback from your last action
45
+ - Cast wide, then narrow as a pattern emerges. Time-box it—don't observe forever.
46
+
47
+ ```
48
+ Incident: error rate 10x normal; affects API gateway + user service;
49
+ started 5 min ago; a deploy went out 15 min ago; users report login failures.
50
+ ```
51
+
52
+ ### 2. ORIENT — make sense of it (the critical phase)
53
+ Match the observations to a pattern and form a hypothesis. This is where most loops go wrong: don't lock onto the first framing. Hold ≥2 candidate explanations and let new evidence shift you.
54
+
55
+ ```
56
+ Pattern resembles last month's connection-pool exhaustion, BUT no DB anomaly this time.
57
+ The deploy touched auth rate-limiting.
58
+ Hypothesis: rate-limit config is too aggressive.
59
+ ```
60
+
61
+ ### 3. DECIDE — pick an action under uncertainty
62
+ - State the action and the hypothesis it tests.
63
+ - 70% confidence now beats 90% too late, for a reversible action.
64
+ - Decide what you'll observe next to confirm or refute.
65
+
66
+ ```
67
+ Decision: roll back the auth deploy.
68
+ Hypothesis: this restores normal error rates.
69
+ Will watch: error rate for 2 minutes; fallback = investigate DB connections.
70
+ ```
71
+
72
+ ### 4. ACT — execute, then immediately re-observe
73
+ Execute decisively and go straight back to OBSERVE. The action creates new information; don't wait blindly for it to "settle."
74
+
75
+ ```
76
+ Action: roll back deployment/auth-service.
77
+ Immediate observe: error rate, response times, 2-minute window.
78
+ ```
79
+
80
+ The loop restarts until the system is stable.
81
+
82
+ ## What Speeds the Loop
83
+ | Speeds it up | Stalls it |
84
+ |--------------|-----------|
85
+ | Pre-planned responses for known scenarios | Waiting for certainty (stuck at Observe/Decide) |
86
+ | Good observability (fast, trustworthy signals) | Information overload (Observe never ends) |
87
+ | Clear hypotheses (fast Orient) | Locking onto one hypothesis (Orient lock) |
88
+ | Reversible actions you can undo | Seeking the perfect fix (Decide never ends) |
89
+
90
+ ## Application Patterns
91
+
92
+ ### Incident Response
93
+ ```
94
+ OBSERVE: metrics, logs, alerts, recent changes
95
+ ORIENT: match pattern, form ≥2 hypotheses, assess blast radius
96
+ DECIDE: mitigation (rollback, scale, disable feature)
97
+ ACT: execute, immediately observe results
98
+ LOOP: continue until stable
99
+ ```
100
+
101
+ ### Debugging Under Pressure
102
+ ```
103
+ OBSERVE: errors, stack traces, recent changes
104
+ ORIENT: form a hypothesis about the cause
105
+ DECIDE: test the most likely hypothesis first
106
+ ACT: add logging / try the fix / eliminate the possibility
107
+ LOOP: update the hypothesis from the result
108
+ ```
109
+
110
+ ## Common Failure Modes
111
+ | Failure | Symptom | Fix |
112
+ |---------|---------|-----|
113
+ | Observation overload | Can't process all data | Filter to key indicators |
114
+ | Orientation lock | Stuck on one hypothesis | Force a second framing |
115
+ | Decision paralysis | Waiting for certainty | Set a decision deadline; act on 70% |
116
+ | Action without observation | Blind execution | Mandate observe-after-act |
117
+ | Not actually looping | Stuck in one phase | Time-box each phase |
118
+
119
+ ## Key Questions
120
+ - "What do I observe RIGHT NOW?" (not 5 minutes ago)
121
+ - "What pattern does this match—and what's my second hypothesis?"
122
+ - "What's my best reversible action given current understanding?"
123
+ - "How will I know in the next 2 minutes whether it worked?"
124
+ - "Am I cycling, or stuck in one phase?"
125
+
126
+ ## Boyd's Insight
127
+ "He who can handle the quickest rate of change survives." The goal isn't just making decisions—it's making and revising them faster than the situation compounds. Speed creates options; delay eliminates them.
@@ -0,0 +1,360 @@
1
+ ---
2
+ name: thinking-opportunity-cost
3
+ description: Before committing scarce time/people/money to one thing, ask "what's the next-best use of these resources, and what does doing nothing cost?" — the real cost is the best option you skip.
4
+ ---
5
+
6
+ # Opportunity Cost Thinking
7
+
8
+ ## Two operative prompts (use these first)
9
+ 1. **Next-best alternative:** "If we didn't do this, what is the single best thing we'd do with the same resources instead?" That foregone option *is* the cost.
10
+ 2. **Explicit do-nothing:** "What happens if we change nothing?" Always put status quo on the list — it's often undervalued and sometimes wins.
11
+
12
+ If both answers are cheap/obvious, you don't need the full framework below — just decide.
13
+
14
+ ## Overview
15
+
16
+ Opportunity cost is the value of the next-best alternative foregone when making a choice. Every decision to do X is simultaneously a decision not to do Y, Z, and everything else. Engineers often focus on the value of their chosen path while underweighting what they're giving up.
17
+
18
+ **Core Principle:** The true cost of anything is what you give up to get it. A "free" option that consumes time has massive opportunity cost.
19
+
20
+ ## When to Use
21
+
22
+ - Resource allocation (time, money, people)
23
+ - Feature prioritization
24
+ - Build vs. buy decisions
25
+ - Technical debt evaluation
26
+ - Career decisions
27
+ - Architecture choices
28
+ - Saying "yes" to any commitment
29
+
30
+ Decision flow:
31
+
32
+ ```
33
+ Making a commitment?
34
+ → Have you considered what you're NOT doing? → no → APPLY OPPORTUNITY COST
35
+ → Is the foregone value significant? → yes → Factor into decision
36
+ ↘ no → Proceed
37
+ ```
38
+
39
+ ## When NOT to Use
40
+ - The choice is trivial or reversible and consumes negligible resources — deciding costs less than analyzing.
41
+ - There is no real alternative use for the resource (it's idle or earmarked) — no opportunity is being given up.
42
+ - The work is mandatory (compliance, security fix, hard dependency) — there's no optional alternative to weigh.
43
+ - You'd be inventing speculative alternatives to look rigorous — if the next-best option is clearly worse, just proceed.
44
+
45
+ ## Trigger Card
46
+
47
+ Before committing scarce time, people, or money to one thing:
48
+
49
+ 1. **Name the next-best alternative** — what would these resources do if not used here? Be specific.
50
+ 2. **Compare value** — what does the primary option deliver vs. the next-best? The real cost is what you give up.
51
+ 3. **Ask: "what does doing nothing cost?"** — sometimes the cheapest option is to wait. If delaying is free, consider it.
52
+
53
+ Skip if the work is mandatory (compliance, security fix, hard dependency) — there's no optional alternative. If the next-best option is clearly worse, don't manufacture alternatives to look rigorous.
54
+
55
+ ## The Opportunity Cost Framework
56
+
57
+ ### Step 1: Identify the Choice
58
+
59
+ State the decision explicitly:
60
+
61
+ ```
62
+ Choice: Build custom authentication system
63
+ Commitment: 3 engineers for 4 months
64
+ ```
65
+
66
+ ### Step 2: List the Alternatives
67
+
68
+ What else could you do with those resources?
69
+
70
+ ```
71
+ Alternatives for 3 engineers × 4 months:
72
+ A. Build custom auth (the choice)
73
+ B. Use Auth0 ($500/mo) + build 3 features
74
+ C. Improve performance of existing system
75
+ D. Reduce technical debt backlog by 40%
76
+ E. Build new product line MVP
77
+ ```
78
+
79
+ ### Step 3: Value Each Alternative
80
+
81
+ Estimate the value of each path:
82
+
83
+ ```markdown
84
+ | Alternative | Direct Value | Strategic Value | Risk | Total Value |
85
+ |-------------|--------------|-----------------|------|-------------|
86
+ | Custom auth | Full control, no vendor cost | IP ownership | High (security) | Medium |
87
+ | Auth0 + features | Features faster | Time to market | Low | High |
88
+ | Performance work | 2x throughput | Customer satisfaction | Low | Medium-High |
89
+ | Tech debt | Faster future dev | Developer retention | Low | Medium |
90
+ | New product MVP | Revenue diversification | Growth potential | High | High |
91
+ ```
92
+
93
+ ### Step 4: Calculate Opportunity Cost
94
+
95
+ Opportunity cost = Value of best foregone alternative
96
+
97
+ ```
98
+ If we choose Custom Auth:
99
+ Best alternative foregone: Auth0 + features (rated "High")
100
+ Opportunity cost: The features we won't build + faster time to market
101
+ ```
102
+
103
+ ### Step 5: Make Decision with Full Accounting
104
+
105
+ Total cost of choice = Direct cost + Opportunity cost
106
+
107
+ ```
108
+ Custom Auth True Cost:
109
+ Direct: 3 engineers × 4 months = 12 engineer-months
110
+ Opportunity: 3 features delayed by 4 months
111
+ + Market share lost to faster competitors
112
+ + Developer time not on revenue features
113
+
114
+ Question: Is custom auth worth all of that?
115
+ ```
116
+
117
+ ## Opportunity Cost Patterns
118
+
119
+ ### The "Free" Trap
120
+
121
+ Nothing is free if it consumes time:
122
+
123
+ ```
124
+ Scenario: "We can build this ourselves instead of paying $10K for the tool"
125
+
126
+ Analysis:
127
+ - Tool cost: $10,000
128
+ - Build time: 2 engineers × 2 weeks = 4 engineer-weeks
129
+ - Engineer cost: ~$4,000/week fully loaded = $16,000
130
+ - Maintenance: 1 week/quarter = $16,000/year ongoing
131
+
132
+ True cost: $16K + ongoing maintenance > $10K + $0 maintenance
133
+ Plus: What else could those engineers have built?
134
+ ```
135
+
136
+ ### The Sunk Cost Interaction
137
+
138
+ Don't let sunk costs distort opportunity cost analysis:
139
+
140
+ ```
141
+ BAD thinking:
142
+ "We've already spent 6 months on this, we can't abandon it"
143
+ (Sunk cost fallacy ignores opportunity cost of continuing)
144
+
145
+ GOOD thinking:
146
+ "Given where we are now, what's the best use of the NEXT 6 months?"
147
+ (Fresh opportunity cost analysis from current state)
148
+ ```
149
+
150
+ ### The Hidden Alternative
151
+
152
+ The status quo is always an alternative:
153
+
154
+ ```
155
+ Proposal: Migrate to Kubernetes
156
+ Alternatives considered: ECS, Nomad, K8s
157
+ Missing alternative: Don't migrate, improve current system
158
+
159
+ Full analysis should include:
160
+ - Cost of migration (all options)
161
+ - Cost of staying put (often undervalued)
162
+ - Opportunity cost of engineers doing migration vs. features
163
+ ```
164
+
165
+ ### Time as the Scarcest Resource
166
+
167
+ Time opportunity cost is often highest:
168
+
169
+ ```
170
+ "Quick meeting, only 30 minutes"
171
+
172
+ For 8-person meeting:
173
+ - Direct cost: 30 min × 8 = 4 person-hours
174
+ - Opportunity cost: 4 hours not spent on focused work
175
+ - Context switching cost: 15 min recovery × 8 = 2 more hours
176
+ - True cost: ~6 person-hours of productivity
177
+
178
+ Question: Is this meeting worth 6 hours of productivity?
179
+ ```
180
+
181
+ ## Application Areas
182
+
183
+ ### Feature Prioritization
184
+
185
+ ```markdown
186
+ ## Opportunity Cost Analysis: Feature A vs. B
187
+
188
+ | Factor | Feature A | Feature B |
189
+ |--------|-----------|-----------|
190
+ | Dev time | 4 weeks | 2 weeks |
191
+ | Revenue impact | $50K/month | $30K/month |
192
+ | Time to value | 4 weeks | 2 weeks |
193
+
194
+ If we build A first:
195
+ - We get A in 4 weeks
196
+ - We get B in 6 weeks
197
+ - 2 extra weeks without B = $60K foregone
198
+
199
+ If we build B first:
200
+ - We get B in 2 weeks
201
+ - We get A in 6 weeks
202
+ - 2 extra weeks without A = $100K foregone
203
+
204
+ Decision: Build A first despite higher dev cost (higher opportunity cost of delay)
205
+ ```
206
+
207
+ ### Build vs. Buy
208
+
209
+ ```markdown
210
+ ## Build vs. Buy: Monitoring System
211
+
212
+ Build:
213
+ - Development: $200K (4 engineers × 6 months)
214
+ - Maintenance: $80K/year
215
+ - Time to production: 6 months
216
+ - Opportunity cost: Features those engineers would have built
217
+
218
+ Buy (Datadog):
219
+ - License: $50K/year
220
+ - Integration: $30K (2 engineers × 1 month)
221
+ - Time to production: 1 month
222
+ - Opportunity cost: None significant
223
+
224
+ 5-year TCO:
225
+ - Build: $200K + ($80K × 5) + opportunity cost = $600K + opportunity
226
+ - Buy: ($50K × 5) + $30K = $280K
227
+
228
+ Decision: Buy unless unique requirements justify 2x+ cost
229
+ ```
230
+
231
+ ### Technical Debt
232
+
233
+ ```markdown
234
+ ## Technical Debt Opportunity Cost
235
+
236
+ Current state: 20% of engineering time on maintenance
237
+ Proposed: 3-month refactoring project
238
+
239
+ Analysis:
240
+ - 3 months of refactoring = no features for 3 months
241
+ - After refactoring: 10% time on maintenance (saves 10%)
242
+ - Break-even: When does saved maintenance = investment?
243
+
244
+ If team = 10 engineers:
245
+ - Investment: 10 × 3 = 30 engineer-months
246
+ - Monthly savings: 10 × 10% = 1 engineer-month
247
+ - Break-even: 30 months
248
+
249
+ Opportunity cost: Features not built during 3-month refactoring
250
+ Real question: Are those features worth more than 30+ months of 10% overhead?
251
+ ```
252
+
253
+ ### Hiring Decisions
254
+
255
+ ```markdown
256
+ ## Hiring Opportunity Cost
257
+
258
+ Choice: Hire senior engineer at $250K
259
+ Alternative: Two mid-level at $300K total
260
+
261
+ Analysis:
262
+ - Senior: Higher immediate productivity, mentorship
263
+ - Two mid: More throughput long-term, redundancy
264
+
265
+ Opportunity cost of senior:
266
+ - Fewer total engineers
267
+ - Less coverage/redundancy
268
+ - Longer ramp-up if they leave
269
+
270
+ Opportunity cost of two mid:
271
+ - More management overhead
272
+ - Longer to complex projects
273
+ - Training investment
274
+
275
+ Decision depends on: Current team composition, project complexity, growth stage
276
+ ```
277
+
278
+ ## Opportunity Cost Template
279
+
280
+ ```markdown
281
+ # Opportunity Cost Analysis: [Decision]
282
+
283
+ ## The Choice
284
+ What we're considering: [Primary option]
285
+ Resource commitment: [Time, money, people]
286
+
287
+ ## Alternatives
288
+ What else could we do with these resources?
289
+
290
+ | # | Alternative | Resource Use | Direct Value | Strategic Value |
291
+ |---|-------------|--------------|--------------|-----------------|
292
+ | 1 | [Primary choice] | [X] | [Value] | [Strategic] |
293
+ | 2 | [Alternative 1] | [X] | [Value] | [Strategic] |
294
+ | 3 | [Alternative 2] | [X] | [Value] | [Strategic] |
295
+ | 4 | Do nothing | [X] | [Value] | [Strategic] |
296
+
297
+ ## Opportunity Cost Calculation
298
+
299
+ Best foregone alternative: [Which one]
300
+ Value of that alternative: [Quantified if possible]
301
+
302
+ ## True Cost of Primary Choice
303
+ - Direct cost: [Resources consumed]
304
+ - Opportunity cost: [Value of foregone alternative]
305
+ - Total: [Sum]
306
+
307
+ ## Decision
308
+ Is [primary choice] worth [total cost]?
309
+ [Reasoning]
310
+
311
+ ## Reversibility
312
+ If we're wrong, can we change course? At what cost?
313
+ ```
314
+
315
+ ## Mental Shortcuts
316
+
317
+ ### The "What Else?" Question
318
+
319
+ Always ask: "If we didn't do this, what would we do instead?"
320
+
321
+ ### The 10x Test
322
+
323
+ If opportunity cost is 10x the direct cost, rethink the decision.
324
+
325
+ ### The Time Value Multiplier
326
+
327
+ Engineer time often has 3-5x multiplier in opportunity cost vs. dollar cost.
328
+
329
+ ### The Status Quo Alternative
330
+
331
+ Always include "change nothing" as an explicit alternative.
332
+
333
+ ## Verification Checklist
334
+
335
+ - [ ] Explicitly stated the choice and resource commitment
336
+ - [ ] Listed at least 3 alternatives (including status quo)
337
+ - [ ] Valued each alternative (even roughly)
338
+ - [ ] Identified the best foregone alternative
339
+ - [ ] Calculated opportunity cost explicitly
340
+ - [ ] Made decision accounting for full cost
341
+ - [ ] Considered reversibility
342
+
343
+ ## Key Questions
344
+
345
+ - "What are we NOT doing by choosing this?"
346
+ - "Is the 'free' option actually free?"
347
+ - "What would we do with these resources otherwise?"
348
+ - "What's the value of our next-best alternative?"
349
+ - "Is this worth more than everything we're giving up?"
350
+ - "Have we included the status quo as an option?"
351
+
352
+ ## Economic Wisdom
353
+
354
+ "There is no such thing as a free lunch." — Milton Friedman
355
+
356
+ Every choice has a cost, even if it's not written on an invoice. The cost is what you gave up to make that choice. Recognizing opportunity cost transforms how you evaluate decisions.
357
+
358
+ "The cost of a thing is the amount of what I will call life which is required to be exchanged for it." — Henry David Thoreau
359
+
360
+ For engineers: substitute "engineering time" for "life" — it's your most valuable and constrained resource.