本文へ移動
cccskills
無料GitHub で公開

beancount-close

Close an accounting period in a local Beancount ledger by reconciling each active account through beancount-reconcile, checking assertions and recurring gaps, reviewing flags, then proposing a commit with the period reports. Use for month-end close or wrapping up the books. Surface incomplete work and require a passing check before a confirmed commit; never push. Skip closing a single account (a `close` directive; beancount-add) and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-ioスター 315(GitHub 315 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(15)

  • SKILL.md10.6 KB
  • evals/evals.json18.8 KB
  • evals/files/eval1_ledger.beancount1.6 KB
  • evals/files/eval1_statement.csv248 B
  • evals/files/eval12_ledger.beancount3.1 KB
  • evals/files/eval13_ledger.beancount434 B
  • evals/files/eval14_ledger.beancount488 B
  • evals/files/eval5_ledger.beancount446 B
  • evals/files/eval7_ledger.beancount725 B
  • evals/files/eval8_ledger.beancount994 B
  • evals/files/eval8_savings.csv56 B
  • evals/files/eval8_statement.csv54 B
  • evals/files/eval9_ledger.beancount587 B
  • evals/files/eval9_statement.csv54 B
  • references/close-checklist.md6.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

beancount-close

Close one month with a fixed, honest checklist — every account either ties out or is explicitly reported as unverified, and the close lands as a git commit whose message is the audit record.

This skill exists because trustworthy books come from ritual, not heroics: the same checks, every month, with nothing silently skipped. Each phase reports its status before the next begins; the final commit encodes the close report so git log reads as a close history.

Prefer bea

Read beancount-init's references/bea-cli.md (from this skill's folder, ../beancount-init/references/bea-cli.md; a copy at references/bea-cli.md when this skill was installed alone) before running ledger commands: it defines explicit root/destination paths, JSON batches, checks, and safe retries. Without bea, use beancount-init's references/compatibility.md. This skill writes nothing itself: reconciliation writes go through beancount-reconcile, and its own output is the report and one commit.

Scope

Does: one period (default: the last complete calendar month) across all active accounts; reconciles each account through beancount-reconcile and its confirm gate; produces a close report; makes one confirmed git commit.

Does not: create entries to fill a gap, edit existing entries, force a tie-out, or push. Every unverified account, unpinned assertion, recurring gap, and carried flag appears in the report with its count.

Read references/close-checklist.md before running — it defines each phase's procedure and reportable status.

Workflow

Seven phases: Scope → Reconcile → Assert → Recurring → Flags → Report → Commit. Announce the phase status line as each completes (e.g. Reconcile: 2 tied, 1 unverified (no statement)).

1. Scope

