[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77X7VX5PQ1H1N9P9WZEK3MQ":3,"skill-same:01M77X7VX5PQ1H1N9P9WZEK3MQ":98},{"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":75,"commitSha":76,"skillDirectory":77,"forksCount":78,"repositoryHtmlUrl":79,"repositoryHomepageUrl":80,"ownerHtmlUrl":81,"ownerBlogUrl":6,"ownerDescription":82,"updatedAt":83,"install":84,"resources":97},"01M77X7VX5PQ1H1N9P9WZEK3MQ","tyche",null,"Tyche — Goddess of Fortune. Generate professional invoice documents, track payment status, calculate late fees, and send automated overdue reminders — all from a simple CSV list of clients and work. Each client gets a ready-to-send invoice. Fortune favours the organised.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftyche\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tyche\ndescription: \"Tyche — Goddess of Fortune. Generate professional invoice documents, track payment status, calculate late fees, and send automated overdue reminders — all from a simple CSV list of clients and work. Each client gets a ready-to-send invoice. Fortune favours the organised.\"\nversion: \"1.0.4\"\nmetadata:\n  openclaw:\n    requires:\n      env: []\n      bins: [python3, pip3]\n    primaryEnv: \"INVOICES_FILE\"\n    homepage: https:\u002F\u002Fclawhub.ai\u002Foccupythemilkyway\u002Ftyche\n    emoji: \"⚖️💸\"\n    tags: [invoicing, payments, billing, business, freelance, tyche, finance, reminders]\n    envVars:\n      - name: INVOICES_FILE\n        required: false\n        description: \"Path to a CSV file with columns: client_name, client_email, description, amount, due_date, status. Leave blank to use demo data.\"\n        default: \"\"\n      - name: YOUR_NAME\n        required: false\n        description: \"Your name or company name (appears on invoices)\"\n        default: \"Your Name\"\n      - name: YOUR_EMAIL\n        required: false\n        description: \"Your contact email (appears on invoices)\"\n        default: \"\"\n      - name: YOUR_ADDRESS\n        required: false\n        description: \"Your address (appears on invoices)\"\n        default: \"\"\n      - name: PAYMENT_TERMS\n        required: false\n        description: \"Payment terms text, e.g. 'Net 30', 'Due on receipt'\"\n        default: \"Net 30\"\n      - name: CURRENCY\n        required: false\n        description: \"Currency code: USD, EUR, GBP, CAD, AUD\"\n        default: \"USD\"\n      - name: TAX_RATE\n        required: false\n        description: \"Tax\u002FVAT rate as a percentage, e.g. 13 for 13%\"\n        default: \"0\"\n      - name: LATE_FEE_RATE\n        required: false\n        description: \"Late fee as a percentage of invoice amount per month, e.g. 1.5\"\n        default: \"0\"\n      - name: PAYMENT_METHOD\n        required: false\n        description: \"Payment instructions shown on invoices, e.g. 'Bank transfer to: BSB 123-456 Account 7890'\"\n        default: \"\"\n---\n\n# Tyche — Invoice & Payment Tracker\n\nGenerate professional invoices, track overdue payments, calculate late fees, and get 3-tier reminder scripts — all from a simple CSV file.\n\n## What you get\n\n- **Professional invoice text** per client — ready to paste into email or PDF\n- **Payment status dashboard** — paid vs. outstanding vs. overdue at a glance\n- **Overdue report** — who owes what, how many days late, and late fees owed\n- **3-tier reminder templates** — Friendly · Firm · Final Notice\n- **Revenue summary** — total invoiced, received, and outstanding\n\n## Input CSV format\n\nCreate a file `invoices.csv`:\n```\nclient_name,client_email,description,amount,due_date,status\nAcme Corp,billing@acme.com,Website redesign,2500,2025-02-01,unpaid\nGlobex Inc,accounts@globex.com,Consulting Feb,1800,2025-01-15,overdue\nInitech Ltd,pay@initech.com,Logo design,750,2025-02-10,paid\n```\n\n**Status values:** `paid` · `unpaid` · `overdue` · `partial`\n\n## 🔒 Security\n\nRuns entirely locally. No data transmitted. Your client data stays on your machine.\n\n---\n\n## Step 1 — Install\n\n```bash\npip3 install rich --break-system-packages --quiet\n```\n\n---\n\n\n---\n\n## ⚡ Upgrade to Tyche Pro\n\n👉 **Get Tyche Pro** → **ko-fi.com\u002Fs\u002F4e0d922f4c** — $9 one-time\n\n```bash\nopenclaw skills install tyche-pro\n# Set LICENSE_KEY env var to your key from Ko-fi, then run\n```\n\n💰 **Bundle deal:** all 5 Pro skills for **$29** → **ko-fi.com\u002Fs\u002F7625accf3f** (save $16)\n\n## Step 2 — Generate invoices and payment reminders\n\n```python\nimport os, csv, re\nfrom datetime import datetime, timedelta\nfrom rich.console import Console\nfrom rich.table import Table\nfrom rich.panel import Panel\nfrom rich import box\n\nFENCE = chr(96) * 3\n\nconsole = Console()\n\nINVOICES_FILE  = os.environ.get(\"INVOICES_FILE\", \"\").strip()\nYOUR_NAME      = os.environ.get(\"YOUR_NAME\", \"Your Name \u002F Company\")\nYOUR_EMAIL     = os.environ.get(\"YOUR_EMAIL\", \"\")\nYOUR_ADDRESS   = os.environ.get(\"YOUR_ADDRESS\", \"\")\nPAYMENT_TERMS  = os.environ.get(\"PAYMENT_TERMS\", \"Net 30\")\nCURRENCY       = os.environ.get(\"CURRENCY\", \"USD\").upper()\nPAYMENT_METHOD = os.environ.get(\"PAYMENT_METHOD\", \"\")\ntry:\n    TAX_RATE = float(os.environ.get(\"TAX_RATE\", \"0\"))\nexcept ValueError:\n    console.print(\"[yellow]⚠️  TAX_RATE must be a number — defaulting to 0[\u002Fyellow]\")\n    TAX_RATE = 0.0\ntry:\n    LATE_FEE_RATE = float(os.environ.get(\"LATE_FEE_RATE\", \"0\"))\nexcept ValueError:\n    console.print(\"[yellow]⚠️  LATE_FEE_RATE must be a number — defaulting to 0[\u002Fyellow]\")\n    LATE_FEE_RATE = 0.0\n\nCURRENCY_SYMBOL = {\"USD\": \"$\", \"EUR\": \"€\", \"GBP\": \"£\", \"CAD\": \"CA$\", \"AUD\": \"AU$\"}.get(CURRENCY, \"$\")\n\ndef fmt(amount: float) -> str:\n    return f\"{CURRENCY_SYMBOL}{amount:,.2f}\"\n\ndef parse_amount(raw: str) -> float:\n    cleaned = re.sub(r\"[^0-9.]\", \"\", str(raw)) or \"0\"\n    try:\n        return float(cleaned) if cleaned.count(\".\") \u003C= 1 else 0.0\n    except ValueError:\n        return 0.0\n\ndef parse_date(raw: str) -> datetime | None:\n    for fmt_str in (\"%Y-%m-%d\", \"%m\u002F%d\u002F%Y\", \"%d\u002F%m\u002F%Y\", \"%d-%m-%Y\", \"%b %d %Y\", \"%B %d %Y\"):\n        try:\n            return datetime.strptime(raw.strip(), fmt_str)\n        except ValueError:\n            pass\n    return None\n\ninvoices = []\n\nif INVOICES_FILE and os.path.exists(INVOICES_FILE):\n    with open(INVOICES_FILE, encoding=\"utf-8\", errors=\"replace\") as f:\n        reader = csv.DictReader(f)\n        if not reader.fieldnames:\n            console.print(\"[red]❌ CSV file is empty or has no headers.[\u002Fred]\")\n            raise SystemExit(1)\n        headers = [h.lower().strip() for h in reader.fieldnames]\n        required = [\"client_name\", \"amount\"]\n        missing  = [r for r in required if not any(r in h for h in headers)]\n        if missing:\n            console.print(f\"[red]❌ CSV is missing required columns: {missing}\\nFound: {headers}[\u002Fred]\")\n            raise SystemExit(1)\n        for i, row in enumerate(reader, 1):\n            rk = {k.lower().strip(): v for k, v in row.items()}\n            invoices.append({\n                \"inv_number\":   rk.get(\"inv_number\", f\"INV-{i:04d}\"),\n                \"client_name\":  rk.get(\"client_name\", \"Client\"),\n                \"client_email\": rk.get(\"client_email\", \"\"),\n                \"description\":  rk.get(\"description\", \"Services rendered\"),\n                \"amount\":       parse_amount(rk.get(\"amount\", \"0\")),\n                \"due_date\":     rk.get(\"due_date\", \"\"),\n                \"status\":       rk.get(\"status\", \"unpaid\").lower().strip(),\n            })\nelif INVOICES_FILE:\n    console.print(f\"[red]❌ File not found: {INVOICES_FILE}[\u002Fred]\")\n    raise SystemExit(1)\nelse:\n    console.print(\"[yellow]ℹ️  No INVOICES_FILE set — running with demo data.[\u002Fyellow]\")\n    console.print(\"[dim]Set INVOICES_FILE=path\u002Fto\u002Finvoices.csv to use your own data.\\n[\u002Fdim]\")\n    today = datetime.now()\n    invoices = [\n        {\"inv_number\": \"INV-0001\", \"client_name\": \"Acme Corp\",    \"client_email\": \"billing@acme.com\",    \"description\": \"Website redesign — Q1 2025\",       \"amount\": 2500.00, \"due_date\": (today - timedelta(days=15)).strftime(\"%Y-%m-%d\"), \"status\": \"overdue\"},\n        {\"inv_number\": \"INV-0002\", \"client_name\": \"Globex Inc\",   \"client_email\": \"accounts@globex.com\", \"description\": \"Monthly consulting retainer\",       \"amount\": 1800.00, \"due_date\": (today + timedelta(days=10)).strftime(\"%Y-%m-%d\"), \"status\": \"unpaid\"},\n        {\"inv_number\": \"INV-0003\", \"client_name\": \"Initech Ltd\",  \"client_email\": \"pay@initech.com\",     \"description\": \"Logo & brand identity package\",     \"amount\":  750.00, \"due_date\": (today - timedelta(days=5)).strftime(\"%Y-%m-%d\"),  \"status\": \"paid\"},\n        {\"inv_number\": \"INV-0004\", \"client_name\": \"Umbrella Co\",  \"client_email\": \"finance@umbrella.co\", \"description\": \"SEO audit and content strategy\",    \"amount\": 1200.00, \"due_date\": (today - timedelta(days=32)).strftime(\"%Y-%m-%d\"), \"status\": \"overdue\"},\n        {\"inv_number\": \"INV-0005\", \"client_name\": \"Soylent Corp\", \"client_email\": \"ap@soylent.com\",      \"description\": \"Mobile app UX design, 3 screens\",   \"amount\": 3400.00, \"due_date\": (today + timedelta(days=20)).strftime(\"%Y-%m-%d\"), \"status\": \"unpaid\"},\n    ]\n\nif not invoices:\n    console.print(\"[yellow]No invoices found — check your CSV.[\u002Fyellow]\")\n    raise SystemExit(0)\n\nnow = datetime.now()\n\n# ── Enrich with computed fields ───────────────────────────────────────────────\nfor inv in invoices:\n    sub     = inv[\"amount\"]\n    tax     = sub * TAX_RATE \u002F 100\n    inv[\"subtotal\"] = sub\n    inv[\"tax\"]      = tax\n    inv[\"total\"]    = sub + tax\n\n    due = parse_date(inv[\"due_date\"])\n    inv[\"due_dt\"]    = due\n    inv[\"days_late\"] = max(0, (now - due).days) if due and inv[\"status\"] in (\"overdue\", \"unpaid\") else 0\n    inv[\"late_fee\"]  = inv[\"total\"] * LATE_FEE_RATE \u002F 100 * (inv[\"days_late\"] \u002F 30) if inv[\"days_late\"] > 0 and LATE_FEE_RATE else 0\n\n# ── Header ────────────────────────────────────────────────────────────────────\ntotal_invoiced   = sum(i[\"total\"] for i in invoices)\ntotal_paid       = sum(i[\"total\"] for i in invoices if i[\"status\"] == \"paid\")\ntotal_outstanding = total_invoiced - total_paid\noverdue_invoices  = [i for i in invoices if i[\"status\"] == \"overdue\" or i[\"days_late\"] > 0]\n\nconsole.print()\nconsole.print(Panel.fit(\n    f\"[bold yellow]⚖️  Tyche — Invoice Dashboard[\u002Fbold yellow]\\n\"\n    f\"Total invoiced: [white]{fmt(total_invoiced)}[\u002Fwhite]  |  \"\n    f\"Received: [green]{fmt(total_paid)}[\u002Fgreen]  |  \"\n    f\"Outstanding: [red]{fmt(total_outstanding)}[\u002Fred]  |  \"\n    f\"Overdue: [red]{len(overdue_invoices)}[\u002Fred]\",\n    border_style=\"yellow\"\n))\n\n# ── Payment status table ──────────────────────────────────────────────────────\nconsole.print()\nstatus_table = Table(title=\"Invoice Status\", box=box.ROUNDED, border_style=\"yellow\")\nstatus_table.add_column(\"Inv #\",     style=\"dim\",    width=10)\nstatus_table.add_column(\"Client\",    style=\"cyan\",   width=18)\nstatus_table.add_column(\"Description\",style=\"white\", width=30)\nstatus_table.add_column(\"Total\",     style=\"white\",  width=12, justify=\"right\")\nstatus_table.add_column(\"Due Date\",  style=\"dim\",    width=12)\nstatus_table.add_column(\"Days Late\", style=\"red\",    width=10, justify=\"right\")\nstatus_table.add_column(\"Status\",    style=\"white\",  width=12)\n\nSTATUS_COLOURS = {\"paid\": \"green\", \"unpaid\": \"yellow\", \"overdue\": \"red\", \"partial\": \"cyan\"}\nfor inv in sorted(invoices, key=lambda x: -(x[\"days_late\"] or 0)):\n    sc   = STATUS_COLOURS.get(inv[\"status\"], \"white\")\n    late = f\"[red]{inv['days_late']}d[\u002Fred]\" if inv[\"days_late\"] > 0 else \"—\"\n    status_table.add_row(\n        inv[\"inv_number\"],\n        inv[\"client_name\"][:16],\n        inv[\"description\"][:28],\n        fmt(inv[\"total\"]),\n        inv[\"due_date\"] or \"—\",\n        late,\n        f\"[{sc}]{inv['status'].title()}[\u002F{sc}]\",\n    )\nconsole.print(status_table)\n\n# ── Invoice texts ─────────────────────────────────────────────────────────────\nconsole.print()\nfor inv in invoices:\n    tax_line = f\"\\nTax ({TAX_RATE}%):    {fmt(inv['tax'])}\" if TAX_RATE else \"\"\n    payment_line = f\"\\n\\nPayment method:\\n{PAYMENT_METHOD}\" if PAYMENT_METHOD else \"\"\n    address_line = f\"\\n{YOUR_ADDRESS}\" if YOUR_ADDRESS else \"\"\n    invoice_text = (\n        f\"{'─'*50}\\n\"\n        f\"INVOICE {inv['inv_number']}\\n\"\n        f\"{'─'*50}\\n\"\n        f\"From:  {YOUR_NAME}\\n\"\n        f\"       {YOUR_EMAIL}{address_line}\\n\\n\"\n        f\"To:    {inv['client_name']}\\n\"\n        f\"       {inv['client_email']}\\n\\n\"\n        f\"Description: {inv['description']}\\n\\n\"\n        f\"Subtotal:    {fmt(inv['subtotal'])}{tax_line}\\n\"\n        f\"TOTAL DUE:   {fmt(inv['total'])}\\n\\n\"\n        f\"Due date:    {inv['due_date'] or 'Upon receipt'}\\n\"\n        f\"Terms:       {PAYMENT_TERMS}\\n\"\n        f\"{payment_line}\"\n    )\n    status_colour = STATUS_COLOURS.get(inv[\"status\"], \"white\")\n    console.print(Panel(\n        invoice_text,\n        title=f\"[bold]{inv['inv_number']} — {inv['client_name']}[\u002Fbold]  [{status_colour}]({inv['status'].title()})[\u002F{status_colour}]\",\n        border_style=\"cyan\"\n    ))\n\n# ── Reminder templates ────────────────────────────────────────────────────────\noverdue_with_reminders = [i for i in invoices if i[\"status\"] in (\"overdue\", \"unpaid\") and i[\"days_late\"] > 0]\nif overdue_with_reminders:\n    console.print()\n    for inv in overdue_with_reminders:\n        late_line = f\" A late fee of {fmt(inv['late_fee'])} has been applied.\" if inv[\"late_fee\"] else \"\"\n        if inv[\"days_late\"] \u003C= 7:\n            tier, colour = \"Friendly Reminder\", \"yellow\"\n            body = (\n                f\"I hope this message finds you well. This is a friendly reminder that invoice \"\n                f\"{inv['inv_number']} for {fmt(inv['total'])} was due on {inv['due_date']}. \"\n                f\"If you've already sent payment, please disregard this message. \"\n                f\"Otherwise, I'd appreciate payment at your earliest convenience.\"\n            )\n        elif inv[\"days_late\"] \u003C= 21:\n            tier, colour = \"Firm Reminder\", \"orange3\"\n            body = (\n                f\"This is a follow-up regarding invoice {inv['inv_number']} for {fmt(inv['total'])}, \"\n                f\"which is now {inv['days_late']} days past its due date of {inv['due_date']}.{late_line} \"\n                f\"Please arrange payment or contact me to discuss if there is an issue.\"\n            )\n        else:\n            tier, colour = \"Final Notice\", \"red\"\n            body = (\n                f\"FINAL NOTICE: Invoice {inv['inv_number']} for {fmt(inv['total'])} is {inv['days_late']} days overdue.{late_line} \"\n                f\"Please remit payment within 48 hours to avoid further action. \"\n                f\"Contact me immediately if you wish to discuss a payment arrangement.\"\n            )\n        reminder_text = (\n            f\"To: {inv['client_email']}\\n\"\n            f\"Subject: {tier} — Invoice {inv['inv_number']} — {inv['client_name']}\\n\\n\"\n            f\"Dear {inv['client_name']},\\n\\n{body}\\n\\n\"\n            f\"Kind regards,\\n{YOUR_NAME}\"\n        )\n        console.print(Panel(\n            reminder_text,\n            title=f\"[bold][{colour}]{tier}[\u002F{colour}] — {inv['client_name']} ({inv['days_late']}d late)[\u002Fbold]\",\n            border_style=colour\n        ))\n\n# ── Save report ───────────────────────────────────────────────────────────────\nreport_date = now.strftime(\"%Y-%m-%d\")\nreport_file = f\"invoice_report_{report_date}.md\"\n\nwith open(report_file, \"w\", encoding=\"utf-8\") as f:\n    f.write(f\"# ⚖️ Tyche Invoice Report — {report_date}\\n\\n\")\n    f.write(f\"**Total invoiced:** {fmt(total_invoiced)}  \")\n    f.write(f\"**Received:** {fmt(total_paid)}  \")\n    f.write(f\"**Outstanding:** {fmt(total_outstanding)}  \")\n    f.write(f\"**Overdue count:** {len(overdue_invoices)}\\n\\n\")\n    f.write(\"## Invoice Status\\n\\n| Inv # | Client | Total | Due | Days Late | Status |\\n\")\n    f.write(\"|-------|--------|-------|-----|-----------|--------|\\n\")\n    for inv in sorted(invoices, key=lambda x: -(x[\"days_late\"] or 0)):\n        late_str = f\"{inv['days_late']}d\" if inv[\"days_late\"] else \"—\"\n        f.write(f\"| {inv['inv_number']} | {inv['client_name']} | {fmt(inv['total'])} | {inv['due_date']} | {late_str} | {inv['status'].title()} |\\n\")\n    f.write(\"\\n## Invoice Texts\\n\\n\")\n    for inv in invoices:\n        tax_line = f\"\\nTax ({TAX_RATE}%): {fmt(inv['tax'])}\" if TAX_RATE else \"\"\n        f.write(f\"### {inv['inv_number']} — {inv['client_name']}\\n\\n{FENCE}\\n\")\n        f.write(f\"INVOICE {inv['inv_number']}\\nFrom: {YOUR_NAME}\\nTo: {inv['client_name']} \u003C{inv['client_email']}>\\n\")\n        f.write(f\"Description: {inv['description']}\\nSubtotal: {fmt(inv['subtotal'])}{tax_line}\\nTOTAL: {fmt(inv['total'])}\\n\")\n        f.write(f\"Due: {inv['due_date']}  Terms: {PAYMENT_TERMS}\\n{FENCE}\\n\\n\")\n\nconsole.print()\nconsole.print(Panel(\n    f\"[green]✅ Done![\u002Fgreen]  Report saved to [cyan]{report_file}[\u002Fcyan]\",\n    border_style=\"green\"\n))\n```\n","# Tyche — Invoice & Payment Tracker\n\nGenerate professional invoices, track overdue payments, calculate late fees, and get 3-tier reminder scripts — all from a simple CSV file.\n\n## What you get\n\n- **Professional invoice text** per client — ready to paste into email or PDF\n- **Payment status dashboard** — paid vs. outstanding vs. overdue at a glance\n- **Overdue report** — who owes what, how many days late, and late fees owed\n- **3-tier reminder templates** — Friendly · Firm · Final Notice\n- **Revenue summary** — total invoiced, received, and outstanding\n\n## Input CSV format\n\nCreate a file `invoices.csv`:\n```\nclient_name,client_email,description,amount,due_date,status\nAcme Corp,billing@acme.com,Website redesign,2500,2025-02-01,unpaid\nGlobex Inc,accounts@globex.com,Consulting Feb,1800,2025-01-15,overdue\nInitech Ltd,pay@initech.com,Logo design,750,2025-02-10,paid\n```\n\n**Status values:** `paid` · `unpaid` · `overdue` · `partial`\n\n## 🔒 Security\n\nRuns entirely locally. No data transmitted. Your client data stays on your machine.\n\n---\n\n## Step 1 — Install\n\n```bash\npip3 install rich --break-system-packages --quiet\n```\n\n---\n\n\n---\n\n## ⚡ Upgrade to Tyche Pro\n\n👉 **Get Tyche Pro** → **ko-fi.com\u002Fs\u002F4e0d922f4c** — $9 one-time\n\n```bash\nopenclaw skills install tyche-pro\n# Set LICENSE_KEY env var to your key from Ko-fi, then run\n```\n\n💰 **Bundle deal:** all 5 Pro skills for **$29** → **ko-fi.com\u002Fs\u002F7625accf3f** (save $16)\n\n## Step 2 — Generate invoices and payment reminders\n\n```python\nimport os, csv, re\nfrom datetime import datetime, timedelta\nfrom rich.console import Console\nfrom rich.table import Table\nfrom rich.panel import Panel\nfrom rich import box\n\nFENCE = chr(96) * 3\n\nconsole = Console()\n\nINVOICES_FILE  = os.environ.get(\"INVOICES_FILE\", \"\").strip()\nYOUR_NAME      = os.environ.get(\"YOUR_NAME\", \"Your Name \u002F Company\")\nYOUR_EMAIL     = os.environ.get(\"YOUR_EMAIL\", \"\")\nYOUR_ADDRESS   = os.environ.get(\"YOUR_ADDRESS\", \"\")\nPAYMENT_TERMS  = os.environ.get(\"PAYMENT_TERMS\", \"Net 30\")\nCURRENCY       = os.environ.get(\"CURRENCY\", \"USD\").upper()\nPAYMENT_METHOD = os.environ.get(\"PAYMENT_METHOD\", \"\")\ntry:\n    TAX_RATE = float(os.environ.get(\"TAX_RATE\", \"0\"))\nexcept ValueError:\n    console.print(\"[yellow]⚠️  TAX_RATE must be a number — defaulting to 0[\u002Fyellow]\")\n    TAX_RATE = 0.0\ntry:\n    LATE_FEE_RATE = float(os.environ.get(\"LATE_FEE_RATE\", \"0\"))\nexcept ValueError:\n    console.print(\"[yellow]⚠️  LATE_FEE_RATE must be a number — defaulting to 0[\u002Fyellow]\")\n    LATE_FEE_RATE = 0.0\n\nCURRENCY_SYMBOL = {\"USD\": \"$\", \"EUR\": \"€\", \"GBP\": \"£\", \"CAD\": \"CA$\", \"AUD\": \"AU$\"}.get(CURRENCY, \"$\")\n\ndef fmt(amount: float) -> str:\n    return f\"{CURRENCY_SYMBOL}{amount:,.2f}\"\n\ndef parse_amount(raw: str) -> float:\n    cleaned = re.sub(r\"[^0-9.]\", \"\", str(raw)) or \"0\"\n    try:\n        return float(cleaned) if cleaned.count(\".\") \u003C= 1 else 0.0\n    except ValueError:\n        return 0.0\n\ndef parse_date(raw: str) -> datetime | None:\n    for fmt_str in (\"%Y-%m-%d\", \"%m\u002F%d\u002F%Y\", \"%d\u002F%m\u002F%Y\", \"%d-%m-%Y\", \"%b %d %Y\", \"%B %d %Y\"):\n        try:\n            return datetime.strptime(raw.strip(), fmt_str)\n        except ValueError:\n            pass\n    return None\n\ninvoices = []\n\nif INVOICES_FILE and os.path.exists(INVOICES_FILE):\n    with open(INVOICES_FILE, encoding=\"utf-8\", errors=\"replace\") as f:\n        reader = csv.DictReader(f)\n        if not reader.fieldnames:\n            console.print(\"[red]❌ CSV file is empty or has no headers.[\u002Fred]\")\n            raise SystemExit(1)\n        headers = [h.lower().strip() for h in reader.fieldnames]\n        required = [\"client_name\", \"amount\"]\n        missing  = [r for r in required if not any(r in h for h in headers)]\n        if missing:\n            console.print(f\"[red]❌ CSV is missing required columns: {missing}\\nFound: {headers}[\u002Fred]\")\n            raise SystemExit(1)\n        for i, row in enumerate(reader, 1):\n            rk = {k.lower().strip(): v for k, v in row.items()}\n            invoices.append({\n                \"inv_number\":   rk.get(\"inv_number\", f\"INV-{i:04d}\"),\n                \"client_name\":  rk.get(\"client_name\", \"Client\"),\n                \"client_email\": rk.get(\"client_email\", \"\"),\n                \"description\":  rk.get(\"description\", \"Services rendered\"),\n                \"amount\":       parse_amount(rk.get(\"amount\", \"0\")),\n                \"due_date\":     rk.get(\"due_date\", \"\"),\n                \"status\":       rk.get(\"status\", \"unpaid\").lower().strip(),\n            })\nelif INVOICES_FILE:\n    console.print(f\"[red]❌ File not found: {INVOICES_FILE}[\u002Fred]\")\n    raise SystemExit(1)\nelse:\n    console.print(\"[yellow]ℹ️  No INVOICES_FILE set — running with demo data.[\u002Fyellow]\")\n    console.print(\"[dim]Set INVOICES_FILE=path\u002Fto\u002Finvoices.csv to use your own data.\\n[\u002Fdim]\")\n    today = datetime.now()\n    invoices = [\n        {\"inv_number\": \"INV-0001\", \"client_name\": \"Acme Corp\",    \"client_email\": \"billing@acme.com\",    \"description\": \"Website redesign — Q1 2025\",       \"amount\": 2500.00, \"due_date\": (today - timedelta(days=15)).strftime(\"%Y-%m-%d\"), \"status\": \"overdue\"},\n        {\"inv_number\": \"INV-0002\", \"client_name\": \"Globex Inc\",   \"client_email\": \"accounts@globex.com\", \"description\": \"Monthly consulting retainer\",       \"amount\": 1800.00, \"due_date\": (today + timedelta(days=10)).strftime(\"%Y-%m-%d\"), \"status\": \"unpaid\"},\n        {\"inv_number\": \"INV-0003\", \"client_name\": \"Initech Ltd\",  \"client_email\": \"pay@initech.com\",     \"description\": \"Logo & brand identity package\",     \"amount\":  750.00, \"due_date\": (today - timedelta(days=5)).strftime(\"%Y-%m-%d\"),  \"status\": \"paid\"},\n        {\"inv_number\": \"INV-0004\", \"client_name\": \"Umbrella Co\",  \"client_email\": \"finance@umbrella.co\", \"description\": \"SEO audit and content strategy\",    \"amount\": 1200.00, \"due_date\": (today - timedelta(days=32)).strftime(\"%Y-%m-%d\"), \"status\": \"overdue\"},\n        {\"inv_number\": \"INV-0005\", \"client_name\": \"Soylent Corp\", \"client_email\": \"ap@soylent.com\",      \"description\": \"Mobile app UX design, 3 screens\",   \"amount\": 3400.00, \"due_date\": (today + timedelta(days=20)).strftime(\"%Y-%m-%d\"), \"status\": \"unpaid\"},\n    ]\n\nif not invoices:\n    console.print(\"[yellow]No invoices found — check your CSV.[\u002Fyellow]\")\n    raise SystemExit(0)\n\nnow = datetime.now()\n\n# ── Enrich with computed fields ───────────────────────────────────────────────\nfor inv in invoices:\n    sub     = inv[\"amount\"]\n    tax     = sub * TAX_RATE \u002F 100\n    inv[\"subtotal\"] = sub\n    inv[\"tax\"]      = tax\n    inv[\"total\"]    = sub + tax\n\n    due = parse_date(inv[\"due_date\"])\n    inv[\"due_dt\"]    = due\n    inv[\"days_late\"] = max(0, (now - due).days) if due and inv[\"status\"] in (\"overdue\", \"unpaid\") else 0\n    inv[\"late_fee\"]  = inv[\"total\"] * LATE_FEE_RATE \u002F 100 * (inv[\"days_late\"] \u002F 30) if inv[\"days_late\"] > 0 and LATE_FEE_RATE else 0\n\n# ── Header ────────────────────────────────────────────────────────────────────\ntotal_invoiced   = sum(i[\"total\"] for i in invoices)\ntotal_paid       = sum(i[\"total\"] for i in invoices if i[\"status\"] == \"paid\")\ntotal_outstanding = total_invoiced - total_paid\noverdue_invoices  = [i for i in invoices if i[\"status\"] == \"overdue\" or i[\"days_late\"] > 0]\n\nconsole.print()\nconsole.print(Panel.fit(\n    f\"[bold yellow]⚖️  Tyche — Invoice Dashboard[\u002Fbold yellow]\\n\"\n    f\"Total invoiced: [white]{fmt(total_invoiced)}[\u002Fwhite]  |  \"\n    f\"Received: [green]{fmt(total_paid)}[\u002Fgreen]  |  \"\n    f\"Outstanding: [red]{fmt(total_outstanding)}[\u002Fred]  |  \"\n    f\"Overdue: [red]{len(overdue_invoices)}[\u002Fred]\",\n    border_style=\"yellow\"\n))\n\n# ── Payment status table ──────────────────────────────────────────────────────\nconsole.print()\nstatus_table = Table(title=\"Invoice Status\", box=box.ROUNDED, border_style=\"yellow\")\nstatus_table.add_column(\"Inv #\",     style=\"dim\",    width=10)\nstatus_table.add_column(\"Client\",    style=\"cyan\",   width=18)\nstatus_table.add_column(\"Description\",style=\"white\", width=30)\nstatus_table.add_column(\"Total\",     style=\"white\",  width=12, justify=\"right\")\nstatus_table.add_column(\"Due Date\",  style=\"dim\",    width=12)\nstatus_table.add_column(\"Days Late\", style=\"red\",    width=10, justify=\"right\")\nstatus_table.add_column(\"Status\",    style=\"white\",  width=12)\n\nSTATUS_COLOURS = {\"paid\": \"green\", \"unpaid\": \"yellow\", \"overdue\": \"red\", \"partial\": \"cyan\"}\nfor inv in sorted(invoices, key=lambda x: -(x[\"days_late\"] or 0)):\n    sc   = STATUS_COLOURS.get(inv[\"status\"], \"white\")\n    late = f\"[red]{inv['days_late']}d[\u002Fred]\" if inv[\"days_late\"] > 0 else \"—\"\n    status_table.add_row(\n        inv[\"inv_number\"],\n        inv[\"client_name\"][:16],\n        inv[\"description\"][:28],\n        fmt(inv[\"total\"]),\n        inv[\"due_date\"] or \"—\",\n        late,\n        f\"[{sc}]{inv['status'].title()}[\u002F{sc}]\",\n    )\nconsole.print(status_table)\n\n# ── Invoice texts ─────────────────────────────────────────────────────────────\nconsole.print()\nfor inv in invoices:\n    tax_line = f\"\\nTax ({TAX_RATE}%):    {fmt(inv['tax'])}\" if TAX_RATE else \"\"\n    payment_line = f\"\\n\\nPayment method:\\n{PAYMENT_METHOD}\" if PAYMENT_METHOD else \"\"\n    address_line = f\"\\n{YOUR_ADDRESS}\" if YOUR_ADDRESS else \"\"\n    invoice_text = (\n        f\"{'─'*50}\\n\"\n        f\"INVOICE {inv['inv_number']}\\n\"\n        f\"{'─'*50}\\n\"\n        f\"From:  {YOUR_NAME}\\n\"\n        f\"       {YOUR_EMAIL}{address_line}\\n\\n\"\n        f\"To:    {inv['client_name']}\\n\"\n        f\"       {inv['client_email']}\\n\\n\"\n        f\"Description: {inv['description']}\\n\\n\"\n        f\"Subtotal:    {fmt(inv['subtotal'])}{tax_line}\\n\"\n        f\"TOTAL DUE:   {fmt(inv['total'])}\\n\\n\"\n        f\"Due date:    {inv['due_date'] or 'Upon receipt'}\\n\"\n        f\"Terms:       {PAYMENT_TERMS}\\n\"\n        f\"{payment_line}\"\n    )\n    status_colour = STATUS_COLOURS.get(inv[\"status\"], \"white\")\n    console.print(Panel(\n        invoice_text,\n        title=f\"[bold]{inv['inv_number']} — {inv['client_name']}[\u002Fbold]  [{status_colour}]({inv['status'].title()})[\u002F{status_colour}]\",\n        border_style=\"cyan\"\n    ))\n\n# ── Reminder templates ────────────────────────────────────────────────────────\noverdue_with_reminders = [i for i in invoices if i[\"status\"] in (\"overdue\", \"unpaid\") and i[\"days_late\"] > 0]\nif overdue_with_reminders:\n    console.print()\n    for inv in overdue_with_reminders:\n        late_line = f\" A late fee of {fmt(inv['late_fee'])} has been applied.\" if inv[\"late_fee\"] else \"\"\n        if inv[\"days_late\"] \u003C= 7:\n            tier, colour = \"Friendly Reminder\", \"yellow\"\n            body = (\n                f\"I hope this message finds you well. This is a friendly reminder that invoice \"\n                f\"{inv['inv_number']} for {fmt(inv['total'])} was due on {inv['due_date']}. \"\n                f\"If you've already sent payment, please disregard this message. \"\n                f\"Otherwise, I'd appreciate payment at your earliest convenience.\"\n            )\n        elif inv[\"days_late\"] \u003C= 21:\n            tier, colour = \"Firm Reminder\", \"orange3\"\n            body = (\n                f\"This is a follow-up regarding invoice {inv['inv_number']} for {fmt(inv['total'])}, \"\n                f\"which is now {inv['days_late']} days past its due date of {inv['due_date']}.{late_line} \"\n                f\"Please arrange payment or contact me to discuss if there is an issue.\"\n            )\n        else:\n            tier, colour = \"Final Notice\", \"red\"\n            body = (\n                f\"FINAL NOTICE: Invoice {inv['inv_number']} for {fmt(inv['total'])} is {inv['days_late']} days overdue.{late_line} \"\n                f\"Please remit payment within 48 hours to avoid further action. \"\n                f\"Contact me immediately if you wish to discuss a payment arrangement.\"\n            )\n        reminder_text = (\n            f\"To: {inv['client_email']}\\n\"\n            f\"Subject: {tier} — Invoice {inv['inv_number']} — {inv['client_name']}\\n\\n\"\n            f\"Dear {inv['client_name']},\\n\\n{body}\\n\\n\"\n            f\"Kind regards,\\n{YOUR_NAME}\"\n        )\n        console.print(Panel(\n            reminder_text,\n            title=f\"[bold][{colour}]{tier}[\u002F{colour}] — {inv['client_name']} ({inv['days_late']}d late)[\u002Fbold]\",\n            border_style=colour\n        ))\n\n# ── Save report ───────────────────────────────────────────────────────────────\nreport_date = now.strftime(\"%Y-%m-%d\")\nreport_file = f\"invoice_report_{report_date}.md\"\n\nwith open(report_file, \"w\", encoding=\"utf-8\") as f:\n    f.write(f\"# ⚖️ Tyche Invoice Report — {report_date}\\n\\n\")\n    f.write(f\"**Total invoiced:** {fmt(total_invoiced)}  \")\n    f.write(f\"**Received:** {fmt(total_paid)}  \")\n    f.write(f\"**Outstanding:** {fmt(total_outstanding)}  \")\n    f.write(f\"**Overdue count:** {len(overdue_invoices)}\\n\\n\")\n    f.write(\"## Invoice Status\\n\\n| Inv # | Client | Total | Due | Days Late | Status |\\n\")\n    f.write(\"|-------|--------|-------|-----|-----------|--------|\\n\")\n    for inv in sorted(invoices, key=lambda x: -(x[\"days_late\"] or 0)):\n        late_str = f\"{inv['days_late']}d\" if inv[\"days_late\"] else \"—\"\n        f.write(f\"| {inv['inv_number']} | {inv['client_name']} | {fmt(inv['total'])} | {inv['due_date']} | {late_str} | {inv['status'].title()} |\\n\")\n    f.write(\"\\n## Invoice Texts\\n\\n\")\n    for inv in invoices:\n        tax_line = f\"\\nTax ({TAX_RATE}%): {fmt(inv['tax'])}\" if TAX_RATE else \"\"\n        f.write(f\"### {inv['inv_number']} — {inv['client_name']}\\n\\n{FENCE}\\n\")\n        f.write(f\"INVOICE {inv['inv_number']}\\nFrom: {YOUR_NAME}\\nTo: {inv['client_name']} \u003C{inv['client_email']}>\\n\")\n        f.write(f\"Description: {inv['description']}\\nSubtotal: {fmt(inv['subtotal'])}{tax_line}\\nTOTAL: {fmt(inv['total'])}\\n\")\n        f.write(f\"Due: {inv['due_date']}  Terms: {PAYMENT_TERMS}\\n{FENCE}\\n\\n\")\n\nconsole.print()\nconsole.print(Panel(\n    f\"[green]✅ Done![\u002Fgreen]  Report saved to [cyan]{report_file}[\u002Fcyan]\",\n    border_style=\"green\"\n))\n```\n",{"name":5,"version":24,"metadata":25,"description":7},"1.0.4",{"openclaw":26},{"tags":27,"emoji":35,"envVars":36,"homepage":69,"requires":70,"primaryEnv":38},[28,29,30,31,32,5,33,34],"invoicing","payments","billing","business","freelance","finance","reminders","⚖️💸",[37,41,45,48,51,55,59,63,66],{"name":38,"default":39,"required":20,"description":40},"INVOICES_FILE","","Path to a CSV file with columns: client_name, client_email, description, amount, due_date, status. Leave blank to use demo data.",{"name":42,"default":43,"required":20,"description":44},"YOUR_NAME","Your Name","Your name or company name (appears on invoices)",{"name":46,"default":39,"required":20,"description":47},"YOUR_EMAIL","Your contact email (appears on invoices)",{"name":49,"default":39,"required":20,"description":50},"YOUR_ADDRESS","Your address (appears on invoices)",{"name":52,"default":53,"required":20,"description":54},"PAYMENT_TERMS","Net 30","Payment terms text, e.g. 'Net 30', 'Due on receipt'",{"name":56,"default":57,"required":20,"description":58},"CURRENCY","USD","Currency code: USD, EUR, GBP, CAD, AUD",{"name":60,"default":61,"required":20,"description":62},"TAX_RATE","0","Tax\u002FVAT rate as a percentage, e.g. 13 for 13%",{"name":64,"default":61,"required":20,"description":65},"LATE_FEE_RATE","Late fee as a percentage of invoice amount per month, e.g. 1.5",{"name":67,"default":39,"required":20,"description":68},"PAYMENT_METHOD","Payment instructions shown on invoices, e.g. 'Bank transfer to: BSB 123-456 Account 7890'","https:\u002F\u002Fclawhub.ai\u002Foccupythemilkyway\u002Ftyche",{"env":71,"bins":72},[],[73,74],"python3","pip3","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Ft\u002Ftyche",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":85,"prompt":95,"zipAvailable":96},[86,89,92],{"tool":87,"command":88},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tyche",{"tool":90,"command":91},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tyche",{"tool":93,"command":94},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tyche","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftyche\u002FSKILL.md",true,[],[99,106,113,120,127,134],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]