Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bookkeeping-automation

БесплатноБез исполняемых скриптовНе проверен

Automate bookkeeping workflows by parsing bank statements (CSV/OFX/QIF), categorizing transactions using rules or an LLM, reconciling accounts, generating…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Bookkeeping Automation

Overview

Automate the repetitive parts of bookkeeping: import bank statements (CSV, OFX/QFX, QIF), categorize transactions with ordered keyword rules and an optional LLM for the leftovers, remove repeated rows safely, reconcile against the statement balance, and print an expense report. Money is always Decimal, never float. The code below was run on sample CSV, OFX (SGML, version 1.02) and QIF files with Python 3.12 and ofxtools 1.1.1. The output is a draft for a human to review before anything is posted to Xero, QuickBooks or a ledger; it is not tax or accounting advice.

Instructions

  1. Save the two modules below as parser.py and pipeline.py in a scratch folder and install the one dependency: pip install ofxtools (inside a virtual environment). The imports below assume those file names (the stdlib parser module was removed in Python 3.10, so there is no clash).
  2. Look at the header row of the CSV export and pass its real column names, date format and (if the bank uses separate debit and credit columns) debit_col/credit_col. Banks differ and change their exports, so never assume a layout; check one row by eye.
  3. Run categorize_by_rules first (free and deterministic). Rules are ordered and the first match wins, so list specific phrases above general ones. Rules only match whole words and respect direction (money in vs out).
  4. Send only the remaining "Uncategorized" rows to a model with categorize_with_llm. It takes any ask(prompt) -> str function, so it works with any provider; read the model name from an environment variable instead of hard-coding one, because model names are retired regularly (OpenAI, for instance, lists gpt-4o-mini for shutdown on 14 January 2027). Sending descriptions to a third-party API is a privacy decision: strip account numbers and names first, or use a local model.
  5. Deduplicate with drop_repeated_ids (same bank id, date and amount twice, typical of overlapping exports). Use possible_duplicates only to produce a list for a person to review: identical rows without bank ids can be genuine (two coffees on one day).
  6. Reconcile with reconcile: opening balance plus the transactions in the statement period must equal the closing balance exactly. Take the balances from the statement, never from the transaction file itself.
  7. Print expense_report, export the categorized rows for review, and only then import into the accounting system.

parser.py

# parser.py - bank statement parsers (CSV, OFX/QFX via ofxtools, QIF)
import csv
from dataclasses import dataclass
from datetime import datetime
from decimal import Decimal


@dataclass
class Transaction:
    date: datetime
    description: str
    amount: Decimal              # negative = money out, positive = money in
    raw_id: str = ""             # bank's transaction id (OFX FITID), used for dedup
    category: str = "Uncategorized"


def money(text: str) -> Decimal:
    """'1,234.50', '$12.00', '(45.10)' and '-45.10' all become Decimal."""
    t = text.replace(",", "").replace("$", "").strip()
    if t.startswith("(") and t.endswith(")"):
        t = "-" + t[1:-1]
    return Decimal(t or "0")


def parse_csv(path, date_col="Date", desc_col="Description", amount_col="Amount",
              date_fmt="%m/%d/%Y", debit_col=None, credit_col=None, id_col=None):
    """Column names and date formats differ per bank: pass what the header row says.
    Banks that export separate debit and credit columns: set debit_col and credit_col."""
    rows = []
    with open(path, newline="", encoding="utf-8-sig") as f:
        for row in csv.DictReader(f):
            if debit_col:
                amount = money(row[credit_col]) - money(row[debit_col])
            else:
                amount = money(row[amount_col])
            rows.append(Transaction(datetime.strptime(row[date_col].strip(), date_fmt),
                                    row[desc_col].strip(), amount,
                                    row.get(id_col, "") if id_col else ""))
    return rows


def parse_ofx(path):
    """OFX 1.x (SGML) and 2.x (XML), .ofx and .qfx. Hand-written regexes break on
    SGML files, whose leaf tags have no closing tag, so use ofxtools."""
    from ofxtools.Parser import OFXTree
    tree = OFXTree()
    tree.parse(path)
    out = []
    for stmt in tree.convert().statements:
        for t in stmt.transactions:
            out.append(Transaction(t.dtposted.replace(tzinfo=None),
                                   t.memo or t.name or "", Decimal(t.trnamt), t.fitid or ""))
    return out


def parse_qif(path):
    """QIF has no standard date format: try the common ones, fail loudly otherwise."""
    out, cur = [], {}
    with open(path, encoding="utf-8-sig") as f:
        for line in f:
            line = line.strip()
            if line == "^":
                if "D" in cur and "T" in cur:
                    out.append(Transaction(_qif_date(cur["D"]), cur.get("P", ""),
Полный SKILL.md на GitHub

Установить bookkeeping-automation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл bookkeeping-automation?

Automate bookkeeping workflows by parsing bank statements (CSV/OFX/QIF), categorizing transactions using rules or an LLM, reconciling accounts, generating expense reports, and detecting duplicates. Use when: automating transaction categorization, building reconciliation pipelines, processing bank exports, or generating expense summaries without manual data entry.

Как установить скилл bookkeeping-automation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bookkeeping-automation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить bookkeeping-automation с