Zenith Finance Gsheets Sync logo

Zenith Finance Gsheets Sync

Community
adityahimaone
zenith-finance-gsheets-sync

Synchronize Zenith Finance ledger and transactions to Google Sheets with automatic updates. Creates/maintains a spreadsheet with Dashboard (summary, charts) and History (full transaction log) sheets.

Overview

Publisheradityahimaone
Repositoryhermes-agent-rtk-caveman
Skill namezenith-finance-gsheets-sync
Stars
84
Forks
4
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by adityahimaone on GitHub. Read the source before you install it.

Installation

Install the Zenith Finance Gsheets Sync AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/adityahimaone/hermes-agent-rtk-caveman/tree/main/skills/finance/zenith-finance-gsheets-sync
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/adityahimaone/hermes-agent-rtk-caveman.git /tmp/hermes-agent-rtk-caveman
mkdir -p .claude/skills
cp -r /tmp/hermes-agent-rtk-caveman/skills/finance/zenith-finance-gsheets-sync .claude/skills/zenith-finance-gsheets-sync
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Zenith Finance Gsheets Sync in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Zenith Finance Gsheets Sync on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Zenith Finance Gsheets Sync is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Zenith Finance → Google Sheets Sync

Automatically syncs Zenith Finance data (Ledger.md and Transactions.md) to a Google Spreadsheet for dashboard visualization and historical tracking.

Trigger

  • User mentions "sync zenith to sheets", "google sheets zenith", "export finance to sheets"
  • After any Zenith Finance transaction update (can be called automatically)
  • Manual sync request

Prerequisites\n1. Google Workspace OAuth setup completed (google-workspace skill authenticated) with scope including https://www.googleapis.com/auth/drive\n2. Google Sheets API and Google Drive API enabled in Google Cloud project\n3. Zenith Finance data files exist:\n - ~/Documents/Obsidian/Notes/Finance/Ledger.md\n - ~/Documents/Obsidian/Notes/Finance/Transactions.md\n4. Optional but recommended: Download a copy of the Google Sheet for manual verification if needed (as user did with /Users/adityahimawan/Downloads/Zenith Finance Dashboard (4).xlsx)\n

Storage

  • Spreadsheet ID stored at: ~/.hermes/zenith_spreadsheet_id.txt
  • If no ID exists, creates new spreadsheet named "Zenith Finance Dashboard"

Sheets Structure

  1. Dashboard (first sheet): Summary metrics and charts
    • Detailed metrics and formulas as specified in the JSON structure
  2. History (second sheet): Full transaction log
    • Columns: Timestamp, Description, Amount, Income/Expense, Category, Source, Balance
    • Append-only format matching Transactions.md
  3. Category (third sheet): Category list for reference
    • Single column list of transaction categories (A1:A9)
    • Used for data validation and reference

Dashboard Metrics Specification

Based on the provided JSON structure, the Dashboard sheet should be updated with exact cell positions:

Key Metrics:

  • B2: "Metric" / C2: "Value" (header)
  • B3: "Total Income" / C3: =SUMIFS(History!C:C, History!D:D, "Income")
  • B4: "Total Expenses" / C4: =SUMIFS(History!C:C, History!D:D, "Expense")
  • B5: "Net Savings" / C5: =C3-C4
  • B6: "Last Updated Now" / C6: =NOW()
  • B7: "Last Updated" / C7: [static timestamp from last sync]
  • B9: "ACCOUNT BALANCES" / C9: "Value" (header)

Account Balance Formulas (B10:B15 label, C10:C15 value):

  • B10: "BCA (Main Bank)" / C10: =SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Expense")
  • B11: "Blu (Digital Bank)" / C11: =SUMIFS(History!C:C, History!F:F, B11, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B11, History!D:D, "Expense")
  • B12: "Gopay (E-Wallet)" / C12: =SUMIFS(History!C:C, History!F:F, B12, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B12, History!D:D, "Expense")
  • B13: "Dompet (Cash on Hand)" / C13: =SUMIFS(History!C:C, History!F:F, B13, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B13, History!D:D, "Expense")
  • B14: "RDN (Saham)" / C14: =SUMIFS(History!C:C, History!F:F, B14, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B14, History!D:D, "Expense")
  • B15: "Emas (Tabungan)" / C15: =SUMIFS(History!C:C, History!F:F, B15, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B15, History!D:D, "Expense")

Derived Metrics:

  • B16: "Total Liquid Assets" / C16: =SUM(C10:C15)

