---
name: business-transaction-identifier
description: Use this skill whenever Claude needs to identify business-related spending inside personal financial statements, build candidate transaction rows, or decide whether transactions are likely business, personal, or need review based on a local trading profile.
---

# Business Transaction Identifier

## Required Context

Read `.claude/skills/business-transaction-identifier/references/trading.MD` first. If it is missing, ask the user to run `/trading`.

Use the profile to understand the business model, normal suppliers, likely expense categories, and transactions that should stay personal.

## Inputs

- Raw statements from `statements/inbox/` or a user-supplied path.
- Supported target formats: PDF, CSV, XLS, XLSX, OFX, QIF, QFX, and other formats that local tools can extract.

## Classification Process

1. Create a source manifest for each statement: file path, file size, and SHA-256 hash.
2. Parse deterministically where possible:
   - CSV/TSV: use headers and column types rather than manual string splitting.
   - XLS/XLSX/ODS: use spreadsheet readers where available.
   - PDF: try text/table extraction first; document any OCR or manual row-boundary inference.
3. Normalize transaction fields before classification.
4. Classify each transaction as `business`, `needs_review`, or `personal`.
5. Keep only `business` and `needs_review` candidates for verification.

## Candidate Row Schema

Use these columns or JSON keys:

```text
source_file,source_file_sha256,statement_row_id,transaction_date,posted_date,description,amount,currency,account_hint,category,business_reason,confidence,evidence,status
```

## Decision Rules

- Business spend needs a concrete link to the trading profile.
- Treat tax, software, cloud, banking fees, professional services, equipment, travel for trading activity, and relevant subscriptions as likely business when the profile supports them.
- Treat groceries, entertainment, family, household, personal transfers, cash withdrawals, and ambiguous card payments as personal or `needs_review` unless the evidence is strong.
- Never create a final CSV. Candidates must go through statement reconciliation first.
- Do not store raw statement contents in tracked files.
