Skill: projectsnowwork/reason (version 1.0.0)

--- name: reason description: Logical reasoning and decision analysis system for clear thinking. Use when user mentions decisions, logic, reasoning, critical thinking, arguments, or problem analysis. Structures decisions with frameworks, evaluates arguments for validity, identifies logical fallacies, analyzes problems systematically, and guides clear thinking. Improves decision quality through structured reasoning. --- # Reason Reasoning system. Think clearly, decide wisely. ## Critical Privacy & Safety ### Data Storage (CRITICAL) - **All reasoning data stored locally only**: `memory/reason/` - **Personal decisions** remain private - **No external analysis** tools connected - **Decision frameworks** customized locally - User controls all data retention and deletion ### Data Structure Reasoning data stored locally: - `memory/reason/decisions.json` - Decision analyses - `memory/reason/frameworks.json` - Reasoning frameworks - `memory/reason/arguments.json` - Argument evaluations - `memory/reason/fallacies.json` - Fallacy detection log ## Core Workflows ### Analyze Decision ``` User: "Should I take the new job offer?" → Use scripts/analyze_decision.py --decision "job-offer" --factors "salary,location,growth" → Structure decision with pros/cons, weighted factors, trade-off analysis ``` ### Evaluate Argument ``` User: "Evaluate this argument for validity" → Use scripts/evaluate_argument.py --argument "..." --check-logic --check-evidence → Assess premises, reasoning, evidence, and identify weaknesses ``` ### Identify Fallacy ``` User: "What fallacy is in this reasoning?" → Use scripts/identify_fallacy.py --statement "..." → Detect logical fallacies, explain why they are flawed ``` ### Structure Problem ``` User: "Help me think through this complex problem" → Use scripts/structure_problem.py --problem "..." --approach systematic → Break problem into components, identify root causes, generate solutions ``` ## Module Reference - **Decision Frameworks**: See [references/decisions.md](references/decisions.md) - **Logical Analysis**: See [references/logic.md](references/logic.md) - **Argument Evaluation**: See [references/arguments.md](references/arguments.md) - **Problem Structuring**: See [references/structuring.md](references/structuring.md) - **Cognitive Biases**: See [references/biases.md](references/biases.md) ## Scripts Reference | Script | Purpose | |--------|---------| | `analyze_decision.py` | Structure decision analysis | | `evaluate_argument.py` | Evaluate argument validity | | `identify_fallacy.py` | Identify logical fallacies | | `structure_problem.py` | Structure complex problems | | `check_bias.py` | Check for cognitive biases | | `build_framework.py` | Create decision frameworks |

path: scripts/analyze_decision.py
content: #!/usr/bin/env python3
"""Analyze decision with framework."""
import json
import os
import uuid
import argparse
from datetime import datetime

REASON_DIR = os.path.expanduser("~/.openclaw/workspace/memory/reason")

def ensure_dir():
    os.makedirs(REASON_DIR, exist_ok=True)

def main():
    parser = argparse.ArgumentParser(description='Analyze decision')
    parser.add_argument('--decision', required=True, help='Decision to analyze')
    parser.add_argument('--factors', help='Key factors (comma-separated)')
    
    args = parser.parse_args()
    
    print(f"\n🧠 DECISION ANALYSIS: {args.decision}")
    print("=" * 60)
    
    print("\nDECISION FRAMEWORK:")
    print("-" * 40)
    print("1. CLARIFY THE DECISION")
    print("   • What exactly are you deciding?")
    print("   • What are your options?")
    print("   • What is the timeline?")
    
    print("\n2. IDENTIFY FACTORS")
    if args.factors:
        factors = [f.strip() for f in args.factors.split(',')]
        for i, f in enumerate(factors, 1):
            print(f"   {i}. {f}")
    else:
        print("   • List all relevant factors")
        print("   • Consider: cost, time, risk, impact")
    
    print("\n3. EVALUATE OPTIONS")
    print("   • Pros and cons of each option")
    print("   • Trade-offs between factors")
    print("   • Short-term vs long-term consequences")
    
    print("\n4. CHECK BIASES")
    print("   • Confirmation bias (seeking confirming evidence)")
    print("   • Sunk cost fallacy (throwing good after bad)")
    print("   • Availability bias (overweighting recent events)")
    
    print("\n5. MAKE DECISION")
    print("   • Which option best aligns with your goals?")
    print("   • What would you advise a friend?")
    print("   • Can you test or reverse the decision?")
    
    # Save analysis
    analysis_id = f"DECISION-{str(uuid.uuid4())[:6].upper()}"
    analysis = {
        "id": analysis_id,
        "decision": args.decision,
        "factors": args.factors,
        "created_at": datetime.now().isoformat()
    }
    
    decisions_file = os.path.join(REASON_DIR, "decisions.json")
    data = {"decisions": []}
    if os.path.exists(decisions_file):
        with open(decisions_file, 'r') as f:
            data = json.load(f)
    
    data['decisions'].append(analysis)
    
    ensure_dir()
    with open(decisions_file, 'w') as f:
        json.dump(data, f, indent=2)
    
    print(f"\n✓ Analysis saved: {analysis_id}")

if __name__ == '__main__':
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)