Monthly Summary (B18:B21):

  • B18: ="MONTHLY SUMMARY (" & TEXT(TODAY(), "mmmm") & ")" / C18: "Value" (header)
  • B19: "Monthly Income" / C19: Complex FILTER/SUM formula for current month
  • B20: "Monthly Expenses" / C20: Complex FILTER/SUM formula for current month
  • B21: "Monthly Net Savings" / C21: =C19-C20

Category Summary (B23 onward):

  • B23: "CATEGORY SUMMARY" / C23: "Value" (header)
  • B24: Array formula for category-based calculations
  • B25:B32: Individual category totals (Expense, Entertainment, Transport, Food, Salary, Other Income, Work)

Workflow

  1. Auth Check: Verify Google OAuth token is valid and has required scopes
  2. Spreadsheet ID: Load existing ID or create new spreadsheet
  3. Sheet Setup: Ensure Dashboard and History sheets exist (rename default sheet to History, add Dashboard)
  4. Data Extraction: Parse Ledger.md and Transactions.md
  5. Update Sheets:
    • Dashboard: Update account balances and summary formulas
    • History: Append new transactions since last sync
  6. Verification: Confirm update success

Detailed Steps\n\n### 1. Authentication Validation\nbash\n# Check if authenticated (adjust path if needed)\npython3 /Users/adityahimawan/.hermes/skills/productivity/google-workspace/scripts/setup.py --check\n# Should return: AUTHENTICATED\n# \n# Note: If your Hermes installation is in a different location, you may need to:\n# 1. Find your google-workspace setup script (usually in ~/.hermes/skills/productivity/google-workspace/scripts/)\n# 2. Or set HERMES_HOME environment variable: HERMES_HOME=/path/to/.hermes python3 setup.py --check\n

2. Spreadsheet Management

  • If ~/.hermes/zenith_spreadsheet_id.txt exists: use that ID
  • Else: create new spreadsheet via Drive API:
    python
    file_metadata = {
        'name': 'Zenith Finance Dashboard',
        'mimeType': 'application/vnd.google-apps.spreadsheet'
    }
    file = drive_service.files().create(body=file_metadata, fields='id').execute()
    spreadsheet_id = file.get('id')

3. Sheet Configuration

  • Ensure we have three sheets in order: Dashboard (index 0), History (index 1), Category (index 2)
  • Rename/reorder sheets as needed to match this structure
  • Uses Google Sheets API batchUpdate

4. Data Parsing

Ledger.md parsing:

  • Extract balances for: BCA, Blu, Gopay, Dompet, RDN, Emas
  • Handle both numeric values and gram-based gold (Emas)

Transactions.md parsing:

  • Extract lines matching pattern: [YYYY-MM-DD HH:MM] | Description | RpAmount | Income/Expense | Category | Source | Balance
  • Determine last synced timestamp to avoid duplicates

5. Dashboard Updates

Update cells with current values according to the JSON structure:

  • B2: "Metric" (static label)
  • C2: "Value" (static label)
  • B3: "Total Income" / C3: =SUMIFS(History!C:C, History!D:D, "Income")
  • B4: "Total Expenses" / C4: =SUMIFS(History!C:C, History!D:D, "Expense")
  • B5: "Net Savings" / C5: =C3-C4
  • B6: "Last Updated Now" / C6: =NOW()
  • B7: "Last Updated" / C7: [static timestamp from last sync]
  • B9: "ACCOUNT BALANCES" / C9: "Value" (header)
  • B10: "BCA (Main Bank)" / C10: =SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Expense")
  • B11: "Blu (Digital Bank)" / C11: =SUMIFS(History!C:C, History!F:F, B11, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B11, History!D:D, "Expense")
  • B12: "Gopay (E-Wallet)" / C12: =SUMIFS(History!C:C, History!F:F, B12, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B12, History!D:D, "Expense")
  • B13: "Dompet (Cash on Hand)" / C13: =SUMIFS(History!C:C, History!F:F, B13, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B13, History!D:D, "Expense")
  • B14: "RDN (Saham)" / C14: =SUMIFS(History!C:C, History!F:F, B14, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B14, History!D:D, "Expense")
  • B15: "Emas (Tabungan)" / C15: =SUMIFS(History!C:C, History!F:F, B15, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B15, History!D:D, "Expense")
  • B16: "Total Liquid Assets" / C16: =SUM(C10:C15)
  • B18: ="MONTHLY SUMMARY (" & TEXT(TODAY(), "mmmm") & ")" / C18: "Value" (header)
  • B19: "Monthly Income" / C19: [complex FILTER/SUM formula for current month]
  • B20: "Monthly Expenses" / C20: [complex FILTER/SUM formula for current month]
  • B21: "Monthly Net Savings" / C21: =C19-C20
  • B23: "CATEGORY SUMMARY" / C23: "Value" (header)
  • B24: [array formula for category-based calculations]
  • B25:B32: Individual category totals (Expense, Entertainment, Transport, Food, Salary, Other Income, Work)
  • Account balances: B8:B13 values with labels in A8:A13

