cynco-labs/ai-accounting-skills / accounting-engagement/skills/export-beancount
export-beancount
VerifiedExport balanced journals to Beancount ledger SoR (prove job). Use when beancount or export ledger.
/export-beancount
Purpose
Push final (or draft-marked) books into Beancount — the ledger system of record.
workpapers/journals*.json + COA → ledger/main.beancount → Fava
Excel remains human working papers. Beancount is where the ledger lives for agents and git.
Load: references/beancount_integration.md
When
| Situation | Output |
|---|---|
| QC passed / finalise done | ledger/main.beancount |
| User wants mid-engagement preview | ledger/draft.beancount (label provisional) |
| Unbalanced journals | Refuse until fixed |
Preconditions
workpapers/journals.jsonexists (andjournals_ye.jsonif YE posted)- Prefer
workpapers/coa.jsonor entity COA template - Each JE: sum(debit) = sum(credit)
pip install beancountrecommended for--bean-check
Command
python3 scripts/export_to_beancount.py \
--client-dir "<client_workspace>" \
--output "<client_workspace>/ledger/main.beancount" \
--bean-check
Or explicit paths:
python3 scripts/export_to_beancount.py \
--journals workpapers/journals.json \
--journals-ye workpapers/journals_ye.json \
--coa references/coa_templates/coa_sdn_bhd.json \
--currency MYR \
--title "LEGAL NAME SDN. BHD." \
--output ledger/main.beancount \
--bean-check
What the exporter does
- Map COA codes → Beancount accounts (
Assets:…,Liabilities:…,Equity:…,Income:…,Expenses:…) - Emit
opendirectives - Emit one Beancount transaction per journal entry (DR +, CR −)
- Write
*.account_map.jsonsidecar - Optional
bean-check
Completion
Done when: ledger/main.beancount written from balanced journals; refuse if any JE unbalanced.
Outputs
ledger/main.beancount(or draft path)ledger/main.beancount.account_map.json- Update
engagement_state.json: artifactbeancount_ledger, stage note
Next
validate-beancountif check not runopen-favato show the user
Failure modes
| Issue | Action |
|---|---|
| Unbalanced JE | Stop; fix journals |
| bean-check fail | Show stderr; fix mapping/dates |
| Missing beancount install | pip install beancount fava once |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |