← Back to Skills Marketplace
737999

GridTRX

by Cware · GitHub ↗ · v0.1.21
cross-platform ✓ Security Clean
563
Downloads
2
Stars
0
Active Installs
22
Versions
Install in OpenClaw
/install gridtrx
Description
Double-entry, full-cycle accounting suite built for AI agents. Converts bank CSVs, OFX, and QBO files into balanced, auditable books — balance sheet, income...
README (SKILL.md)

Skill: GridTRX Accounting

Demo

Watch the demo: Full accounting cycle in 15 minutes

What it does

Use this skill when the user asks you to "do the books," "categorize expenses," "import bank transactions," "run a balance sheet," or any bookkeeping task. GridTRX is a full-cycle double-entry accounting engine. You prompt in plain English, and the agent completes the books correctly. Every transaction balances. Every amount is deterministic. All data is local — no cloud services, no external APIs.

GridTRX produces a full set of auditable books: balance sheet, income statement, general ledger, trial balance, adjusting journal entries, retained earnings rollforward. Reports are exportable to CSV and PDF for any time period.

Architecture

GridTRX has three interfaces to the same engine (models.pybooks.db):

  1. MCP Server (preferred for agents) — Structured JSON tools. 20 tools (12 read, 8 write) wrapping models.py directly. No text parsing, typed parameters, deterministic output.
  2. CLI (fallback for agents, power users) — One-shot shell commands via python cli.py. Zero dependencies beyond Python 3.7+ standard library. Any terminal-based agent can drive it via subprocess.
  3. Browser UI (for humans) — Flask web interface at localhost:5000 via python run.py. Ledger browsing, report viewer with drill-down, comparative reports up to 13 columns, bank import with rule preview, reconciliation marking, dark mode.

All three hit the same models.py data layer. Nothing is out of sync. Use MCP when available. Fall back to CLI otherwise. The browser UI is for human review.

Prerequisites

Install dependencies before first use (one-time setup):

pip install -r requirements.txt

Or install individually: pip install mcp (MCP server), pip install flask (browser UI). The CLI has no dependencies beyond the Python 3.7+ standard library.

No packages are installed at runtime. All dependencies must be pre-installed.

MCP Setup

Add to the agent's MCP config with GRIDTRX_WORKSPACE set to the user's client folder:

{
  "command": "python",
  "args": ["/path/to/mcp_server.py"],
  "env": {"GRIDTRX_WORKSPACE": "/path/to/clients"}
}

GRIDTRX_WORKSPACE is mandatory — the MCP server will refuse to start without it. Any db_path outside the workspace is rejected at runtime. Every MCP tool takes db_path as its first parameter, which must resolve to a books.db file inside the workspace.

CLI Usage

GRIDTRX_WORKSPACE=/path/to/clients python cli.py /path/to/clients/acme/books.db \x3Ccommand>

Runs one command, prints plain text to stdout, exits. When GRIDTRX_WORKSPACE is set, the CLI enforces the same workspace boundary as the MCP server — paths outside the workspace are rejected.

Inputs needed

  • The absolute path to the client's books (books.db file or its parent folder).
  • The absolute path to the bank file (.csv, .ofx, or .qbo).
  • The bank account name to post against (typically BANK.CHQ for chequing).

Core concepts

  • Double-entry: Every transaction is a balanced zero-sum entry. Debits = Credits. Always.
  • Sign convention: Positive = Debit. Parentheses (1,500.00) = Credit. = Zero.
  • Amounts: Stored as integer cents internally. Displayed as dollars with two decimals.
  • Account names: Case-insensitive, UPPER by convention. Common prefixes: BANK. EX. REV. AR. AP. GST. RE. SHL. — When importing a trial balance or creating accounts, ALWAYS use GridTRX naming. Never use numeric account codes. If the source data has numeric codes (1010, 5800, etc.), ignore the codes and map by description to the nearest GridTRX account name. If no match exists, create the account using the EX. or REV. prefix convention. Always call list_accounts first before creating anything.
  • EX.SUSP (Suspense): Where unrecognized transactions land. This is the triage queue. Tell the AI what the suspense items are and it will clear them. Or clear them yourself through the GUI.
  • Import rules: Keyword → account mappings. Case-insensitive match, highest priority wins. Optional tax code splits the amount into net + tax automatically.
  • Lock date: Prevents changes to closed periods. Check before importing historical data.
  • Architecture: Each client is one SQLite file. Copy it, back it up, email it. One data layer (models.py) — CLI, MCP server, and browser UI all call the same functions.

