Beancount Accounting
Skill2 starsChanged 10 months agoApache-2.0View on GitHub
This skill should be used when the user asks to "add a transaction", "create a beancount entry", "record an expense", "balance my accounts", "query my finances", "check account balances", "categorize spending", "write beancount", "edit .beancount files", "run a BQL query", "reconcile accounts", or mentions beancount, double-entry accounting, or ledger files. Provides comprehensive beancount syntax, directives, and query language expertise.
In this repository3 other files it gives its agents.
- bamlSkill
- edgartoolsSkill
- one-pagerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Every transaction must balance to zero.
- Distinctive: line 30
Use colon-separated hierarchical names starting with capital letters:
- Distinctive: line 205
Before editing, read the beancount file to understand:
- Distinctive: line 214
Use consistent payee/narration style
- Distinctive: line 215
Ensure transaction balances to zero
- Distinctive: line 216
Add to chronologically appropriate location or include file
- Very specific: line 220
Run bean-check to validate syntax:
- Very specific: line 254
Use include to split by month or category
- Distinctive: line 255
Keep account definitions in main file
- Distinctive: line 256
Add transactions to appropriate include files
- Distinctive: line 261
Use specific subcategories for visibility
- Distinctive: line 266
Add monthly balance assertions for bank accounts
- Very specific: line 272
Always run bean-check after edits
- Distinctive: line 273
Use balance assertions frequently
- Distinctive: line 274
Keep transactions in chronological order
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Beancount Accounting Skill
Beancount is a plain-text double-entry accounting system. This skill provides expertise for creating, editing, and querying beancount files.
Core Concepts
Double-Entry Accounting
Every transaction must balance to zero. Money flows between accounts:
- Debits increase Assets/Expenses, decrease Liabilities/Income/Equity
- Credits decrease Assets/Expenses, increase Liabilities/Income/Equity
Five Account Types
| Type | Purpose | Normal Balance |
Assets | What you own (bank accounts, investments) | Positive |
Liabilities | What you owe (credit cards, loans) | Negative |
Income | Money coming in (salary, interest) | Negative |
Expenses | Money going out (food, rent) | Positive |
Equity | Net worth, opening balances | Negative |
Account Naming
Use colon-separated hierarchical names starting with capital letters:
Type:Country:Institution:Account:SubAccountExamples:
Assets:Checking:Centennial:Joint
Liabilities:Card:Chase:Sapphire
Expenses:Food:Groceries
Income:Salary:EmployerTransaction Syntax
Basic Format
YYYY-MM-DD flag "Payee" "Narration"
Account1 Amount Currency
Account2 Amount Currency ; optional commentFlags
*- Cleared/completed transaction!- Pending/needs review
Examples
Simple expense:
2026-01-03 * "Starbucks" "Morning coffee"
Expenses:Food:Coffee 5.75 USD
Liabilities:Card:Chase:SapphirePaycheck with multiple postings:
2026-01-15 * "Employer" "Bi-weekly salary"
Assets:Checking:Main 3500.00 USD
Expenses:Taxes:Federal 800.00 USD
Expenses:Taxes:State 200.00 USD
Expenses:Insurance:Health 150.00 USD
Income:Salary -4650.00 USDTransfer between accounts:
2026-01-10 * "Transfer to savings"
Assets:Savings:Ally 500.00 USD
Assets:Checking:Main -500.00 USDAmount Interpolation
One posting amount can be omitted - beancount calculates it:
2026-01-03 * "Grocery Store" "Weekly groceries"
Expenses:Food:Groceries 125.43 USD
Assets:Checking:Main ; Amount calculated as -125.43 USDEssential Directives
open / close
Declare account lifecycle:
2026-01-01 open Assets:Checking:Main USD
2028-12-31 close Assets:Checking:Mainbalance
Assert account balance at start of day (catches errors):
2026-01-31 balance Assets:Checking:Main 4583.84 USDpad
Auto-generate balancing entry between two dates:
2026-01-01 pad Assets:Checking:Main Equity:Opening-Balances
2026-01-02 balance Assets:Checking:Main 4583.84 USDinclude
Split files for organization:
include "2026-01.beancount"
include "accounts.beancount"option
Configure beancount behavior:
option "title" "Personal Finances"
option "operating_currency" "USD"Metadata and Tags
Metadata
Attach key-value pairs to directives or postings:
2026-01-03 * "Amazon" "Office supplies"
order-id: "123-456-789"
Expenses:Office 45.00 USD
category: "equipment"
Liabilities:Card:ChaseTags and Links
Group related transactions:
2026-01-15 * "Hotel" "Conference lodging" #work-travel #conference-2026
Expenses:Travel:Lodging 299.00 USD
Liabilities:Card:Chase
2026-02-01 * "Expense Report" "Reimbursement" ^conference-2026
Assets:Checking:Main 299.00 USD
Income:ReimbursementsBQL Queries
Beancount Query Language (BQL) provides SQL-like queries. Run with bean-query:
bean-query finances/2026.beancount "SELECT account, sum(position) WHERE account ~ 'Expenses' GROUP BY 1"Common Queries
Account balance:
SELECT account, sum(position)
WHERE account ~ 'Assets:Checking'
GROUP BY 1Monthly expenses by category:
SELECT MONTH(date), account, sum(position)
WHERE account ~ 'Expenses' AND year = 2026
GROUP BY 1, 2
ORDER BY 1, 2Transactions for an account:
SELECT date, narration, payee, position, balance
WHERE account = 'Assets:Checking:Centennial:Joint'
ORDER BY dateKey BQL Functions
| Function | Purpose |
SUM(position) | Aggregate amounts |
YEAR(date), MONTH(date) | Extract date parts |
COST(position) | Get cost basis |
account ~ 'pattern' | Regex match account |
Working with Beancount Files
Reading Files
Before editing, read the beancount file to understand:
- Existing account structure
- Naming conventions used
- Transaction patterns
- Include file organization
Adding Transactions
- Match existing account names exactly
- Use consistent payee/narration style
- Ensure transaction balances to zero
- Add to chronologically appropriate location or include file
Validation
Run bean-check to validate syntax:
bean-check finances/2026.beancountCommon Patterns
Credit card payment:
2026-01-25 * "Chase" "Credit card payment"
Liabilities:Card:Chase:Sapphire 500.00 USD
Assets:Checking:Main -500.00 USDInvestment purchase with cost basis:
2026-01-20 * "Fidelity" "Buy index fund"
Assets:Investments:Fidelity:FXAIX 10 FXAIX {150.00 USD}
Assets:Investments:Fidelity:Cash -1500.00 USDMortgage payment breakdown:
2026-01-01 * "Rocket Mortgage" "Monthly mortgage"
Liabilities:Loan:RocketMortgage 800.00 USD ; Principal
Expenses:Housing:Interest 900.00 USD ; Interest
Expenses:Housing:Escrow 300.00 USD ; Escrow
Assets:Checking:Main -2000.00 USDBest Practices
File Organization
- Use
includeto split by month or category - Keep account definitions in main file
- Add transactions to appropriate include files
Account Hierarchy
- Be consistent with naming depth
- Use specific subcategories for visibility
- Group related accounts logically
Balance Assertions
- Add monthly balance assertions for bank accounts
- Reconcile against actual statements
- Catches data entry errors early
Error Prevention
- Always run
bean-checkafter edits - Use balance assertions frequently
- Keep transactions in chronological order
Additional Resources
Reference Files
For detailed syntax and patterns, consult:
references/syntax.md- Complete directive reference with all optionsreferences/bql.md- Full BQL query language documentationreferences/examples.md- Common transaction patterns and workflows
Command Line Tools
| Command | Purpose |
bean-check file.beancount | Validate syntax |
bean-query file.beancount "QUERY" | Run BQL query |
bean-report file.beancount balances | Balance report |
bean-web file.beancount | Web interface |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

