{
  "schemaVersion": "1.0",
  "item": {
    "slug": "decision-trees",
    "name": "Decision Trees",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/evgyur/decision-trees",
    "canonicalUrl": "https://clawhub.ai/evgyur/decision-trees",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/decision-trees",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=decision-trees",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "scripts/decision_tree.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/decision-trees"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/decision-trees",
    "agentPageUrl": "https://openagent3.xyz/skills/decision-trees/agent",
    "manifestUrl": "https://openagent3.xyz/skills/decision-trees/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/decision-trees/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Decision Trees — Structured Decision-Making",
        "body": "Decision tree analysis: a visual tool for making decisions with probabilities and expected value."
      },
      {
        "title": "When to Use",
        "body": "✅ Good for:\n\nBusiness decisions (investments, hiring, product launches)\nPersonal choices (career, relocation, purchases)\nTrading & investing (position sizing, entry/exit)\nOperational decisions (expansion, outsourcing)\nAny situation with measurable consequences\n\n❌ Not suitable for:\n\nDecisions with true uncertainty (black swans)\nFast tactical choices\nPurely emotional/ethical questions"
      },
      {
        "title": "Method",
        "body": "Decision tree = tree-like structure where:\n\nDecision nodes (squares) — your actions\nChance nodes (circles) — random events\nEnd nodes (triangles) — final outcomes\n\nProcess:\n\nDefine options — all possible actions\nDefine outcomes — what can happen after each action\nEstimate probabilities — how likely is each outcome (0-100%)\nEstimate values — utility/reward for each outcome (money, points, utility units)\nCalculate EV — expected value = Σ (probability × value)\nChoose — option with highest EV"
      },
      {
        "title": "Formula",
        "body": "EV = Σ (probability_i × value_i)\n\nExample:\n\nOutcome A: 70% probability, +$100 → 0.7 × 100 = $70\nOutcome B: 30% probability, -$50 → 0.3 × (-50) = -$15\nEV = $70 + (-$15) = $55"
      },
      {
        "title": "Classic Example (from Wikipedia)",
        "body": "Decision: Go to party or stay home?"
      },
      {
        "title": "Estimates:",
        "body": "Party: +9 utility (fun)\nHome: +3 utility (comfort)\nCarrying jacket unnecessarily: -2 utility\nBeing cold: -10 utility\nProbability cold: 70%\nProbability warm: 30%"
      },
      {
        "title": "Tree:",
        "body": "Decision\n├─ Go to party\n│  ├─ Take jacket\n│  │  ├─ Cold (70%) → 9 utility (party)\n│  │  └─ Warm (30%) → 9 - 2 = 7 utility (carried unnecessarily)\n│  │  EV = 0.7 × 9 + 0.3 × 7 = 8.4\n│  └─ Don't take jacket\n│     ├─ Cold (70%) → 9 - 10 = -1 utility (froze)\n│     └─ Warm (30%) → 9 utility (perfect)\n│     EV = 0.7 × (-1) + 0.3 × 9 = 2.0\n└─ Stay home\n   └─ EV = 3.0 (always)\n\nConclusion: Go and take jacket (EV = 8.4) > stay home (EV = 3.0) > go without jacket (EV = 2.0)"
      },
      {
        "title": "Business Example",
        "body": "Decision: Launch new product?"
      },
      {
        "title": "Estimates:",
        "body": "Success probability: 40%\nFailure probability: 60%\nProfit if success: $500K\nLoss if failure: $200K\nDon't launch: $0"
      },
      {
        "title": "Tree:",
        "body": "Launch product\n├─ Success (40%) → +$500K\n└─ Failure (60%) → -$200K\n\nEV = (0.4 × 500K) + (0.6 × -200K) = 200K - 120K = +$80K\n\nDon't launch\n└─ EV = $0\n\nConclusion: Launch (EV = +$80K) is better than not launching ($0)."
      },
      {
        "title": "Trading Example",
        "body": "Decision: Enter position or wait?"
      },
      {
        "title": "Estimates:",
        "body": "Probability of rise: 60%\nProbability of fall: 40%\nPosition size: $1000\nTarget: +10% ($100 profit)\nStop-loss: -5% ($50 loss)"
      },
      {
        "title": "Tree:",
        "body": "Enter position\n├─ Rise (60%) → +$100\n└─ Fall (40%) → -$50\n\nEV = (0.6 × 100) + (0.4 × -50) = 60 - 20 = +$40\n\nWait\n└─ No position → $0\n\nEV = $0\n\nConclusion: Entering position has positive EV (+$40), better than waiting ($0)."
      },
      {
        "title": "Method Limitations",
        "body": "⚠️ Critical points:\n\nSubjective estimates — probabilities often \"finger in the air\"\nDoesn't account for risk appetite — ignores psychology (loss aversion)\nSimplified model — reality is more complex\nUnstable — small data changes can drastically alter the tree\nMay be inaccurate — other methods exist that are more precise (random forests)\n\nBut: The method is valuable for structuring thinking, even if numbers are approximate."
      },
      {
        "title": "1. Structuring",
        "body": "Ask:\n\nWhat are the action options?\nWhat are possible outcomes?\nWhat are values/utility for each outcome?\nHow do we measure value? (money, utility units, happiness points)"
      },
      {
        "title": "2. Probability Estimation",
        "body": "Help estimate through:\n\nHistorical data (if available)\nComparable situations\nExpert judgment (user experience)\nSubjective assessment (if no data)"
      },
      {
        "title": "3. Visualization",
        "body": "Draw tree in markdown:\n\nDecision\n├─ Option A\n│  ├─ Outcome A1 (X%) → Value Y\n│  └─ Outcome A2 (Z%) → Value W\n└─ Option B\n   └─ Outcome B1 (100%) → Value V"
      },
      {
        "title": "4. EV Calculation",
        "body": "For each option:\n\nEV_A = (X% × Y) + (Z% × W)\nEV_B = V"
      },
      {
        "title": "5. Recommendation",
        "body": "Option with highest EV = best choice (rationally).\n\nBut add context:\n\nRisk tolerance (can user handle worst case)\nTime horizon (when is result needed)\nOther factors (reputational risk, emotions, ethics)"
      },
      {
        "title": "Trading & Investing",
        "body": "Position Sizing:\n\nOptions: 5%, 10%, 20% of capital\nOutcomes: Profit/loss with different probabilities\nValue: Absolute profit in $\n\nEntry Timing:\n\nOptions: Enter now, wait for -5%, wait for -10%\nOutcomes: Price goes up/down\nValue: Opportunity cost vs better entry price"
      },
      {
        "title": "Business Strategy",
        "body": "Product Launch:\n\nOptions: Launch / don't launch\nOutcomes: Success / failure\nValue: Revenue, market share, costs\n\nHiring Decision:\n\nOptions: Hire candidate A / candidate B / don't hire\nOutcomes: Successful onboarding / quit after X months\nValue: Productivity, costs, opportunity cost"
      },
      {
        "title": "Personal Decisions",
        "body": "Career Change:\n\nOptions: Stay / change job / start business\nOutcomes: Success / failure in new role\nValue: Salary, satisfaction, growth, risk\n\nReal Estate:\n\nOptions: Buy house A / house B / continue renting\nOutcomes: Price increase / decrease / personal situation changes\nValue: Net worth, monthly costs, quality of life"
      },
      {
        "title": "Operations",
        "body": "Capacity Planning:\n\nOptions: Expand production / outsource / status quo\nOutcomes: Demand increases / decreases\nValue: Profit, utilization, fixed costs\n\nVendor Selection:\n\nOptions: Vendor A / Vendor B / in-house\nOutcomes: Quality, reliability, failures\nValue: Total cost of ownership"
      },
      {
        "title": "Calculator Script",
        "body": "Use scripts/decision_tree.py for automated EV calculations:\n\npython3 scripts/decision_tree.py --interactive\n\nOr via JSON:\n\npython3 scripts/decision_tree.py --json tree.json\n\nJSON format:\n\n{\n  \"decision\": \"Launch product?\",\n  \"options\": [\n    {\n      \"name\": \"Launch\",\n      \"outcomes\": [\n        {\"name\": \"Success\", \"probability\": 0.4, \"value\": 500000},\n        {\"name\": \"Failure\", \"probability\": 0.6, \"value\": -200000}\n      ]\n    },\n    {\n      \"name\": \"Don't launch\",\n      \"outcomes\": [\n        {\"name\": \"Status quo\", \"probability\": 1.0, \"value\": 0}\n      ]\n    }\n  ]\n}\n\nOutput:\n\n📊 Decision Tree Analysis\n\nDecision: Launch product?\n\nOption 1: Launch\n  └─ EV = $80,000.00\n     ├─ Success (40.0%) → +$500,000.00\n     └─ Failure (60.0%) → -$200,000.00\n\nOption 2: Don't launch\n  └─ EV = $0.00\n     └─ Status quo (100.0%) → $0.00\n\n✅ Recommendation: Launch (EV: $80,000.00)"
      },
      {
        "title": "Final Checklist",
        "body": "Before giving recommendation, ensure:\n\n✅ All options covered\n✅ Probabilities sum to 100% for each branch\n✅ Values are realistic (not fantasies)\n✅ Worst case scenario is clear to user\n✅ Risk/reward ratio is explicit\n✅ Method limitations mentioned\n✅ Qualitative context added (not just EV)"
      },
      {
        "title": "Method Advantages",
        "body": "✅ Simple — people understand trees intuitively\n✅ Visual — clear structure\n✅ Works with little data — can use expert estimates\n✅ White box — transparent logic\n✅ Worst/best case — extreme scenarios visible\n✅ Multiple decision-makers — can account for different interests"
      },
      {
        "title": "Method Disadvantages",
        "body": "❌ Unstable — small data changes → large tree changes\n❌ Inaccurate — often more precise methods exist\n❌ Subjective — probability estimates \"from the head\"\n❌ Complex — becomes unwieldy with many outcomes\n❌ Doesn't account for risk preference — assumes risk neutrality"
      },
      {
        "title": "Important",
        "body": "The method is valuable for structuring thinking, but numbers are often taken from thin air.\n\nWhat matters more is the process — forcing yourself to think through all branches and explicitly evaluate consequences.\n\nDon't sell the decision as \"scientifically proven\" — it's just a framework for conscious choice."
      },
      {
        "title": "Further Reading",
        "body": "Decision trees in operations research\nInfluence diagrams (more compact for complex decisions)\nUtility functions (accounting for risk aversion)\nMonte Carlo simulation (for greater accuracy)\nReal options analysis (for strategic decisions)"
      }
    ],
    "body": "Decision Trees — Structured Decision-Making\n\nDecision tree analysis: a visual tool for making decisions with probabilities and expected value.\n\nWhen to Use\n\n✅ Good for:\n\nBusiness decisions (investments, hiring, product launches)\nPersonal choices (career, relocation, purchases)\nTrading & investing (position sizing, entry/exit)\nOperational decisions (expansion, outsourcing)\nAny situation with measurable consequences\n\n❌ Not suitable for:\n\nDecisions with true uncertainty (black swans)\nFast tactical choices\nPurely emotional/ethical questions\nMethod\n\nDecision tree = tree-like structure where:\n\nDecision nodes (squares) — your actions\nChance nodes (circles) — random events\nEnd nodes (triangles) — final outcomes\n\nProcess:\n\nDefine options — all possible actions\nDefine outcomes — what can happen after each action\nEstimate probabilities — how likely is each outcome (0-100%)\nEstimate values — utility/reward for each outcome (money, points, utility units)\nCalculate EV — expected value = Σ (probability × value)\nChoose — option with highest EV\nFormula\nEV = Σ (probability_i × value_i)\n\n\nExample:\n\nOutcome A: 70% probability, +$100 → 0.7 × 100 = $70\nOutcome B: 30% probability, -$50 → 0.3 × (-50) = -$15\nEV = $70 + (-$15) = $55\nClassic Example (from Wikipedia)\n\nDecision: Go to party or stay home?\n\nEstimates:\nParty: +9 utility (fun)\nHome: +3 utility (comfort)\nCarrying jacket unnecessarily: -2 utility\nBeing cold: -10 utility\nProbability cold: 70%\nProbability warm: 30%\nTree:\nDecision\n├─ Go to party\n│  ├─ Take jacket\n│  │  ├─ Cold (70%) → 9 utility (party)\n│  │  └─ Warm (30%) → 9 - 2 = 7 utility (carried unnecessarily)\n│  │  EV = 0.7 × 9 + 0.3 × 7 = 8.4\n│  └─ Don't take jacket\n│     ├─ Cold (70%) → 9 - 10 = -1 utility (froze)\n│     └─ Warm (30%) → 9 utility (perfect)\n│     EV = 0.7 × (-1) + 0.3 × 9 = 2.0\n└─ Stay home\n   └─ EV = 3.0 (always)\n\n\nConclusion: Go and take jacket (EV = 8.4) > stay home (EV = 3.0) > go without jacket (EV = 2.0)\n\nBusiness Example\n\nDecision: Launch new product?\n\nEstimates:\nSuccess probability: 40%\nFailure probability: 60%\nProfit if success: $500K\nLoss if failure: $200K\nDon't launch: $0\nTree:\nLaunch product\n├─ Success (40%) → +$500K\n└─ Failure (60%) → -$200K\n\nEV = (0.4 × 500K) + (0.6 × -200K) = 200K - 120K = +$80K\n\nDon't launch\n└─ EV = $0\n\n\nConclusion: Launch (EV = +$80K) is better than not launching ($0).\n\nTrading Example\n\nDecision: Enter position or wait?\n\nEstimates:\nProbability of rise: 60%\nProbability of fall: 40%\nPosition size: $1000\nTarget: +10% ($100 profit)\nStop-loss: -5% ($50 loss)\nTree:\nEnter position\n├─ Rise (60%) → +$100\n└─ Fall (40%) → -$50\n\nEV = (0.6 × 100) + (0.4 × -50) = 60 - 20 = +$40\n\nWait\n└─ No position → $0\n\nEV = $0\n\n\nConclusion: Entering position has positive EV (+$40), better than waiting ($0).\n\nMethod Limitations\n\n⚠️ Critical points:\n\nSubjective estimates — probabilities often \"finger in the air\"\nDoesn't account for risk appetite — ignores psychology (loss aversion)\nSimplified model — reality is more complex\nUnstable — small data changes can drastically alter the tree\nMay be inaccurate — other methods exist that are more precise (random forests)\n\nBut: The method is valuable for structuring thinking, even if numbers are approximate.\n\nUser Workflow\n1. Structuring\n\nAsk:\n\nWhat are the action options?\nWhat are possible outcomes?\nWhat are values/utility for each outcome?\nHow do we measure value? (money, utility units, happiness points)\n2. Probability Estimation\n\nHelp estimate through:\n\nHistorical data (if available)\nComparable situations\nExpert judgment (user experience)\nSubjective assessment (if no data)\n3. Visualization\n\nDraw tree in markdown:\n\nDecision\n├─ Option A\n│  ├─ Outcome A1 (X%) → Value Y\n│  └─ Outcome A2 (Z%) → Value W\n└─ Option B\n   └─ Outcome B1 (100%) → Value V\n\n4. EV Calculation\n\nFor each option:\n\nEV_A = (X% × Y) + (Z% × W)\nEV_B = V\n\n5. Recommendation\n\nOption with highest EV = best choice (rationally).\n\nBut add context:\n\nRisk tolerance (can user handle worst case)\nTime horizon (when is result needed)\nOther factors (reputational risk, emotions, ethics)\nApplication Examples by Domain\nTrading & Investing\n\nPosition Sizing:\n\nOptions: 5%, 10%, 20% of capital\nOutcomes: Profit/loss with different probabilities\nValue: Absolute profit in $\n\nEntry Timing:\n\nOptions: Enter now, wait for -5%, wait for -10%\nOutcomes: Price goes up/down\nValue: Opportunity cost vs better entry price\nBusiness Strategy\n\nProduct Launch:\n\nOptions: Launch / don't launch\nOutcomes: Success / failure\nValue: Revenue, market share, costs\n\nHiring Decision:\n\nOptions: Hire candidate A / candidate B / don't hire\nOutcomes: Successful onboarding / quit after X months\nValue: Productivity, costs, opportunity cost\nPersonal Decisions\n\nCareer Change:\n\nOptions: Stay / change job / start business\nOutcomes: Success / failure in new role\nValue: Salary, satisfaction, growth, risk\n\nReal Estate:\n\nOptions: Buy house A / house B / continue renting\nOutcomes: Price increase / decrease / personal situation changes\nValue: Net worth, monthly costs, quality of life\nOperations\n\nCapacity Planning:\n\nOptions: Expand production / outsource / status quo\nOutcomes: Demand increases / decreases\nValue: Profit, utilization, fixed costs\n\nVendor Selection:\n\nOptions: Vendor A / Vendor B / in-house\nOutcomes: Quality, reliability, failures\nValue: Total cost of ownership\nCalculator Script\n\nUse scripts/decision_tree.py for automated EV calculations:\n\npython3 scripts/decision_tree.py --interactive\n\n\nOr via JSON:\n\npython3 scripts/decision_tree.py --json tree.json\n\n\nJSON format:\n\n{\n  \"decision\": \"Launch product?\",\n  \"options\": [\n    {\n      \"name\": \"Launch\",\n      \"outcomes\": [\n        {\"name\": \"Success\", \"probability\": 0.4, \"value\": 500000},\n        {\"name\": \"Failure\", \"probability\": 0.6, \"value\": -200000}\n      ]\n    },\n    {\n      \"name\": \"Don't launch\",\n      \"outcomes\": [\n        {\"name\": \"Status quo\", \"probability\": 1.0, \"value\": 0}\n      ]\n    }\n  ]\n}\n\n\nOutput:\n\n📊 Decision Tree Analysis\n\nDecision: Launch product?\n\nOption 1: Launch\n  └─ EV = $80,000.00\n     ├─ Success (40.0%) → +$500,000.00\n     └─ Failure (60.0%) → -$200,000.00\n\nOption 2: Don't launch\n  └─ EV = $0.00\n     └─ Status quo (100.0%) → $0.00\n\n✅ Recommendation: Launch (EV: $80,000.00)\n\nFinal Checklist\n\nBefore giving recommendation, ensure:\n\n✅ All options covered\n✅ Probabilities sum to 100% for each branch\n✅ Values are realistic (not fantasies)\n✅ Worst case scenario is clear to user\n✅ Risk/reward ratio is explicit\n✅ Method limitations mentioned\n✅ Qualitative context added (not just EV)\nMethod Advantages\n\n✅ Simple — people understand trees intuitively ✅ Visual — clear structure ✅ Works with little data — can use expert estimates ✅ White box — transparent logic ✅ Worst/best case — extreme scenarios visible ✅ Multiple decision-makers — can account for different interests\n\nMethod Disadvantages\n\n❌ Unstable — small data changes → large tree changes ❌ Inaccurate — often more precise methods exist ❌ Subjective — probability estimates \"from the head\" ❌ Complex — becomes unwieldy with many outcomes ❌ Doesn't account for risk preference — assumes risk neutrality\n\nImportant\n\nThe method is valuable for structuring thinking, but numbers are often taken from thin air.\n\nWhat matters more is the process — forcing yourself to think through all branches and explicitly evaluate consequences.\n\nDon't sell the decision as \"scientifically proven\" — it's just a framework for conscious choice.\n\nFurther Reading\nDecision trees in operations research\nInfluence diagrams (more compact for complex decisions)\nUtility functions (accounting for risk aversion)\nMonte Carlo simulation (for greater accuracy)\nReal options analysis (for strategic decisions)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/evgyur/decision-trees",
    "publisherUrl": "https://clawhub.ai/evgyur/decision-trees",
    "owner": "evgyur",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/decision-trees",
    "downloadUrl": "https://openagent3.xyz/downloads/decision-trees",
    "agentUrl": "https://openagent3.xyz/skills/decision-trees/agent",
    "manifestUrl": "https://openagent3.xyz/skills/decision-trees/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/decision-trees/agent.md"
  }
}