Workflow

Step 1: Initialize (if no books exist)

MCP: No direct tool — use exec to run CLI. CLI: python cli.py then new /path/to/folder "Company Name"

This creates books.db with a full chart of accounts (~60 posting accounts), five reports (BS, IS, AJE, TRX, RE.OFS), 60+ import rules, and four tax codes. Always use starter books as the base — they include the critical perpetual retained earnings chain (IS → NI → RE.CLOSE → RE on BS, plus RE.OFS/RE.OPEN for year-end). Never build reports from scratch without this chain. The fiscal year ceiling (fy_end_date) is automatically set to the current fiscal year end.

After setup, run validate to confirm the report chain is intact: CLI: python cli.py /path/to/books.db validate

Step 2: Import bank data

MCP (preferred):

  • CSV: import_csv(db_path, csv_path, "BANK.CHQ")
  • OFX/QBO: import_ofx(db_path, ofx_path, "BANK.CHQ")

CLI fallback:

  • CSV: python cli.py /path/to/books.db importcsv /path/to/file.csv BANK.CHQ
  • OFX: python cli.py /path/to/books.db importofx /path/to/file.qbo BANK.CHQ

The import applies all rules automatically. Check the result summary: posted, skipped, to_suspense.

CaseWare AJE import:

  • MCP: import_aje(db_path, file_path, "25AJE")
  • CLI: python cli.py /path/to/books.db importaje /path/to/aje_export.iif 25AJE
  • Supports QuickBooks IIF and Venice/MYOB text formats. Maps CsW account descriptions to Grid account codes.

Step 3: Audit suspense

MCP: get_ledger(db_path, "EX.SUSP") CLI: python cli.py /path/to/books.db ledger EX.SUSP

Every entry here is an unrecognized transaction. Note the description and transaction ID for each.

Step 4: Resolve suspense with the user

Present each suspense item to the user. Ask: "What category is this?"

Do NOT guess. If the description is ambiguous (e.g., "AMAZON", "BEST BUY", "TRANSFER"), ask the user for business context before categorizing.

Once the user answers, add a rule so future imports are automatic:

MCP: add_rule(db_path, "AMAZON", "EX.OFFICE", "G5", 0) CLI: python cli.py /path/to/books.db addrule AMAZON EX.OFFICE G5 0

Tax code is optional. Common codes: G5 (GST 5%), H13 (HST 13%), H15 (HST 15%), E (exempt).

Step 5: Clear the bad suspense entries and re-import

Delete each suspense transaction, then re-import so the new rules apply:

MCP: delete_transaction(db_path, txn_id) for each, then import_csv(...) or import_ofx(...) again. CLI: python cli.py /path/to/books.db delete \x3Ctxn_id> for each, then re-run the import command.

Repeat Steps 3-5 until suspense is empty.

Step 6: Verify and report

MCP:

  • trial_balance(db_path) — debits must equal credits
  • generate_report(db_path, "BS") — Balance Sheet
  • generate_report(db_path, "IS") — Income Statement

CLI:

  • python cli.py /path/to/books.db tb
  • python cli.py /path/to/books.db report BS
  • python cli.py /path/to/books.db report IS

Step 7: Year-end rollforward

When the fiscal year is complete:

MCP: rollforward(db_path, "2025-12-31") CLI: python cli.py /path/to/books.db rollforward 2025-12-31

This reads RE.CLOSE from the IS, posts Dr RE.OFS / Cr RE.OPEN, sets the lock date, and advances the FY ceiling to the next year. Then repeat from Step 2 for the next fiscal year. Rows beyond the ceiling are automatically skipped during import.

Recovery: Undoing a bad import

If the user uploaded the wrong file or you imported against the wrong account:

  1. Find the bad transactions: search_transactions(db_path, "some description") or via CLI search \x3Ckeyword>.
  2. Delete them one by one: delete_transaction(db_path, txn_id) or CLI delete \x3Ctxn_id>.
  3. Verify the trial balance still balances after cleanup.
  4. Re-import the correct file.

There is no bulk undo. Deletions are individual and respect the lock date — you cannot delete transactions in a locked period.

MCP tools reference (20 tools)