6. History Append

  • Format new rows as: [timestamp, description, amount, income/expense, category, source, balance]
  • Append to History!A:G using sheets.append with INSERT_ROWS

7. Category Sheet Management

  • Ensure Category sheet exists as third sheet (index 2)
  • Update Category sheet with single column list of unique categories from Transactions.md
  • Format: A1: "Category" (header), A2:A[n]: unique category values
  • Used for data validation and reference in Dashboard calculations

7. Error Handling

  • If auth fails: guide user to re-run google-workspace setup
  • If spreadsheet not found: create new one
  • If sheet missing: recreate missing sheets
  • Validate data before writing

Known Bugs & Fixes (2026-04-13)

Bug 1: Regex Missing Type Column

Transactions.md has 7 fields but regex only captured 6 (missing Income/Expense).

python
# ❌ Wrong (6 groups)
r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\]\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+)'

# ✅ Correct (7 groups — adds Income/Expense type)
r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\]\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+)'

Bug 2: google_api.py Argument Format

google_api.py sheets append/update expects --values '<json>' NOT --values-file <path>.

python
# ❌ Wrong
run_gapi("sheets", "append", sid, range, "--values-file", temp_file)

# ✅ Correct
values_json = json.dumps(rows)
run_gapi("sheets", "append", sid, range, "--values", values_json)

Bug 3: Google Sheets Strips Leading Zeros

Timestamp "2026-04-10 07:22" becomes "2026-04-10 7:22" in Google Sheets, breaking dedup. Always normalize timestamps before comparing:

python
def normalize_timestamp(ts):
    ts = str(ts).strip()
    try:
        dt = datetime.strptime(ts, '%Y-%m-%d %H:%M')
        return dt.strftime('%Y-%m-%d %H:%M')
    except ValueError:
        try:
            dt = datetime.strptime(ts, '%Y-%m-%d %-H:%M')
            return dt.strftime('%Y-%m-%d %H:%M')
        except ValueError:
            return ts

Bug 4: Dedup Key Must Include Amount

Same timestamp + different description is rare, but same timestamp + same description + different amount happens (e.g., two GoRide rides same day). Use timestamp|description|amount as unique key.

Bug 5: Dashboard Formulas (B3:C6) Must NOT Be Overwritten

User manages Dashboard formulas manually. Sync should ONLY update B7:C7 (Last Updated label + timestamp). NEVER write to B3:C6.

Correct Sync Logic

  1. Parse Transactions.md → list of transactions with unique_key = timestamp|desc|amount
  2. Read History sheet existing data (A2:C) → normalize timestamps → build existing_keys set
  3. Filter: new_transactions = md_transactions NOT in existing_keys
  4. Append only new rows to History!A:G
  5. Update Dashboard!B7:C7 with timestamp (nothing else)

Output Format

Upon successful sync:

✅ Zenith Finance synced to Google Sheets
📊 Spreadsheet: https://docs.google.com/spreadsheets/d/[ID]
📅 Last sync: [timestamp]
📝 Transactions added: [count]
💰 Accounts updated: 6
📋 Dashboard: B3-C7 updated with Income/Expense/Savings/timestamps

Example Usage

After recording a new transaction in Zenith Finance:

bash
# Manual sync
hermes-agent "sync zenith finance to google sheets"

# Or it can be triggered automatically after zenith-finance skill runs

Dependencies

  • google-workspace skill (authenticated)
  • Python packages: google-api-python-client, google-auth-httplib2, google-auth-oauthlib
  • Available in Hermes agent venv

Critical: Sync Script Bugs Fixed (2026-04-13)

The sync_wrapper.py at ~/.hermes/skills/finance/zenith-finance-sync/scripts/sync_wrapper.py had bugs that broke sync. Fixes applied:

Bug 1: Regex only captured 6 groups, Transactions.md has 7 fields

Format: [YYYY-MM-DD HH:MM] | Desc | Amount | Type | Category | Source | Balance

