{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agentledger",
    "name": "AgentLedger",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/c-goro/agentledger",
    "canonicalUrl": "https://clawhub.ai/c-goro/agentledger",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agentledger",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agentledger",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "README.md",
      "package.json",
      "cli.js",
      "ledger.js",
      "budget.js"
    ],
    "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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/agentledger"
    },
    "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/agentledger",
    "agentPageUrl": "https://openagent3.xyz/skills/agentledger/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agentledger/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agentledger/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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "AgentLedger is an accounting skill that logs every transaction you make, tracks spending across multiple accounts, and provides detailed reports. Use this to maintain a complete financial record of your purchases.\n\nImportant: Always log transactions immediately after making purchases. This skill is designed for AI agents to track their own expenses (API costs, tool subscriptions, etc.)."
      },
      {
        "title": "1. Log a Transaction",
        "body": "When you make any purchase, immediately log it:\n\n// In Node.js context, require the ledger\nconst AgentLedger = require('./src/ledger.js');\nconst ledger = new AgentLedger();\n\n// Log a transaction\nawait ledger.logTransaction({\n  amount: 29.99,\n  currency: 'USD',\n  vendor: 'OpenAI',\n  description: 'GPT-4 API credits',\n  category: 'API/Services',\n  account: 'privacy-card-1',\n  context: 'Needed additional tokens for user project analysis',\n  receiptUrl: 'https://platform.openai.com/receipts/xyz',\n  confirmationId: 'sub_1234567890'\n});\n\nCLI Usage (supports both positional and named parameters):\n\n# Positional style\nnode src/cli.js log 29.99 \"OpenAI\" \"GPT-4 API credits\" --category=\"API/Services\"\n\n# Named parameter style  \nnode src/cli.js log --amount=29.99 --vendor=\"OpenAI\" --description=\"GPT-4 API credits\" --category=\"API/Services\" --context=\"Monthly API refill\""
      },
      {
        "title": "2. Check Current Spending",
        "body": "// Get spending summary\nconst summary = await ledger.getSummary('this-month');\nconsole.log(`Total spent this month: $${summary.total}`);\n\n// Check specific category\nconst apiSpending = await ledger.getCategorySpending('API/Services', 'this-month');"
      },
      {
        "title": "3. Generate Reports",
        "body": "// Monthly report\nconst report = await ledger.generateReport('monthly', { month: '2024-01' });\n\n// Custom date range\nconst customReport = await ledger.generateReport('custom', {\n  startDate: '2024-01-01',\n  endDate: '2024-01-31'\n});"
      },
      {
        "title": "4. Budget Management",
        "body": "// Set monthly budget for API services\nawait ledger.setBudget('API/Services', 500, 'monthly');\n\n// Check budget status\nconst budgetStatus = await ledger.checkBudget('API/Services');\nif (budgetStatus.isNearLimit) {\n  console.log(`Warning: ${budgetStatus.percentUsed}% of API budget used`);\n}"
      },
      {
        "title": "Categories",
        "body": "Use these predefined categories for consistent tracking:\n\nAPI/Services - API credits, SaaS subscriptions\nInfrastructure - Hosting, domains, CDN\nMarketing - Ads, social media tools\nTools - Software licenses, utilities\nSubscriptions - Recurring monthly/yearly services\nOther - Miscellaneous expenses"
      },
      {
        "title": "Privacy.com Cards",
        "body": "The ledger automatically detects Privacy.com card data if available:\n\n// If you have Privacy.com JSON exports in workspace/privacy/\nawait ledger.importPrivacyTransactions('./privacy/card-1.json');"
      },
      {
        "title": "Manual Account Setup",
        "body": "// Register a new payment method\nawait ledger.addAccount({\n  id: 'stripe-main',\n  name: 'Main Stripe Account',\n  type: 'credit_card',\n  currency: 'USD'\n});"
      },
      {
        "title": "Natural Language Queries",
        "body": "Ask questions like:\n\n\"How much did I spend on API keys this month?\"\n\"What was that $20 charge from yesterday?\"\n\"Show me all infrastructure costs from last quarter\"\n\"Am I over budget on marketing spend?\"\n\nThe CLI handles these queries:\n\nnode src/cli.js query \"API spending this month\"\nnode src/cli.js find \"OpenAI\" --last-week"
      },
      {
        "title": "Time Periods",
        "body": "Supported natural language time periods:\n\ntoday, yesterday\nthis-week, last-week\nthis-month, last-month\nthis-quarter, last-quarter\nthis-year, last-year\nlast-30-days, last-90-days"
      },
      {
        "title": "Data Export",
        "body": "// Export to CSV\nawait ledger.exportTransactions('csv', './exports/transactions.csv');\n\n// Export to JSON\nawait ledger.exportTransactions('json', './exports/transactions.json');"
      },
      {
        "title": "Essential Commands for AI Agents",
        "body": "# Initialize (run once)\nnode src/cli.js init\n\n# Log transactions (supports both styles)\nnode src/cli.js log 29.99 \"OpenAI\" \"API credits\" --category=\"API/Services\"\nnode src/cli.js log --amount=29.99 --vendor=\"OpenAI\" --description=\"API credits\" --category=\"API/Services\"\n\n# Check current spending\nnode src/cli.js summary                    # This month\nnode src/cli.js summary --period=\"today\"   # Today only\nnode src/cli.js summary --period=\"this-week\" # This week\n\n# Set and check budgets\nnode src/cli.js budget set \"API/Services\" 500    # Set monthly budget\nnode src/cli.js budget status                    # Check all budgets\n\n# Generate detailed reports  \nnode src/cli.js report monthly\nnode src/cli.js report --type=category\nnode src/cli.js report --type=vendor\n\n# Search transactions\nnode src/cli.js find \"OpenAI\"                    # Search by vendor\nnode src/cli.js find \"API\" --category=\"API/Services\"  # Search by category\nnode src/cli.js find --min-amount=50             # Find large expenses\n\n# Export data\nnode src/cli.js export csv                       # Export to CSV\nnode src/cli.js export --format=json            # Export to JSON\n\n# Natural language queries\nnode src/cli.js query \"How much did I spend on APIs this month?\"\nnode src/cli.js query \"What was that $25 charge?\"\n\n# Import from Privacy.com\nnode src/cli.js import privacy ./privacy-export.json"
      },
      {
        "title": "File Storage",
        "body": "Transactions: workspace/ledger/transactions.json\nAccounts: workspace/ledger/accounts.json\nBudgets: workspace/ledger/budgets.json\nSettings: workspace/ledger/settings.json"
      },
      {
        "title": "Best Practices",
        "body": "Log immediately - Don't wait, log every purchase as it happens\nAdd context - Explain why the purchase was necessary\nUse consistent categories - Stick to the predefined categories\nInclude receipts - Store confirmation numbers and receipt URLs\nSet budgets - Establish spending limits for each category\nReview regularly - Generate monthly reports to track spending patterns"
      },
      {
        "title": "Error Handling & Edge Cases",
        "body": "The ledger handles common errors gracefully:"
      },
      {
        "title": "Input Validation",
        "body": "Negative amounts: Rejected (use positive amounts only)\nMissing required fields: Clear error messages with usage examples\nInvalid currency: Accepted (no validation - assumes user knows what they're doing)\nVery long descriptions: Handled without truncation"
      },
      {
        "title": "Data Safety",
        "body": "Automatic backups: Created before each save operation\nCorrupted data recovery: Automatic recovery from .backup files\nEmpty periods: Gracefully shows $0.00 totals\nMulti-currency: Properly separated in summaries and reports"
      },
      {
        "title": "Example Error Recovery",
        "body": "# If you see \"Could not load transactions\" message:\n# The system automatically tries to recover from backup\n# Your data should be restored automatically\n\n# Manual backup check\nls workspace/ledger/*.backup  # Check if backups exist"
      },
      {
        "title": "Security & Privacy",
        "body": "Local storage only: All data stays in workspace/ledger/ JSON files\nNo external API calls: Core functionality works offline\nNo sensitive data: Never store actual card numbers or passwords\nAccount aliases: Use descriptive IDs like privacy-card-1 or company-amex\nReceipt URLs: Store links to receipts, not receipt content itself"
      }
    ],
    "body": "AgentLedger - AI Agent Expense Tracking\nOverview\n\nAgentLedger is an accounting skill that logs every transaction you make, tracks spending across multiple accounts, and provides detailed reports. Use this to maintain a complete financial record of your purchases.\n\nImportant: Always log transactions immediately after making purchases. This skill is designed for AI agents to track their own expenses (API costs, tool subscriptions, etc.).\n\nCore Functions\n1. Log a Transaction\n\nWhen you make any purchase, immediately log it:\n\n// In Node.js context, require the ledger\nconst AgentLedger = require('./src/ledger.js');\nconst ledger = new AgentLedger();\n\n// Log a transaction\nawait ledger.logTransaction({\n  amount: 29.99,\n  currency: 'USD',\n  vendor: 'OpenAI',\n  description: 'GPT-4 API credits',\n  category: 'API/Services',\n  account: 'privacy-card-1',\n  context: 'Needed additional tokens for user project analysis',\n  receiptUrl: 'https://platform.openai.com/receipts/xyz',\n  confirmationId: 'sub_1234567890'\n});\n\n\nCLI Usage (supports both positional and named parameters):\n\n# Positional style\nnode src/cli.js log 29.99 \"OpenAI\" \"GPT-4 API credits\" --category=\"API/Services\"\n\n# Named parameter style  \nnode src/cli.js log --amount=29.99 --vendor=\"OpenAI\" --description=\"GPT-4 API credits\" --category=\"API/Services\" --context=\"Monthly API refill\"\n\n2. Check Current Spending\n// Get spending summary\nconst summary = await ledger.getSummary('this-month');\nconsole.log(`Total spent this month: $${summary.total}`);\n\n// Check specific category\nconst apiSpending = await ledger.getCategorySpending('API/Services', 'this-month');\n\n3. Generate Reports\n// Monthly report\nconst report = await ledger.generateReport('monthly', { month: '2024-01' });\n\n// Custom date range\nconst customReport = await ledger.generateReport('custom', {\n  startDate: '2024-01-01',\n  endDate: '2024-01-31'\n});\n\n4. Budget Management\n// Set monthly budget for API services\nawait ledger.setBudget('API/Services', 500, 'monthly');\n\n// Check budget status\nconst budgetStatus = await ledger.checkBudget('API/Services');\nif (budgetStatus.isNearLimit) {\n  console.log(`Warning: ${budgetStatus.percentUsed}% of API budget used`);\n}\n\nCategories\n\nUse these predefined categories for consistent tracking:\n\nAPI/Services - API credits, SaaS subscriptions\nInfrastructure - Hosting, domains, CDN\nMarketing - Ads, social media tools\nTools - Software licenses, utilities\nSubscriptions - Recurring monthly/yearly services\nOther - Miscellaneous expenses\nAccount Integration\nPrivacy.com Cards\n\nThe ledger automatically detects Privacy.com card data if available:\n\n// If you have Privacy.com JSON exports in workspace/privacy/\nawait ledger.importPrivacyTransactions('./privacy/card-1.json');\n\nManual Account Setup\n// Register a new payment method\nawait ledger.addAccount({\n  id: 'stripe-main',\n  name: 'Main Stripe Account',\n  type: 'credit_card',\n  currency: 'USD'\n});\n\nNatural Language Queries\n\nAsk questions like:\n\n\"How much did I spend on API keys this month?\"\n\"What was that $20 charge from yesterday?\"\n\"Show me all infrastructure costs from last quarter\"\n\"Am I over budget on marketing spend?\"\n\nThe CLI handles these queries:\n\nnode src/cli.js query \"API spending this month\"\nnode src/cli.js find \"OpenAI\" --last-week\n\nTime Periods\n\nSupported natural language time periods:\n\ntoday, yesterday\nthis-week, last-week\nthis-month, last-month\nthis-quarter, last-quarter\nthis-year, last-year\nlast-30-days, last-90-days\nData Export\n// Export to CSV\nawait ledger.exportTransactions('csv', './exports/transactions.csv');\n\n// Export to JSON\nawait ledger.exportTransactions('json', './exports/transactions.json');\n\nCLI Quick Reference\nEssential Commands for AI Agents\n# Initialize (run once)\nnode src/cli.js init\n\n# Log transactions (supports both styles)\nnode src/cli.js log 29.99 \"OpenAI\" \"API credits\" --category=\"API/Services\"\nnode src/cli.js log --amount=29.99 --vendor=\"OpenAI\" --description=\"API credits\" --category=\"API/Services\"\n\n# Check current spending\nnode src/cli.js summary                    # This month\nnode src/cli.js summary --period=\"today\"   # Today only\nnode src/cli.js summary --period=\"this-week\" # This week\n\n# Set and check budgets\nnode src/cli.js budget set \"API/Services\" 500    # Set monthly budget\nnode src/cli.js budget status                    # Check all budgets\n\n# Generate detailed reports  \nnode src/cli.js report monthly\nnode src/cli.js report --type=category\nnode src/cli.js report --type=vendor\n\n# Search transactions\nnode src/cli.js find \"OpenAI\"                    # Search by vendor\nnode src/cli.js find \"API\" --category=\"API/Services\"  # Search by category\nnode src/cli.js find --min-amount=50             # Find large expenses\n\n# Export data\nnode src/cli.js export csv                       # Export to CSV\nnode src/cli.js export --format=json            # Export to JSON\n\n# Natural language queries\nnode src/cli.js query \"How much did I spend on APIs this month?\"\nnode src/cli.js query \"What was that $25 charge?\"\n\n# Import from Privacy.com\nnode src/cli.js import privacy ./privacy-export.json\n\nFile Storage\nTransactions: workspace/ledger/transactions.json\nAccounts: workspace/ledger/accounts.json\nBudgets: workspace/ledger/budgets.json\nSettings: workspace/ledger/settings.json\nBest Practices\nLog immediately - Don't wait, log every purchase as it happens\nAdd context - Explain why the purchase was necessary\nUse consistent categories - Stick to the predefined categories\nInclude receipts - Store confirmation numbers and receipt URLs\nSet budgets - Establish spending limits for each category\nReview regularly - Generate monthly reports to track spending patterns\nError Handling & Edge Cases\n\nThe ledger handles common errors gracefully:\n\nInput Validation\nNegative amounts: Rejected (use positive amounts only)\nMissing required fields: Clear error messages with usage examples\nInvalid currency: Accepted (no validation - assumes user knows what they're doing)\nVery long descriptions: Handled without truncation\nData Safety\nAutomatic backups: Created before each save operation\nCorrupted data recovery: Automatic recovery from .backup files\nEmpty periods: Gracefully shows $0.00 totals\nMulti-currency: Properly separated in summaries and reports\nExample Error Recovery\n# If you see \"Could not load transactions\" message:\n# The system automatically tries to recover from backup\n# Your data should be restored automatically\n\n# Manual backup check\nls workspace/ledger/*.backup  # Check if backups exist\n\nSecurity & Privacy\nLocal storage only: All data stays in workspace/ledger/ JSON files\nNo external API calls: Core functionality works offline\nNo sensitive data: Never store actual card numbers or passwords\nAccount aliases: Use descriptive IDs like privacy-card-1 or company-amex\nReceipt URLs: Store links to receipts, not receipt content itself"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/c-goro/agentledger",
    "publisherUrl": "https://clawhub.ai/c-goro/agentledger",
    "owner": "c-goro",
    "version": "1.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agentledger",
    "downloadUrl": "https://openagent3.xyz/downloads/agentledger",
    "agentUrl": "https://openagent3.xyz/skills/agentledger/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agentledger/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agentledger/agent.md"
  }
}