Read tools

Tool Purpose
list_accounts(db_path, query?) List/search chart of accounts
get_balance(db_path, account_name, date_from?, date_to?) Single account balance
get_ledger(db_path, account_name, date_from?, date_to?) Account ledger with running balance
trial_balance(db_path, as_of_date?) Trial balance — all accounts, Dr/Cr columns
generate_report(db_path, report_name, date_from?, date_to?) Run a report (BS, IS, AJE, etc.)
get_transaction(db_path, txn_id) Single transaction with all journal lines
search_transactions(db_path, query, limit?) Search by description/reference
list_reports(db_path) List available reports
list_rules(db_path) List import rules
get_info(db_path) Company name, fiscal year, lock date

Write tools

Tool Purpose
post_transaction(db_path, date, description, amount, debit_account, credit_account) Post a simple 2-line entry
delete_transaction(db_path, txn_id) Delete a transaction (respects lock date)
add_account(db_path, name, normal_balance, description?) Add a posting account
add_rule(db_path, keyword, account_name, tax_code?, priority?) Add an import rule
delete_rule(db_path, rule_id) Delete an import rule
import_csv(db_path, csv_path, bank_account) Import bank CSV
import_ofx(db_path, ofx_path, bank_account) Import bank OFX/QBO
import_aje(db_path, file_path, ref_prefix) Import CaseWare AJE export (IIF or Venice)
rollforward(db_path, ye_date) Year-end rollforward (posts RE closing, sets lock, advances ceiling)
year_end(db_path, ye_date) Alias for rollforward
set_lock_date(db_path, lock_date?) Show or set the lock date
set_ceiling(db_path, date?) Show or set the fiscal year ceiling
bulk_report_layout(db_path, report_name, items, after_account?, mode?) Batch-place items on a report (accounts, totals, labels, separators)

Guardrails

  • NEVER GUESS CATEGORIES. If a transaction description is ambiguous, let it go to EX.SUSP and ask the user. Do not assume "AMAZON" is office supplies — it could be inventory, personal, or cost of sales.
  • NEVER MODIFY books.db DIRECTLY. All writes go through cli.py commands or MCP tools. Never use file tools to read or write the SQLite database.
  • STAY IN THE WORKSPACE. Only operate on books.db files within the user's GridTRX workspace. Both the MCP server and CLI enforce this when GRIDTRX_WORKSPACE is set — the MCP server will not start without it, and both interfaces reject any path outside the workspace.
  • NO OUTBOUND NETWORK REQUESTS. GridTRX processes data locally. It does not phone home, call APIs, or transmit data. Do not attempt to "verify" transactions against external services.
  • RESPECT THE POSTING WINDOW. Before importing, check the lock date and FY ceiling with get_info(). You cannot post on or before the lock date, or after the FY ceiling. Run rollforward to advance to the next fiscal year.
  • PRESERVE RAW OUTPUT. When presenting financial data to the user, use the exact numbers from GridTRX. Do not round, reformat, or flip signs. Positive = Debit. Parentheses = Credit.
  • TRIAL BALANCE MUST BALANCE. After any operation, if the trial balance shows unequal debits and credits, something is wrong. Stop and investigate before proceeding.
  • LIMIT EXEC SCOPE. When using exec, only run python cli.py commands against books within the workspace. Do not run arbitrary shell commands, install packages, start background processes, or execute scripts other than cli.py. The MCP server is the preferred interface — use CLI only when MCP is unavailable.