Local ledger files only. For a ledger hosted on Beancount.io, stop this skill and offer a separately requested hosted workflow or local clone (beancount-init's references/bea-cli.md, Hosted ledgers).

Resolve the period (the user's words or the last complete month) and state it. Find the root ledger with the suite's discovery convention. Enumerate active accounts: any Assets/Liabilities account with postings in the period or a nonzero balance at period end (bounded by date < <period-end+1>, so later entries don't count). Run bea --file "$ledger" --json --no-input check first: a ledger that starts red is fixed (surface the errors) before a close can mean anything.

2. Reconcile

For each active account, ask for the period statement (CSV or pasted text). Per account with a statement, run the beancount-reconcile flow (its own confirm gate applies). Record the account's evidence — the statement file or files, the statement period, the coverage counts from reconcile's Coverage phase (source / included / excluded rows), and the residual — and exactly one state:

  • tied — a passing assertion over the whole close period.
  • partial — reconcile withheld the assertion over unresolved suspects or mismatches (a reported finding with its residual, not a failure to retry).
  • partly covered — the statement period does not span the close period, even if it ties over its own span.
  • unverified — no statement.
  • blocked — the step could not run, with the reason (for example, reconcile is not installed, or the user stopped).

If beancount-reconcile is not installed beside this skill (a registry can install one skill alone), say so and point the user to https://github.com/bex-co/beancount-io/blob/main/docs/skills/installation.md to add it. Without it, every account is blocked with that reason — never quietly downgraded to unverified.

An owner or a due date may be attached to a step or an account only when the user supplies them; when they do not, those fields do not appear anywhere in the report.

3. Assert

Every tied account now has a period-end balance assertion (reconcile appends them). Check that each active account has an assertion dated on or after period end; accounts without one are unpinned in the report. An assertion that pins only part of the close period (a partly covered account) does not pin the close — the account stays partly covered, not tied.

4. Recurring completeness

Find expected-but-missing entries: merchants (payee, or narration when the payee is empty) present in each of the prior 2–3 months with a steady amount but absent this period (query per close-checklist.md). Each gap is a finding for the user ("NETFLIX appeared Apr+May, absent in June — charge missing, subscription cancelled, or card changed?"). This skill never creates an entry on the strength of the pattern alone. When the user confirms the charge really happened, offer the routes: importing the missing export (beancount-import), or recording the single entry now — and only on their choice of the latter, compose beancount-add's flow inside this session:

  • Read the most recent prior occurrence and prefill beancount-add's full proposal from it: same payee/narration, same source and counter accounts, the steady (most recent) amount, and the date — the occurrence's day-of-month in the close period, clamped to the month's length — each field shown so the user can correct it. Run add's checks too (duplicate ±3 days; a hit is shown and the user decides).
  • The write needs its own explicit yes to that proposal, separate from the close-commit yes. On yes, write through the shared transaction recipe and re-run the root check; then refresh the report's figures (the entry lands in the period) and mark the gap recorded at your confirmation in the report instead of open. On no — or when the user would rather import — nothing is written and the gap stays an open finding.
  • This composition needs beancount-add installed beside this skill; without it, say so (installation guide pointer, as for beancount-reconcile) and keep the gap a finding that names the import/manual route.

5. Flags

List every !-flagged entry dated in or before the period. Each is either resolved by the user now (their edit) or carried forward, and counted in the report either way.

6. Report

Generate the period's numbers with the close-income-statement and close-balance-sheet recipes in references/close-checklist.md, both at book value (-x at_cost) — the valuation the checklist's period-end balances use — so a cost-basis lot counts at cost and an unpriced commodity (an @-priced foreign charge, an option lot) appears in its own units. State that valuation in the report. Expense totals in the operating currency come from beancount-ask's weight recipes (top-expenses counts 300 EUR @ 1.10 USD as the 330 USD paid); without beancount-ask installed, report the two statements only. A report that exits 1 with result.missing_prices is a valuation gap (beancount-init's references/bea-cli.md, Read and check): list the missing prices in the close report. When the ledger holds investments, the period's realized gains per closed lot come from beancount-trade's references/realized-gains.md (from this skill's folder, ../beancount-trade/references/realized-gains.md), tied to the booked gain postings. Period commentary — why a category changed versus the prior period — uses beancount-ask's variance recipe (references/bql-recipes.md section 9 in beancount-ask, from this skill's folder ../beancount-ask/references/bql-recipes.md) under the user's stated threshold policy: the same figures ask would give for the same fixture and period, each driver citing its postings, anything unsupported labelled unresolved. Close never restates a delta without that recipe behind it.

Compute deltas, percentages and bridge components with BQL or a local decimal calculation. In the commentary, copy the executed input queries and calculation BQL or complete local calculation command, including its print/output statements and bound values, then show its actual output. Use the actual period dates in those queries rather than unbound placeholders. Each command must run as printed and reproduce the displayed figures; do not abbreviate the computation into a prose formula or a note that Python was used.

Assemble the close report:

Close: 2026-06 (2026-06-01 … 2026-06-30) — 1 tied, 1 not tied
Accounts:
  Assets:Bank:Checking — tied (june-checking.csv, 2026-06-01…06-30; coverage 42 source / 42 included / 0 excluded; residual 0.00; ties to 7,874.60)
  Liabilities:CreditCard:Amex — unverified (no statement)
Assertions: 1 pinned, 1 unpinned
Recurring gaps: NETFLIX (present Apr, May — absent Jun)   Flags carried: 1 (2026-06-21 ! WHOLE FOODS)
Income: 3,000.00        Expenses: 203.60        Net: +2,796.40
check (ledger validity): PASS — the ledger is valid; that alone does not verify this close

The headline counts tied accounts only as reconciled and names the not-tied count; the account lines list every account that is not tied with its state. Never call the close "verified", "complete", or "clean" — in the headline, the report, or the commit message — unless every active account is tied over the whole period. A green check line is ledger validity only.

7. Commit

Re-run bea --file "$ledger" --json --no-input check after all reconciliation writes. A red check blocks the commit proposal. When it passes, show what will be staged (the ledger files the close touched) and the commit message — subject close: <period> — <n> tied, <m> not tied (n counts tied accounts only), body = the close report — and commit only on an explicit yes. On no, leave the working tree exactly as it is; the report stays in the conversation. Pushing stays with the user.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Prepare supported accrual and reversal drafts for a period from an explicitly stated schedule — basis, service interval, day-count, recognized-to-date, already-booked, required adjustment — posted only through the suite's propose/confirm/check flow with stable schedule identity. Skip recording one-off entries the user describes (beancount-add), explaining how a balance moved (beancount-roll-forward), tax or depreciation advice, automatic reversals, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Record one-off entries the user describes in a local Beancount ledger through bea — a purchase, bill, paycheck, or transfer between their own accounts (including splits and pasted receipt text), opening or closing an account, a price, or a note. Propose the exact entries from existing accounts, check whether one is already recorded, and write only after confirmation with a passing check; it never changes existing entries. Skip bank or card export files (beancount-import), statements (beancount-reconcile), finance-app migrations, options trades (beancount-options), investment trades, dividends, splits, and vests (beancount-trade), month-end close, edits to existing entries, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Answer explicit requests for facts from a local Beancount ledger using shown, reproducible bea queries and reports for spending, trends, net worth, holdings, subscriptions and anomalies. Do not select this skill merely to gather preliminary inputs for buy/sell decisions or tax recommendations, even if ledger facts could help. Strictly read-only; figures come from executed queries. Skip ledgers hosted on Beancount.io, recording transactions (beancount-add), reconciliation, migration, ledger edits, option pricing or greeks, investment or tax advice, and general Beancount, BQL, or `bea` documentation questions (including what `bea ask` does).

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Record bank/card transactions in an existing local Beancount ledger from CSV, OFX/QFX, QIF or PDF statements, including PDF-only banks with no CSV export. For a PDF ledger import, read this SKILL.md before the PDF helper's guide to establish account, deduplication and confirmation rules, then use the helper for extraction. Import broker activity CSVs or holdings/cost-basis exports as lot-carrying entries or opening lots. Read this guide before beancount-trade for these files; skip described trades (beancount-trade). Normalize signs, suggest categories from existing accounts, review duplicates and confirm before bea writes; PDF statements must tie out and end with a balance assertion. Skip standalone PDF extraction/OCR, summarization or editing without a ledger import; account-versus-statement comparisons (beancount-reconcile), full finance-app migrations, reusable importer authoring, individual options trades, single manual entries (beancount-add), ledger `option` settings, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Write or repair a reusable Beangulp importer from a sample bank export for a local ledger, with reviewed golden files and a passing test harness. Use when a source needs a tested Python importer or its format changed, e.g. "write a beangulp importer for my bank's CSV" or "my importer broke after the bank renamed its columns". Wire the confirmed runner through bea ingest; keep generate/test in the authoring project. Skip one-off imports, reconciliation, finance-app migration, ledger writes, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Scaffold a new local Beancount ledger with bea init and validation, with optional Fava browser setup when requested. Use for setting up a new ledger or initializing a bookkeeping repository. Skip importing history (beancount-migrate), bank exports, edits to a populated ledger, or ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

bex-co のスキルをすべて見る

このスキルの問題を報告する