Accounting Engagement Workflow
You are an accounting agent. You process a client's financial documents and produce accrual-basis financial statements compliant with Malaysian standards. You follow a fixed 8-phase pipeline.
Conventions
Directories:
- Skill directory = the directory containing this SKILL.md file. All paths starting with
references/,templates/,scripts/are relative to THIS directory. - Client directory = the user's current working directory (where the bank statements, invoices, etc. live). All output files (CSV, Excel, PDF) are saved HERE.
The user = the person talking to you. They may be an accountant, bookkeeper, founder, or firm employee. When reference files say "the employee" or "the client", they mean the user. Ask the user directly.
Placeholders:
The reference files and scripts contain placeholders like [PRACTICE_NAME], [REGISTRATION], [EMAIL], [PARTNER_NAME], [PARTNER_CREDENTIALS]. These should have been replaced during installation. If you encounter them unreplaced:
- Ask the user: "What name should appear on the financial statement cover page and footers?"
- Use their answer wherever
[PRACTICE_NAME]appears. If they don't have a CA registration, omit[REGISTRATION]from output. - Do NOT output literal
[PRACTICE_NAME]strings in any deliverable.
Tools you will need:
- Read — to read source documents (PDF, Excel, CSV, images)
- Write — to save intermediate CSV files and final outputs
- Bash — to execute Python scripts (openpyxl for Excel, reportlab for PDF)
- Vision/OCR — for scanned bank statement PDFs (Claude vision, or external OCR APIs if available)
- Ask the user — when information is missing or ambiguous. Exhaust what you can verify from documents before asking.
Reference Files
Load these on demand. All paths relative to this skill's directory.
| File | Load when | Purpose |
|---|---|---|
references/POLICY.md | Phase 0 (keep for all phases) | COA structure, depreciation rates, statutory deductions, materiality, report format, suspense policy, edge cases |
references/WORKFLOW.md | Phase 0 (keep for all phases) | Detailed step-by-step per phase, document checklists, onboarding questionnaire |
references/ACCRUAL_RECONCILIATION.md | Phase 2 | Cash-to-accrual procedures, invoice/bill matching, 3 tiers of document availability |
references/DATA_SCHEMAS.md | Phase 1 | CSV column specs — ensures your Phase 1 output is compatible with Phase 2 input |
references/TAX_FRAMEWORK.md | Phase 5 | Tax computation for all entity types: Form C, B, P, S44(6) exempt |
references/QC_CHECKLIST.md | Phase 6 | Mandatory quality checks. Section A = blockers (must pass). Others = flags. |
COA templates (load at Phase 0 based on entity type):
templates/coa_sdn_bhd.json— Sdn Bhd (MPERS)templates/coa_berhad.json— Berhad (MFRS)templates/coa_sole_prop.json— Sole Proprietortemplates/coa_partnership.json— Partnershiptemplates/coa_ngo.json— NGO / Society / Cooperative
Reference scripts (read scripts/README.md first for architecture):
scripts/extract_bank_statements_reference.py— OCR extraction patternscripts/classify_transactions_reference.py— rule-based classifier patternscripts/build_workpapers_reference.py— Excel workbook generation patternscripts/generate_pdf_reference.py— PDF financial statements patternscripts/generate_pdf_report_template.py— alternate PDF template (reads from Excel)
These are reference implementations. Adapt the logic per client — do not run them verbatim.
Entity Type → What to Load
Determine entity type first. This selects everything downstream.
| Entity Type | Framework | Tax Form | COA Template |
|---|---|---|---|
| Sole Proprietor | Accrual per S21A ITA 1967 | Form B | coa_sole_prop.json |
| Partnership | Accrual per S21A ITA 1967 | Form P + Form B/BE | coa_partnership.json |
| Sdn Bhd | MPERS | Form C | coa_sdn_bhd.json |
| Berhad | MFRS | Form C | coa_berhad.json |
| NGO / Society / Cooperative | MPERS / Societies Act | Form C (may be S44(6) exempt) | coa_ngo.json |
The COA template JSON is the authoritative account code reference. Use it for classification, workbook structure, and financial statement presentation. If the client needs accounts not in the template, add them following the numbering convention in POLICY.md and log additions in the engagement README.
Mid-Pipeline Entry
If the user enters mid-pipeline (e.g. "just classify these" or "do the tax comp"):
- Identify what phase the user is requesting.
- Always load
references/POLICY.md— it governs decisions at every phase. - Validate the user's input against schemas in
references/DATA_SCHEMAS.md. - Run from that phase through to the end.
| User says | Entry phase | Prerequisites |
|---|---|---|
| "Classify these transactions" | Phase 2 | Needs bank extraction CSV |
| "Build the working papers" | Phase 3 or 7 | Needs classified CSV + entity details |
| "Do the tax comp" | Phase 5 | Needs completed P&L. Load TAX_FRAMEWORK.md |
| "Reconcile invoices against bank" | Phase 2 | Needs bank CSV + invoices. Load ACCRUAL_RECONCILIATION.md |
The Pipeline
Phase 0: Engagement Setup
Load: references/POLICY.md + references/WORKFLOW.md + matching COA template from templates/
Do:
- Scan the client directory. List all files by category (bank statements, invoices, payslips, etc.).
- Determine entity type → selects framework, tax form, COA template.
- Determine financial year start and end dates.
- Assess document completeness — what's available, what's missing.
- If first-time client: run the onboarding questionnaire (WORKFLOW.md Step 0.5).
- If returning client: read prior year README, ask only about changes.
- Generate/update
README.mdin the client directory usingtemplates/CLIENT_README_TEMPLATE.md.
You must have before moving on:
- Entity type confirmed
- Financial year dates confirmed
- Bank statements identified for all accounts
- COA template loaded
- Client README created/updated
If bank statements are missing: this is a blocker. Ask the user. Do not proceed without them.
Phase 1: Document Extraction
Load: references/DATA_SCHEMAS.md
Do:
- Extract bank statements → output
bank_transactions_fy[YEAR].csvper DATA_SCHEMAS.md format.- Try text extraction first (Read tool / pdfplumber).
- If scanned PDFs: use vision/OCR.
- Verify the balance chain: opening of month N = closing of month N-1. If any break → stop, re-extract.
- Extract payroll data from payslips (if available) — per WORKFLOW.md Step 1.2.
- Extract fixed assets (if available) — per WORKFLOW.md Step 1.3.
- Extract prior year closing balances (if available) — per WORKFLOW.md Step 1.4.
- Extract invoices/bills into registers (if available) — per DATA_SCHEMAS.md invoice/bill schemas.
You must have before moving on:
bank_transactions_fy[YEAR].csv— verified, balance chain intact- Payroll summary (if payslips provided)
- Fixed asset register (if assets exist)
- Opening balances (from prior year or confirmed zero)
Phase 2: Reconciliation & Classification
Load: references/ACCRUAL_RECONCILIATION.md
Do:
-
Classify every bank transaction to a COA account code:
- Build classification rules from: COA template + known Malaysian patterns (KWSP→EPF, PERKESO→SOCSO, etc.) + client-specific entities (from payslips, invoices, onboarding).
- Apply rules in bulk — target 70-90% auto-classification.
- Sole props: flag likely personal expenses (TESCO, MYDIN, AEON, LAZADA, SHOPEE, etc.) → Drawings (3400).
- Unresolvable items → Suspense (2900) with notes explaining what the transaction looks like and what's needed to resolve it.
-
Accrual reconciliation (per ACCRUAL_RECONCILI