Scaffolds a new Beancount ledger with bea init and validation, or prepares an existing ledger for agent access. Useful for starting bookkeeping repos or onboarding existing Beancount books.
Ships in beancount-io. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Part of the Beancount.io ledger skill suite.
Scaffold a fresh ledger in the current working directory with one bea
installation for create and validate, or set up a ledger the user already
keeps so a coding agent can work on it (the existing-ledger branch).
Run the steps in order. Stop if a preflight check fails — partial scaffolding is worse than no scaffolding.
beaRead references/bea-cli.md for the shared command contract. Create and
validate the ledger through bea init and bea check. If bea is absent,
use the explicit template and developer path in references/compatibility.md.
Fava is a separate, optional browser runtime; run Step 4 only when requested.
Local ledger files only. For a ledger hosted on Beancount.io, stop this skill and offer a separately requested hosted workflow or local clone (references/bea-cli.md, Hosted ledgers).
Run pwd && ls -A to see the working directory.
Existing ledger. When the user says they already keep Beancount books
(set the agent up for them, use my existing ledger, bring my books), or the
folder already holds .bean/.beancount files and the user did not ask for a
new ledger beside them, follow Existing ledger instead of
the steps below. It never creates a ledger and never changes a ledger file.
Hard-refuse if any of these already exist: main.bean, pyproject.toml,
Makefile. Print which ones are present and stop. Do not overwrite. When the
present file is a ledger, offer the existing-ledger branch instead.
If the directory contains other files but none of those markers, warn once and ask for confirmation before continuing.
Check bea as references/bea-cli.md describes (installed, and at the
suite's minimum version) and remember BEA (yes/no). Ask for the operating
currency (default USD) and an optional checking opening balance; call the
answers CURRENCY and OPENING (empty when none). Also ask which of these the
household has — brokerage or retirement investment accounts, crypto
wallets/exchanges, a property (and mortgage) — and the name to use for each;
call the answers HOUSEHOLD (empty when none). They only shape Step 3b's
proposed opens; nothing is opened on the strength of this answer alone. Detect FAVA: yes when the
user asked for Fava / make start / "bootstrap fava", otherwise ask once
(default no when BEA is yes; default yes only when BEA is no and they
still want a browser — otherwise they can install bea later).
When FAVA is yes, verify uv is on PATH (command -v uv; PowerShell Get-Command uv). If missing, stop and tell
them to install it with their package manager (brew install uv on macOS),
or follow the official uv installation guide.
Use the historical start date supplied by the user or beancount-migrate when
present. It must be on/before the earliest entry, including any opening-balance
transaction. Otherwise run date +%Y-%m-%d and use today. Call it OPEN_DATE.
Settle the date before writing: the opens are written once, not rewritten
later for older history.
main.beanWhen BEA is yes, set directory to the current directory, currency to
CURRENCY, and open_date to OPEN_DATE:
bea --json --no-input init "$directory" --currency "$currency" --date "$open_date"
Add --opening-balance "Assets:Checking OPENING" to that command only when
OPENING is non-empty. Check bea init --help before using setup-catalog
options: published bea 0.3.1 has neither --preset nor --title. When
--preset is listed and the user names a purpose the setup catalog covers
(freelance work, a business, investments, a rental, shared expenses, a
community organization), add --preset <id> with the matching preset
(freelance@1, business@1, portfolio@1, rental@1,
shared-expenses@1, community@1; personal@1 is the household default and
blank@1 an empty chart). Add --title only when help lists it and a preset
is selected; select personal@1 when only a household ledger name was given.
When help also lists --module and a household ledger also holds
investments, a rental property, or side income, keep --preset personal@1
and add --module investments@1, --module rental-property@1 (with
--property-name <Name>, an ASCII account part such as OakSt, for the
property the user named), or --module side-business@1 for each one named;
those accounts then exist and Step 3b proposes only what the modules do not
open. Modules belong to a household's own books: a company, a club, or money
shared with other people gets its own ledger and preset, never a module.
Opening balances then name that preset's asset/liability accounts instead of
Assets:Checking. Without those options, use the base recipe and explain
that this CLI creates the standard chart; Step 3b can add the user's approved
investment/property accounts. Then bind ledger to the new root's absolute path and
run the check recipe in references/bea-cli.md.
bea init . writes ./main.bean, so on this path the file is exactly what
bea init produced and no template is written by hand. Continue to Step 3b
when HOUSEHOLD is non-empty, then Step 4 when FAVA is yes; otherwise Step 5.
When BEA is no, use the fourteen-account template in
references/compatibility.md, with the same currency, open date and optional
opening balance. Validate through the explicit developer path there; report
an unvalidated result if no checker is available.
The starter accounts cover everyday money only, so an investor's first trade
would stall on missing accounts. Propose the opens for exactly what the user
named in Step 1 — show every open line, get one yes for the set, then
write them dated OPEN_DATE (the open recipe, with --currency repeated
per allowed commodity and, for investment accounts, --booking as chosen
below; on the no-bea path append the same lines to the template in its
style). Suggested shape, names from the user:
Assets:<Name> with the operating
currency plus the symbols they actually hold, and — once, shared by all —
Income:Dividends and Income:CapitalGains (operating currency) so a
first dividend or sale has somewhere to land.Assets:Crypto:<Name> with its coins (plus
the operating currency on an exchange that holds cash).Assets:Property:<Name> with its one property commodity,
Assets:Escrow:<Name>, Liabilities:Mortgage:<Name> when there is a
loan, Income:Rent:<Name> for a rental (the model beancount-property
uses; it can also propose these at purchase time).For every investment account, explain the booking method before writing
it — it decides which lot an unnamed sell reduces, and changing it later
rewrites gain history, so this is the cheap moment to choose. In plain
terms: STRICT (the default when none is written) makes every sell name
its exact lot, or the write is refused as ambiguous; STRICT_WITH_SIZE
also matches a sell that exactly empties one lot; FIFO sells the oldest
lot first, LIFO the newest, HIFO the highest-cost; NONE books no
gain at all. Average cost is not supported by the engine — if the user
asks for it (some tax regimes require it), say so plainly and let them pick
another method now rather than discover it at their first sell. Write only
the method they choose (STRICT may be left unwritten, as the default).
After the opens, run the check recipe again. Balances and holdings themselves are not seeded here: existing positions come in through beancount-import's opening-lots path, and new trades through beancount-trade.
Skip this entire step when FAVA is no.
python3 -c "import random; bad={50000,55555,60000,65000}; ps=[p for p in range(49152,65536) if p not in bad and p%1000]; print(random.choice(ps))"
Call the integer PORT. If python3 is missing:
awk 'BEGIN{srand(); print 49152 + int(rand()*16384)}'. On native Windows
(PowerShell has neither), use python or Get-Random -Minimum 49152 -Maximum 65536,
re-rolling a port in the excluded set.
uv init --bare
uv add fava
--bare skips hello-world boilerplate. uv add fava pulls Fava's own runtime
deps (including Beancount for the browser) into .venv/ — that is Fava's
environment, not a second customer CLI; bea operations need nothing more in it.
Tab-indent the recipe line. Substitute {{PORT}}:
.PHONY: start
PORT ?= {{PORT}}
start:
uv run fava main.bean -p $(PORT)
.gitignoreOverwrite whatever uv init --bare wrote with a .gitignore covering .venv/,
.fava/, Python build and cache artifacts, and common OS/editor files
(.DS_Store, .idea/, .vscode/).
Write AGENTS.md from references/agents-template.md, substituting the
currency and the account names read back from main.bean, plus the one-line
CLAUDE.md (@AGENTS.md) — each only when that file does not already exist.
Never overwrite an existing AGENTS.md or CLAUDE.md; if AGENTS.md
pre-existed, leave it and offer the bridge instead of writing unasked. The
template reference holds the exact text and rules.
git init (only if needed)If .git/ does not already exist, run git init. Don't stage anything.
Print:
main.bean, AGENTS.md, CLAUDE.md when written; plus
Makefile, .gitignore, pyproject.toml, uv.lock, .venv/ when FAVA
ran).bea check passed.make start (without make, e.g. native Windows, run uv run fava main.bean -p <PORT>) → http://localhost:<PORT>.Keep the report tight — one short line per item.
For books the user already keeps. Read-only on the ledger: only AGENTS.md
and CLAUDE.md may be created, only when absent, and only by bea. They are
its output: never edit them afterwards. If bea fails at any step, follow
references/bea-cli.md (When the installed bea fails) and stop.
bea init --existing finds it in a folder
(main.bean, main.beancount, or the one file nothing else there
includes) and refuses, naming the candidates, when there are several; then
ask the user which is the root. Never pick one yourself.bea as references/bea-cli.md describes, then
check that bea init --help lists --existing. Published bea 0.3.1
does not: say the existing-ledger setup needs a newer bea, offer
bea upgrade, run the check recipe on the root so the user sees the
ledger's state, and stop. Do not write AGENTS.md by hand; its facts come
from loading the ledger.ledger
(the recipe below). It changes no ledger file. It writes AGENTS.md and
the @AGENTS.md CLAUDE.md only when each is absent (data.agent_files
says created, kept or skipped) and exits 0 even when the ledger has
errors.data.attention item as its location,
message and next. Do not act on those next steps; removing a plugin or
an option is the user's decision. When an item is plugin-beside-ledger,
run later bea commands from the ledger's folder with PYTHONPATH=., as
the written AGENTS.md says.git rev-parse --is-inside-work-tree). Never run git init in it and never stage.bea --json --no-input init --existing "$ledger"
Next steps: ask a question about the ledger (beancount-ask), record an entry (beancount-add), or import a bank export (beancount-import).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/beancount-accrualsPrepare 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./beancount-addRecord 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./beancount-askAnswer 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)./beancount-io:beancount-initfrom beancount-io
npx claudepluginhub bex-co/beancount-io --plugin beancount-ioOther plugins' skills for the same job