Usage Guidance
This skill is coherent with its description, but before installing or running it: (1) set GRIDTRX_WORKSPACE to a dedicated directory (not your home or root) so the tool cannot access unrelated files; (2) review the included Python files yourself (or have a developer do so) if you will run the MCP server — it will expose programmatic tools to any agent that can call it; (3) only install optional dependencies (mcp, flask) from trusted registries and limit network exposure (run MCP only for local agent processes, not on a public interface); (4) treat books.db as sensitive financial data — the docs mention copying/ emailing it, but that is a human action you should control; (5) note that the repo is provided with source code included, and the skill does not auto-install unknown binaries, so you remain in control of dependency installation and runtime invocation.
Capability Analysis
Type: OpenClaw Skill Name: gridtrx Version: 0.1.21 The GridTRX skill bundle is a local, double-entry accounting suite that demonstrates strong security practices for an AI-driven tool. It implements a mandatory 'GRIDTRX_WORKSPACE' environment variable check in both 'cli.py' and 'mcp_server.py' to enforce strict directory boundaries and prevent path traversal attacks. The core logic in 'models.py' uses parameterized SQL queries to mitigate injection risks, and the agent instructions in 'SKILL.md' and 'ai.txt' explicitly prohibit outbound network requests and emphasize local data privacy. No evidence of malicious intent, data exfiltration, or unauthorized execution was found.
Capability Assessment
Purpose & Capability
Name/description (accounting engine) matches the included code (models.py, cli.py, mcp_server.py) and the single required binary (python3). GRIDTRX_WORKSPACE is a workspace path used to restrict which SQLite books.db files the tool may open — this is coherent with the stated purpose.
Instruction Scope
SKILL.md and ai.txt instruct the agent to run the CLI or start the MCP server and to operate only on SQLite books inside GRIDTRX_WORKSPACE. The instructions emphasize 'all data is local' and the code enforces an explicit workspace boundary. Note: the docs suggest copying/backing up or emailing the books.db file — that is a user action that can expose sensitive financial data if done carelessly, but it is not performed automatically by the skill.
Install Mechanism
No install spec is embedded; the repository includes source files and a requirements.txt with optional dependencies (mcp, flask). SKILL.md instructs users to pip install the optional packages before use. There is no download-from-URL or extract step in the skill bundle that would write arbitrary third-party code at runtime.
Credentials
Only GRIDTRX_WORKSPACE is required (declared as primaryEnv). This is a path, not a secret credential, and is directly used to enforce a workspace boundary. No unrelated secrets or external API keys are requested.
Persistence & Privilege
always is false. The skill allows autonomous invocation (disable-model-invocation is false), which is standard for skills and expected for agent-driven bookkeeping. The skill does not request system-wide configuration changes or other skills' credentials.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gridtrx
  3. After installation, invoke the skill by name or use /gridtrx
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.21
## gridtrx 0.1.21 - Updated some GUI stuff for users. Fixed some print errors. Added caseware AJE import. - No file changes detected in this release. - Documentation and instructions in SKILL.md remain unchanged. - No user-facing or functional updates in this version.
v0.1.20
- No file or code changes detected in this version. - Documentation and instructions in SKILL.md remain unchanged. - Fixed PDF reporting. Tried to make them faster. -CW
v0.1.19
# gridtrx 0.1.19 Changelog - Added requirements.txt listing core dependencies for installation. - Updated SKILL.md to clarify that dependencies must be pre-installed and are not installed at runtime. - Improved documentation of MCP, CLI, and browser UI setup and usage. - Refined environment/bin requirements in SKILL.md metadata (removed pip, confirmed Python 3 requirement).
v0.1.18
- Added a prominent demo section with a link to a full accounting cycle video walkthrough. - Updated core concepts to clarify account naming conventions and mapping, emphasizing the exclusive use of GridTRX account names and removal of numeric account codes. - Expanded account name guidance: instructs to always call `list_accounts` before creating new accounts, and specifies conventions when mapping or creating accounts. - No code changes; SKILL.md documentation only.
v0.1.17
-updated some GUI formatting stuff for the cpa/accountant users. - No code or documentation changes detected in this release. - Version bump only; all features and workflows remain unchanged.
v0.1.16
- Documentation updated in SKILL.md with clarifications and formatting improvements. - No code changes or modifications to existing files. - Workflow steps, usage instructions, and architecture details remain consistent.
v0.1.15
- Added instructions and support details for CaseWare AJE import via both MCP and CLI, including supported formats and account code mapping. - Improved clarity by removing outdated references to fiscal year ceiling, posting window, and historical posting restrictions. - No changes to code or required tools; documentation update only.
v0.1.14
## gridtrx 0.1.14 - Expanded accounting period controls: clarified lock date (closed-period floor), introduced fiscal year ceiling (posting window is now strictly enforced). - Added details on year-end rollforward with new instructions for CLI and MCP (`rollforward`), including recommended workflow for multi-year books. - Updated initialization workflow to mandate use of starter books, ensuring persistent retained earnings chain and correct fiscal-year cutoff. - Added validation step (`validate`) after book creation to confirm report chain integrity. - Revised documentation for fiscal period restrictions and row-skipping behavior when importing beyond the current period. - General documentation tightening and updated best practices throughout SKILL.md.
v0.1.13
- No file changes detected in this release. - Added AR/AP modules, better AJE report printing for human users. - Version bump only; no modifications to features, documentation, or functionality.
v0.1.12
No changes detected in this version. - AR and AP subledger one-shot implementation added. - Version 0.1.12 has no file modifications or documentation updates. - All features and usage remain unchanged from the previous release.
v0.1.11
- Added new file: `run.py`. - Introduced Flask-based browser UI via `python run.py` for ledger browsing, report viewing, comparative reports, bank imports with rule preview, reconciliation marking, and dark mode. - No changes to existing workflow, MCP interface, or CLI functionality.
v0.1.10
- Added full repository structure for initial version, including .git and required sample files. - Expanded documentation: SKILL.md now details the browser UI (Flask web app), alongside MCP server and CLI interfaces. - Clarified architecture: all three interfaces (MCP, CLI, browser UI) use the same data layer for synchronization. - Updated description to emphasize “full-cycle accounting” and support for CSV, OFX, and QBO bank files. - Revised workflow and key concepts sections for greater clarity and guidance for AI and human users.
v0.1.9
- No code or documentation changes detected in this release. - More security patches @CW - Version bump to 0.1.9 only; functionality and usage unchanged.
v0.1.8
## gridtrx 0.1.8 - No file changes detected in this version. - edited to fix some security stuff @CW - No updates to functionality, features, or documentation content. - Release appears to maintain the prior state of the skill.
v0.1.7
- Updated description to clarify the skill is for AI agents and reworded for conciseness. - No functional or code changes detected in this version. - Documentation only: minor edits for clarity, with no impact on workflow or tool usage.
v0.1.6
## gridtrx 0.1.6 Changelog - Added an `openclaw` metadata section specifying required environment variables (`GRIDTRX_WORKSPACE`) and binaries (`python3`, `pip`) for deployment compatibility. - Declared `GRIDTRX_WORKSPACE` as the primary environment variable. - No changes to code or CLI/MCP tool behavior.
v0.1.5
- CLI usage now requires `GRIDTRX_WORKSPACE` to be set, enforcing the same workspace security as the MCP server. - CLI commands updated in documentation to include the `GRIDTRX_WORKSPACE` environment variable and reject paths outside the workspace. - Clarified workspace guardrails for both interfaces in step-by-step instructions. - No functional or file changes—documentation update only.
v0.1.4
gridtrx 0.1.4 - Added explicit binary and package requirements for Python 3 and the 'mcp' package. - Introduced an environment variable (`GRIDTRX_WORKSPACE`) as a mandatory setting, enforced by the MCP server. - Updated documentation to reflect new requirements and clarify MCP server startup conditions. - Retained all CLI and MCP tool workflows and guardrails from the previous version.
v0.1.3
- MCP setup instructions updated: requires setting the GRIDTRX_WORKSPACE environment variable to restrict database access. - The MCP server now enforces workspace boundaries at runtime, rejecting operations on db_path values outside the allowed workspace. - Guardrails section updated to clarify that the MCP server enforces workspace restrictions on database paths.
v0.1.2
- Clarified dependency requirements: CLI now explicitly requires only Python 3.7+ standard library; MCP server requires the 'mcp' package. - Updated security and usage guardrails: Only operate on `books.db` files within the user's GridTRX workspace and never pass or access database paths outside the workspace. - Strengthened "all data is local": Emphasized no cloud services or external APIs; no outbound network requests. - Removed the obsolete `run.py` file, streamlining the codebase and documentation.
Metadata
Slug gridtrx
Version 0.1.21
License
All-time Installs 0
Active Installs 0
Total Versions 22
Frequently Asked Questions

What is GridTRX?

Double-entry, full-cycle accounting suite built for AI agents. Converts bank CSVs, OFX, and QBO files into balanced, auditable books — balance sheet, income... It is an AI Agent Skill for Claude Code / OpenClaw, with 563 downloads so far.

How do I install GridTRX?

Run "/install gridtrx" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is GridTRX free?

Yes, GridTRX is completely free (open-source). You can download, install and use it at no cost.

Which platforms does GridTRX support?

GridTRX is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created GridTRX?

It is built and maintained by Cware (@737999); the current version is v0.1.21.

💬 Comments