{"id":"e573f086-3cce-4d1f-8355-61db0e6f3676","entityType":"agent","slug":"clawhub-yaohx-star-yaohx-expense-tracker","name":"Yaohx Expense Tracker","canonicalUrl":"https://www.xpersona.co/agent/clawhub-yaohx-star-yaohx-expense-tracker","canonicalPath":"/agent/clawhub-yaohx-star-yaohx-expense-tracker","generatedAt":"2026-10-11T10:51:50.283Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":null},"description":"个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions... Skill: Yaohx Expense Tracker Owner: yaohx-star Summary: 个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions... Tags: latest:1.0.3 Version history: v1.0.3 | 2026-07-11T14:24:48.513Z | auto - Major refactor for skill structure and documentation to clarify usage and workflow. - Updated and greatly expanded SKILL.md:","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1735rtand3mccspdcq16nv2g1887kma:yaohx-expense-tracker","sourceUrl":"https://clawhub.ai/yaohx-star/yaohx-expense-tracker","homepage":"https://clawhub.ai/yaohx-star/skills/yaohx-expense-tracker","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/yaohx-star/yaohx-expense-tracker","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/yaohx-star/skills/yaohx-expense-tracker","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":null},"stars":null,"forks":null,"downloads":1109,"packageName":null,"latestVersion":"1.0.3","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:44:38.530Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T08:44:38.542Z","lastCrawledAt":"2026-10-11T08:44:38.530Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T08:44:38.530Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.3","createdAt":"2026-07-11T14:24:48.513Z","changelog":"- Major refactor for skill structure and documentation to clarify usage and workflow. - Updated and greatly expanded SKILL.md: now emphasizes local data processing, step-by-step workflow, strict shell parameter usage, and added multi-modal usage guidelines. - All executable scripts except `init_db.py` are removed from the package; workflow descriptions no longer recommend direct JSON piping into scripts. - Strengthened guidance for using argument-based script calls (no JSON via stdin), improved cross-platform instructions (Windows compatibility), and clarified OCR handling for different model capabilities. - Added clear instructions for initialization, expense recording (text + image flow), record querying, monthly report generation, and deletion with corresponding command-line examples. - Added table for script functions and arguments, plus more comprehensive category-matching rules. - Removed old implementation/developer references to match a documentation-and-guidance-only skill release.","fileCount":3,"zipByteSize":5794},{"version":"1.0.2","createdAt":"2026-06-07T15:23:56.981Z","changelog":"修复路径问题","fileCount":8,"zipByteSize":15345},{"version":"1.0.1","createdAt":"2026-06-07T14:03:29.377Z","changelog":"添加记账提醒，每天定时提醒记账","fileCount":8,"zipByteSize":15450},{"version":"1.0.0","createdAt":"2026-06-07T13:30:40.007Z","changelog":"Initial release of yaohx-expense-tracker. - Automatically records expenses from user text or payment screenshots, extracting amount, merchant, category, and payment method. - Maintains categorized expense data files by month. - Generates and sends monthly spending reports automatically at 20:00 on the last day of each month. - Supports commands for manual bookkeeping, record review, and on-demand report generation. - Requires initialization to create category and expense files on first use.","fileCount":8,"zipByteSize":15440}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1735rtand3mccspdcq16nv2g1887kma:yaohx-expense-tracker","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T10:51:50.282Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yaohx-star-yaohx-expense-tracker/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":null},"readme":"Skill: Yaohx Expense Tracker\n\nOwner: yaohx-star\n\nSummary: 个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions...\n\nTags: latest:1.0.3\n\nVersion history:\n\nv1.0.3 | 2026-07-11T14:24:48.513Z | auto\n\n- Major refactor for skill structure and documentation to clarify usage and workflow.\n- Updated and greatly expanded SKILL.md: now emphasizes local data processing, step-by-step workflow, strict shell parameter usage, and added multi-modal usage guidelines.\n- All executable scripts except `init_db.py` are removed from the package; workflow descriptions no longer recommend direct JSON piping into scripts.\n- Strengthened guidance for using argument-based script calls (no JSON via stdin), improved cross-platform instructions (Windows compatibility), and clarified OCR handling for different model capabilities.\n- Added clear instructions for initialization, expense recording (text + image flow), record querying, monthly report generation, and deletion with corresponding command-line examples.\n- Added table for script functions and arguments, plus more comprehensive category-matching rules.\n- Removed old implementation/developer references to match a documentation-and-guidance-only skill release.\n\nv1.0.2 | 2026-06-07T15:23:56.981Z | user\n\n修复路径问题\n\nv1.0.1 | 2026-06-07T14:03:29.377Z | user\n\n添加记账提醒，每天定时提醒记账\n\nv1.0.0 | 2026-06-07T13:30:40.007Z | auto\n\nInitial release of yaohx-expense-tracker.\n\n- Automatically records expenses from user text or payment screenshots, extracting amount, merchant, category, and payment method.\n- Maintains categorized expense data files by month.\n- Generates and sends monthly spending reports automatically at 20:00 on the last day of each month.\n- Supports commands for manual bookkeeping, record review, and on-demand report generation.\n- Requires initialization to create category and expense files on first use.\n\nArchive index:\n\nArchive v1.0.3: 3 files, 5794 bytes\n\nFiles: skill-card.md (2324b), SKILL.md (9557b), _meta.json (140b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: yaohx-expense-tracker\ndescription: \"个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions recording an expense, checking spending, or requesting a consumption report.\"\nagent_created: true\n---\n\n# 记账助手 (Expense Tracker)\n\n## 概述\n\n一个纯本地处理的个人记账技能。支持文本输入和支付截图两种方式记录消费，按月归档到本地 JSON 文件，支持消费分类管理、记录查询、月度报告生成。所有数据存储和处理均在本地完成，不依赖任何云端 API。\n\n## 数据存储位置\n\n所有数据文件存放在工作区根目录下（即当前工作目录）：\n\n| 文件/目录 | 说明 |\n|---|---|\n| `categories.json` | 消费分类定义文件 |\n| `expenses/` | 消费记录目录 |\n| `expenses/expenses-YYYYMM.json` | 按月份的消费记录文件 |\n\n数据格式详见 `references/data_schema.md`。\n\n## 触发场景\n\n1. **文本记账**：用户发送消费描述，如 \"午餐花了25元\"、\"打车15块\"\n2. **图片记账**：用户发送微信支付/支付宝截图，直接识图后记录\n3. **手动记录**：用户说\"记账\"并提供详细信息\n4. **查看记录**：用户说\"看看本月消费\"、\"本月花了多少\"\n5. **月度报告**：用户说\"生成本月消费报告\"、\"月度总结\"\n6. **删除记录**：用户说\"删除刚才那条记录\"、\"删掉某笔消费\"\n\n## 工作流程\n\n### 初始化（首次使用时执行）\n\n当用户首次使用记账功能时，先执行初始化：\n\n```bash\npython scripts/init_db.py\n```\n\n此脚本在工作区根目录创建：\n- `categories.json`（含默认分类）\n- `expenses/` 目录\n- 当前月份的 `expenses/expenses-YYYYMM.json` 空文件\n\n### 流程 A：处理文本账单\n\n1. 从用户消息中提取关键信息：日期、时间、金额、商家、消费类别、支付方式、备注\n2. 如果用户未提供日期/时间，默认使用当前日期和时间\n3. 根据商家名称和备注，自动匹配消费分类（匹配规则见下方）\n4. 调用脚本写入记录\n5. 回复用户确认记录成功，展示本次消费摘要和本月累计\n\n**关键：调用脚本时使用独立参数，绝不传递 JSON 字符串**\n\n正确调用方式：\n\n```bash\npython scripts/record_expense.py --amount 25 --merchant \"兰州拉面\" --category \"餐饮\" --date 2026-07-09 --time 1230 --payment \"微信\" --note \"午餐\"\n```\n\n参数说明：\n- `--amount`：金额（数字，必填）\n- `--merchant`：商家名称（必填）\n- `--category`：消费分类（可选，不传则自动匹配）\n- `--date`：日期，格式 YYYY-MM-DD（可选，默认今天）\n- `--time`：时间，格式 HHMM（可选，默认当前时间）\n- `--payment`：支付方式（可选，如 微信/支付宝/现金/银行卡）\n- `--note`：备注（可选）\n\n### 流程 B：处理图片账单（支付截图）\n\n**根据模型能力选择路径：**\n\n#### 路径 B1：多模态模型（能直接识图）\n\n如果你是多模态模型，可以直接观察图片：\n\n1. 用户发送支付截图后，直接观察图片，提取以下信息：\n   - 金额（必填）\n   - 商家/收款方名称\n   - 支付方式（微信/支付宝等）\n   - 交易时间（如图片中可见）\n   - 备注/商品说明\n2. 将提取结果展示给用户确认（如有不确定的信息请用户补充）\n3. 用户确认后，使用独立参数调用 `record_expense.py` 写入记录\n4. 回复确认\n\n#### 路径 B2：非多模态模型（无法识图，使用本地 OCR）\n\n如果你无法直接观察图片（非多模态模型），使用本地 OCR 脚本提取文字：\n\n1. 获取用户发送的截图文件路径\n2. 调用 OCR 脚本提取文字和结构化信息：\n\n```bash\npython scripts/ocr_image.py --image \"截图文件路径\"\n```\n\n脚本使用 rapidocr-onnxruntime 进行本地 OCR：\n\n3. OCR 脚本输出 JSON 格式结果：\n\n```json\n{\n  \"success\": true,\n  \"raw_text\": \"微信支付 ¥25.00 向兰州拉面付款...\",\n  \"structured\": {\n    \"amount\": 25.00,\n    \"merchant\": \"兰州拉面\",\n    \"date\": \"2026-07-09\",\n    \"time\": \"1230\",\n    \"payment\": \"微信\",\n    \"note\": null\n  },\n  \"method\": \"rapidocr\"\n}\n```\n\n4. 读取 `structured` 中的字段，如果关键信息（金额、商家）已提取到，展示给用户确认后调用 `record_expense.py` 写入记录\n5. 如果 `structured` 中部分字段为 null，根据 `raw_text` 上下文自行推断补充，或请用户手动补充缺失信息\n6. 如果 OCR 脚本返回 `\"success\": false`，说明 OCR 不可用，此时**必须**请用户手动输入消费信息（金额、商家等），不要直接报错终止\n\nOCR 不可用时输出示例：\n```json\n{\n  \"success\": false,\n  \"error\": \"rapidocr-onnxruntime not installed\",\n  \"install_hint\": \"pip install rapidocr-onnxruntime\",\n  \"fallback_instruction\": \"OCR is not available. Please ask the user to manually input the expense details.\"\n}\n```\n\n**OCR 依赖安装（非多模态模型必须安装）：**\n\n如需使用图片记账功能，运行：\n```bash\npython -m pip install rapidocr-onnxruntime\n```\n\n如果未安装 rapidocr，OCR 脚本会返回 `fallback_instruction`，此时必须请用户手动输入消费信息。\n多模态模型不需要安装 OCR——直接识图即可。\n\n### 流程 C：查看消费记录\n\n调用脚本查询：\n\n```bash\n# 查看指定月份\npython scripts/list_expenses.py --month 202607\n\n# 查看指定月份某分类\npython scripts/list_expenses.py --month 202607 --category \"餐饮\"\n\n# 不传 --month 则默认当前月\npython scripts/list_expenses.py\n```\n\n### 流程 D：生成月度消费报告\n\n```bash\n# 指定月份\npython scripts/generate_report.py --month 202607\n\n# 不传则默认当前月\npython scripts/generate_report.py\n```\n\n报告内容包含：\n- 本月总支出金额\n- 各分类支出金额及占比\n- 日均消费金额\n- 单笔最高消费\n- 支付方式分布\n- 与上月对比（如果上月数据存在）\n\n将报告摘要回复给用户，可配合 show_widget 展示饼图或柱状图。\n\n### 流程 E：删除消费记录\n\n```bash\npython scripts/delete_expense.py --id 2026-07-09-001\n```\n\n删除后回复用户确认。\n\n## 消费分类自动匹配规则\n\n当用户未明确指定分类时，根据商家名称和备注自动匹配：\n\n- 含\"餐、饭、面、粉、菜、外卖、咖啡、奶茶、饮料、零食、烧烤、火锅、早点、早餐、午餐、晚餐、夜宵\"等 → `餐饮`\n- 含\"打车、滴滴、公交、地铁、加油、停车、充电、单车、出租、高铁、火车、机票、飞机\"等 → `交通`\n- 含\"超市、便利店、淘宝、京东、拼多多、天猫、苏宁、网购\"等 → `购物`\n- 含\"房租、房贷、水电、燃气、物业、宽带\"等 → `居住`\n- 含\"电影、KTV、游戏、旅游、景点、门票、健身\"等 → `娱乐`\n- 含\"医院、药房、诊所、挂号、药\"等 → `医疗`\n- 含\"话费、流量、充值\"等 → `通讯`\n- 含\"衣服、鞋、裤、裙、外套、服装\"等 → `服饰`\n- 含\"书、课程、培训、学费、教育\"等 → `教育`\n- 其他默认归入 `其他`\n\n## 脚本调用注意事项\n\n### 绝不传递 JSON 字符串\n\n所有脚本均使用 `argparse` 接收独立参数。不要将数据组装成 JSON 字符串再传给脚本。这是为了避免 Windows 下 shell 引号转义问题。\n\n错误示例（会导致 Windows 下引号冲突）：\n```bash\npython scripts/record_expense.py '{\"amount\": 25, \"merchant\": \"兰州拉面\"}'\n```\n\n正确示例（独立参数，无嵌套引号问题）：\n```bash\npython scripts/record_expense.py --amount 25 --merchant \"兰州拉面\"\n```\n\n### 使用 python 而非 python3\n\n在 Windows 上，`python3` 命令通常不存在。始终使用 `python`。\n\n### 中文参数\n\n中文参数用双引号包裹即可，不需要额外转义：\n```bash\npython scripts/record_expense.py --amount 25 --merchant \"兰州拉面\" --category \"餐饮\"\n```\n\n### 脚本路径\n\n脚本路径相对于 skill 目录。脚本内部会自动以当前工作目录作为数据存储根目录。如需指定其他数据目录，使用 `--data-dir` 参数：\n```bash\npython scripts/record_expense.py --amount 25 --merchant \"兰州拉面\" --data-dir \"C:\\Users\\me\\my-expenses\"\n```\n\n## 脚本清单\n\n| 脚本 | 功能 | 关键参数 |\n|---|---|---|\n| `scripts/ocr_image.py` | OCR 识别截图文字（非多模态模型用） | `--image`（必填） |\n| `scripts/init_db.py` | 初始化数据文件 | `--data-dir`（可选） |\n| `scripts/record_expense.py` | 记录一笔消费 | `--amount`, `--merchant`, `--category`, `--date`, `--time`, `--payment`, `--note` |\n| `scripts/list_expenses.py` | 查询消费记录 | `--month`, `--category`（均可选） |\n| `scripts/generate_report.py` | 生成月度报告 | `--month`（可选，默认当月） |\n| `scripts/delete_expense.py` | 删除一条记录 | `--id` |\n\n## 数据格式\n\n数据格式详见 `references/data_schema.md`。\n\n## 注意事项\n\n- `expenses-YYYYMM.json` 中 `id` 格式为 `YYYY-MM-DD-NNN`，NNN 为当天序号（001 起），同一日期内递增\n- 每次写入后自动更新 `last_updated` 时间戳\n- 金额保留原始精度，汇总时四舍五入到两位小数\n- 所有 Python 脚本使用 UTF-8 编码\n- 脚本输出为 JSON 格式，方便模型解析\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn74k9gxerd67wztxke01p3js188715p\",\n  \"slug\": \"yaohx-expense-tracker\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783779888513\n}\n\nFile v1.0.3:skill-card.md\n\n## Description:\n\nYaohx Expense Tracker helps an agent record local personal expenses from text or payment screenshots, query monthly spending, manage categories, delete records, and generate monthly spending reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[yaohx-star](https://clawhub.ai/user/yaohx-star)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users can use this skill with an agent to maintain a local personal expense ledger, capture spending from natural-language notes or payment screenshots, and review monthly spending summaries.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Deleting financial records can remove a user's source-of-truth expense data if the wrong record is selected.\n\nMitigation: Ask the user to confirm the exact record identifier and visible expense details before running a deletion workflow.\n\nRisk: The optional OCR path recommends installing an unpinned dependency.\n\nMitigation: Install OCR dependencies only in a controlled environment with pinned, trusted package versions.\n\nRisk: The release evidence warns that expected supporting scripts may be missing from the installed package.\n\nMitigation: Verify the installed package includes the required scripts before relying on recording, OCR, listing, reporting, or deletion workflows.\n\n## Reference(s):\n\n- [Server-resolved GitHub source repository](https://github.com/yaohx-star/yaohx-expense-tracker)\n- [ClawHub skill page](https://clawhub.ai/yaohx-star/skills/yaohx-expense-tracker)\n- [Publisher profile](https://clawhub.ai/user/yaohx-star)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Plain text or Markdown with shell command examples and JSON-shaped script outputs]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May create or update local categories and monthly expense JSON files when the supporting scripts are present.]\n\n## Skill Version(s):\n\n1.0.3 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.2: 8 files, 15345 bytes\n\nFiles: references/data_schema.md (3942b), scripts/generate_report.py (9416b), scripts/init_db.py (3629b), scripts/ocr_bill.py (7321b), scripts/record_expense.py (5311b), skill-card.md (1973b), SKILL.md (5637b), _meta.json (140b)\n\nFile v1.0.2:SKILL.md\n\n---\r\nname: expense-tracker\r\ndescription: 个人记账助手。当用户发送账单/消费信息（文本或支付截图），自动识别并记录到消费数据库；每月最后一天晚上8点自动生成月度消费报告。触发词包括：记账、账单、消费记录、花了多少钱、月度总结、消费报告等。\r\nmetadata:\r\n  openclaw:\r\n    requires:\r\n      bins:\r\n        - python3\r\n      config: []\r\n---\r\n\r\n# 记账助手 (Expense Tracker)\r\n\r\n## 描述\r\n\r\n一个完整的个人记账技能，支持文本输入和支付截图两种方式记录消费，按月归档，并在每月最后一天自动生成消费分类汇总报告。\r\n\r\n核心能力：\r\n- **自动识别账单**：收到支付类文本消息或支付截图时，自动提取关键信息（金额、商家、分类、支付方式等）\r\n- **消费分类管理**：维护 `categories.json` 分类定义文件\r\n- **按月归档**：每月消费记录存入 `expenses/expenses-YYYYMM.json`\r\n- **月度报告**：每月最后一天 20:00 自动生成并发送消费总结\r\n\r\n## 数据文件说明\r\n\r\n所有数据文件存放在 OpenCLAW 工作区根目录下：\r\n\r\n| 文件/目录 | 说明 |\r\n|-----------|------|\r\n| `categories.json` | 消费分类定义文件 |\r\n| `expenses/` | 消费记录目录 |\r\n| `expenses/expenses-YYYYMM.json` | 按月份的消费记录文件 |\r\n\r\n数据格式详见 `references/data_schema.md`。\r\n\r\n## 使用方法\r\n\r\n### 触发场景\r\n\r\n1. **文本记账**：用户直接发送消费描述文本，如 \"午餐花了25元\"、\"打车15块\"、\"今天买了杯咖啡18元\"\r\n2. **图片记账**：用户发送微信支付/支付宝截图，需调用 OCR 脚本识别\r\n3. **手动记录**：用户说\"记账\"并提供详细信息\r\n4. **查看记录**：用户说\"看看本月消费\"、\"本月花了多少\"\r\n5. **记账提醒**：每天20:00 自动触发\r\n6. **月度报告**：每月最后一天 20:00 自动触发，或用户说\"生成本月消费报告\"\r\n\r\n\r\n### 工作流程\r\n\r\n#### 流程 A：处理文本账单\r\n\r\n1. 从用户消息中提取关键信息：日期、时间、金额、商家、消费类别、支付方式、备注\r\n2. 如果用户未提供日期/时间，默认使用当前日期和时间\r\n3. 根据商家名称和备注，自动匹配最合适的消费分类（参考 `categories.json`）\r\n4. 调用 `scripts/record_expense.py` 将数据写入当月 `expenses/expenses-YYYYMM.json` 文件\r\n5. 回复用户确认记录成功，并展示本次消费摘要和本月累计\r\n\r\n消费分类自动匹配规则：\r\n- 含\"餐、饭、面、粉、菜、外卖、咖啡、奶茶、饮料、零食、烧烤、火锅\"等 → `餐饮`\r\n- 含\"打车、滴滴、公交、地铁、加油、停车、充电、单车\"等 → `交通`\r\n- 含\"超市、便利店、淘宝、京东、拼多多\"等 → `购物`\r\n- 含\"房租、房贷、水电、燃气、物业\"等 → `居住`\r\n- 含\"电影、KTV、游戏、旅游、景点\"等 → `娱乐`\r\n- 含\"医院、药房、诊所、挂号\"等 → `医疗`\r\n- 含\"话费、流量、宽带\"等 → `通讯`\r\n- 其他默认归入 `其他`\r\n\r\n#### 流程 B：处理图片账单（支付截图）\r\n\r\n1. 用户发送图片到对话，先保存图片到临时文件\r\n2. 调用 `python3 scripts/ocr_bill.py <图片路径>` 执行 OCR 识别\r\n3. 解析 OCR 返回的 JSON 结果，提取账单信息\r\n4. 如果 OCR 识别出多条消费记录，逐条确认后记录\r\n5. 将识别结果展示给用户确认，用户回复\"确认\"后写入文件\r\n6. 如果 OCR 识别不完整（缺少金额、商家等），请用户补充缺失信息\r\n\r\n#### 流程 C：生成月度消费报告\r\n\r\n触发条件（每月最后一天 20:00 自动，或用户手动触发）：\r\n1. 调用 `python3 scripts/generate_report.py <YYYYMM>` 生成报告\r\n2. 报告内容包含：\r\n   - 本月总支出金额\r\n   - 各分类支出金额及占比（饼图数据）\r\n   - 日均消费金额\r\n   - 单笔最高消费\r\n   - 支付方式分布\r\n   - 与上月对比（如果上月数据存在）\r\n3. 将报告摘要回复给用户，同时写入当月 expense 文件的 `monthly_summaries` 字段\r\n\r\n## 指令\r\n\r\n### 初始化（首次使用时执行）\r\n\r\n当用户首次使用记账功能时，执行初始化：\r\n\r\n```bash\r\npython3 scripts/init_db.py\r\n```\r\n\r\n此脚本会创建：\r\n- `categories.json`（含默认分类：餐饮、交通、购物、居住、娱乐、医疗、通讯、服饰、教育、其他）\r\n- `expenses/` 目录\r\n- 当前月份的 `expenses/expenses-YYYYMM.json` 空文件\r\n\r\n### 记录消费\r\n\r\n当用户发送疑似账单内容时：\r\n\r\n1. **判断是否为账单**：消息含金额（数字+元/块/¥）、商家名、支付动词（花了、买了、支付、付款、消费）\r\n2. **提取信息并构造 JSON**，调用脚本写入：\r\n\r\n```bash\r\npython3 scripts/record_expense.py '<JSON字符串>'\r\n```\r\n\r\nJSON 格式见 `references/data_schema.md`。\r\n\r\n3. **确认回复**：简洁回复，包含消费摘要\r\n\r\n### 记账提醒\r\n\r\n每天 20:00 检查 `expenses/expenses-YYYYMM.json` 中是否有当天的记账记录，并发送记账提醒。\r\n\r\n### 月度总结自动化\r\n\r\n参考 `references/data_schema.md` 中的月度总结格式。\r\n\r\n每月最后一天 20:00，自动执行：\r\n```bash\r\npython3 scripts/generate_report.py YYYYMM\r\n```\r\n将生成的报告发送给用户。\r\n\r\n### 注意事项\r\n\r\n- `expenses-YYYYMM.json` 中 `id` 格式为 `YYYY-MM-DD-NNN`，NNN 为当天序号（001 起），同一日期内递增\r\n- 每次写入后更新 `last_updated` 时间戳\r\n- 金额保留原始精度，汇总时四舍五入到两位小数\r\n- 所有 Python 脚本必须使用 UTF-8 编码\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn74k9gxerd67wztxke01p3js188715p\",\n  \"slug\": \"yaohx-expense-tracker\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1780845836981\n}\n\nFile v1.0.2:references/data_schema.md\n\n# 记账数据格式参考\r\n\r\n## categories.json - 消费分类定义\r\n\r\n```json\r\n{\r\n  \"categories\": [\r\n    {\"name\": \"餐饮\", \"icon\": \"🍜\", \"description\": \"三餐、外卖、零食、饮料、咖啡等\"},\r\n    {\"name\": \"交通\", \"icon\": \"🚗\", \"description\": \"打车、公交、地铁、加油、停车、共享单车\"},\r\n    {\"name\": \"购物\", \"icon\": \"🛒\", \"description\": \"日用品、数码产品、服饰、网购等\"},\r\n    {\"name\": \"居住\", \"icon\": \"🏠\", \"description\": \"房租、房贷、水电燃气、物业、维修\"},\r\n    {\"name\": \"娱乐\", \"icon\": \"🎮\", \"description\": \"电影、KTV、游戏、旅游、景点门票\"},\r\n    {\"name\": \"医疗\", \"icon\": \"💊\", \"description\": \"挂号、药品、体检、治疗\"},\r\n    {\"name\": \"通讯\", \"icon\": \"📱\", \"description\": \"话费、流量、宽带\"},\r\n    {\"name\": \"服饰\", \"icon\": \"👗\", \"description\": \"衣服、鞋帽、饰品、箱包\"},\r\n    {\"name\": \"教育\", \"icon\": \"📚\", \"description\": \"培训、书籍、文具、课程\"},\r\n    {\"name\": \"其他\", \"icon\": \"📦\", \"description\": \"未归类的其他消费\"}\r\n  ]\r\n}\r\n```\r\n\r\n## expenses/expenses-YYYYMM.json - 月度消费记录\r\n\r\n```json\r\n{\r\n  \"expenses\": [\r\n    {\r\n      \"id\": \"2026-06-01-001\",\r\n      \"date\": \"2026-06-01\",\r\n      \"time\": \"11:32:06\",\r\n      \"amount\": 25.00,\r\n      \"currency\": \"CNY\",\r\n      \"merchant\": \"全国工商联机关服务中心（北京仁合兴餐饮）\",\r\n      \"category\": \"餐饮\",\r\n      \"payment_method\": \"中信银行信用卡(0814)\",\r\n      \"notes\": \"午餐\",\r\n      \"source\": \"微信支付截图\"\r\n    }\r\n  ],\r\n  \"last_updated\": \"2026/6/6 21:03:52\",\r\n  \"monthly_summaries\": {}\r\n}\r\n```\r\n\r\n### 字段说明\r\n\r\n| 字段 | 类型 | 必填 | 说明 |\r\n|------|------|------|------|\r\n| id | string | 是 | 唯一标识，格式 `YYYY-MM-DD-NNN`，NNN 为当天 3 位序号 |\r\n| date | string | 是 | 消费日期，格式 `YYYY-MM-DD` |\r\n| time | string | 否 | 消费时间，格式 `HH:MM:SS` |\r\n| amount | number | 是 | 消费金额 |\r\n| currency | string | 否 | 货币，默认 `CNY` |\r\n| merchant | string | 是 | 商家名称 |\r\n| category | string | 是 | 消费分类，必须存在于 `categories.json` |\r\n| payment_method | string | 否 | 支付方式，如\"微信支付\"、\"支付宝\"、\"中信银行信用卡(0814)\" |\r\n| notes | string | 否 | 备注 |\r\n| source | string | 否 | 数据来源，如\"微信支付截图\"、\"支付宝截图\"、\"手动输入\" |\r\n\r\n### ID 生成规则\r\n\r\n- 格式：`YYYY-MM-DD-NNN`\r\n- NNN 从 001 开始，同一日期内依次递增\r\n- 新增记录时读取当月文件，找到当天最大序号 +1\r\n\r\n### monthly_summaries 格式\r\n\r\n```json\r\n{\r\n  \"monthly_summaries\": {\r\n    \"202606\": {\r\n      \"generated_at\": \"2026-06-30 20:05:00\",\r\n      \"total_amount\": 3520.50,\r\n      \"total_count\": 45,\r\n      \"avg_daily\": 117.35,\r\n      \"max_single\": {\"amount\": 500.00, \"merchant\": \"京东\", \"date\": \"2026-06-15\"},\r\n      \"category_breakdown\": {\r\n        \"餐饮\": {\"amount\": 1200.00, \"count\": 25, \"percentage\": 34.1},\r\n        \"交通\": {\"amount\": 300.50, \"count\": 8, \"percentage\": 8.5},\r\n        \"购物\": {\"amount\": 1500.00, \"count\": 5, \"percentage\": 42.6},\r\n        \"居住\": {\"amount\": 400.00, \"count\": 2, \"percentage\": 11.4},\r\n        \"娱乐\": {\"amount\": 120.00, \"count\": 5, \"percentage\": 3.4}\r\n      },\r\n      \"payment_breakdown\": {\r\n        \"微信支付\": {\"amount\": 2000.00, \"count\": 30},\r\n        \"支付宝\": {\"amount\": 1520.50, \"count\": 15}\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## 自动化排程\r\n\r\n建议在 OpenCLAW 中设置自动化任务 `expense-monthly-report`：\r\n\r\n- **触发时间**：每月最后一天 20:00\r\n- **执行指令**：`生成本月消费报告`\r\n- **rrule**：`FREQ=MONTHLY;BYMONTHDAY=-1;BYHOUR=20;BYMINUTE=0`\r\n\r\n\r\n建议在 OpenCLAW 中设置自动化任务 `expense-daily_reminder`：\r\n\r\n- **触发时间**：每天 20:00\r\n- **执行指令**：`记账提醒`\r\n- **rrule**：`FREQ=DAILY;BYHOUR=20;BYMINUTE=0`\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nExpense Tracker records personal spending from text or payment screenshots, stores monthly expense records, and generates monthly spending summaries. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[nontrace](https://clawhub.ai/user/nontrace) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nIndividuals and agent users use this skill to capture expenses from manual descriptions or payment screenshots, maintain monthly JSON expense records, and review category-based spending reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill stores sensitive expense history in local JSON files. <br>\nMitigation: Use it only where local persistent storage of spending history is acceptable, protect the generated files, and remove records that should not be retained. <br>\nRisk: Payment screenshots can expose raw payment text through OCR logs. <br>\nMitigation: Avoid screenshots with unrelated sensitive information and remove or disable raw OCR logging before routine use. <br>\n\n\n## Reference(s): <br>\n- [Data Schema Reference](references/data_schema.md) <br>\n- [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with bash snippets and JSON expense records] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Creates and updates local JSON files for categories, monthly expenses, and monthly summaries.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.1: 8 files, 15450 bytes\n\nFiles: references/data_schema.md (3744b), scripts/generate_report.py (9390b), scripts/init_db.py (3629b), scripts/ocr_bill.py (7321b), scripts/record_expense.py (5285b), skill-card.md (2300b), SKILL.md (5637b), _meta.json (140b)\n\nFile v1.0.1:SKILL.md\n\n---\r\nname: expense-tracker\r\ndescription: 个人记账助手。当用户发送账单/消费信息（文本或支付截图），自动识别并记录到消费数据库；每月最后一天晚上8点自动生成月度消费报告。触发词包括：记账、账单、消费记录、花了多少钱、月度总结、消费报告等。\r\nmetadata:\r\n  openclaw:\r\n    requires:\r\n      bins:\r\n        - python3\r\n      config: []\r\n---\r\n\r\n# 记账助手 (Expense Tracker)\r\n\r\n## 描述\r\n\r\n一个完整的个人记账技能，支持文本输入和支付截图两种方式记录消费，按月归档，并在每月最后一天自动生成消费分类汇总报告。\r\n\r\n核心能力：\r\n- **自动识别账单**：收到支付类文本消息或支付截图时，自动提取关键信息（金额、商家、分类、支付方式等）\r\n- **消费分类管理**：维护 `categories.json` 分类定义文件\r\n- **按月归档**：每月消费记录存入 `expenses/expenses-YYYYMM.json`\r\n- **月度报告**：每月最后一天 20:00 自动生成并发送消费总结\r\n\r\n## 数据文件说明\r\n\r\n所有数据文件存放在 OpenCLAW 工作区根目录下：\r\n\r\n| 文件/目录 | 说明 |\r\n|-----------|------|\r\n| `categories.json` | 消费分类定义文件 |\r\n| `expenses/` | 消费记录目录 |\r\n| `expenses/expenses-YYYYMM.json` | 按月份的消费记录文件 |\r\n\r\n数据格式详见 `references/data_schema.md`。\r\n\r\n## 使用方法\r\n\r\n### 触发场景\r\n\r\n1. **文本记账**：用户直接发送消费描述文本，如 \"午餐花了25元\"、\"打车15块\"、\"今天买了杯咖啡18元\"\r\n2. **图片记账**：用户发送微信支付/支付宝截图，需调用 OCR 脚本识别\r\n3. **手动记录**：用户说\"记账\"并提供详细信息\r\n4. **查看记录**：用户说\"看看本月消费\"、\"本月花了多少\"\r\n5. **记账提醒**：每天20:00 自动触发\r\n6. **月度报告**：每月最后一天 20:00 自动触发，或用户说\"生成本月消费报告\"\r\n\r\n\r\n### 工作流程\r\n\r\n#### 流程 A：处理文本账单\r\n\r\n1. 从用户消息中提取关键信息：日期、时间、金额、商家、消费类别、支付方式、备注\r\n2. 如果用户未提供日期/时间，默认使用当前日期和时间\r\n3. 根据商家名称和备注，自动匹配最合适的消费分类（参考 `categories.json`）\r\n4. 调用 `scripts/record_expense.py` 将数据写入当月 `expenses/expenses-YYYYMM.json` 文件\r\n5. 回复用户确认记录成功，并展示本次消费摘要和本月累计\r\n\r\n消费分类自动匹配规则：\r\n- 含\"餐、饭、面、粉、菜、外卖、咖啡、奶茶、饮料、零食、烧烤、火锅\"等 → `餐饮`\r\n- 含\"打车、滴滴、公交、地铁、加油、停车、充电、单车\"等 → `交通`\r\n- 含\"超市、便利店、淘宝、京东、拼多多\"等 → `购物`\r\n- 含\"房租、房贷、水电、燃气、物业\"等 → `居住`\r\n- 含\"电影、KTV、游戏、旅游、景点\"等 → `娱乐`\r\n- 含\"医院、药房、诊所、挂号\"等 → `医疗`\r\n- 含\"话费、流量、宽带\"等 → `通讯`\r\n- 其他默认归入 `其他`\r\n\r\n#### 流程 B：处理图片账单（支付截图）\r\n\r\n1. 用户发送图片到对话，先保存图片到临时文件\r\n2. 调用 `python3 scripts/ocr_bill.py <图片路径>` 执行 OCR 识别\r\n3. 解析 OCR 返回的 JSON 结果，提取账单信息\r\n4. 如果 OCR 识别出多条消费记录，逐条确认后记录\r\n5. 将识别结果展示给用户确认，用户回复\"确认\"后写入文件\r\n6. 如果 OCR 识别不完整（缺少金额、商家等），请用户补充缺失信息\r\n\r\n#### 流程 C：生成月度消费报告\r\n\r\n触发条件（每月最后一天 20:00 自动，或用户手动触发）：\r\n1. 调用 `python3 scripts/generate_report.py <YYYYMM>` 生成报告\r\n2. 报告内容包含：\r\n   - 本月总支出金额\r\n   - 各分类支出金额及占比（饼图数据）\r\n   - 日均消费金额\r\n   - 单笔最高消费\r\n   - 支付方式分布\r\n   - 与上月对比（如果上月数据存在）\r\n3. 将报告摘要回复给用户，同时写入当月 expense 文件的 `monthly_summaries` 字段\r\n\r\n## 指令\r\n\r\n### 初始化（首次使用时执行）\r\n\r\n当用户首次使用记账功能时，执行初始化：\r\n\r\n```bash\r\npython3 scripts/init_db.py\r\n```\r\n\r\n此脚本会创建：\r\n- `categories.json`（含默认分类：餐饮、交通、购物、居住、娱乐、医疗、通讯、服饰、教育、其他）\r\n- `expenses/` 目录\r\n- 当前月份的 `expenses/expenses-YYYYMM.json` 空文件\r\n\r\n### 记录消费\r\n\r\n当用户发送疑似账单内容时：\r\n\r\n1. **判断是否为账单**：消息含金额（数字+元/块/¥）、商家名、支付动词（花了、买了、支付、付款、消费）\r\n2. **提取信息并构造 JSON**，调用脚本写入：\r\n\r\n```bash\r\npython3 scripts/record_expense.py '<JSON字符串>'\r\n```\r\n\r\nJSON 格式见 `references/data_schema.md`。\r\n\r\n3. **确认回复**：简洁回复，包含消费摘要\r\n\r\n### 记账提醒\r\n\r\n每天 20:00 检查 `expenses/expenses-YYYYMM.json` 中是否有当天的记账记录，并发送记账提醒。\r\n\r\n### 月度总结自动化\r\n\r\n参考 `references/data_schema.md` 中的月度总结格式。\r\n\r\n每月最后一天 20:00，自动执行：\r\n```bash\r\npython3 scripts/generate_report.py YYYYMM\r\n```\r\n将生成的报告发送给用户。\r\n\r\n### 注意事项\r\n\r\n- `expenses-YYYYMM.json` 中 `id` 格式为 `YYYY-MM-DD-NNN`，NNN 为当天序号（001 起），同一日期内递增\r\n- 每次写入后更新 `last_updated` 时间戳\r\n- 金额保留原始精度，汇总时四舍五入到两位小数\r\n- 所有 Python 脚本必须使用 UTF-8 编码\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn74k9gxerd67wztxke01p3js188715p\",\n  \"slug\": \"yaohx-expense-tracker\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1780841009377\n}\n\nFile v1.0.1:references/data_schema.md\n\n# 记账数据格式参考\r\n\r\n## categories.json - 消费分类定义\r\n\r\n```json\r\n{\r\n  \"categories\": [\r\n    {\"name\": \"餐饮\", \"icon\": \"🍜\", \"description\": \"三餐、外卖、零食、饮料、咖啡等\"},\r\n    {\"name\": \"交通\", \"icon\": \"🚗\", \"description\": \"打车、公交、地铁、加油、停车、共享单车\"},\r\n    {\"name\": \"购物\", \"icon\": \"🛒\", \"description\": \"日用品、数码产品、服饰、网购等\"},\r\n    {\"name\": \"居住\", \"icon\": \"🏠\", \"description\": \"房租、房贷、水电燃气、物业、维修\"},\r\n    {\"name\": \"娱乐\", \"icon\": \"🎮\", \"description\": \"电影、KTV、游戏、旅游、景点门票\"},\r\n    {\"name\": \"医疗\", \"icon\": \"💊\", \"description\": \"挂号、药品、体检、治疗\"},\r\n    {\"name\": \"通讯\", \"icon\": \"📱\", \"description\": \"话费、流量、宽带\"},\r\n    {\"name\": \"服饰\", \"icon\": \"👗\", \"description\": \"衣服、鞋帽、饰品、箱包\"},\r\n    {\"name\": \"教育\", \"icon\": \"📚\", \"description\": \"培训、书籍、文具、课程\"},\r\n    {\"name\": \"其他\", \"icon\": \"📦\", \"description\": \"未归类的其他消费\"}\r\n  ]\r\n}\r\n```\r\n\r\n## expenses/expenses-YYYYMM.json - 月度消费记录\r\n\r\n```json\r\n{\r\n  \"expenses\": [\r\n    {\r\n      \"id\": \"2026-06-01-001\",\r\n      \"date\": \"2026-06-01\",\r\n      \"time\": \"11:32:06\",\r\n      \"amount\": 25.00,\r\n      \"currency\": \"CNY\",\r\n      \"merchant\": \"全国工商联机关服务中心（北京仁合兴餐饮）\",\r\n      \"category\": \"餐饮\",\r\n      \"payment_method\": \"中信银行信用卡(0814)\",\r\n      \"notes\": \"午餐\",\r\n      \"source\": \"微信支付截图\"\r\n    }\r\n  ],\r\n  \"last_updated\": \"2026/6/6 21:03:52\",\r\n  \"monthly_summaries\": {}\r\n}\r\n```\r\n\r\n### 字段说明\r\n\r\n| 字段 | 类型 | 必填 | 说明 |\r\n|------|------|------|------|\r\n| id | string | 是 | 唯一标识，格式 `YYYY-MM-DD-NNN`，NNN 为当天 3 位序号 |\r\n| date | string | 是 | 消费日期，格式 `YYYY-MM-DD` |\r\n| time | string | 否 | 消费时间，格式 `HH:MM:SS` |\r\n| amount | number | 是 | 消费金额 |\r\n| currency | string | 否 | 货币，默认 `CNY` |\r\n| merchant | string | 是 | 商家名称 |\r\n| category | string | 是 | 消费分类，必须存在于 `categories.json` |\r\n| payment_method | string | 否 | 支付方式，如\"微信支付\"、\"支付宝\"、\"中信银行信用卡(0814)\" |\r\n| notes | string | 否 | 备注 |\r\n| source | string | 否 | 数据来源，如\"微信支付截图\"、\"支付宝截图\"、\"手动输入\" |\r\n\r\n### ID 生成规则\r\n\r\n- 格式：`YYYY-MM-DD-NNN`\r\n- NNN 从 001 开始，同一日期内依次递增\r\n- 新增记录时读取当月文件，找到当天最大序号 +1\r\n\r\n### monthly_summaries 格式\r\n\r\n```json\r\n{\r\n  \"monthly_summaries\": {\r\n    \"202606\": {\r\n      \"generated_at\": \"2026-06-30 20:05:00\",\r\n      \"total_amount\": 3520.50,\r\n      \"total_count\": 45,\r\n      \"avg_daily\": 117.35,\r\n      \"max_single\": {\"amount\": 500.00, \"merchant\": \"京东\", \"date\": \"2026-06-15\"},\r\n      \"category_breakdown\": {\r\n        \"餐饮\": {\"amount\": 1200.00, \"count\": 25, \"percentage\": 34.1},\r\n        \"交通\": {\"amount\": 300.50, \"count\": 8, \"percentage\": 8.5},\r\n        \"购物\": {\"amount\": 1500.00, \"count\": 5, \"percentage\": 42.6},\r\n        \"居住\": {\"amount\": 400.00, \"count\": 2, \"percentage\": 11.4},\r\n        \"娱乐\": {\"amount\": 120.00, \"count\": 5, \"percentage\": 3.4}\r\n      },\r\n      \"payment_breakdown\": {\r\n        \"微信支付\": {\"amount\": 2000.00, \"count\": 30},\r\n        \"支付宝\": {\"amount\": 1520.50, \"count\": 15}\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## 自动化排程\r\n\r\n建议在 OpenCLAW 中设置自动化任务 `expense-monthly-report`：\r\n\r\n- **触发时间**：每月最后一天 20:00\r\n- **执行指令**：`生成本月消费报告`\r\n- **rrule**：`FREQ=MONTHLY;BYMONTHDAY=-1;BYHOUR=20;BYMINUTE=0`\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nExpense Tracker helps users record personal expenses from text or payment screenshots, maintain local monthly expense JSON files, and generate monthly spending summaries. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[nontrace](https://clawhub.ai/user/nontrace) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users can use this skill to track personal spending by recording expenses from natural-language messages or payment screenshots. The skill also supports recurring reminders and monthly spending reports for local budgeting workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can record sensitive spending information from broad expense-related triggers. <br>\nMitigation: Use explicit recording commands, confirm each write before saving, and review generated records for amount, merchant, category, payment method, and source. <br>\nRisk: OCR processing may expose private bill or payment screenshot text because raw OCR text is printed and returned. <br>\nMitigation: Avoid OCR on sensitive bills unless raw OCR logging is removed or disabled, and delete temporary screenshot files after processing. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/nontrace/yaohx-expense-tracker) <br>\n- [Expense Data Schema](references/data_schema.md) <br>\n- [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Files] <br>\n**Output Format:** [User-facing text or Markdown, shell commands for local scripts, and JSON expense data files.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Writes local categories.json and expenses/expenses-YYYYMM.json files; monthly reports are saved into monthly_summaries and printed as text plus JSON.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.0: 8 files, 15440 bytes\n\nFiles: references/data_schema.md (3744b), scripts/generate_report.py (9390b), scripts/init_db.py (3629b), scripts/ocr_bill.py (7321b), scripts/record_expense.py (5285b), skill-card.md (2427b), SKILL.md (5453b), _meta.json (140b)\n\nFile v1.0.0:SKILL.md\n\n---\r\nname: expense-tracker\r\ndescription: 个人记账助手。当用户发送账单/消费信息（文本或支付截图），自动识别并记录到消费数据库；每月最后一天晚上8点自动生成月度消费报告。触发词包括：记账、账单、消费记录、花了多少钱、月度总结、消费报告等。\r\nmetadata:\r\n  openclaw:\r\n    requires:\r\n      bins:\r\n        - python3\r\n      config: []\r\n---\r\n\r\n# 记账助手 (Expense Tracker)\r\n\r\n## 描述\r\n\r\n一个完整的个人记账技能，支持文本输入和支付截图两种方式记录消费，按月归档，并在每月最后一天自动生成消费分类汇总报告。\r\n\r\n核心能力：\r\n- **自动识别账单**：收到支付类文本消息或支付截图时，自动提取关键信息（金额、商家、分类、支付方式等）\r\n- **消费分类管理**：维护 `categories.json` 分类定义文件\r\n- **按月归档**：每月消费记录存入 `expenses/expenses-YYYYMM.json`\r\n- **月度报告**：每月最后一天 20:00 自动生成并发送消费总结\r\n\r\n## 数据文件说明\r\n\r\n所有数据文件存放在 OpenCLAW 工作区根目录下：\r\n\r\n| 文件/目录 | 说明 |\r\n|-----------|------|\r\n| `categories.json` | 消费分类定义文件 |\r\n| `expenses/` | 消费记录目录 |\r\n| `expenses/expenses-YYYYMM.json` | 按月份的消费记录文件 |\r\n\r\n数据格式详见 `references/data_schema.md`。\r\n\r\n## 使用方法\r\n\r\n### 触发场景\r\n\r\n1. **文本记账**：用户直接发送消费描述文本，如 \"午餐花了25元\"、\"打车15块\"、\"今天买了杯咖啡18元\"\r\n2. **图片记账**：用户发送微信支付/支付宝截图，需调用 OCR 脚本识别\r\n3. **手动记录**：用户说\"记账\"并提供详细信息\r\n4. **查看记录**：用户说\"看看本月消费\"、\"本月花了多少\"\r\n5. **月度报告**：每月最后一天 20:00 自动触发，或用户说\"生成本月消费报告\"\r\n\r\n\r\n### 工作流程\r\n\r\n#### 流程 A：处理文本账单\r\n\r\n1. 从用户消息中提取关键信息：日期、时间、金额、商家、消费类别、支付方式、备注\r\n2. 如果用户未提供日期/时间，默认使用当前日期和时间\r\n3. 根据商家名称和备注，自动匹配最合适的消费分类（参考 `categories.json`）\r\n4. 调用 `scripts/record_expense.py` 将数据写入当月 `expenses/expenses-YYYYMM.json` 文件\r\n5. 回复用户确认记录成功，并展示本次消费摘要和本月累计\r\n\r\n消费分类自动匹配规则：\r\n- 含\"餐、饭、面、粉、菜、外卖、咖啡、奶茶、饮料、零食、烧烤、火锅\"等 → `餐饮`\r\n- 含\"打车、滴滴、公交、地铁、加油、停车、充电、单车\"等 → `交通`\r\n- 含\"超市、便利店、淘宝、京东、拼多多\"等 → `购物`\r\n- 含\"房租、房贷、水电、燃气、物业\"等 → `居住`\r\n- 含\"电影、KTV、游戏、旅游、景点\"等 → `娱乐`\r\n- 含\"医院、药房、诊所、挂号\"等 → `医疗`\r\n- 含\"话费、流量、宽带\"等 → `通讯`\r\n- 其他默认归入 `其他`\r\n\r\n#### 流程 B：处理图片账单（支付截图）\r\n\r\n1. 用户发送图片到对话，先保存图片到临时文件\r\n2. 调用 `python3 scripts/ocr_bill.py <图片路径>` 执行 OCR 识别\r\n3. 解析 OCR 返回的 JSON 结果，提取账单信息\r\n4. 如果 OCR 识别出多条消费记录，逐条确认后记录\r\n5. 将识别结果展示给用户确认，用户回复\"确认\"后写入文件\r\n6. 如果 OCR 识别不完整（缺少金额、商家等），请用户补充缺失信息\r\n\r\n#### 流程 C：生成月度消费报告\r\n\r\n触发条件（每月最后一天 20:00 自动，或用户手动触发）：\r\n1. 调用 `python3 scripts/generate_report.py <YYYYMM>` 生成报告\r\n2. 报告内容包含：\r\n   - 本月总支出金额\r\n   - 各分类支出金额及占比（饼图数据）\r\n   - 日均消费金额\r\n   - 单笔最高消费\r\n   - 支付方式分布\r\n   - 与上月对比（如果上月数据存在）\r\n3. 将报告摘要回复给用户，同时写入当月 expense 文件的 `monthly_summaries` 字段\r\n\r\n## 指令\r\n\r\n### 初始化（首次使用时执行）\r\n\r\n当用户首次使用记账功能时，执行初始化：\r\n\r\n```bash\r\npython3 scripts/init_db.py\r\n```\r\n\r\n此脚本会创建：\r\n- `categories.json`（含默认分类：餐饮、交通、购物、居住、娱乐、医疗、通讯、服饰、教育、其他）\r\n- `expenses/` 目录\r\n- 当前月份的 `expenses/expenses-YYYYMM.json` 空文件\r\n\r\n### 记录消费\r\n\r\n当用户发送疑似账单内容时：\r\n\r\n1. **判断是否为账单**：消息含金额（数字+元/块/¥）、商家名、支付动词（花了、买了、支付、付款、消费）\r\n2. **提取信息并构造 JSON**，调用脚本写入：\r\n\r\n```bash\r\npython3 scripts/record_expense.py '<JSON字符串>'\r\n```\r\n\r\nJSON 格式见 `references/data_schema.md`。\r\n\r\n3. **确认回复**：简洁回复，包含消费摘要\r\n\r\n### 月度总结自动化\r\n\r\n参考 `references/data_schema.md` 中的月度总结格式。\r\n\r\n每月最后一天 20:00，自动执行：\r\n```bash\r\npython3 scripts/generate_report.py YYYYMM\r\n```\r\n将生成的报告发送给用户。\r\n\r\n### 注意事项\r\n\r\n- `expenses-YYYYMM.json` 中 `id` 格式为 `YYYY-MM-DD-NNN`，NNN 为当天序号（001 起），同一日期内递增\r\n- 每次写入后更新 `last_updated` 时间戳\r\n- 金额保留原始精度，汇总时四舍五入到两位小数\r\n- 所有 Python 脚本必须使用 UTF-8 编码\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn74k9gxerd67wztxke01p3js188715p\",\n  \"slug\": \"yaohx-expense-tracker\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1780839040007\n}\n\nFile v1.0.0:references/data_schema.md\n\n# 记账数据格式参考\r\n\r\n## categories.json - 消费分类定义\r\n\r\n```json\r\n{\r\n  \"categories\": [\r\n    {\"name\": \"餐饮\", \"icon\": \"🍜\", \"description\": \"三餐、外卖、零食、饮料、咖啡等\"},\r\n    {\"name\": \"交通\", \"icon\": \"🚗\", \"description\": \"打车、公交、地铁、加油、停车、共享单车\"},\r\n    {\"name\": \"购物\", \"icon\": \"🛒\", \"description\": \"日用品、数码产品、服饰、网购等\"},\r\n    {\"name\": \"居住\", \"icon\": \"🏠\", \"description\": \"房租、房贷、水电燃气、物业、维修\"},\r\n    {\"name\": \"娱乐\", \"icon\": \"🎮\", \"description\": \"电影、KTV、游戏、旅游、景点门票\"},\r\n    {\"name\": \"医疗\", \"icon\": \"💊\", \"description\": \"挂号、药品、体检、治疗\"},\r\n    {\"name\": \"通讯\", \"icon\": \"📱\", \"description\": \"话费、流量、宽带\"},\r\n    {\"name\": \"服饰\", \"icon\": \"👗\", \"description\": \"衣服、鞋帽、饰品、箱包\"},\r\n    {\"name\": \"教育\", \"icon\": \"📚\", \"description\": \"培训、书籍、文具、课程\"},\r\n    {\"name\": \"其他\", \"icon\": \"📦\", \"description\": \"未归类的其他消费\"}\r\n  ]\r\n}\r\n```\r\n\r\n## expenses/expenses-YYYYMM.json - 月度消费记录\r\n\r\n```json\r\n{\r\n  \"expenses\": [\r\n    {\r\n      \"id\": \"2026-06-01-001\",\r\n      \"date\": \"2026-06-01\",\r\n      \"time\": \"11:32:06\",\r\n      \"amount\": 25.00,\r\n      \"currency\": \"CNY\",\r\n      \"merchant\": \"全国工商联机关服务中心（北京仁合兴餐饮）\",\r\n      \"category\": \"餐饮\",\r\n      \"payment_method\": \"中信银行信用卡(0814)\",\r\n      \"notes\": \"午餐\",\r\n      \"source\": \"微信支付截图\"\r\n    }\r\n  ],\r\n  \"last_updated\": \"2026/6/6 21:03:52\",\r\n  \"monthly_summaries\": {}\r\n}\r\n```\r\n\r\n### 字段说明\r\n\r\n| 字段 | 类型 | 必填 | 说明 |\r\n|------|------|------|------|\r\n| id | string | 是 | 唯一标识，格式 `YYYY-MM-DD-NNN`，NNN 为当天 3 位序号 |\r\n| date | string | 是 | 消费日期，格式 `YYYY-MM-DD` |\r\n| time | string | 否 | 消费时间，格式 `HH:MM:SS` |\r\n| amount | number | 是 | 消费金额 |\r\n| currency | string | 否 | 货币，默认 `CNY` |\r\n| merchant | string | 是 | 商家名称 |\r\n| category | string | 是 | 消费分类，必须存在于 `categories.json` |\r\n| payment_method | string | 否 | 支付方式，如\"微信支付\"、\"支付宝\"、\"中信银行信用卡(0814)\" |\r\n| notes | string | 否 | 备注 |\r\n| source | string | 否 | 数据来源，如\"微信支付截图\"、\"支付宝截图\"、\"手动输入\" |\r\n\r\n### ID 生成规则\r\n\r\n- 格式：`YYYY-MM-DD-NNN`\r\n- NNN 从 001 开始，同一日期内依次递增\r\n- 新增记录时读取当月文件，找到当天最大序号 +1\r\n\r\n### monthly_summaries 格式\r\n\r\n```json\r\n{\r\n  \"monthly_summaries\": {\r\n    \"202606\": {\r\n      \"generated_at\": \"2026-06-30 20:05:00\",\r\n      \"total_amount\": 3520.50,\r\n      \"total_count\": 45,\r\n      \"avg_daily\": 117.35,\r\n      \"max_single\": {\"amount\": 500.00, \"merchant\": \"京东\", \"date\": \"2026-06-15\"},\r\n      \"category_breakdown\": {\r\n        \"餐饮\": {\"amount\": 1200.00, \"count\": 25, \"percentage\": 34.1},\r\n        \"交通\": {\"amount\": 300.50, \"count\": 8, \"percentage\": 8.5},\r\n        \"购物\": {\"amount\": 1500.00, \"count\": 5, \"percentage\": 42.6},\r\n        \"居住\": {\"amount\": 400.00, \"count\": 2, \"percentage\": 11.4},\r\n        \"娱乐\": {\"amount\": 120.00, \"count\": 5, \"percentage\": 3.4}\r\n      },\r\n      \"payment_breakdown\": {\r\n        \"微信支付\": {\"amount\": 2000.00, \"count\": 30},\r\n        \"支付宝\": {\"amount\": 1520.50, \"count\": 15}\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## 自动化排程\r\n\r\n建议在 OpenCLAW 中设置自动化任务 `expense-monthly-report`：\r\n\r\n- **触发时间**：每月最后一天 20:00\r\n- **执行指令**：`生成本月消费报告`\r\n- **rrule**：`FREQ=MONTHLY;BYMONTHDAY=-1;BYHOUR=20;BYMINUTE=0`\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nExpense Tracker helps an agent recognize expense text or payment screenshots, store categorized monthly expense records, and generate monthly spending reports. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[nontrace](https://clawhub.ai/user/nontrace) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nIndividuals and personal productivity agents use this skill to record purchases from natural-language messages or payment screenshots, maintain local categorized expense files, and produce monthly summaries. It is useful for lightweight personal bookkeeping where local storage of spending history is acceptable. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill handles sensitive expense history and payment-screenshot contents. <br>\nMitigation: Review data retention expectations before installation and keep generated categories.json and expenses/ files in a protected local workspace. <br>\nRisk: Automatic text triggers can save expenses without enough user confirmation. <br>\nMitigation: Require explicit confirmation before writing text-derived or OCR-derived expense records. <br>\nRisk: OCR processing can expose raw payment text in logs or command output. <br>\nMitigation: Disable or redact raw OCR debug logging before using the skill with real payment screenshots. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/nontrace/yaohx-expense-tracker) <br>\n- [Data Schema Reference](references/data_schema.md) <br>\n- [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and JSON expense or report data] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Creates or updates local categories.json and expenses/expenses-YYYYMM.json files; OCR output can include raw payment-screenshot text.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: Yaohx Expense Tracker Owner: yaohx-star Summary: 个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions... Tags: latest:1.0.3 Version history: v1.0.3 | 2026-07-11T14:24:48.513Z | auto - Major refactor for skill structure and documentation to clarify usage and workflow. - Updated and greatly expanded SKILL.md:","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python scripts/init_db.py"},{"language":"bash","snippet":"python scripts/record_expense.py --amount 25 --merchant \"兰州拉面\" --category \"餐饮\" --date 2026-07-09 --time 1230 --payment \"微信\" --note \"午餐\""},{"language":"bash","snippet":"python scripts/ocr_image.py --image \"截图文件路径\""},{"language":"json","snippet":"{\n  \"success\": true,\n  \"raw_text\": \"微信支付 ¥25.00 向兰州拉面付款...\",\n  \"structured\": {\n    \"amount\": 25.00,\n    \"merchant\": \"兰州拉面\",\n    \"date\": \"2026-07-09\",\n    \"time\": \"1230\",\n    \"payment\": \"微信\",\n    \"note\": null\n  },\n  \"method\": \"rapidocr\"\n}"},{"language":"json","snippet":"{\n  \"success\": false,\n  \"error\": \"rapidocr-onnxruntime not installed\",\n  \"install_hint\": \"pip install rapidocr-onnxruntime\",\n  \"fallback_instruction\": \"OCR is not available. Please ask the user to manually input the expense details.\"\n}"},{"language":"bash","snippet":"python -m pip install rapidocr-onnxruntime"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: yaohx-expense-tracker\ndescription: \"个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions recording an expense, checking spending, or requesting a consumption report.\"\nagent_created: true\n---\n\n# 记账助手 (Expense Tracker)\n\n## 概述\n\n一个纯本地处理的个人记账技能。支持文本输入和支付截图两种方式记录消费，按月归档到本地 JSON 文件，支持消费分类管理、记录查询、月度报告生成。所有数据存储和处理均在本地完成，不依赖任何云端 API。\n\n## 数据存储位置\n\n所有数据文件存放在工作区根目录下（即当前工作目录）：\n\n| 文件/目录 | 说明 |\n|---|---|\n| `categories.json` | 消费分类定义文件 |\n| `expenses/` | 消费记录目录 |\n| `expenses/expenses-YYYYMM.json` | 按月份的消费记录文件 |\n\n数据格式详见 `references/data_schema.md`。\n\n## 触发场景\n\n1. **文本记账**：用户发送消费描述，如 \"午餐花了25元\"、\"打车15块\"\n2. **图片记账**：用户发送微信支付/支付宝截图，直接识图后记录\n3. **手动记录**：用户说\"记账\"并提供详细信息\n4. **查看记录**：用户说\"看看本月消费\"、\"本月花了多少\"\n5. **月度报告**：用户说\"生成本月消费报告\"、\"月度总结\"\n6. **删除记录**：用户说\"删除刚才那条记录\"、\"删掉某笔消费\"\n\n## 工作流程\n\n### 初始化（首次使用时执行）\n\n当用户首次使用记账功能时，先执行初始化：\n\n```bash\npython scripts/init_db.py\n```\n\n此脚本在工作区根目录创建：\n- `categories.json`（含默认分类）\n- `expenses/` 目录\n- 当前月份的 `expenses/expenses-YYYYMM.json` 空文件\n\n### 流程 A：处理文本账单\n\n1. 从用户消息中提取关键信息：日期、时间、金额、商家、消费类别、支付方式、备注\n2. 如果用户未提供日期/时间，默认使用当前日期和时间\n3. 根据商家名称和备注，自动匹配消费分类（匹配规则见下方）\n4. 调用脚本写入记录\n5. 回复用户确认记录成功，展示本次消费摘要和本月累计\n\n**关键：调用脚本时使用独立参数，绝不传递 JSON 字符串**\n\n正确调用方式：\n\n```bash\npython scripts/record_expense.py --amount 25 --merchant \"兰州拉面\" --category \"餐饮\" --date 2026-07-09 --time 1230 --payment \"微信\" --note \"午餐\"\n```\n\n参数说明：\n- `--amount`：金额（数字，必填）\n- `--merchant`：商家名称（必填）\n- `--category`：消费分类（可选，不传则自动匹配）\n- `--date`：日期，格式 YYYY-MM-DD（可选，默认今天）\n- `--time`：时间，格式 HHMM（可选，默认当前时间）\n- `--payment`：支付方式（可选，如 微信/支付宝/现金/银行卡）\n- `--note`：备注（可选）\n\n### 流程 B：处理图片账单（支付截图）\n\n**根据模型能力选择路径：**\n\n#### 路径 B1：多模态模型（能直接识图）\n\n如果你是多模态模型，可以直接观察图片：\n\n1. 用户发送支付截图后，直接观察图片，提取以下信息：\n   - 金额（必填）\n   - 商家/收款方名称\n   - 支付方式（微信/支付宝等）\n   - 交易时间（如图片中可见）\n   - 备注/商品说明\n2. 将提取结果展示给用户确认（如有不确定的信息请用户补充）\n3. 用户确认后，使用独立参数调用 `record_expense.py` 写入记录\n4. 回复确认\n\n#### 路径 B2：非多模态模型（无法识图，使用本地 OCR）\n\n如果你无法直接观察图片（非多模态模型），使用本地 OCR 脚本提取文字：\n\n1. 获取用户发送的截图文件路径\n2. 调用 OCR 脚本提取文字和结构化信息：\n\n```bash\npython scripts/ocr_image.py --image \"截图文件路径\"\n```\n\n脚本使用 rapidocr-onnxruntime 进行本地 OCR：\n\n3. OCR 脚本输出 JSON 格式结果：\n\n```json\n{\n  \"success\": true,\n  \"raw_text\": \"微信支付 ¥25.00 向兰州拉面付款...\",\n  \"structured\": {\n    \"amount\": 25.00,\n    \"merchant\": \"兰州拉面\",\n    \"date\": \"2026-07-09\",\n    \"time\": \"1230\",\n    \"payment\": \"微信\",\n    \"note\": null\n  },\n  \"method\": \"rapidocr\"\n}\n```\n\n4. 读取 `structured` 中的字段，如果关键信息（金额、商家）已提取到，展示给用户确认后调用 `record_expense.py` 写入记录\n5. 如果 `structured` 中部分字段为 null，根据 `raw_text` 上下文自行推断补充，或请用户手动补充缺失信息\n6. 如果 OCR 脚本返回 `\"success\": false`，说明 OCR 不可用，此时**必须**请用户手动输入消费信息（金额、商家等），不要直接报错终止\n\nOCR 不可用时输出示例：\n```json\n{\n  \"success\": false,\n  \"error\": \"rapidocr-onnxruntime not installed\",\n  \"install_hint\": \"pip install rapidocr-onnxruntime\",\n  \"fallback_instruction\": \"OCR is not available. Please ask the user to manually input the expense details.\"\n}\n```\n\n**OCR 依赖安装（非多模态模型必须安装）：**\n\n如需使用图片记账功能，运行：\n```bash\npython -m pip install rapidocr-onnxruntime\n```\n\n如果未安装 rapidocr，OCR 脚本会返回 `fallback"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn74k9gxerd67wztxke01p3js188715p\",\n  \"slug\": \"yaohx-expense-tracker\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783779888513\n}"},{"path":"skill-card.md","content":"## Description:\n\nYaohx Expense Tracker helps an agent record local personal expenses from text or payment screenshots, query monthly spending, manage categories, delete records, and generate monthly spending reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[yaohx-star](https://clawhub.ai/user/yaohx-star)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users can use this skill with an agent to maintain a local personal expense ledger, capture spending from natural-language notes or payment screenshots, and review monthly spending summaries.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Deleting financial records can remove a user's source-of-truth expense data if the wrong record is selected.\n\nMitigation: Ask the user to confirm the exact record identifier and visible expense details before running a deletion workflow.\n\nRisk: The optional OCR path recommends installing an unpinned dependency.\n\nMitigation: Install OCR dependencies only in a controlled environment with pinned, trusted package versions.\n\nRisk: The release evidence warns that expected supporting scripts may be missing from the installed package.\n\nMitigation: Verify the installed package includes the required scripts before relying on recording, OCR, listing, reporting, or deletion workflows.\n\n## Reference(s):\n\n- [Server-resolved GitHub source repository](https://github.com/yaohx-star/yaohx-expense-tracker)\n- [ClawHub skill page](https://clawhub.ai/yaohx-star/skills/yaohx-expense-tracker)\n- [Publisher profile](https://clawhub.ai/user/yaohx-star)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Plain text or Markdown with shell command examples and JSON-shaped script outputs]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May create or update local categories and monthly expense JSON files when the supporting scripts are present.]\n\n## Skill Version(s):\n\n1.0.3 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions... Skill: Yaohx Expense Tracker Owner: yaohx-star Summary: 个人记账助手。当用户发送消费信息（文本或支付截图）时自动识别并记录到本地消费数据库；支持按月归档、分类统计、查看消费记录、生成月度消费报告。触发词：记账、账单、消费记录、花了多少钱、月度总结、消费报告、看看本月消费等。This skill should be used when the user mentions... Tags: latest:1.0.3 Version history: v1.0.3 | 2026-07-11T14:24:48.513Z | auto - Major refactor for skill structure and documentation to clarify usage and workflow. - Updated and greatly expanded SKILL.md:","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":954,"uniquenessScore":56,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T08:44:38.542Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T10:51:50.283Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}