{
  "schemaVersion": "1.0",
  "item": {
    "slug": "heath-ledger",
    "name": "Heath Ledger",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/wrannaman/heath-ledger",
    "canonicalUrl": "https://clawhub.ai/wrannaman/heath-ledger",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/heath-ledger",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=heath-ledger",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README-RECONCILIATION.md",
      "RECONCILIATION-RESULTS.md",
      "SKILL.md",
      "references/bookkeeper-comparison.md",
      "references/chart-of-accounts.md",
      "scripts/add_rule.mjs"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/heath-ledger"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/heath-ledger",
    "agentPageUrl": "https://openagent3.xyz/skills/heath-ledger/agent",
    "manifestUrl": "https://openagent3.xyz/skills/heath-ledger/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/heath-ledger/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Heath Ledger",
        "body": "AI bookkeeping skill for Mercury bank accounts."
      },
      {
        "title": "Quick Start",
        "body": "scripts/init_db.mjs — creates DB + seeds ~90 universal vendor→category rules\nscripts/connect_mercury.sh <MERCURY_API_TOKEN> [entity_name] — discovers accounts\n(Optional) scripts/connect_stripe.sh <entity_id> <stripe_api_key> — connect Stripe for exact revenue + fees\n(If Stripe connected) scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date> — pull monthly revenue data\nscripts/pull_transactions.sh <entity_id> <start_date> <end_date>\nscripts/categorize.sh <entity_id> — rule-based first, AI for unknowns\nReview ambiguous items, correct with scripts/set_category.sh\nscripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]"
      },
      {
        "title": "Mercury API Key (Required)",
        "body": "Get from Mercury Dashboard → Settings → API Tokens. The token gives read-only access to transactions."
      },
      {
        "title": "Stripe API Key (Optional but Recommended)",
        "body": "Without Stripe API: Mercury shows net Stripe deposits (revenue minus fees). The system estimates gross revenue using a configurable fee rate (default 2.3% + $0.30).\n\nWith Stripe API: You get exact gross revenue, exact fees, and proper refund tracking. Always prefer this when available.\n\nTo connect: scripts/connect_stripe.sh <entity_id> <stripe_api_key>\nThen pull data: scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date>\n\nThe P&L generator automatically uses Stripe data when available, falling back to Mercury estimates otherwise."
      },
      {
        "title": "Entity Settings",
        "body": "Configure per-entity via the entity_settings table:\n\nSettingDefaultDescriptionaccounting_basisaccrualaccrual or cash — cash basis uses posted dates onlymonth_offset1Fiscal year month offset (1 = calendar year)stripe_fee_rate0.023Stripe percentage fee for gross-up calculationstripe_fee_fixed0.30Stripe fixed fee per transactionamortization_monthlynullMonthly amortization amount for acquired assets"
      },
      {
        "title": "Workflow",
        "body": "Connect Mercury — scripts/connect_mercury.sh <token> [name] discovers accounts, creates entity\nPull transactions — scripts/pull_transactions.sh <entity_id> <start_date> <end_date>\nCategorize — scripts/categorize.sh <entity_id> [max_transactions] — rule-based first, then AI for unknowns\nReview ambiguous — Script outputs low-confidence items. Ask user, then update with scripts/set_category.sh <transaction_id> <category> [subcategory]\nGenerate books — scripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]"
      },
      {
        "title": "Scripts Reference",
        "body": "All scripts are in scripts/. Run with bash or node. Database is SQLite at data/heath.db.\n\nScriptPurposeinit_db.mjsCreate/migrate SQLite database + seed rulesconnect_mercury.shConnect Mercury API, discover accountspull_transactions.shPull transactions for date rangecategorize.shCategorize transactions (rules + AI)set_category.shManually set category for a transactionadd_rule.shAdd/update a categorization rulegenerate_books.shGenerate Excel workbooklist_entities.shList all entitiesconnect_stripe.shConnect Stripe API to an entitypull_stripe_revenue.shPull Stripe balance transactions by monthstatus.shShow entity status (accounts, tx counts)"
      },
      {
        "title": "Chart of Accounts",
        "body": "See references/chart-of-accounts.md for the full chart with P&L sections and cash flow classifications."
      },
      {
        "title": "Learning & Compounding System",
        "body": "Heath Ledger gets smarter over time through a layered rule system:"
      },
      {
        "title": "Rule Hierarchy",
        "body": "Entity-specific rules (highest priority) — per-company overrides\nGlobal rules (entity_id = NULL) — apply to all entities\nSeed rules — universal vendor mappings shipped with the skill\nAI categorization — used when no rule matches"
      },
      {
        "title": "How Learning Works",
        "body": "Every manual correction creates or updates a categorization rule\nRules track usage_count — heavily-used rules are more reliable\nsource field tracks provenance: seed, ai, human, manual\nHuman-confirmed rules get confidence: 0.95-1.0\nAI-generated rules start at 0.85 and can be promoted\nEntity-specific rules can be promoted to global when they prove universal"
      },
      {
        "title": "The Compounding Effect",
        "body": "After categorizing ~5,000 transactions across 2 entities, the system now auto-categorizes ~95% of transactions without AI. Each new entity benefits from all previous learnings."
      },
      {
        "title": "Stripe Net vs Gross (Without Stripe API)",
        "body": "Mercury deposits from Stripe are net amounts (revenue minus ~2.9% + $0.30 fees). Without the Stripe API:\n\nWe estimate gross revenue using configurable fee rates\nThis creates \"synthetic\" Stripe Fee entries\nAccuracy depends on your actual Stripe fee rate (varies by plan, card type, international)\nSolution: Connect Stripe API for exact numbers"
      },
      {
        "title": "Deel Fee Splitting",
        "body": "Deel combines platform fees and contractor payroll in one transaction stream. Pattern:\n\nSmall fixed amounts (~$2-5) → Deel Platform Fee → categorize as \"Software expenses\"\nLarger variable amounts → Contractor Payroll → categorize as \"Wages & Salaries\"\nThe system learns this pattern but may need initial human guidance"
      },
      {
        "title": "Mercury API Limitations",
        "body": "Only returns posted transactions (not pending)\nSome counterparty names are truncated or normalized differently\nWire descriptions may include reference numbers that create duplicate rules"
      },
      {
        "title": "Multi-Currency",
        "body": "Wise transfers create both a debit (USD) and may show FX fees separately\nInternational wire fees from Mercury appear as separate line items\nFX gains/losses are not tracked (would need multi-currency ledger)"
      },
      {
        "title": "AI Categorization",
        "body": "The categorize.sh script calls the host agent's model via stdin/stdout JSON protocol. It sends transaction batches and expects category assignments back. The script writes a prompt to stdout that the agent should process and return results for.\n\nWhen AI confidence < 0.85, transactions are flagged as ambiguous for user review."
      },
      {
        "title": "Key Details",
        "body": "Cash or accrual basis — configurable per entity\nMultiple entities supported — each with own connections and rules\nRules persist — categorization rules saved to SQLite, reused across runs\nSeed rules — ~90 universal vendor mappings loaded on init\nExcel output — 4-tab workbook: P&L, Balance Sheet, Cash Flow, Transaction Detail"
      }
    ],
    "body": "Heath Ledger\n\nAI bookkeeping skill for Mercury bank accounts.\n\nQuick Start\nscripts/init_db.mjs — creates DB + seeds ~90 universal vendor→category rules\nscripts/connect_mercury.sh <MERCURY_API_TOKEN> [entity_name] — discovers accounts\n(Optional) scripts/connect_stripe.sh <entity_id> <stripe_api_key> — connect Stripe for exact revenue + fees\n(If Stripe connected) scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date> — pull monthly revenue data\nscripts/pull_transactions.sh <entity_id> <start_date> <end_date>\nscripts/categorize.sh <entity_id> — rule-based first, AI for unknowns\nReview ambiguous items, correct with scripts/set_category.sh\nscripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]\nSetup Flow\nMercury API Key (Required)\n\nGet from Mercury Dashboard → Settings → API Tokens. The token gives read-only access to transactions.\n\nStripe API Key (Optional but Recommended)\n\nWithout Stripe API: Mercury shows net Stripe deposits (revenue minus fees). The system estimates gross revenue using a configurable fee rate (default 2.3% + $0.30).\n\nWith Stripe API: You get exact gross revenue, exact fees, and proper refund tracking. Always prefer this when available.\n\nTo connect: scripts/connect_stripe.sh <entity_id> <stripe_api_key> Then pull data: scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date>\n\nThe P&L generator automatically uses Stripe data when available, falling back to Mercury estimates otherwise.\n\nEntity Settings\n\nConfigure per-entity via the entity_settings table:\n\nSetting\tDefault\tDescription\naccounting_basis\taccrual\taccrual or cash — cash basis uses posted dates only\nmonth_offset\t1\tFiscal year month offset (1 = calendar year)\nstripe_fee_rate\t0.023\tStripe percentage fee for gross-up calculation\nstripe_fee_fixed\t0.30\tStripe fixed fee per transaction\namortization_monthly\tnull\tMonthly amortization amount for acquired assets\nWorkflow\nConnect Mercury — scripts/connect_mercury.sh <token> [name] discovers accounts, creates entity\nPull transactions — scripts/pull_transactions.sh <entity_id> <start_date> <end_date>\nCategorize — scripts/categorize.sh <entity_id> [max_transactions] — rule-based first, then AI for unknowns\nReview ambiguous — Script outputs low-confidence items. Ask user, then update with scripts/set_category.sh <transaction_id> <category> [subcategory]\nGenerate books — scripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]\nScripts Reference\n\nAll scripts are in scripts/. Run with bash or node. Database is SQLite at data/heath.db.\n\nScript\tPurpose\ninit_db.mjs\tCreate/migrate SQLite database + seed rules\nconnect_mercury.sh\tConnect Mercury API, discover accounts\npull_transactions.sh\tPull transactions for date range\ncategorize.sh\tCategorize transactions (rules + AI)\nset_category.sh\tManually set category for a transaction\nadd_rule.sh\tAdd/update a categorization rule\ngenerate_books.sh\tGenerate Excel workbook\nlist_entities.sh\tList all entities\nconnect_stripe.sh\tConnect Stripe API to an entity\npull_stripe_revenue.sh\tPull Stripe balance transactions by month\nstatus.sh\tShow entity status (accounts, tx counts)\nChart of Accounts\n\nSee references/chart-of-accounts.md for the full chart with P&L sections and cash flow classifications.\n\nLearning & Compounding System\n\nHeath Ledger gets smarter over time through a layered rule system:\n\nRule Hierarchy\nEntity-specific rules (highest priority) — per-company overrides\nGlobal rules (entity_id = NULL) — apply to all entities\nSeed rules — universal vendor mappings shipped with the skill\nAI categorization — used when no rule matches\nHow Learning Works\nEvery manual correction creates or updates a categorization rule\nRules track usage_count — heavily-used rules are more reliable\nsource field tracks provenance: seed, ai, human, manual\nHuman-confirmed rules get confidence: 0.95-1.0\nAI-generated rules start at 0.85 and can be promoted\nEntity-specific rules can be promoted to global when they prove universal\nThe Compounding Effect\n\nAfter categorizing ~5,000 transactions across 2 entities, the system now auto-categorizes ~95% of transactions without AI. Each new entity benefits from all previous learnings.\n\nKnown Limitations\nStripe Net vs Gross (Without Stripe API)\n\nMercury deposits from Stripe are net amounts (revenue minus ~2.9% + $0.30 fees). Without the Stripe API:\n\nWe estimate gross revenue using configurable fee rates\nThis creates \"synthetic\" Stripe Fee entries\nAccuracy depends on your actual Stripe fee rate (varies by plan, card type, international)\nSolution: Connect Stripe API for exact numbers\nDeel Fee Splitting\n\nDeel combines platform fees and contractor payroll in one transaction stream. Pattern:\n\nSmall fixed amounts (~$2-5) → Deel Platform Fee → categorize as \"Software expenses\"\nLarger variable amounts → Contractor Payroll → categorize as \"Wages & Salaries\"\nThe system learns this pattern but may need initial human guidance\nMercury API Limitations\nOnly returns posted transactions (not pending)\nSome counterparty names are truncated or normalized differently\nWire descriptions may include reference numbers that create duplicate rules\nMulti-Currency\nWise transfers create both a debit (USD) and may show FX fees separately\nInternational wire fees from Mercury appear as separate line items\nFX gains/losses are not tracked (would need multi-currency ledger)\nAI Categorization\n\nThe categorize.sh script calls the host agent's model via stdin/stdout JSON protocol. It sends transaction batches and expects category assignments back. The script writes a prompt to stdout that the agent should process and return results for.\n\nWhen AI confidence < 0.85, transactions are flagged as ambiguous for user review.\n\nKey Details\nCash or accrual basis — configurable per entity\nMultiple entities supported — each with own connections and rules\nRules persist — categorization rules saved to SQLite, reused across runs\nSeed rules — ~90 universal vendor mappings loaded on init\nExcel output — 4-tab workbook: P&L, Balance Sheet, Cash Flow, Transaction Detail"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wrannaman/heath-ledger",
    "publisherUrl": "https://clawhub.ai/wrannaman/heath-ledger",
    "owner": "wrannaman",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/heath-ledger",
    "downloadUrl": "https://openagent3.xyz/downloads/heath-ledger",
    "agentUrl": "https://openagent3.xyz/skills/heath-ledger/agent",
    "manifestUrl": "https://openagent3.xyz/skills/heath-ledger/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/heath-ledger/agent.md"
  }
}