@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,170 @@
1
+ ---
2
+ name: thinking-pre-mortem
3
+ description: Before committing to a plan or launch, assume it has already failed and reason backward through why — prospective hindsight surfaces risks that "what could go wrong?" misses.
4
+ ---
5
+
6
+ # Pre-Mortem Analysis
7
+
8
+ ## Overview
9
+ The pre-mortem, developed by psychologist Gary Klein, uses "prospective hindsight": instead of asking "What could go wrong?", assume the plan HAS failed and reason backward through why. Stating failure as already-happened surfaces concrete risks that forward-looking risk assessment glosses over.
10
+
11
+ **Core Principle:** It's easier to explain a failure that "already happened" than to predict one. Use that asymmetry productively in a single reasoning pass.
12
+
13
+ ## When to Use
14
+ - Project kickoff (before work begins)
15
+ - Before committing to a major technical decision
16
+ - Sprint planning for high-risk work
17
+ - Before launch or major release
18
+ - When team seems overconfident
19
+ - After a plan is formed but before execution
20
+
21
+ Decision flow:
22
+ ```
23
+ Starting significant work? → yes → Plan looks solid / on track? → yes → PRE-MORTEM ESSENTIAL
24
+ ↘ no → Pre-mortem still valuable
25
+ ↘ no → Standard risk assessment may suffice
26
+ ```
27
+
28
+ ## When NOT to Use
29
+ - The work is small, local, and reversible — failure is cheap to undo, so skip the ceremony.
30
+ - You're mid-incident under time pressure — act on the likely cause now (ooda/occams-razor); pre-mortem belongs *before* execution, not during firefighting.
31
+ - You'd only generate generic risks ("requirements unclear", "scope creep") that don't bind to this specific plan — stop if nothing concrete surfaces.
32
+ - The risks are already enforced by automated gates (CI, canary, rollback) — don't re-list what the system already catches.
33
+
34
+ ## Trigger Card
35
+
36
+ Before committing to a plan or launch where optimism may be hiding risks:
37
+
38
+ 1. **Assume it has already failed** — "It's six months later. The project was a disaster. What happened?"
39
+ 2. **List concrete failure reasons** — specific to THIS plan, not generic. Why did it actually fail?
40
+ 3. **Mitigate the top 3-5** — for each top failure reason, add a concrete safeguard or change the plan.
41
+
42
+ Skip if you'd only generate generic risks that don't bind to this specific plan. If risks are already enforced by automated gates (CI, canary, rollback), don't re-list what the system already catches. For a full launch risk review, run the full procedure.
43
+
44
+ ## The Process
45
+
46
+ ### Step 1: Set the Failure Frame
47
+ Adopt the stance that the plan has already failed, stated in past tense:
48
+ > "It is [future date, post-deadline]. This plan didn't just slip — it failed. The launch was rolled back / the migration corrupted data / adoption never happened."
49
+
50
+ Past tense is what makes this work: you are *explaining* a failure, not *predicting* one.
51
+
52
+ ### Step 2: Generate Failure Reasons (one prospective-hindsight pass)
53
+ Reason through *why* it failed across every angle. Push for breadth, not comfort — aim for 15+ distinct reasons before filtering:
54
+ - **Technical:** wrong architecture, integration/contract breaks, scale limits, data loss
55
+ - **Process:** untested paths, no rollback, deploy timing, missing migration step
56
+ - **Assumptions:** which load-bearing assumption turned out false?
57
+ - **Dependencies/external:** upstream API, vendor, rate limits, config drift
58
+ - Force a second sweep: "What did I, the author of this plan, most want to be true that wasn't?"
59
+
60
+ Generate the full list first; do not prune or rank while generating (premature filtering anchors on the obvious risks).
61
+
62
+ ### Step 3: Categorize and Prioritize
63
+ Group by theme and assess:
64
+
65
+ | Category | Risk | Likelihood | Impact | Priority |
66
+ |----------|------|------------|--------|----------|
67
+ | Technical | API integration fails | High | Critical | P0 |
68
+ | Process | Requirements unclear | Medium | High | P1 |
69
+ | People | Key person leaves | Low | Critical | P1 |
70
+ | External | Vendor delays | Medium | Medium | P2 |
71
+
72
+ ### Step 4: Develop Mitigations
73
+ For top risks, define:
74
+ ```
75
+ Risk: API integration fails
76
+ Mitigation:
77
+ - Spike on integration first, before depending on it
78
+ - Identify fallback vendor / degrade path
79
+ - Build abstraction layer for swap-ability
80
+ Verification: integration smoke test passes before downstream work begins
81
+ ```
82
+
83
+ ### Step 5: Update the Plan
84
+ Incorporate mitigations into the plan:
85
+ - Add spike/investigation tasks ahead of dependent work
86
+ - Build in contingency for the highest P×S risks
87
+ - Add a concrete verification/checkpoint for each top risk
88
+
89
+ ## Pre-Mortem Template
90
+
91
+ ```markdown
92
+ # Pre-Mortem: [Project Name]
93
+ Date: [Date]
94
+
95
+ ## The Scenario
96
+ It is [Future Date]. [Project] has failed.
97
+
98
+ ## Failure Reasons Identified
99
+
100
+ ### Technical
101
+ - [Reason 1]
102
+ - [Reason 2]
103
+
104
+ ### Process
105
+ - [Reason 1]
106
+ - [Reason 2]
107
+
108
+ ### People/Team
109
+ - [Reason 1]
110
+ - [Reason 2]
111
+
112
+ ### External/Dependencies
113
+ - [Reason 1]
114
+ - [Reason 2]
115
+
116
+ ## Priority Risks and Mitigations
117
+
118
+ ### P0: [Risk Name]
119
+ - **Description**: [What went wrong]
120
+ - **Mitigation**: [How to prevent]
121
+ - **Owner**: [Who]
122
+ - **Checkpoint**: [When to verify]
123
+
124
+ ### P1: [Risk Name]
125
+ ...
126
+
127
+ ## Plan Updates
128
+ - [ ] [Action item from pre-mortem]
129
+ ...
130
+ ```
131
+
132
+ ## Why Pre-Mortems Work
133
+
134
+ 1. **Reframes prediction as explanation**: Explaining an "already-happened" failure is concrete; predicting one stays vague.
135
+ 2. **Defeats first-plausible-answer lock-in**: Generating the full failure list before ranking stops anchoring on the obvious risk.
136
+ 3. **Surfaces buried assumptions**: Asking "what did the plan need to be true that wasn't?" exposes load-bearing assumptions the forward plan hid.
137
+ 4. **Counters optimism**: The forced-failure stance overrides the natural bias toward "this will work."
138
+
139
+ ## Common Failure Categories to Prompt
140
+
141
+ | Category | Example Failures |
142
+ |----------|-----------------|
143
+ | Requirements | Scope creep, unclear success criteria, missing stakeholder |
144
+ | Technical | Wrong architecture, integration failures, scale issues |
145
+ | Timeline | Underestimation, dependencies delayed, parallel work blocked |
146
+ | Team | Key person unavailable, skill gaps, communication breakdown |
147
+ | External | Vendor issues, regulatory changes, market shift |
148
+ | Process | Insufficient testing, deployment problems, no rollback |
149
+
150
+ ## Execution Tips
151
+ - **Use past tense** consistently ("failed" not "might fail") — it's what triggers the hindsight effect.
152
+ - **Generate before filtering** — collect the full list, then rank; don't prune mid-sweep.
153
+ - **Interrogate the plan's own optimism** — what did the author most want to be true?
154
+ - **Convert to action** — a pre-mortem with no plan change is wasted; each top risk needs a mitigation + verification.
155
+
156
+ ## Verification Checklist
157
+ - [ ] Run before significant work begins (not mid-incident)
158
+ - [ ] Failure frame stated in past tense
159
+ - [ ] 15+ distinct failure reasons generated before ranking
160
+ - [ ] Risks prioritized by likelihood × impact
161
+ - [ ] Top 3-5 risks have explicit mitigations
162
+ - [ ] Each mitigation has a concrete verification/checkpoint
163
+ - [ ] Plan updated to incorporate findings
164
+
165
+ ## Key Questions
166
+ - "The plan failed. Why?"
167
+ - "What was obvious in retrospect that the plan missed?"
168
+ - "What warning signs would have shown up first?"
169
+ - "Which load-bearing assumption turned out to be false?"
170
+ - "What did the plan most need to be true that wasn't?"
@@ -0,0 +1,324 @@
1
+ ---
2
+ name: thinking-probabilistic
3
+ description: Use when stating a forecast, estimate, or risk. Anchor on the base rate, give a confidence range instead of a point, and update the number when new evidence arrives.
4
+ ---
5
+
6
+ # Probabilistic Thinking
7
+
8
+ ## Overview
9
+
10
+ Probabilistic thinking, informed by Philip Tetlock's "Superforecasting," treats a forecast as a probability and a range rather than a single confident number. Three moves do almost all the work: **anchor on the base rate**, **express the estimate as a range** (not a point), and **update the number** when new evidence arrives.
11
+
12
+ **Core Principle:** Start from how often similar things happen, state your estimate as a range with a confidence level, and move the number — explicitly — when the evidence moves.
13
+
14
+ > **Stateless-agent note.** Across a single task you have no persistent prediction log, so there is no "track my calibration over months" step here. The leverage is in the *act* of estimating: base rate, range, update. Apply the calibration *attitude* (assume you're overconfident; widen the range) without pretending to keep a cross-session scorecard you don't have.
15
+
16
+ ## When to Use
17
+
18
+ - Stating a timeline or effort estimate
19
+ - Assessing the risk of an action (migration, deploy, change)
20
+ - Predicting an outcome (will this fix work? will this launch hit the target?)
21
+ - Evaluating an uncertain technical choice
22
+ - Any time you're about to give a confident single number you can't actually be sure of
23
+
24
+ Decision flow:
25
+
26
+ ```
27
+ About to state a forecast/estimate/risk?
28
+ → Outcome genuinely uncertain? → yes → BASE RATE, then a RANGE (not a point)
29
+ → New evidence since last estimate? → yes → UPDATE THE NUMBER
30
+ → Can you just look it up / measure it? → yes → DO THAT INSTEAD
31
+ ```
32
+
33
+ ## When NOT to Use
34
+
35
+ - **The quantity is knowable.** If you can measure it, query it, or look it up, do that — don't dress a checkable fact as a probability.
36
+ - **A single piece of evidence updates a single prior.** That's the narrower mechanics of `thinking-bayesian`; use it for the explicit prior × likelihood-ratio update.
37
+ - **The decision doesn't depend on the number.** If you'd act the same across the plausible range, skip the estimate and act.
38
+ - **You'd be inventing the base rate.** If there's no real reference class, say the estimate is a guess rather than manufacturing false precision.
39
+
40
+ ## Core Concepts
41
+
42
+ ### Probability as Confidence
43
+
44
+ Convert vague language to numbers:
45
+
46
+ | Vague Statement | Probability Range |
47
+ |-----------------|-------------------|
48
+ | "Certain" | 99%+ |
49
+ | "Almost certain" | 90-99% |
50
+ | "Very likely" | 80-90% |
51
+ | "Likely" / "Probable" | 65-80% |
52
+ | "Better than even" | 55-65% |
53
+ | "Toss-up" | 45-55% |
54
+ | "Unlikely" | 20-35% |
55
+ | "Very unlikely" | 10-20% |
56
+ | "Almost impossible" | 1-10% |
57
+ | "Impossible" | <1% |
58
+
59
+ ### Confidence Intervals
60
+
61
+ Express estimates as ranges, not points:
62
+
63
+ ```
64
+ BAD: "The project will take 6 weeks"
65
+ GOOD: "I'm 80% confident the project will take 4-8 weeks"
66
+ BETTER: "50% confidence: 5-7 weeks; 90% confidence: 3-10 weeks"
67
+ ```
68
+
69
+ ### Base Rates
70
+
71
+ Start with how often similar things happen:
72
+
73
+ ```
74
+ Question: Will this feature launch on time?
75
+ Base rate: What % of similar features launched on time? ~40%
76
+ Adjustment: This team is experienced (+10%), scope is clear (+10%)
77
+ Estimate: ~60% probability of on-time launch
78
+ ```
79
+
80
+ ## The Probabilistic Process
81
+
82
+ ### Step 1: Express Initial Probability
83
+
84
+ State your belief as a number:
85
+
86
+ ```markdown
87
+ ## Prediction: Will we hit Q2 revenue target?
88
+
89
+ Initial estimate: 65%
90
+ Reasoning:
91
+ - Last 4 quarters: Hit 3/4 targets (75% base rate)
92
+ - Current pipeline: Slightly below historical (-10%)
93
+ - New product launching: Uncertain impact
94
+ ```
95
+
96
+ ### Step 2: Identify Key Uncertainties
97
+
98
+ What could change the probability?
99
+
100
+ ```markdown
101
+ Key uncertainties:
102
+ 1. Will Enterprise deal close? (+15% if yes)
103
+ 2. Will new product cannibalize existing? (-10% if significant)
104
+ 3. Will competitor launch disrupt? (-20% if aggressive)
105
+ ```
106
+
107
+ ### Step 3: Create Probability Tree
108
+
109
+ For complex predictions, branch scenarios:
110
+
111
+ ```
112
+ Project success: ?
113
+ ├── Technical risk resolves well (60%)
114
+ │ ├── Team stays intact (80%) → 0.60 × 0.80 = 48% → SUCCESS
115
+ │ └── Key person leaves (20%) → 0.60 × 0.20 × 0.50 = 6% → PARTIAL
116
+ ├── Technical risk causes delays (30%)
117
+ │ ├── Scope reduced (60%) → 0.30 × 0.60 × 0.70 = 12.6% → SUCCESS
118
+ │ └── Scope maintained (40%) → 0.30 × 0.40 = 12% → FAILURE
119
+ └── Technical risk blocks project (10%) → 10% → FAILURE
120
+
121
+ P(Success) = 48% + 12.6% = 60.6% ≈ 60%
122
+ ```
123
+
124
+ ### Step 4: Update with New Information
125
+
126
+ When new evidence arrives, update:
127
+
128
+ ```markdown
129
+ Original estimate: 65% hit revenue target
130
+
131
+ New information: Enterprise deal delayed to Q3
132
+ Impact: -15% (was +15% if closed, now neutral)
133
+ Updated estimate: 50%
134
+
135
+ New information: Competitor launch was weak
136
+ Impact: +10% (was -20% if aggressive)
137
+ Updated estimate: 60%
138
+ ```
139
+
140
+ ### Step 5: State the Estimate So It Can Be Checked
141
+
142
+ Make the forecast falsifiable within the task itself: a clear claim, a timeframe, and the range. This lets the *user or a later observation* verify it — you don't carry a personal scorecard across sessions, but a sharply-stated prediction can still be proven right or wrong.
143
+
144
+ ```markdown
145
+ Prediction: "80% confident the migration completes with <5 min downtime,
146
+ range 1-15 min downtime." (Checkable against the actual run.)
147
+ ```
148
+
149
+ ## Calibration Techniques
150
+
151
+ > These are sanity checks you apply *now*, within the task — not a longitudinal tracking exercise.
152
+
153
+ ### The Equivalent Bet Test
154
+
155
+ "Would I bet at these odds?"
156
+
157
+ ```
158
+ Prediction: 80% confident project finishes on time
159
+ Equivalent: Would I bet $4 to win $1?
160
+ If that feels wrong, adjust the probability.
161
+ ```
162
+
163
+ ### The Outside View
164
+
165
+ Always check base rates:
166
+
167
+ ```
168
+ Inside view: "Our team is great, we'll definitely finish on time"
169
+ Outside view: "What % of similar projects finished on time?"
170
+
171
+ Inside tends toward overconfidence
172
+ Outside provides calibration anchor
173
+ ```
174
+
175
+ ### The Pre-Mortem Adjustment
176
+
177
+ Imagine failure, then adjust:
178
+
179
+ ```
180
+ Initial estimate: 85% success
181
+ After pre-mortem: Identified 5 failure modes I hadn't considered
182
+ Adjusted estimate: 70%
183
+ ```
184
+
185
+ ### The Confidence Interval Check
186
+
187
+ Are your intervals too narrow?
188
+
189
+ ```
190
+ Test: Of your 90% confidence intervals, do 90% contain the actual?
191
+ Common finding: Only 60-70% do
192
+ Fix: Widen intervals by 50%
193
+ ```
194
+
195
+ ## Application Examples
196
+
197
+ ### Project Estimation
198
+
199
+ ```markdown
200
+ ## Project: Payment System Rewrite
201
+
202
+ Timeline estimate:
203
+ - 50% confidence: 8-12 weeks
204
+ - 80% confidence: 6-16 weeks
205
+ - 95% confidence: 4-24 weeks
206
+
207
+ Key variables:
208
+ - API complexity: High uncertainty (+/- 3 weeks)
209
+ - Team availability: Medium uncertainty (+/- 2 weeks)
210
+ - Integration testing: High uncertainty (+/- 4 weeks)
211
+
212
+ Commitment: "We're 80% confident we'll deliver in Q2"
213
+ ```
214
+
215
+ ### Risk Assessment
216
+
217
+ ```markdown
218
+ ## Risk: Database migration causes extended downtime
219
+
220
+ Probability assessment:
221
+ - Base rate for similar migrations: 20% have issues
222
+ - Our preparation level: Above average (-5%)
223
+ - Complexity of our schema: Above average (+5%)
224
+ - Rollback plan quality: Strong (-5%)
225
+
226
+ Estimate: 15% probability of extended downtime
227
+
228
+ Mitigation value:
229
+ - If issue occurs: 4 hours downtime × $10K/hour = $40K
230
+ - Expected loss: 15% × $40K = $6K
231
+ - Mitigation cost: $3K for additional testing
232
+ - Decision: Mitigation worth it (ROI positive)
233
+ ```
234
+
235
+ ### Technical Decision
236
+
237
+ ```markdown
238
+ ## Decision: Adopt new framework
239
+
240
+ Success probability factors:
241
+ | Factor | Probability | Weight |
242
+ |--------|-------------|--------|
243
+ | Team learns quickly | 70% | 0.3 |
244
+ | Framework matures | 80% | 0.2 |
245
+ | Performance meets needs | 60% | 0.3 |
246
+ | Integration works | 75% | 0.2 |
247
+
248
+ Combined probability (simplified):
249
+ 0.70 × 0.80 × 0.60 × 0.75 = 25% (if all must succeed)
250
+ OR weighted average: 70% (if partial success acceptable)
251
+
252
+ Decision: High uncertainty suggests pilot first
253
+ ```
254
+
255
+ ## Probabilistic Thinking Template
256
+
257
+ ```markdown
258
+ # Probabilistic Assessment: [Prediction]
259
+
260
+ ## Prediction
261
+ [Clear, falsifiable statement with timeframe]
262
+
263
+ ## Initial Probability
264
+ Estimate: [X]%
265
+ Base rate: [Similar events: Y%]
266
+ Adjustment rationale: [Why different from base rate]
267
+
268
+ ## Confidence Interval
269
+ - 50% CI: [Range]
270
+ - 80% CI: [Range]
271
+ - 95% CI: [Range]
272
+
273
+ ## Key Uncertainties
274
+ | Uncertainty | If positive | If negative |
275
+ |-------------|-------------|-------------|
276
+ | [Factor 1] | +X% | -Y% |
277
+ | [Factor 2] | +X% | -Y% |
278
+
279
+ ## Updates (within this task)
280
+ | New information | Old P | New P |
281
+ |-----------------|-------|-------|
282
+ | | | |
283
+
284
+ ## Checkable Outcome
285
+ [The specific observation that will prove this forecast right or wrong]
286
+ ```
287
+
288
+ ## Verification Checklist
289
+
290
+ - [ ] Expressed prediction as specific probability
291
+ - [ ] Checked base rate for similar events
292
+ - [ ] Created appropriate confidence intervals
293
+ - [ ] Identified key uncertainties and their impacts
294
+ - [ ] Stated the prediction so it's checkable (claim + timeframe + range)
295
+ - [ ] Applied equivalent bet test for sanity check
296
+ - [ ] Willing to update the number when new information arrives
297
+
298
+ ## Key Questions
299
+
300
+ - "What probability would I assign to this?"
301
+ - "What's the base rate for similar things?"
302
+ - "What would change my estimate up or down?"
303
+ - "Am I being overconfident? (Usually yes — widen the range)"
304
+ - "Have I given a range, or am I hiding uncertainty behind a single number?"
305
+ - "Would I bet at these odds?"
306
+
307
+ ## Tetlock's Superforecaster Traits
308
+
309
+ 1. **Update often:** Change the number when evidence changes
310
+ 2. **Granular probabilities:** Use 65% not "likely"
311
+ 3. **Outside view:** Start with base rates
312
+ 4. **Seek disconfirming evidence:** Look for reasons you're wrong
313
+ 5. **Ranges, not points:** Express confidence as an interval, and widen it
314
+ 6. **Intellectual humility:** Assume you're often wrong
315
+
316
+ ## Tetlock's Wisdom
317
+
318
+ "The fox knows many things, but the hedgehog knows one big thing."
319
+
320
+ Superforecasters are foxes—they integrate many perspectives, update frequently, and avoid ideological certainty. They're not smarter; they're more calibrated.
321
+
322
+ "Beliefs are hypotheses to be tested, not treasures to be protected."
323
+
324
+ Your predictions should change as evidence changes. Holding steady when you should update is a calibration failure.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: thinking-red-team
3
+ description: Use when reviewing code, auth, or APIs for security vulnerabilities — adopt an attacker mindset, enumerate the attack surface, report only findings with a concrete reproducible attack path.
4
+ ---
5
+
6
+ # Red Team Thinking
7
+
8
+ ## Overview
9
+
10
+ Red teaming is **adversarial security review**: deliberately attacking a system you control to find vulnerabilities before an attacker does. This skill is scoped to security/code vulnerability detection — it is NOT for plan stress-testing or decision challenge (use `thinking-pre-mortem` or `thinking-steel-manning` for those).
11
+
12
+ **The anti-fabrication gate is the most important rule:** every reported finding MUST include a concrete, reproducible attack path — entry point → exact steps → realized impact. If you cannot describe how the attack actually executes against *this* code/config, it is not a finding. Drop it. A short report of real, demonstrable vulnerabilities beats a long list of speculation.
13
+
14
+ **Core Principle:** Attack yourself before others do. But only report what you can actually break.
15
+
16
+ ## When to Use
17
+
18
+ - Security review of code, authentication, authorization, APIs, or infrastructure you control
19
+ - Pre-launch security hardening of a system that handles auth, data, or money
20
+ - Evaluating whether a specific vulnerability class (injection, XSS, auth bypass, etc.) is present in your code
21
+
22
+ Decision flow:
23
+
24
+ ```
25
+ Reviewing a system for security?
26
+ → Can you demonstrate an attack path? → No → Don't report it
27
+ → Is the finding reproducible against this code/config? → No → Drop it
28
+ → Is this plan stress-testing or decision challenge? → Yes → Use thinking-pre-mortem or thinking-steel-manning
29
+ → No → RED TEAM IT
30
+ ```
31
+
32
+ ## When NOT to Use
33
+
34
+ - **Speculative claims without a reproducible attack path.** This is the anti-fabrication gate. "Best practice says X" or "this could theoretically be vulnerable" is not a finding. State the entry point, exact steps, and realized impact — or drop it.
35
+ - **Plan, strategy, or decision stress-testing.** For "how could this plan fail," use `thinking-pre-mortem`. For "what's the strongest case against this decision," use `thinking-steel-manning`.
36
+ - **Architecture review without security focus.** For architecture resilience, use `thinking-systems` or `thinking-pre-mortem`.
37
+ - **Running scanners replaces thinking.** Where you can actually run a SAST tool, fuzzer, or PoC, do that. This skill structures the adversarial thinking; it doesn't replace automated verification.
38
+ - **Padding the report to look thorough.** A short list of real vulnerabilities beats a long list of theoretical ones. Resist the incentive to add "informational" or "best-practice" items.
39
+
40
+ ## Procedure
41
+
42
+ ### Step 1: Define the Target and Scope
43
+
44
+ ```markdown
45
+ Target: [System/component under review]
46
+ Scope: [What to attack — be specific]
47
+ Out of scope: [What to skip]
48
+ Goal: [What constitutes a successful attack — e.g., unauthorized access, data exfiltration, privilege escalation]
49
+ ```
50
+
51
+ ### Step 2: Adopt the Adversary Mindset
52
+
53
+ Identify who would attack this system and what they want:
54
+
55
+ ```markdown
56
+ Adversary profiles:
57
+ - External attacker (no access): targets public endpoints, auth bypass, injection
58
+ - Authenticated user (basic access): targets privilege escalation, IDOR, business logic
59
+ - Insider (elevated access): targets data exfiltration, audit bypass
60
+
61
+ For each profile, ask: "If I wanted to cause maximum damage with their access level, how would I?"
62
+ ```
63
+
64
+ ### Step 3: Enumerate the Attack Surface
65
+
66
+ Map every entry point and trust boundary:
67
+
68
+ | Surface | Exposure | Trust Boundary |
69
+ |---------|----------|----------------|
70
+ | Login form | Public internet | Anonymous → Authenticated |
71
+ | API /graphql | Public (with key) | Authenticated → Application |
72
+ | Password reset flow | Public | Anonymous → Account owner |
73
+ | Admin panel | Internal network | Authenticated → Admin |
74
+ | File upload endpoint | Authenticated | User data → Server storage |
75
+
76
+ ### Step 4: Execute Attack Scenarios
77
+
78
+ For each attack surface, attempt to break the system:
79
+
80
+ ```markdown
81
+ Attack: Credential stuffing against login
82
+ Steps:
83
+ 1. Obtain breach database of known credentials
84
+ 2. Script requests against /login with varied credentials
85
+ 3. Observe rate limiting, account lockout, timing differences
86
+ Findings:
87
+ - Rate limiting: 10 req/min per IP (bypassable via distribution)
88
+ - Account lockout: none
89
+ - Timing: response time reveals valid vs invalid usernames ← VULNERABILITY
90
+ ```
91
+
92
+ For each attack scenario, record: the entry point, exact steps taken, observed behavior, and whether a vulnerability was found.
93
+
94
+ ### Step 5: Attempt Defense Bypass
95
+
96
+ For each defense encountered, try to bypass it:
97
+
98
+ | Defense | Bypass Attempt | Result |
99
+ |---------|---------------|--------|
100
+ | IP-based rate limiting | Distribute requests across IPs | BYPASSED |
101
+ | Input validation | Unicode normalization attacks | RESISTED |
102
+ | Session timeout | Replay expired token with modified timestamp | BYPASSED |
103
+
104
+ ### Step 6: Document Findings — With the Anti-Fabrication Gate
105
+
106
+ For EVERY finding, fill out:
107
+
108
+ ```markdown
109
+ Finding: [Title]
110
+ Severity: Critical / High / Medium / Low
111
+ Attack path (REQUIRED):
112
+ Entry point: [URL, endpoint, parameter, file]
113
+ Steps: [1. Send X, 2. Observe Y, 3. Escalate to Z]
114
+ Realized impact: [What the attacker actually achieves — data access, privilege, DoS]
115
+ Remediation: [Concrete fix]
116
+ ```
117
+
118
+ **If you cannot fill out the attack path completely, drop the finding.** Do not report "Missing HttpOnly flag" as a standalone finding without demonstrating session token theft. Do not report "No rate limiting" without demonstrating a viable brute-force attack.
119
+
120
+ ## Output Contract
121
+
122
+ A completed Red Team report produces:
123
+
124
+ 1. **Target and Scope** — what was reviewed and what was excluded
125
+ 2. **Attack Surface Map** — entry points with exposure levels and trust boundaries
126
+ 3. **Attack Scenarios Executed** — each scenario with steps, observations, and outcome
127
+ 4. **Findings Report** — each with severity AND a concrete, reproducible attack path (entry point → steps → impact)
128
+ 5. **Defense Bypass Results** — which defenses held and which were circumvented
129
+ 6. **Remediation Recommendations** — prioritized by severity with concrete fixes
130
+
131
+ Findings without a complete attack path are excluded from the report. A report with zero findings is acceptable if no reproducible vulnerabilities were discovered.
132
+
133
+ ## Anti-Patterns
134
+
135
+ | Anti-Pattern | Symptom | Correction |
136
+ |---|---|---|
137
+ | **Speculative claims** | Findings that say "could be vulnerable" or "best practice says" without a demonstrated attack path | Drop them; only report what you can actually break |
138
+ | **Padding the report** | Adding "informational" or "best-practice" items to look thorough | A short report of real vulns beats a long list of theory |
139
+ | **Non-security red-teaming** | Using this skill for plan stress-testing or decision challenge | Use `thinking-pre-mortem` (plans) or `thinking-steel-manning` (decisions) |
140
+ | **Skipping the adversary model** | Attacking without defining who the attacker is and what access they have | Define the adversary profile first; attacks make sense only in context |
141
+ | **Missing the attack path** | Reporting a vulnerability without showing how to reach it | Every finding needs: entry point → steps → impact |
142
+ | **Scanner-as-substitute** | Running a SAST tool and reporting its output without adversarial thinking | The tool finds patterns; red-teaming finds exploitable paths |