version: "1.0"
name: "Default YNAB Prompts"
description: "Standard set of comprehensive YNAB analysis prompts"

prompts:
  - name: "ynab_checkup"
    description: "6-step comprehensive budget health assessment"
    parameters:
      - name: "budget_id"
        type: "string"
        description: "Specific budget ID (optional, defaults to primary budget)"
        required: false
      - name: "include_goals"
        type: "boolean"
        description: "Include goal progress analysis"
        default: true
      - name: "analysis_months"
        type: "integer"
        description: "Number of months to analyze for trends"
        default: 6
        minimum: 1
        maximum: 12
    
    steps:
      - "Get budget summary and overall health metrics"
      - "Analyze category balances and identify overspending patterns"
      - "Review goal progress and completion estimates"
      - "Examine cash flow trends and scheduled transactions"
      - "Assess net worth changes and account balances"
      - "Generate comprehensive health score and recommendations"
    
    tools_used:
      - "get_budget_summary"
      - "get_categories"
      - "get_overspending_analysis"
      - "get_goals_status"
      - "get_cash_flow_analysis"
      - "get_net_worth_trend"
      - "get_scheduled_transactions"
    
    output_format: "comprehensive_report"
    tags: ["health", "comprehensive", "analysis", "checkup"]

  - name: "monthly_budget_review"
    description: "Structured monthly performance analysis"
    parameters:
      - name: "budget_id"
        type: "string"
        description: "Specific budget ID (optional)"
        required: false
      - name: "review_month"
        type: "string"
        description: "Month to review in YYYY-MM format (optional, defaults to last month)"
        required: false
      - name: "compare_to_previous"
        type: "boolean"
        description: "Compare performance to previous month"
        default: true
    
    steps:
      - "Analyze spending performance for the specified month"
      - "Compare actual vs budgeted amounts by category"
      - "Identify top spending categories and payees"
      - "Review goal funding progress during the month"
      - "Examine cash flow for the period"
      - "Generate monthly performance insights and next month recommendations"
    
    tools_used:
      - "get_spending_report"
      - "get_categories"
      - "get_payees"
      - "get_goals_status"
      - "get_cash_flow_analysis"
      - "get_overspending_analysis"
    
    output_format: "monthly_report"
    tags: ["monthly", "review", "performance", "comparison"]

  - name: "analyze_spending_patterns"
    description: "Deep spending behavior analysis with trends and anomalies"
    parameters:
      - name: "budget_id"
        type: "string"
        description: "Specific budget ID (optional)"
        required: false
      - name: "analysis_period"
        type: "string" 
        description: "Analysis time period"
        enum: ["last_3_months", "last_6_months", "last_year", "year_to_date"]
        default: "last_6_months"
      - name: "focus_categories"
        type: "array"
        description: "Specific category groups to focus on (optional)"
        required: false
      - name: "min_transaction_amount"
        type: "number"
        description: "Minimum transaction amount to include in analysis"
        default: 0
    
    steps:
      - "Generate comprehensive spending report for the specified period"
      - "Analyze spending trends and identify patterns by category"
      - "Examine payee spending behavior and frequency"
      - "Identify spending anomalies and unusual transactions"
      - "Compare spending patterns across different time periods"
      - "Provide actionable insights for spending optimization"
    
    tools_used:
      - "get_spending_report"
      - "search_transactions"
      - "get_payees"
      - "get_categories"
      - "get_overspending_analysis"
      - "get_underspending_analysis"
    
    output_format: "detailed_analysis"
    tags: ["spending", "patterns", "trends", "analysis", "optimization"]

  - name: "cash_balance_check"
    description: "5-step cash reconciliation verification process"
    parameters:
      - name: "budget_id"
        type: "string"
        description: "Specific budget ID (optional)"
        required: false
      - name: "include_off_budget"
        type: "boolean"
        description: "Include off-budget accounts in analysis"
        default: true
      - name: "check_scheduled"
        type: "boolean"
        description: "Include upcoming scheduled transactions"
        default: true
      - name: "forecast_days"
        type: "integer"
        description: "Number of days ahead to forecast cash flow"
        default: 30
        minimum: 7
        maximum: 90
    
    steps:
      - "Get current account balances and verify totals"
      - "Check for uncleared transactions and reconciliation issues"
      - "Analyze recent cash flow trends and patterns"
      - "Review upcoming scheduled transactions and their impact"
      - "Generate cash position forecast and highlight potential issues"
    
    tools_used:
      - "get_accounts"
      - "get_account_details"
      - "get_transactions"
      - "get_scheduled_transactions"
      - "get_cash_flow_analysis"
    
    output_format: "reconciliation_report"
    tags: ["cash", "reconciliation", "balance", "verification", "forecast"]

  - name: show_unapproved_transactions
    description: Find and display all unapproved transactions in a YNAB budget with clear formatting and actionable summary information
    parameters:
      - name: budget_id
        type: string
        description: Specific budget ID (optional, uses default if not provided)
        required: false
      - name: months_back
        type: integer
        description: Number of months to search back from current date
        default: 3
        minimum: 1
        maximum: 12
      - name: since_date
        type: string
        description: Start date for search in YYYY-MM-DD format (optional, defaults to current year)
        required: false
      - name: include_cleared
        type: boolean
        description: Include cleared but unapproved transactions
        default: true
    steps:
      - "Step 1: CRITICAL - Always use since_date parameter set to current year (e.g., 2025-01-01) or calculated from months_back parameter to ensure recent transactions, not old modified ones"
      - "Step 2: Search for transactions using search_transactions with approved_only=false and the calculated since_date"
      - "Step 3: Filter results to show only transactions with approved: false"
      - "Step 4: Sort and group transactions by date (most recent first) for easy review"
      - "Step 5: Format output clearly showing: date, payee, amount, account, category, and memo (if present)"
      - "Step 6: Calculate and display summary totals (count, total amount, breakdown by account/date)"
      - "Step 7: Provide actionable next steps for user to approve transactions in YNAB"
      - "Step 8: If no unapproved transactions found, clearly state this and confirm the search date range used"
    tools_used:
      - search_transactions
    implementation_notes: |
      IMPORTANT: The search_transactions function without date filters returns old modified transactions, 
      not recent transactions. Always calculate and use since_date parameter:
      - Default: Use current year start date (e.g., "2025-01-01")
      - Custom: Calculate from months_back parameter (e.g., 3 months back from today)
      - Never search without date parameters unless user explicitly requests historical analysis
    example_usage: |
      Use this prompt to quickly identify transactions that need your review and approval in YNAB.
      Results will be grouped by date and show key transaction details to help you categorize and approve them efficiently.
      The prompt automatically searches recent transactions to avoid confusion with old data.
    tags:
      - transaction-management
      - approval-workflow
      - budget-maintenance
      - current-transactions

  - name: verify_cash_matching
    description: >-
      Executes the official YNAB cash matching verification process to ensure budget dollars match account reality. This is a critical diagnostic tool for troubleshooting budget discrepancies.
    parameters:
      - name: budget_id
        type: string
        description: Specific budget ID to analyze (optional, defaults to default budget)
        required: false
    steps:
      - "Get budget months data and identify the furthest future month with Ready to Assign status"
      - "Calculate total Available amounts across all categories for the furthest future month"
      - "Adjust Available total based on Ready to Assign amount (add if positive, subtract if negative, no change if All Money Assigned)"
      - "Calculate total actual cash by summing positive cash account balances, positive credit card balances, minus any overdrawn amounts"
      - "Compare total cash in plan vs total actual cash in accounts to identify any discrepancies"
      - "Generate comprehensive diagnostic report with findings, discrepancy analysis, and specific next steps"

    tools_used:
      - get_budget_months
      - get_categories  
      - get_accounts
      - get_budget_summary

    output_format: |
      # YNAB Cash Matching Verification Report
      
      ## Summary
      - Budget analyzed: [Budget Name]
      - Verification date: [Current Date]
      - Furthest future month: [Month/Year]
      
      ## Plan Cash Calculation
      1. Available in [Month]: $[amount]
      2. Ready to Assign adjustment: $[amount] ([positive/negative/none])
      3. **Total Cash in Plan: $[final_amount]**
      
      ## Account Cash Calculation  
      1. Cash account balances: $[amount]
      2. Positive credit card balances: $[amount]
      3. Overdrawn account adjustments: $[amount]
      4. **Total Actual Cash: $[final_amount]**
      
      ## Verification Result
      - **Status**: [MATCH/DISCREPANCY]
      - **Difference**: $[amount] (if any)
      
      ## Next Steps
      [Specific recommendations based on results]

    tags:
      - verification
      - diagnostic
      - cash-matching
      - troubleshooting
