$npx -y skills add adityahimaone/hermes-agent-rtk-caveman --skill zenith-finance-maintenanceMaintain Zenith Finance local files (Ledger.md and Transactions.md) in an easy-to-maintain format. Provides simple key-value format for ledger, standard transaction format, helper scripts, and procedures for fixing common formatting issues while maintaining compatibility with Goo
| 1 | # Zenith Finance Local File Maintenance |
| 2 | |
| 3 | This skill provides methods to maintain Zenith Finance's local files (Ledger.md and Transactions.md) |
| 4 | in formats that are easy to maintain, parse, and update programmatically while remaining |
| 5 | human-readable and compatible with the zenith-finance-sync skill for Google Sheets synchronization. |
| 6 | |
| 7 | ## Problem |
| 8 | |
| 9 | The default Zenith Finance Ledger.md format uses complex markdown that can break when edited: |
| 10 | ``` |
| 11 | - **BCA (Main Bank)**: Rp28.632.790,57 |
| 12 | ``` |
| 13 | |
| 14 | This format is prone to errors when: |
| 15 | - Manually editing the file |
| 16 | - Using search/replace operations |
| 17 | - Programmatic updates with regex |
| 18 | - Accidental removal of markdown formatting |
| 19 | |
| 20 | ## Solution: Easy Maintenance Format |
| 21 | |
| 22 | ### Ledger.md Format |
| 23 | Convert to simple key-value pairs: |
| 24 | ``` |
| 25 | ## Liquid Assets |
| 26 | BCA: 28632790 |
| 27 | Blu: 175501 |
| 28 | Gopay: 6670 |
| 29 | Dompet: 452000 |
| 30 | |
| 31 | ## Investments |
| 32 | RDN: 7231400 |
| 33 | Emas: 11936534 |
| 34 | ``` |
| 35 | |
| 36 | Benefits: |
| 37 | - Easy to read and edit |
| 38 | - Simple to parse with regex or split |
| 39 | - Hard to break accidentally |
| 40 | - Compatible with helper scripts |
| 41 | - Still human-readable |
| 42 | |
| 43 | ### Transactions.md Format |
| 44 | Keep the existing pipe-delimited format (already optimal): |
| 45 | ``` |
| 46 | [YYYY-MM-DD HH:MM] | Description - RpAmount | Category | Source | RpBalance |
| 47 | ``` |
| 48 | |
| 49 | Example: |
| 50 | ``` |
| 51 | [2026-04-11 09:51] | Gojek - Rp20,490.00 | Food | BCA (Main Bank) | Rp28,643,790.57 |
| 52 | ``` |
| 53 | |
| 54 | Benefits: |
| 55 | - Each transaction on its own line (easy to append/modify/remove) |
| 56 | - Consistent format for parsing |
| 57 | - Already compatible with zenith-finance-sync |
| 58 | - Human-readable |
| 59 | |
| 60 | ## Helper Script: update_ledger.py |
| 61 | |
| 62 | A Python script for easy ledger updates: |
| 63 | |
| 64 | ```python |
| 65 | #!/usr/bin/env python3 |
| 66 | """ |
| 67 | Helper script to update Ledger.md values easily. |
| 68 | Usage: python3 update_ledger.py --bca 28632790 --blu 175501 --gopay 6670 --dompet 452000 --rdn 7231400 --emas 11936534 |
| 69 | """ |
| 70 | |
| 71 | import argparse |
| 72 | import os |
| 73 | import re |
| 74 | |
| 75 | def update_ledger(bca=None, blu=None, gopay=None, dompet=None, rdn=None, emas=None): |
| 76 | ledger_path = os.path.join(os.path.dirname(__file__), "Ledger.md") |
| 77 | |
| 78 | # Read current content |
| 79 | with open(ledger_path, 'r') as f: |
| 80 | content = f.read() |
| 81 | |
| 82 | # Update values if provided |
| 83 | if bca is not None: |
| 84 | content = re.sub(r'(BCA: )\d+', f'\\1{bca}', content) |
| 85 | if blu is not None: |
| 86 | content = re.sub(r'(Blu: )\d+', f'\\1{blu}', content) |
| 87 | if gopay is not None: |
| 88 | content = re.sub(r'(Gopay: )\d+', f'\\1{gopay}', content) |
| 89 | if dompet is not None: |
| 90 | content = re.sub(r'(Dompet: )\d+', f'\\1{dompet}', content) |
| 91 | if rdn is not None: |
| 92 | content = re.sub(r'(RDN: )\d+', f'\\1{rdn}', content) |
| 93 | if emas is not None: |
| 94 | content = re.sub(r'(Emas: )\d+', f'\\1{emas}', content) |
| 95 | |
| 96 | # Write back |
| 97 | with open(ledger_path, 'w') as f: |
| 98 | f.write(content) |
| 99 | |
| 100 | print("Ledger.md updated successfully!") |
| 101 | |
| 102 | if __name__ == "__main__": |
| 103 | parser = argparse.ArgumentParser(description='Update Ledger.md values') |
| 104 | parser.add_argument('--bca', type=int, help='BCA balance') |
| 105 | parser.add_argument('--blu', type=int, help='Blu balance') |
| 106 | parser.add_argument('--gopay', type=int, help='Gopay balance') |
| 107 | parser.add_argument('--dompet', type=int, help='Dompet balance') |
| 108 | parser.add_argument('--rdn', type=int, help='RDN balance') |
| 109 | parser.add_argument('--emas', type=int, help='Emas value') |
| 110 | |
| 111 | args = parser.parse_args() |
| 112 | update_ledger( |
| 113 | bca=args.bca, |
| 114 | blu=args.blu, |
| 115 | gopay=args.gopay, |
| 116 | dompet=args.dompet, |
| 117 | rdn=args.rdn, |
| 118 | emas=args.emas |
| 119 | ) |
| 120 | ``` |
| 121 | |
| 122 | Place this script in: `~/Documents/Obsidian/Notes/Finance/update_ledger.py` |
| 123 | Make it executable: `chmod +x update_ledger.py` |
| 124 | |
| 125 | ## Common Maintenance Tasks |
| 126 | |
| 127 | ### 1. Updating a Balance |
| 128 | ```bash |
| 129 | # Update BCA balance |
| 130 | python3 ~/Documents/Obsidian/Notes/Finance/update_ledger.py --bca 28632790 |
| 131 | |
| 132 | # Update multiple balances |
| 133 | python3 ~/Documents/Obsidian/Notes/Finance/update_ledger.py --bca 28632790 --blu 175501 |
| 134 | ``` |
| 135 | |
| 136 | ### 2. Adding a Transaction |
| 137 | Append to Transactions.md in the standard format: |
| 138 | ``` |
| 139 | [YYYY-MM-DD HH:MM] | Merchant - RpAmount | Category | Source | RpRunningBalance |
| 140 | ``` |
| 141 | |
| 142 | Example: |
| 143 | ``` |
| 144 | [2026-04-11 10:15] | Kopi Soklin - Rp15,000.00 | Food | BCA (Main Bank) | Rp28,617,790.57 |
| 145 | ``` |
| 146 | |
| 147 | ### 3. Fixing Concatenated Transactions |
| 148 | If transactions get concatenated (missing newline between them): |
| 149 | ``` |
| 150 | ... | Rp28,632,790.57[2026-04-11 10:12] | Goride ... |
| 151 | ``` |
| 152 | |
| 153 | Use this Python snippet to fix: |
| 154 | ```python |
| 155 | import re |
| 156 | |
| 157 | def fix_concatenated_transactions(content): |
| 158 | # Pattern: balance ending with .57 or .00 followed immediately b |