← 返回 Skills 市场
hohobohan

Sync Adapter

作者 Hobohan · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
40
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hobohan-sync-adapter
功能描述
Sync local .md data files to Google Sheets with dedup hashing. Reusable for expenses, investments, and any key-value data.
使用说明 (SKILL.md)

Sync Adapter

Pattern for syncing structured .md data to Google Sheets. Uses a service account, JWT auth, and content-hash dedup to avoid duplicates.

Authentication

  • Service account: /home/hobopi/.openclaw/secrets/google-service-account.json
  • JWT flow: sign with RSA256, exchange for access token
  • Sheet API: https://sheets.googleapis.com/v4/spreadsheets/{id}
  • Spreadsheet ID: 1Ikbydh-Xzc6F3pk1Q5lbCTbdEERSb4Hq8obzbABVZbU

Dedup strategy

Key generation: (normalized_date|normalized_amount|notes)

  • normalize_amount(str) — strips trailing zeros from decimal: $18.00$18, $18.50$18.50
  • This prevents float vs string mismatches between ledger ($18.00 as float 18.0) and sheet (18 as string)

Flow:

  1. Read all ledger *.md files → parse entries
  2. Read all existing sheet rows → build set of dedup keys
  3. Filter: only entries whose key not already in set
  4. Append new entries only

Parsing ledger format

m = re.match(r'^- ([^$]+) \$([0-9]+\.?[0-9]*) \| (.+)', line)

Parses: - Category $Amount | Notes

Investment format:

m = re.match(r'^- ([^$]+) \$([0-9.]+)(?: \| (.+))?', line)

Sync implementations

Expense sync (daily 9:30am)

  • Script: scripts/sync-ledger-to-sheet.py
  • Tab: Sheet1
  • Columns: Date, Category, Amount (SGD), Notes
  • Pinned to deepseek/deepseek-v4-flash, timeout 60s

Investment sync (Saturday 11am)

  • Script: scripts/sync-investments-to-sheet.py (or agent reads ledger + writes to sheet directly)
  • Tab: Investments
  • Columns: Date, Type (DEPOSIT/WITHDRAW), Amount (SGD), Notes
  • Type field: positive → DEPOSIT, negative → WITHDRAW
  • Pinned to deepseek/deepseek-v4-flash, timeout 600s

API notes

  • Use valueInputOption: 'USER_ENTERED' for date/currency formatting
  • Date format: YYYY-MM-DD (string) — prevents auto-conversion to different format
  • Amount: send as number (float), not string — prevents ' prefix
  • Find last row: read column A, count non-empty cells
  • Append: start after last populated row
  • Never modify existing rows — append only
安全使用建议
Before installing or running it, confirm the service-account JSON belongs to you, has only the minimum Google Sheets permissions needed, and that the spreadsheet ID is your intended destination. Treat the cron sync as an automated process that may append private expense or investment data without further prompting once configured.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose is syncing structured local markdown ledger data to Google Sheets, and the documented credential use, Sheets API calls, deduplication, and append-only behavior fit that purpose.
Instruction Scope
The skill documents a specific service-account path and spreadsheet ID, so it is not fully generic despite describing itself as reusable; users must confirm or replace those values.
Install Mechanism
The package contains only markdown skill documentation and a changelog; no executable scripts, dependencies, or hidden install steps were present.
Credentials
Read/write, exec, cron, and sensitive-credential access are proportionate for scheduled Sheets synchronization, but they touch private financial-style records and should be scoped by the user.
Persistence & Privilege
The skill describes scheduled daily and weekly sync jobs through cron, but this is disclosed and aligned with its sync purpose; no privilege escalation or stealth persistence was found.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hobohan-sync-adapter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hobohan-sync-adapter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release. Service account JWT auth, dedup hashing, ledger parsing, Google Sheet append-only sync.
元数据
Slug hobohan-sync-adapter
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Sync Adapter 是什么?

Sync local .md data files to Google Sheets with dedup hashing. Reusable for expenses, investments, and any key-value data. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 40 次。

如何安装 Sync Adapter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hobohan-sync-adapter」即可一键安装,无需额外配置。

Sync Adapter 是免费的吗?

是的,Sync Adapter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Sync Adapter 支持哪些平台?

Sync Adapter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Sync Adapter?

由 Hobohan(@hohobohan)开发并维护,当前版本 v1.0.0。

💬 留言讨论