python
# ❌ Wrong (missing Income/Expense type)
re.match(r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\]\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+)', line)

# ✅ Correct (7 capture groups)
re.match(r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\]\s*\|\s*(.+?)\s*\|\s*\|(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+)', line)

Bug 2: Unpacking mismatch

python
# ❌ Wrong (6 values)
timestamp_str, description, amount_str, category, source, balance_str = match.groups()

# ✅ Correct (7 values — added tx_type)
timestamp_str, description, amount_str, tx_type, category, source, balance_str = match.groups()

Bug 3: google_api.py expects --values not --values-file

python
# ❌ Wrong
run_gapi("sheets", "append", spreadsheet_id, "History!A:F", "--values-file", temp_file)

# ✅ Correct — pass JSON string directly
values_json = json.dumps(body["values"])
run_gapi("sheets", "append", spreadsheet_id, "History!A:G", "--values", values_json)

Bug 4: Dashboard formulas referenced wrong column

python
# ❌ Wrong (Income/Expense is column D, not E)
['Total Income', '=SUMIF(History!E:E, "Income", History!C:C)']
['Total Expenses', '=SUMIF(History!E:E, "Expense", History!C:C)']
['Net Savings', '=B2-B3']

# ✅ Correct (column D = Income/Expense type, SUMIFS syntax)
['Total Income', '=SUMIFS(History!C:C, History!D:D, "Income")']
['Total Expenses', '=SUMIFS(History!C:C, History!D:D, "Expense")']
['Net Savings', '=B3-B4']

Full corrected sync_wrapper.py

Reference file: ~/.hermes/skills/finance/zenith-finance-sync/scripts/sync_wrapper.py

Notes

  • Sync is one-way: Obsidian → Google Sheets (not bidirectional)
  • Formulas in Dashboard sheet allow for Google Sheets native calculations
  • History sheet preserves full transaction audit trail
  • To reset sync: delete ~/.hermes/zenith_spreadsheet_id.txt and re-run
  • Clear ~/.hermes/zenith_sync_state.json after fixing script to force full re-sync

Troubleshooting & Verification

Based on common issues encountered during sync execution:

If hermes-agent command not found:

  1. Check installation: which hermes-agent or look in ~/.hermes/bin/
  2. Ensure Hermes is properly installed and in your PATH
  3. You can manually trigger sync by running the skill directly if needed

Verification steps after sync:

  1. Local data check: Confirm Transactions.md contains all expected transactions
  2. Google Sheet structure: Verify 3 sheets exist (Dashboard, History, Category)
  3. Dashboard formulas: Check exact cell positions match JSON specification:
    • C3: =SUMIFS(History!C:C, History!D:D, "Income")
    • C4: =SUMIFS(History!C:C, History!D:D, "Expense")
    • C5: =C3-C4
    • C6: =NOW()
    • C10: =SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Income") - SUMIFS(History!C:C, History!F:F, B10, History!D:D, "Expense")
  4. History sheet: New transactions should be appended to column A-G
  5. Category sheet: Should contain unique categories from Transactions.md

Expected impact verification: After adding a transaction (e.g., 50,000 Expense, Housing, BCA):

  • Total Expenses (C4) should increase by transaction amount
  • Net Savings (C5) should decrease by transaction amount
  • BCA Balance (C10) should decrease by transaction amount (if expense from BCA)

Common issues:

  • Authentication problems: Re-run google-workspace setup skill
  • Missing spreadsheet: Skill will create new one if ID file missing
  • Sheet structure issues: Skill will recreate missing sheets
  • Data parsing errors: Check Transactions.md format matches [YYYY-MM-DD HH:MM] | Description | RpAmount | Income/Expense | Category | Source | Balance

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Zenith Finance Gsheets Sync AI skill do?

Synchronize Zenith Finance ledger and transactions to Google Sheets with automatic updates. Creates/maintains a spreadsheet with Dashboard (summary, charts) and History (full transaction log) sheets.

Why use Zenith Finance Gsheets Sync on TypingMind?

Because you install it once and use it with any model. Zenith Finance Gsheets Sync is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Zenith Finance Gsheets Sync in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/adityahimaone/hermes-agent-rtk-caveman/tree/main/skills/finance/zenith-finance-gsheets-sync. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Zenith Finance Gsheets Sync?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Zenith Finance Gsheets Sync?

As many as you like. As long as a model supports skills, you can use Zenith Finance Gsheets Sync with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Zenith Finance Gsheets Sync AI skill free?

Yes. It is published on GitHub by adityahimaone under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