Import my prior books

From gethouston/houston · View interactive version

Import my prior books is an AI agent skill from the GitHub repository gethouston/houston. Backfill memory from your prior system: a QuickBooks Online or Xero export, a CSV, or a spreadsheet from your prior accountant. I seed your chart of accounts (only if you don't have one), build an opening trial balance from the prior period's closing balances, and learn vendor-to-account-code rules

How to use this skill

Skill file

Import My Prior Books

Pulls your prior year's bookkeeping into memory so this year doesn't start cold. I read a QuickBooks Online export, a Xero export, or a generic CSV / xlsx; seed your chart of accounts if you don't have one; build the opening trial balance from prior closing balances; and learn vendor-to-account-code rules from transaction history. Every downstream skill — process-my-statements, categorize-my-transactions, close-my-month — starts with vendor knowledge already loaded.

Read-only: I never connect back to push, never rewrite your prior books. I learn from them.

When to use

Connections I need

I run external work through Composio. Before this skill runs I check that the categories below are linked. Missing → I name the category, ask you to connect it from the Integrations tab, stop.

This skill works fully from a dropped file (xlsx or CSV export). No connection blocks the run.

Information I need

I read your bookkeeping context first. For every required field that's missing I ask ONE plain-language question (best modality: connected app > file drop > URL > paste) and wait.

Steps

<!-- houston-workflow:v1 -->

  1. Read config. Load config/context-ledger.json - required: universal.company.fiscalYearEnd (determines import period boundary), universal.accountingMethod (cash vs. accrual affects opening balance interpretation). If missing, ask ONE targeted question (modality hint: connected app > file > URL > paste) and continue.
  1. Identify source format. User drops one of:

Detect format by column headers. If ambiguous, confirm inline with one question. For xlsx use openpyxl; for CSV use stdlib csv module.

  1. Discover Composio connection only if needed. If user asks pull direct from QuickBooks Online / Xero instead of file drop, discover slug at runtime:

```bash

composio search accounting

```

Never hardcode tool names. If no connection exists, print link command and stop - no invent data. File drop always preferred path; connected-app pull is option, not default.

  1. Parse into normalized row stream. Every source row lands as:

```ts

{

date: string; // YYYY-MM-DD

party: string; // raw vendor/customer name from the source

amount: number; // signed: money out of the business = negative

glCode: string; // text, validated later against chart of accounts

glName: string;

memo?: string;

docType?: string; // "Bill", "Check", "Invoice", etc.

}

```

QuickBooks Online debits/credits: Amount column already signed in General Ledger export. In Transaction List, Amount reflects account's natural balance - check Account column to normalize to agent-wide sign convention (money out of business = negative).

Xero: compute amount = debit - credit, then apply same sign convention per account type (asset/expense debits = positive = money out ⇒ flip to negative; revenue/liability credits = money in ⇒ leave positive).

  1. Seed chart of accounts (only if ours missing). If config/chart-of-accounts.json does NOT exist AND export includes a chart of accounts (QuickBooks Online and Xero exports both do - unique set of {gl_code, gl_name, account_type} tuples), build initial chart of accounts from export. Normalize:
  1. Build opening trial balance. From prior period's CLOSING balances (last row per account code in General Ledger export, or Running Balance column at period end in Xero):
  1. Seed prior categorizations. From transaction history:
  1. Mark period as imported in run-index.json. Read existing run-index.json (create empty array if absent), append:

```json

{

"id": "{uuid4}",

"period": "2023",

"periodStart": "2023-01-01",

"periodEnd": "2023-12-31",

"status": "imported",

"source": "qbo-import" | "xero-import" | "csv-import",

"accountsIncluded": ["..."],

"transactionCount": 0,

"createdAt": "{now}",

"updatedAt": "{now}"

}

```

Write atomically (read-merge-write - never overwrite).

  1. DO NOT write detailed transactions. This skill no produce runs/{period}/run.json - imported period not run we own, it's prior system's ledger. If user want reviewed workbook for imported period, drop statements into statements/_inbox/ and invoke process-my-statements, which benefit from seeded prior-categorizations.
  1. DO NOT append to outputs.json. Chart of accounts, opening trial balance, prior-categorizations all config. run-index.json row is single index entry, there.
  1. Summarize to user. Counts: transactions parsed, unique parties canonicalized, prior-categorizations seeded (with ≥ 80% / ≥ 3-txn threshold explained), chart of accounts rows adopted (or skipped because ours exists), opening trial balance balance-check result. Flag ambiguous parties that missed threshold - founder can promote manually via categorize-my-transactions mode=rule-add. Next move: "process this year's statements and categorization will hit most rows from prior memory".

Outputs

No entry in outputs.json.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.