beanquery
Skill1 starsChanged 4 months agoApache-2.0View on GitHub
Query existing Beancount ledgers with bean-query and Beancount Query Language (BQL). Use when an agent needs quick read-only ledger lookups, balances, journals, transaction searches, or CSV results.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-aeoSkill
- agent-memorySkill
- ci-repairbaySkill
- delegated-developmentSkill
- ghSkill
- issue-blueprintSkill
- issue-workbenchSkill
- minifluxSkill
- og-imageSkill
- opSkill
- pencil-to-figma-migrationSkill
- pr-comment-sweepSkill
- pr-launchpadSkill
- repo-surveyorSkill
- review-checkpointSkill
- review-repairbaySkill
- shipyardSkill
- skill-optimizerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use bean-query for fast, read-only queries against an existing Beancount ledger.
- Distinctive: line 13
Read this file first. Load one reference only when task needs deeper detail:
- Very specific: line 19
Do not load all references for routine query.
- Distinctive: line 25
Check command and ledger:
- Distinctive: line 39
Run one-shot query. Quote query as one shell argument:
- Very specific: line 46
Use --format=csv for agent parsing.
- Very specific: line 47
Use --numberify when spreadsheet-like numeric currency columns are needed.
- Very specific: line 73
Default queries scan postings.
- Very specific: line 82
Use FROM entries for directive-level rows.
- Very specific: line 91
Use BALANCES for account totals, JOURNAL for account registers, and PRINT for Beancount-formatted directives.
- Very specific: line 93
Use explicit GROUP BY for every non-aggregate target.
- Very specific: line 98
Check optional values with IS NULL or IS NOT NULL.
- Very specific: line 112
Use .help targets, .help from, and .help where for complete type-aware columns and functions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
beanquery
Use bean-query for fast, read-only queries against an existing Beancount
ledger. Do not edit ledger files or use BQL CREATE/INSERT.
Progressive loading
Read this file first. Load one reference only when task needs deeper detail:
- Exact tables, columns, types, or structured fields: schema
- Ready-made reports and search patterns: query cookbook
- BQL grammar, semantics, operators, and edge cases: BQL
Do not load all references for routine query. Re-check live .describe output
when ledger schema or installed beanquery version may differ.
Procedure
- Resolve ledger path. Never guess it; ask user when unknown.
Check command and ledger:
test -f "$LEDGER" command -v bean-query || python3 -m beanquery --helpInspect schema when query shape is unclear:
bean-query "$LEDGER" ".tables" bean-query "$LEDGER" ".describe postings"Run one-shot query. Quote query as one shell argument:
bean-query "$LEDGER" --format=csv \ "SELECT date, account, position WHERE account ~ '^Expenses:' ORDER BY date;"- Use
--format=csvfor agent parsing. Use text for quick human inspection. Use--numberifywhen spreadsheet-like numeric currency columns are needed. - Load once without
--no-errorswhen ledger health matters. Report Beancount validation errors;--no-errorsonly hides their output.
For long BQL, pipe stdin instead of fighting shell quoting:
cat <<'BQL' | bean-query "$LEDGER" --format=csv
SELECT date, account, number, currency
WHERE account ~ '^Expenses:'
ORDER BY date, account;
BQLLedger model
Ledger source exposes:
postings default table; one row per transaction posting
entries every Beancount directive
transactions transaction directives
accounts account open/close dates
commodities, prices, balances, notes, events, documentsDefault queries scan postings. Common posting columns:
date, year, month, day, flag, payee, narration, description
account, other_accounts, accounts, position, number, currency
cost_number, cost_currency, cost_date, price, weight, balance
posting_flag, meta, entry, filename, lineno, location, id, type, tags, linksUse FROM entries for directive-level rows. Use FROM # for one constant row;
without it, SELECT 1 repeats once per posting.
Core query rules
SELECTqueries defaultpostings; each row is one posting.WHERE account ~ 'REGEX'filters posting rows. Use directive fields inFROM(date,year,narration,flag) when complete transactions must remain for balancing context.- Use
BALANCESfor account totals,JOURNALfor account registers, andPRINTfor Beancount-formatted directives. - Use explicit
GROUP BYfor every non-aggregate target.sum(position)returns inventory;sum(cost(position))returns cost-basis inventory. OPEN ON,CLOSE ON, andCLEARperform accounting transformations, not simple date predicates.~and!~are case-insensitive regex operators. Dates useYYYY-MM-DD. Check optional values withIS NULLorIS NOT NULL.
Load query cookbook for task recipes. Load BQL reference for grammar, operators, functions, or edge cases.
Discovery and troubleshooting
bean-query "$LEDGER" ".tables"
bean-query "$LEDGER" ".describe postings"
bean-query "$LEDGER" ".describe entries"Use .help targets, .help from, and .help where for complete type-aware
columns and functions. If result is empty, verify default table, column name,
regex, date range, and whether filter belongs in FROM or WHERE. Use
.errors to inspect load errors.
Interactive shell commands include .tables, .describe, .errors, .reload,
.parse, .explain, .set pager false, .format csv, .output FILE, and
.run NAME for Beancount query directives.
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.

