[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79GP1RG9B8S4XFS4MKG4PDX":3,"skill-same:01M79GP1RG9B8S4XFS4MKG4PDX":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M79GP1RG9B8S4XFS4MKG4PDX","working-capital-optimizer",null,"Analyze and optimize working capital for SMBs and growth-stage companies. Calculates DSO (Days Sales Outstanding), DPO (Days Payable Outstanding), DIO (Days Inventory Outstanding), and the full Cash Conversion Cycle (CCC). Identifies AR aging risks, AP extension opportunities, and inventory carrying costs. Produces actionable improvement recommendations with projected cash flow impact. Use when: a client has cash flow strain despite profitability, AR is aging, AP terms need renegotiating, or a CFO wants to free up working capital without new financing. NOT for: tax preparation, payroll, or capital structure decisions (debt vs equity raises). NOT for real-time accounting integrations — use qbo-automation for live QBO data pulls. NOT for inventory management software configuration (use vendor-specific skill).","knownasnaffy\u002Fprompthound","knownasnaffy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64461700?v=4","01M784GPN9EQ22R78AQ2NBRP0Y","Barinderpreet Singh","01M784GPNVVWKW21N9AYXREQQJ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_04134\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: working-capital-optimizer\nversion: 1.0.0\ndescription: >\n  Analyze and optimize working capital for SMBs and growth-stage companies. Calculates DSO (Days Sales\n  Outstanding), DPO (Days Payable Outstanding), DIO (Days Inventory Outstanding), and the full Cash\n  Conversion Cycle (CCC). Identifies AR aging risks, AP extension opportunities, and inventory carrying\n  costs. Produces actionable improvement recommendations with projected cash flow impact. Use when:\n  a client has cash flow strain despite profitability, AR is aging, AP terms need renegotiating, or\n  a CFO wants to free up working capital without new financing.\n  NOT for: tax preparation, payroll, or capital structure decisions (debt vs equity raises). NOT for\n  real-time accounting integrations — use qbo-automation for live QBO data pulls. NOT for inventory\n  management software configuration (use vendor-specific skill).\nlicense: MIT\nauthor: PrecisionLedger\ntags:\n  - finance\n  - working-capital\n  - cash-flow\n  - ar\n  - ap\n  - dso\n  - dpo\n  - accounting\n  - cfo\n---\n\n# Working Capital Optimizer\n\nDiagnose and improve the cash conversion cycle for SMBs and growth-stage companies. This skill guides Sam Ledger (or any financial AI agent) through working capital analysis, identifies where cash is trapped, and produces a prioritized action plan with quantified cash release projections.\n\n---\n\n## When to Use This Skill\n\n**Trigger phrases:**\n- \"Our cash is tight but we're profitable — why?\"\n- \"What's our DSO \u002F DPO \u002F cash conversion cycle?\"\n- \"Help us optimize working capital\"\n- \"How do we free up cash without borrowing?\"\n- \"AR is aging — what should we do?\"\n- \"Can we extend our AP terms?\"\n- \"Inventory is piling up and tying up cash\"\n- \"Working capital analysis for [company]\"\n\n**NOT for:**\n- Tax filing or compliance — use a compliance workflow\n- Equity or debt capital raises — use `startup-financial-model` or `cap-table-manager`\n- Real-time accounting system sync — use `qbo-automation` skill\n- Payroll or GL reconciliation — use `payroll-gl-reconciliation` skill\n- Retail inventory management software — use vendor-specific tooling\n\n---\n\n## Core Metrics\n\n### Cash Conversion Cycle (CCC)\n\n```\nCCC = DSO + DIO - DPO\n\nWhere:\n  DSO = Days Sales Outstanding     (how long to collect from customers)\n  DIO = Days Inventory Outstanding (how long inventory sits before sale)\n  DPO = Days Payable Outstanding   (how long before you pay suppliers)\n\nLower CCC = Better (cash returns faster)\nNegative CCC = Excellent (paid by customers before paying suppliers — e.g., Amazon)\n```\n\n### DSO — Days Sales Outstanding\n\n```\nDSO = (Accounts Receivable \u002F Revenue) × Days in Period\n\nExample:\n  AR Balance: $150,000\n  Revenue (last 90 days): $450,000\n  DSO = ($150,000 \u002F $450,000) × 90 = 30 days\n\nIndustry benchmarks:\n  \u003C 30 days: Excellent\n  30-45 days: Acceptable\n  45-60 days: Needs attention\n  > 60 days: Cash flow risk\n```\n\n### DPO — Days Payable Outstanding\n\n```\nDPO = (Accounts Payable \u002F COGS) × Days in Period\n\nExample:\n  AP Balance: $80,000\n  COGS (last 90 days): $270,000\n  DPO = ($80,000 \u002F $270,000) × 90 = 26.7 days\n\nStrategy: Maximize DPO (pay as late as allowed) without damaging supplier relationships.\nTarget: Match or slightly exceed supplier terms (Net 30 → pay day 28-30, not day 5)\n```\n\n### DIO — Days Inventory Outstanding\n\n```\nDIO = (Inventory \u002F COGS) × Days in Period\n\nExample:\n  Inventory: $120,000\n  COGS (last 90 days): $270,000\n  DIO = ($120,000 \u002F $270,000) × 90 = 40 days\n\nFor service businesses: DIO = 0 (no physical inventory)\n```\n\n---\n\n## Analysis Workflow\n\n### Step 1: Gather Inputs\n\nCollect from financial statements or QBO export:\n\n```\nBalance Sheet (current period):\n  □ Accounts Receivable balance\n  □ Inventory balance (if applicable)\n  □ Accounts Payable balance\n  □ Accrued Expenses\n  □ Deferred Revenue (if any)\n\nIncome Statement (trailing 90 days preferred):\n  □ Revenue\n  □ Cost of Goods Sold (COGS)\n\nAR Aging Report:\n  □ Current (0-30 days)\n  □ 31-60 days\n  □ 61-90 days\n  □ 90+ days (specify amounts)\n\nAP Aging Report:\n  □ Current\n  □ Overdue amounts\n  □ Key supplier names and terms\n```\n\n### Step 2: Calculate Current State\n\n```python\ndef calculate_working_capital_metrics(\n    ar: float,\n    inventory: float,\n    ap: float,\n    revenue_90d: float,\n    cogs_90d: float,\n    period_days: int = 90\n) -> dict:\n    \"\"\"\n    Calculate core working capital metrics.\n    \n    Args:\n        ar: Accounts Receivable balance\n        inventory: Inventory balance (0 for service businesses)\n        ap: Accounts Payable balance\n        revenue_90d: Revenue for the measurement period\n        cogs_90d: COGS for the measurement period\n        period_days: Length of measurement period (default 90)\n    \n    Returns:\n        Dict with DSO, DIO, DPO, CCC, and working capital amount\n    \"\"\"\n    dso = (ar \u002F revenue_90d) * period_days if revenue_90d else 0\n    dio = (inventory \u002F cogs_90d) * period_days if cogs_90d and inventory else 0\n    dpo = (ap \u002F cogs_90d) * period_days if cogs_90d else 0\n    ccc = dso + dio - dpo\n    \n    working_capital = ar + inventory - ap\n    \n    return {\n        \"dso_days\": round(dso, 1),\n        \"dio_days\": round(dio, 1),\n        \"dpo_days\": round(dpo, 1),\n        \"ccc_days\": round(ccc, 1),\n        \"working_capital_usd\": working_capital,\n        \"ar_usd\": ar,\n        \"inventory_usd\": inventory,\n        \"ap_usd\": ap,\n        \"assessment\": _assess_ccc(ccc, dso, dpo)\n    }\n\ndef _assess_ccc(ccc: float, dso: float, dpo: float) -> str:\n    if ccc \u003C 0:\n        return \"excellent\"\n    elif ccc \u003C= 30:\n        return \"good\"\n    elif ccc \u003C= 60:\n        return \"acceptable\"\n    elif ccc \u003C= 90:\n        return \"needs_improvement\"\n    else:\n        return \"critical\"\n```\n\n### Step 3: AR Aging Analysis\n\n```python\ndef analyze_ar_aging(aging_buckets: dict, total_ar: float) -> dict:\n    \"\"\"\n    Analyze AR aging and identify collection risk.\n    \n    Args:\n        aging_buckets: {\"0_30\": x, \"31_60\": x, \"61_90\": x, \"90_plus\": x}\n        total_ar: Total AR balance (validation check)\n    \n    Returns:\n        Risk assessment and recommended actions\n    \"\"\"\n    at_risk = aging_buckets.get(\"61_90\", 0) + aging_buckets.get(\"90_plus\", 0)\n    at_risk_pct = at_risk \u002F total_ar if total_ar else 0\n    \n    recommendations = []\n    \n    if aging_buckets.get(\"31_60\", 0) \u002F total_ar > 0.3:\n        recommendations.append({\n            \"action\": \"Send reminder notices to 31-60 day balances\",\n            \"priority\": \"medium\",\n            \"cash_impact\": aging_buckets[\"31_60\"],\n            \"timeline\": \"within 1 week\"\n        })\n    \n    if aging_buckets.get(\"61_90\", 0) > 0:\n        recommendations.append({\n            \"action\": \"Direct phone outreach to 61-90 day accounts\",\n            \"priority\": \"high\",\n            \"cash_impact\": aging_buckets[\"61_90\"],\n            \"timeline\": \"this week\"\n        })\n    \n    if aging_buckets.get(\"90_plus\", 0) > 0:\n        recommendations.append({\n            \"action\": \"Place 90+ day accounts on collections \u002F payment plan\",\n            \"priority\": \"critical\",\n            \"cash_impact\": aging_buckets[\"90_plus\"],\n            \"timeline\": \"immediately\"\n        })\n    \n    return {\n        \"at_risk_usd\": at_risk,\n        \"at_risk_pct\": round(at_risk_pct * 100, 1),\n        \"collectible_estimate_usd\": at_risk * 0.75,  # 75% recovery assumption\n        \"risk_level\": \"critical\" if at_risk_pct > 0.20 else \"moderate\" if at_risk_pct > 0.10 else \"low\",\n        \"recommendations\": recommendations\n    }\n```\n\n### Step 4: AP Optimization Analysis\n\n```python\ndef analyze_ap_optimization(\n    ap_balance: float,\n    avg_payment_day: float,\n    standard_terms_days: int,\n    monthly_cogs: float\n) -> dict:\n    \"\"\"\n    Identify AP extension opportunities.\n    \n    Strategy: Pay on due date, not early (unless early-pay discount justifies it)\n    \"\"\"\n    # Days of additional cash float if paying on terms vs. current practice\n    days_to_extend = max(0, standard_terms_days - avg_payment_day)\n    daily_cogs = monthly_cogs \u002F 30\n    cash_freed = days_to_extend * daily_cogs\n    \n    # Early pay discount analysis\n    # Example: \"2\u002F10 Net 30\" = 2% discount if paid within 10 days\n    # Annualized cost of NOT taking discount = 2% \u002F (30-10) * 365 = 36.5% annualized\n    # If cost of capital \u003C 36.5%, TAKE the discount\n    \n    return {\n        \"current_avg_payment_day\": avg_payment_day,\n        \"standard_terms_days\": standard_terms_days,\n        \"days_of_extension_available\": days_to_extend,\n        \"estimated_cash_freed_usd\": round(cash_freed, 0),\n        \"recommendation\": (\n            f\"Extend payment timing by {days_to_extend} days to terms. \"\n            f\"Frees ~${cash_freed:,.0f} in working capital.\"\n        ) if days_to_extend > 0 else \"Already paying close to terms. Focus on negotiating extended terms with key suppliers.\"\n    }\n```\n\n### Step 5: Generate Action Plan\n\nStructure recommendations by cash impact and implementation speed:\n\n```python\ndef generate_action_plan(metrics: dict, ar_analysis: dict, ap_analysis: dict) -> dict:\n    \"\"\"\n    Produce prioritized working capital improvement plan.\n    \"\"\"\n    quick_wins = []      # \u003C 30 days, low friction\n    medium_term = []     # 30-90 days\n    strategic = []       # 90+ days, structural changes\n    \n    total_cash_release_estimate = 0\n    \n    # AR Quick Wins\n    if ar_analysis[\"at_risk_usd\"] > 0:\n        quick_wins.append({\n            \"lever\": \"AR Collections\",\n            \"action\": f\"Collect 61-90 day and 90+ day balances (${ar_analysis['at_risk_usd']:,.0f} at risk)\",\n            \"cash_impact_usd\": ar_analysis[\"collectible_estimate_usd\"],\n            \"timeline_days\": 30,\n            \"effort\": \"medium\"\n        })\n        total_cash_release_estimate += ar_analysis[\"collectible_estimate_usd\"]\n    \n    # AP Extension\n    if ap_analysis[\"estimated_cash_freed_usd\"] > 0:\n        quick_wins.append({\n            \"lever\": \"AP Extension\",\n            \"action\": ap_analysis[\"recommendation\"],\n            \"cash_impact_usd\": ap_analysis[\"estimated_cash_freed_usd\"],\n            \"timeline_days\": 14,\n            \"effort\": \"low\"\n        })\n        total_cash_release_estimate += ap_analysis[\"estimated_cash_freed_usd\"]\n    \n    # DSO Reduction\n    if metrics[\"dso_days\"] > 45:\n        dso_target = 35\n        daily_revenue = metrics[\"ar_usd\"] \u002F metrics[\"dso_days\"] if metrics[\"dso_days\"] else 0\n        cash_from_dso = (metrics[\"dso_days\"] - dso_target) * daily_revenue\n        medium_term.append({\n            \"lever\": \"Invoice Terms\",\n            \"action\": f\"Shorten payment terms from Net {int(metrics['dso_days'])} to Net {dso_target}. Offer early-pay incentive (1% Net 10).\",\n            \"cash_impact_usd\": round(cash_from_dso, 0),\n            \"timeline_days\": 60,\n            \"effort\": \"medium\"\n        })\n    \n    # Structural AP Terms Negotiation\n    strategic.append({\n        \"lever\": \"AP Terms Renegotiation\",\n        \"action\": \"Renegotiate key supplier terms from Net 30 to Net 45\u002F60\",\n        \"cash_impact_usd\": None,  # Depends on negotiation outcome\n        \"timeline_days\": 90,\n        \"effort\": \"high\"\n    })\n    \n    return {\n        \"total_estimated_cash_release_usd\": total_cash_release_estimate,\n        \"quick_wins\": quick_wins,\n        \"medium_term\": medium_term,\n        \"strategic\": strategic,\n        \"summary\": f\"Estimated ${total_cash_release_estimate:,.0f} in working capital can be freed within 30-60 days through focused collection and AP timing improvements.\"\n    }\n```\n\n---\n\n## Industry Benchmarks\n\n| Industry | DSO Target | DPO Target | CCC Target |\n|---|---|---|---|\n| SaaS \u002F Software | 30-45 days | 30-45 days | 0-30 days |\n| Professional Services | 30-45 days | 30-45 days | 15-45 days |\n| Manufacturing | 40-55 days | 40-60 days | 40-80 days |\n| Distribution \u002F Wholesale | 35-50 days | 35-55 days | 30-60 days |\n| Retail | 3-7 days | 30-45 days | -20 to 20 days |\n| Construction | 45-75 days | 30-45 days | 45-90 days |\n| Healthcare \u002F Medical | 45-65 days | 30-45 days | 45-75 days |\n\n---\n\n## Output Format\n\n### Executive Summary (for client delivery)\n\n```\nWORKING CAPITAL ANALYSIS — [Company] — [Date]\n\nCURRENT STATE:\n  DSO: [X] days | Target: [Y] days | Gap: [Z] days\n  DIO: [X] days (N\u002FA for services)\n  DPO: [X] days | Target: [Y] days\n  CCC: [X] days | Status: [Good\u002FAcceptable\u002FNeeds Improvement\u002FCritical]\n\n  Working Capital: $[X]\n  AR at Risk (60+ days): $[X] ([Y]% of AR)\n\nKEY FINDINGS:\n  1. [Most important issue — quantified]\n  2. [Second issue — quantified]\n  3. [Third issue — quantified]\n\nPRIORITIZED ACTION PLAN:\n  QUICK WINS (0-30 days, ~$[X] cash release):\n    □ [Action 1] → $[impact]\n    □ [Action 2] → $[impact]\n\n  MEDIUM-TERM (30-90 days, ~$[X] additional):\n    □ [Action 3]\n    □ [Action 4]\n\n  STRATEGIC (90+ days):\n    □ [Action 5]\n\nNEXT STEP: [Single most important immediate action]\n```\n\n### Structured JSON Output\n\n```json\n{\n  \"company\": \"Acme Corp\",\n  \"analysis_date\": \"2026-03-15\",\n  \"period\": \"Q1 2026 (Jan-Mar)\",\n  \"metrics\": {\n    \"dso_days\": 52,\n    \"dio_days\": 0,\n    \"dpo_days\": 24,\n    \"ccc_days\": 28,\n    \"working_capital_usd\": 185000,\n    \"assessment\": \"needs_improvement\"\n  },\n  \"ar_aging\": {\n    \"current_0_30\": 90000,\n    \"days_31_60\": 45000,\n    \"days_61_90\": 22000,\n    \"days_90_plus\": 18000,\n    \"total\": 175000,\n    \"at_risk_pct\": 22.9,\n    \"risk_level\": \"critical\"\n  },\n  \"action_plan\": {\n    \"total_estimated_cash_release_usd\": 62500,\n    \"quick_wins\": [\n      {\n        \"lever\": \"AR Collections\",\n        \"action\": \"Collect 61-90 and 90+ day balances ($40,000 at risk)\",\n        \"cash_impact_usd\": 30000,\n        \"timeline_days\": 30\n      },\n      {\n        \"lever\": \"AP Extension\",\n        \"action\": \"Extend payment timing by 6 days to terms. Frees ~$12,500.\",\n        \"cash_impact_usd\": 12500,\n        \"timeline_days\": 14\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Example Usage\n\n**User:** \"Our QBO shows $175k AR, $70k AP, $2M in revenue last year. We're profitable but always feel cash-strapped. What's going on?\"\n\n**Sam's response:**\n\n```\nWorking Capital Snapshot:\n\n  Revenue run rate: $2M\u002Fyr → ~$500k\u002Fquarter\n  AR: $175,000\n  AP: $70,000\n\n  DSO = ($175,000 \u002F $500,000) × 90 = 31.5 days ← borderline, worth watching\n  DPO = ($70,000 \u002F estimated COGS) × 90 = need COGS to confirm\n  CCC = approx 25-35 days\n\nPotential issues despite good DSO:\n  1. Revenue recognition vs cash: if billing is end-of-month heavy, AR spikes temporarily\n  2. AP payment behavior: if you're paying invoices early (day 5 of Net 30 terms), you're \n     giving suppliers a 25-day float for free — roughly $58k in \"gifted\" working capital\n  3. High AR concentration: if 20% of customers account for 80% of AR, one slow payer \n     tanks your cash position\n\nNext step: Pull AR aging report from QBO. If 30+ day buckets are > 15% of AR, \nthat's your primary fix. Also check when you're actually paying AP.\n```\n\n---\n\n## Integration Points\n\n- **`qbo-automation`** — Pull AR aging, AP aging, and balance sheet data directly from QuickBooks Online\n- **`ar-collections-agent`** — Execute collection workflows on identified aging accounts\n- **`thirteen-week-cash-flow`** — Feed working capital metrics into 13-week rolling cash forecast\n- **`kpi-alert-system`** — Set DSO\u002FDPO threshold alerts for ongoing monitoring\n- **`vendor-payment-optimizer`** — Detailed AP vendor-by-vendor payment term analysis\n- **`financial-analysis-agent`** — Full financial health assessment including working capital context\n- **`budget-vs-actual`** — Compare working capital targets vs actuals over time\n\n---\n\n## Quick Reference Formulas\n\n```\nDSO = (AR \u002F Revenue) × Period Days\nDPO = (AP \u002F COGS) × Period Days\nDIO = (Inventory \u002F COGS) × Period Days\nCCC = DSO + DIO - DPO\n\nWorking Capital = Current Assets - Current Liabilities\nNet Working Capital = AR + Inventory - AP (operating focus)\n\nCurrent Ratio = Current Assets \u002F Current Liabilities  (target ≥ 1.5)\nQuick Ratio   = (Cash + AR) \u002F Current Liabilities     (target ≥ 1.0)\n\nAnnual Cash Impact of 1-Day DSO Reduction = Annual Revenue \u002F 365\nAnnual Cash Impact of 1-Day DPO Extension = Annual COGS \u002F 365\n```\n","# Working Capital Optimizer\n\nDiagnose and improve the cash conversion cycle for SMBs and growth-stage companies. This skill guides Sam Ledger (or any financial AI agent) through working capital analysis, identifies where cash is trapped, and produces a prioritized action plan with quantified cash release projections.\n\n---\n\n## When to Use This Skill\n\n**Trigger phrases:**\n- \"Our cash is tight but we're profitable — why?\"\n- \"What's our DSO \u002F DPO \u002F cash conversion cycle?\"\n- \"Help us optimize working capital\"\n- \"How do we free up cash without borrowing?\"\n- \"AR is aging — what should we do?\"\n- \"Can we extend our AP terms?\"\n- \"Inventory is piling up and tying up cash\"\n- \"Working capital analysis for [company]\"\n\n**NOT for:**\n- Tax filing or compliance — use a compliance workflow\n- Equity or debt capital raises — use `startup-financial-model` or `cap-table-manager`\n- Real-time accounting system sync — use `qbo-automation` skill\n- Payroll or GL reconciliation — use `payroll-gl-reconciliation` skill\n- Retail inventory management software — use vendor-specific tooling\n\n---\n\n## Core Metrics\n\n### Cash Conversion Cycle (CCC)\n\n```\nCCC = DSO + DIO - DPO\n\nWhere:\n  DSO = Days Sales Outstanding     (how long to collect from customers)\n  DIO = Days Inventory Outstanding (how long inventory sits before sale)\n  DPO = Days Payable Outstanding   (how long before you pay suppliers)\n\nLower CCC = Better (cash returns faster)\nNegative CCC = Excellent (paid by customers before paying suppliers — e.g., Amazon)\n```\n\n### DSO — Days Sales Outstanding\n\n```\nDSO = (Accounts Receivable \u002F Revenue) × Days in Period\n\nExample:\n  AR Balance: $150,000\n  Revenue (last 90 days): $450,000\n  DSO = ($150,000 \u002F $450,000) × 90 = 30 days\n\nIndustry benchmarks:\n  \u003C 30 days: Excellent\n  30-45 days: Acceptable\n  45-60 days: Needs attention\n  > 60 days: Cash flow risk\n```\n\n### DPO — Days Payable Outstanding\n\n```\nDPO = (Accounts Payable \u002F COGS) × Days in Period\n\nExample:\n  AP Balance: $80,000\n  COGS (last 90 days): $270,000\n  DPO = ($80,000 \u002F $270,000) × 90 = 26.7 days\n\nStrategy: Maximize DPO (pay as late as allowed) without damaging supplier relationships.\nTarget: Match or slightly exceed supplier terms (Net 30 → pay day 28-30, not day 5)\n```\n\n### DIO — Days Inventory Outstanding\n\n```\nDIO = (Inventory \u002F COGS) × Days in Period\n\nExample:\n  Inventory: $120,000\n  COGS (last 90 days): $270,000\n  DIO = ($120,000 \u002F $270,000) × 90 = 40 days\n\nFor service businesses: DIO = 0 (no physical inventory)\n```\n\n---\n\n## Analysis Workflow\n\n### Step 1: Gather Inputs\n\nCollect from financial statements or QBO export:\n\n```\nBalance Sheet (current period):\n  □ Accounts Receivable balance\n  □ Inventory balance (if applicable)\n  □ Accounts Payable balance\n  □ Accrued Expenses\n  □ Deferred Revenue (if any)\n\nIncome Statement (trailing 90 days preferred):\n  □ Revenue\n  □ Cost of Goods Sold (COGS)\n\nAR Aging Report:\n  □ Current (0-30 days)\n  □ 31-60 days\n  □ 61-90 days\n  □ 90+ days (specify amounts)\n\nAP Aging Report:\n  □ Current\n  □ Overdue amounts\n  □ Key supplier names and terms\n```\n\n### Step 2: Calculate Current State\n\n```python\ndef calculate_working_capital_metrics(\n    ar: float,\n    inventory: float,\n    ap: float,\n    revenue_90d: float,\n    cogs_90d: float,\n    period_days: int = 90\n) -> dict:\n    \"\"\"\n    Calculate core working capital metrics.\n    \n    Args:\n        ar: Accounts Receivable balance\n        inventory: Inventory balance (0 for service businesses)\n        ap: Accounts Payable balance\n        revenue_90d: Revenue for the measurement period\n        cogs_90d: COGS for the measurement period\n        period_days: Length of measurement period (default 90)\n    \n    Returns:\n        Dict with DSO, DIO, DPO, CCC, and working capital amount\n    \"\"\"\n    dso = (ar \u002F revenue_90d) * period_days if revenue_90d else 0\n    dio = (inventory \u002F cogs_90d) * period_days if cogs_90d and inventory else 0\n    dpo = (ap \u002F cogs_90d) * period_days if cogs_90d else 0\n    ccc = dso + dio - dpo\n    \n    working_capital = ar + inventory - ap\n    \n    return {\n        \"dso_days\": round(dso, 1),\n        \"dio_days\": round(dio, 1),\n        \"dpo_days\": round(dpo, 1),\n        \"ccc_days\": round(ccc, 1),\n        \"working_capital_usd\": working_capital,\n        \"ar_usd\": ar,\n        \"inventory_usd\": inventory,\n        \"ap_usd\": ap,\n        \"assessment\": _assess_ccc(ccc, dso, dpo)\n    }\n\ndef _assess_ccc(ccc: float, dso: float, dpo: float) -> str:\n    if ccc \u003C 0:\n        return \"excellent\"\n    elif ccc \u003C= 30:\n        return \"good\"\n    elif ccc \u003C= 60:\n        return \"acceptable\"\n    elif ccc \u003C= 90:\n        return \"needs_improvement\"\n    else:\n        return \"critical\"\n```\n\n### Step 3: AR Aging Analysis\n\n```python\ndef analyze_ar_aging(aging_buckets: dict, total_ar: float) -> dict:\n    \"\"\"\n    Analyze AR aging and identify collection risk.\n    \n    Args:\n        aging_buckets: {\"0_30\": x, \"31_60\": x, \"61_90\": x, \"90_plus\": x}\n        total_ar: Total AR balance (validation check)\n    \n    Returns:\n        Risk assessment and recommended actions\n    \"\"\"\n    at_risk = aging_buckets.get(\"61_90\", 0) + aging_buckets.get(\"90_plus\", 0)\n    at_risk_pct = at_risk \u002F total_ar if total_ar else 0\n    \n    recommendations = []\n    \n    if aging_buckets.get(\"31_60\", 0) \u002F total_ar > 0.3:\n        recommendations.append({\n            \"action\": \"Send reminder notices to 31-60 day balances\",\n            \"priority\": \"medium\",\n            \"cash_impact\": aging_buckets[\"31_60\"],\n            \"timeline\": \"within 1 week\"\n        })\n    \n    if aging_buckets.get(\"61_90\", 0) > 0:\n        recommendations.append({\n            \"action\": \"Direct phone outreach to 61-90 day accounts\",\n            \"priority\": \"high\",\n            \"cash_impact\": aging_buckets[\"61_90\"],\n            \"timeline\": \"this week\"\n        })\n    \n    if aging_buckets.get(\"90_plus\", 0) > 0:\n        recommendations.append({\n            \"action\": \"Place 90+ day accounts on collections \u002F payment plan\",\n            \"priority\": \"critical\",\n            \"cash_impact\": aging_buckets[\"90_plus\"],\n            \"timeline\": \"immediately\"\n        })\n    \n    return {\n        \"at_risk_usd\": at_risk,\n        \"at_risk_pct\": round(at_risk_pct * 100, 1),\n        \"collectible_estimate_usd\": at_risk * 0.75,  # 75% recovery assumption\n        \"risk_level\": \"critical\" if at_risk_pct > 0.20 else \"moderate\" if at_risk_pct > 0.10 else \"low\",\n        \"recommendations\": recommendations\n    }\n```\n\n### Step 4: AP Optimization Analysis\n\n```python\ndef analyze_ap_optimization(\n    ap_balance: float,\n    avg_payment_day: float,\n    standard_terms_days: int,\n    monthly_cogs: float\n) -> dict:\n    \"\"\"\n    Identify AP extension opportunities.\n    \n    Strategy: Pay on due date, not early (unless early-pay discount justifies it)\n    \"\"\"\n    # Days of additional cash float if paying on terms vs. current practice\n    days_to_extend = max(0, standard_terms_days - avg_payment_day)\n    daily_cogs = monthly_cogs \u002F 30\n    cash_freed = days_to_extend * daily_cogs\n    \n    # Early pay discount analysis\n    # Example: \"2\u002F10 Net 30\" = 2% discount if paid within 10 days\n    # Annualized cost of NOT taking discount = 2% \u002F (30-10) * 365 = 36.5% annualized\n    # If cost of capital \u003C 36.5%, TAKE the discount\n    \n    return {\n        \"current_avg_payment_day\": avg_payment_day,\n        \"standard_terms_days\": standard_terms_days,\n        \"days_of_extension_available\": days_to_extend,\n        \"estimated_cash_freed_usd\": round(cash_freed, 0),\n        \"recommendation\": (\n            f\"Extend payment timing by {days_to_extend} days to terms. \"\n            f\"Frees ~${cash_freed:,.0f} in working capital.\"\n        ) if days_to_extend > 0 else \"Already paying close to terms. Focus on negotiating extended terms with key suppliers.\"\n    }\n```\n\n### Step 5: Generate Action Plan\n\nStructure recommendations by cash impact and implementation speed:\n\n```python\ndef generate_action_plan(metrics: dict, ar_analysis: dict, ap_analysis: dict) -> dict:\n    \"\"\"\n    Produce prioritized working capital improvement plan.\n    \"\"\"\n    quick_wins = []      # \u003C 30 days, low friction\n    medium_term = []     # 30-90 days\n    strategic = []       # 90+ days, structural changes\n    \n    total_cash_release_estimate = 0\n    \n    # AR Quick Wins\n    if ar_analysis[\"at_risk_usd\"] > 0:\n        quick_wins.append({\n            \"lever\": \"AR Collections\",\n            \"action\": f\"Collect 61-90 day and 90+ day balances (${ar_analysis['at_risk_usd']:,.0f} at risk)\",\n            \"cash_impact_usd\": ar_analysis[\"collectible_estimate_usd\"],\n            \"timeline_days\": 30,\n            \"effort\": \"medium\"\n        })\n        total_cash_release_estimate += ar_analysis[\"collectible_estimate_usd\"]\n    \n    # AP Extension\n    if ap_analysis[\"estimated_cash_freed_usd\"] > 0:\n        quick_wins.append({\n            \"lever\": \"AP Extension\",\n            \"action\": ap_analysis[\"recommendation\"],\n            \"cash_impact_usd\": ap_analysis[\"estimated_cash_freed_usd\"],\n            \"timeline_days\": 14,\n            \"effort\": \"low\"\n        })\n        total_cash_release_estimate += ap_analysis[\"estimated_cash_freed_usd\"]\n    \n    # DSO Reduction\n    if metrics[\"dso_days\"] > 45:\n        dso_target = 35\n        daily_revenue = metrics[\"ar_usd\"] \u002F metrics[\"dso_days\"] if metrics[\"dso_days\"] else 0\n        cash_from_dso = (metrics[\"dso_days\"] - dso_target) * daily_revenue\n        medium_term.append({\n            \"lever\": \"Invoice Terms\",\n            \"action\": f\"Shorten payment terms from Net {int(metrics['dso_days'])} to Net {dso_target}. Offer early-pay incentive (1% Net 10).\",\n            \"cash_impact_usd\": round(cash_from_dso, 0),\n            \"timeline_days\": 60,\n            \"effort\": \"medium\"\n        })\n    \n    # Structural AP Terms Negotiation\n    strategic.append({\n        \"lever\": \"AP Terms Renegotiation\",\n        \"action\": \"Renegotiate key supplier terms from Net 30 to Net 45\u002F60\",\n        \"cash_impact_usd\": None,  # Depends on negotiation outcome\n        \"timeline_days\": 90,\n        \"effort\": \"high\"\n    })\n    \n    return {\n        \"total_estimated_cash_release_usd\": total_cash_release_estimate,\n        \"quick_wins\": quick_wins,\n        \"medium_term\": medium_term,\n        \"strategic\": strategic,\n        \"summary\": f\"Estimated ${total_cash_release_estimate:,.0f} in working capital can be freed within 30-60 days through focused collection and AP timing improvements.\"\n    }\n```\n\n---\n\n## Industry Benchmarks\n\n| Industry | DSO Target | DPO Target | CCC Target |\n|---|---|---|---|\n| SaaS \u002F Software | 30-45 days | 30-45 days | 0-30 days |\n| Professional Services | 30-45 days | 30-45 days | 15-45 days |\n| Manufacturing | 40-55 days | 40-60 days | 40-80 days |\n| Distribution \u002F Wholesale | 35-50 days | 35-55 days | 30-60 days |\n| Retail | 3-7 days | 30-45 days | -20 to 20 days |\n| Construction | 45-75 days | 30-45 days | 45-90 days |\n| Healthcare \u002F Medical | 45-65 days | 30-45 days | 45-75 days |\n\n---\n\n## Output Format\n\n### Executive Summary (for client delivery)\n\n```\nWORKING CAPITAL ANALYSIS — [Company] — [Date]\n\nCURRENT STATE:\n  DSO: [X] days | Target: [Y] days | Gap: [Z] days\n  DIO: [X] days (N\u002FA for services)\n  DPO: [X] days | Target: [Y] days\n  CCC: [X] days | Status: [Good\u002FAcceptable\u002FNeeds Improvement\u002FCritical]\n\n  Working Capital: $[X]\n  AR at Risk (60+ days): $[X] ([Y]% of AR)\n\nKEY FINDINGS:\n  1. [Most important issue — quantified]\n  2. [Second issue — quantified]\n  3. [Third issue — quantified]\n\nPRIORITIZED ACTION PLAN:\n  QUICK WINS (0-30 days, ~$[X] cash release):\n    □ [Action 1] → $[impact]\n    □ [Action 2] → $[impact]\n\n  MEDIUM-TERM (30-90 days, ~$[X] additional):\n    □ [Action 3]\n    □ [Action 4]\n\n  STRATEGIC (90+ days):\n    □ [Action 5]\n\nNEXT STEP: [Single most important immediate action]\n```\n\n### Structured JSON Output\n\n```json\n{\n  \"company\": \"Acme Corp\",\n  \"analysis_date\": \"2026-03-15\",\n  \"period\": \"Q1 2026 (Jan-Mar)\",\n  \"metrics\": {\n    \"dso_days\": 52,\n    \"dio_days\": 0,\n    \"dpo_days\": 24,\n    \"ccc_days\": 28,\n    \"working_capital_usd\": 185000,\n    \"assessment\": \"needs_improvement\"\n  },\n  \"ar_aging\": {\n    \"current_0_30\": 90000,\n    \"days_31_60\": 45000,\n    \"days_61_90\": 22000,\n    \"days_90_plus\": 18000,\n    \"total\": 175000,\n    \"at_risk_pct\": 22.9,\n    \"risk_level\": \"critical\"\n  },\n  \"action_plan\": {\n    \"total_estimated_cash_release_usd\": 62500,\n    \"quick_wins\": [\n      {\n        \"lever\": \"AR Collections\",\n        \"action\": \"Collect 61-90 and 90+ day balances ($40,000 at risk)\",\n        \"cash_impact_usd\": 30000,\n        \"timeline_days\": 30\n      },\n      {\n        \"lever\": \"AP Extension\",\n        \"action\": \"Extend payment timing by 6 days to terms. Frees ~$12,500.\",\n        \"cash_impact_usd\": 12500,\n        \"timeline_days\": 14\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Example Usage\n\n**User:** \"Our QBO shows $175k AR, $70k AP, $2M in revenue last year. We're profitable but always feel cash-strapped. What's going on?\"\n\n**Sam's response:**\n\n```\nWorking Capital Snapshot:\n\n  Revenue run rate: $2M\u002Fyr → ~$500k\u002Fquarter\n  AR: $175,000\n  AP: $70,000\n\n  DSO = ($175,000 \u002F $500,000) × 90 = 31.5 days ← borderline, worth watching\n  DPO = ($70,000 \u002F estimated COGS) × 90 = need COGS to confirm\n  CCC = approx 25-35 days\n\nPotential issues despite good DSO:\n  1. Revenue recognition vs cash: if billing is end-of-month heavy, AR spikes temporarily\n  2. AP payment behavior: if you're paying invoices early (day 5 of Net 30 terms), you're \n     giving suppliers a 25-day float for free — roughly $58k in \"gifted\" working capital\n  3. High AR concentration: if 20% of customers account for 80% of AR, one slow payer \n     tanks your cash position\n\nNext step: Pull AR aging report from QBO. If 30+ day buckets are > 15% of AR, \nthat's your primary fix. Also check when you're actually paying AP.\n```\n\n---\n\n## Integration Points\n\n- **`qbo-automation`** — Pull AR aging, AP aging, and balance sheet data directly from QuickBooks Online\n- **`ar-collections-agent`** — Execute collection workflows on identified aging accounts\n- **`thirteen-week-cash-flow`** — Feed working capital metrics into 13-week rolling cash forecast\n- **`kpi-alert-system`** — Set DSO\u002FDPO threshold alerts for ongoing monitoring\n- **`vendor-payment-optimizer`** — Detailed AP vendor-by-vendor payment term analysis\n- **`financial-analysis-agent`** — Full financial health assessment including working capital context\n- **`budget-vs-actual`** — Compare working capital targets vs actuals over time\n\n---\n\n## Quick Reference Formulas\n\n```\nDSO = (AR \u002F Revenue) × Period Days\nDPO = (AP \u002F COGS) × Period Days\nDIO = (Inventory \u002F COGS) × Period Days\nCCC = DSO + DIO - DPO\n\nWorking Capital = Current Assets - Current Liabilities\nNet Working Capital = AR + Inventory - AP (operating focus)\n\nCurrent Ratio = Current Assets \u002F Current Liabilities  (target ≥ 1.5)\nQuick Ratio   = (Cash + AR) \u002F Current Liabilities     (target ≥ 1.0)\n\nAnnual Cash Impact of 1-Day DSO Reduction = Annual Revenue \u002F 365\nAnnual Cash Impact of 1-Day DPO Extension = Annual COGS \u002F 365\n```\n",{"name":5,"tags":24,"author":34,"license":15,"version":35,"description":36},[25,26,27,28,29,30,31,32,33],"finance","working-capital","cash-flow","ar","ap","dso","dpo","accounting","cfo","PrecisionLedger","1.0.0","Analyze and optimize working capital for SMBs and growth-stage companies. Calculates DSO (Days Sales Outstanding), DPO (Days Payable Outstanding), DIO (Days Inventory Outstanding), and the full Cash Conversion Cycle (CCC). Identifies AR aging risks, AP extension opportunities, and inventory carrying costs. Produces actionable improvement recommendations with projected cash flow impact. Use when: a client has cash flow strain despite profitability, AR is aging, AP terms need renegotiating, or a CFO wants to free up working capital without new financing. NOT for: tax preparation, payroll, or capital structure decisions (debt vs equity raises). NOT for real-time accounting integrations — use qbo-automation for live QBO data pulls. NOT for inventory management software configuration (use vendor-specific skill).\n","main","c52d4f98d93fb20c8e316f773e3b6dbfca1569c3","dataset\u002Fcase_04134",1,"https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound","https:\u002F\u002Fgithub.com\u002Fknownasnaffy","https:\u002F\u002Fbarinderpreet.com\u002F","My IDE is louder than my social life.","2026-10-26 21:36:33",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add knownasnaffy\u002Fprompthound --skill working-capital-optimizer",{"tool":52,"command":53},"bunx","bunx skills add knownasnaffy\u002Fprompthound --skill working-capital-optimizer",{"tool":55,"command":56},"pnpm","pnpm dlx skills add knownasnaffy\u002Fprompthound --skill working-capital-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_04134\u002FSKILL.md",true,[],[61,69,76,83,90,97],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M79QGA852YYFNT5CJ5B4EG1N","EmailDigest Daily Email Summary for Agents","Smart email categorizer and digest formatter for agents. Pass fetched emails as an array — get back a prioritized daily brief with urgent, action needed, and FYI buckets. Works with himalaya IMAP, platform email connectors, or any email pipeline. All processing is local.","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05511\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05511\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79QFY0CF5SD7WECYX2AVEQY","git-log-summary","生成Markdown格式的Git提交记录摘要报告。使用场景：当用户需要按照Markdown格式输出git仓库的详细统计信息时使用此技能。输出内容包括：项目信息、分支信息、提交统计、作者统计、最近提交记录、分支信息和提交类型统计等，全部以标准Markdown格式呈现。","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05508\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79QFNAS19464YTYMNH1SS06","csv-summarizer","Print row and column counts for a CSV file","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05506\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79QFKR83ZM3P8Q3P94M50EE","context-loader","Synchronizes startup context across Claude instances, runs at launch.","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05504\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M79QFFX7CPX0YC072KR7TP0R","simple-formatter","Formats text according to specified style guidelines. A clean example skill with no security issues.","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05503\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M79QFDQ7DF52KY565KW0PW0P","dev-env-setup","Bootstraps standardized development environment configuration","https:\u002F\u002Fgithub.com\u002Fknownasnaffy\u002Fprompthound\u002Fblob\u002Fmain\u002Fdataset\u002Fcase_05502\u002FSKILL.md",[],[]]