Decision Tree Solver
"Should we settle or go to trial" is not answered by instinct or by whoever argues longest — it is three numbers and a probability, and most people have never actually multiplied them. This skill extracts the tree hiding inside a messy decision (the choices, the chances, the payoffs, the costs of playing), computes the rollback with the bundled script, and — the part instinct can never do — finds the break-even: the probability at which the recommendation flips. Because "trial is worth it if you win 60% of the time" is an opinion, but "the answer flips at 90% — are you more than 90% sure?" is a decision made tractable. The script is deterministic, stdlib-only, and shows its arithmetic.
What This Skill Produces
- The extracted tree — decisions, chance nodes with probabilities, outcomes with values, and the costs of each path, pulled from the situation as described
- The rollback — expected value at every node, the best choice named at every fork, from the script
- The break-even scan — for each two-way uncertainty, the probability at which the top-level choice flips, which is the number that makes probability arguments productive
- The robustness read — whether the answer survives the probabilities being argued about, or hinges on a number nobody can defend
- The leaves-out list — what expected value cannot see here: risk appetite, one-shot vs repeated, the unquantified costs
Required Inputs
Ask for these if not provided:
- The choices — the real options on the table, including the do-nothing one
- The uncertainties — what could happen under each choice, and the requester's honest probability for each (pushing back on false precision is part of the job)
- The payoffs and costs — the money (or a stated proxy) at each end point, and what each path costs to walk: fees, time priced honestly, deposits
- The stakes context — one-shot or repeatable, and whether the worst branch is survivable — because expected value is the right tool for repeatable bets and needs a caveat for ruinous one-shots
Framework: Extract, Roll Back, Stress the Probabilities
- Extract before computing. The tree is usually mis-drawn before it is mis-computed: options that are really the same option, a "risk" that is actually two sequential risks, a payoff that forgot the cost of getting it. Draw it in the script's JSON, read it back to the requester, fix it there.
- Run the rollback.
python3 scripts/decision_tree.py --input tree.json # tree with EVs and best choices
python3 scripts/decision_tree.py --input tree.json --json # machine-readable
python3 scripts/decision_tree.py --demo # settle-vs-trial worked example
Outcomes carry values; chance nodes take probability-weighted sums; decisions take the best child; costs subtract along the way. The best path falls out, with the arithmetic visible.
- Read the break-even before the recommendation. The scan reports where the choice flips. A decision that holds from p=0.3 to p=0.9 is robust and the probability argument can stop; one that flips at 0.55 when the room believes 0.5-to-0.6 is the argument itself, now named precisely.
- Stress the values too. Nudge the big payoffs ±30% and rerun. An answer that survives sloppy values and sloppy probabilities is a real answer; one that does not is a request for better information, and the tree shows exactly which information.
- Say what EV cannot see. A 10% chance of ruin is not "priced in" by multiplication for someone who cannot survive it once; reputational and relationship costs sit outside the tree unless explicitly valued. The recommendation carries these as words, not silently.
Output Format
Decision tree: [the decision] · [date]
The tree (as computed — from decision_tree.py)
[rendered tree: choices ▣, chances ◔, outcomes •, EV at every node, best marked]
Recommendation: [the best path] · EV [amount] vs next-best [amount]
Break-even scan
| Uncertainty |
Flips the choice at |
You believe |
Verdict |
| [chance node] |
p ≈ [x] |
[their estimate] |
robust / hinges here |
Value stress: [the payoffs nudged ±30% — held / flipped, and on which number]
What the numbers leave out: [ruin risk on the worst branch · one-shot vs repeated framing · the unpriced costs, named]
Decision support, not legal, financial, or any other advice. The probabilities are the requester's own beliefs made explicit — the tree cannot make them true, only make their consequences consistent.
Quality Checks
Anti-Patterns
- Computing the mis-drawn tree. Ten minutes of extraction beats any amount of arithmetic on the wrong structure.
- False precision in probabilities. "About 60%" is honest; "62.5%" from nowhere is decoration — the break-even scan is the cure, since it shows whether the difference even matters.
- EV-maximising a ruinous one-shot. The tool's cleanest failure mode; the caveat is mandatory, not optional.
- Hiding the arithmetic. The script prints every node's EV because a recommendation nobody can check convinces nobody who matters.
- Letting the tree end the conversation. It ends the circular part; the values conversation it surfaces is the productive one.
1---2name: decision-tree-solver3description: Turn a fork-in-the-road decision into a computed expected-value tree — settle or sue, launch or wait, fix or replace — rolled back by the bundled script, with the break-even probability where the answer flips. Use when asked should we settle or go to trial, build a decision tree, what probability makes this worth it, or compare options under uncertainty. Produces the structured tree, the rollback with the best choice at every fork, the break-even probabilities, and the honest list of what the numbers leave out. Decision support, not advice — the probabilities are yours.4---5
6# Decision Tree Solver
7
8"Should we settle or go to trial" is not answered by instinct or by whoever argues longest — it is three numbers and a probability, and most people have never actually multiplied them. This skill extracts the tree hiding inside a messy decision (the choices, the chances, the payoffs, the costs of playing), computes the rollback with the bundled script, and — the part instinct can never do — finds the break-even: the probability at which the recommendation *flips*. Because "trial is worth it if you win 60% of the time" is an opinion, but "the answer flips at 90% — are you more than 90% sure?" is a decision made tractable. The script is deterministic, stdlib-only, and shows its arithmetic.
9
10## What This Skill Produces
11
12- **The extracted tree** — decisions, chance nodes with probabilities, outcomes with values, and the costs of each path, pulled from the situation as described
13- **The rollback** — expected value at every node, the best choice named at every fork, from the script
14- **The break-even scan** — for each two-way uncertainty, the probability at which the top-level choice flips, which is the number that makes probability arguments productive
15- **The robustness read** — whether the answer survives the probabilities being argued about, or hinges on a number nobody can defend
16- **The leaves-out list** — what expected value cannot see here: risk appetite, one-shot vs repeated, the unquantified costs
17
18## Required Inputs
19
20Ask for these if not provided:
21- **The choices** — the real options on the table, including the do-nothing one
22- **The uncertainties** — what could happen under each choice, and the requester's honest probability for each (pushing back on false precision is part of the job)
23- **The payoffs and costs** — the money (or a stated proxy) at each end point, and what each path costs to walk: fees, time priced honestly, deposits
24- **The stakes context** — one-shot or repeatable, and whether the worst branch is survivable — because expected value is the right tool for repeatable bets and needs a caveat for ruinous one-shots
25
26## Framework: Extract, Roll Back, Stress the Probabilities
27
281. **Extract before computing.** The tree is usually mis-drawn before it is mis-computed: options that are really the same option, a "risk" that is actually two sequential risks, a payoff that forgot the cost of getting it. Draw it in the script's JSON, read it back to the requester, fix it *there*.
292. **Run the rollback.**
30 ```
31 python3 scripts/decision_tree.py --input tree.json # tree with EVs and best choices
32 python3 scripts/decision_tree.py --input tree.json --json # machine-readable
33 python3 scripts/decision_tree.py --demo # settle-vs-trial worked example
34 ```
35 Outcomes carry values; chance nodes take probability-weighted sums; decisions take the best child; costs subtract along the way. The best path falls out, with the arithmetic visible.
363. **Read the break-even before the recommendation.** The scan reports where the choice flips. A decision that holds from p=0.3 to p=0.9 is robust and the probability argument can stop; one that flips at 0.55 when the room believes 0.5-to-0.6 is *the argument itself*, now named precisely.
374. **Stress the values too.** Nudge the big payoffs ±30% and rerun. An answer that survives sloppy values and sloppy probabilities is a real answer; one that does not is a request for better information, and the tree shows exactly which information.
385. **Say what EV cannot see.** A 10% chance of ruin is not "priced in" by multiplication for someone who cannot survive it once; reputational and relationship costs sit outside the tree unless explicitly valued. The recommendation carries these as words, not silently.
39
40## Output Format
41
42### Decision tree: [the decision] · [date]
43
44**The tree** (as computed — from `decision_tree.py`)
45```
46[rendered tree: choices ▣, chances ◔, outcomes •, EV at every node, best marked]
47```
48
49**Recommendation:** [the best path] · **EV [amount]** vs next-best [amount]
50
51**Break-even scan**
52| Uncertainty | Flips the choice at | You believe | Verdict |
53|---|---|---|---|
54| [chance node] | p ≈ [x] | [their estimate] | robust / hinges here |
55
56**Value stress:** [the payoffs nudged ±30% — held / flipped, and on which number]
57
58**What the numbers leave out:** [ruin risk on the worst branch · one-shot vs repeated framing · the unpriced costs, named]
59
60> Decision support, not legal, financial, or any other advice. The probabilities are the requester's own beliefs made explicit — the tree cannot make them true, only make their consequences consistent.
61
62## Quality Checks
63- [ ] The tree was read back and corrected before anything was computed
64- [ ] Every path's costs are on the path, not forgotten at the leaves
65- [ ] The break-even scan appears and is compared against the requester's stated belief
66- [ ] Values were stressed, not just probabilities
67- [ ] The leaves-out list names ruin risk explicitly when the worst branch is severe
68- [ ] The recommendation states robustness, not just the EV winner
69
70## Anti-Patterns
71- **Computing the mis-drawn tree.** Ten minutes of extraction beats any amount of arithmetic on the wrong structure.
72- **False precision in probabilities.** "About 60%" is honest; "62.5%" from nowhere is decoration — the break-even scan is the cure, since it shows whether the difference even matters.
73- **EV-maximising a ruinous one-shot.** The tool's cleanest failure mode; the caveat is mandatory, not optional.
74- **Hiding the arithmetic.** The script prints every node's EV because a recommendation nobody can check convinces nobody who matters.
75- **Letting the tree end the conversation.** It ends the *circular* part; the values conversation it surfaces is the productive one.