jaz-cli 2.6.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/assets/skills/api/SKILL.md +12 -2
  2. package/assets/skills/api/references/dependencies.md +3 -2
  3. package/assets/skills/api/references/endpoints.md +78 -0
  4. package/assets/skills/api/references/feature-glossary.md +4 -4
  5. package/assets/skills/api/references/field-map.md +17 -0
  6. package/assets/skills/api/references/full-api-surface.md +1 -1
  7. package/assets/skills/conversion/SKILL.md +1 -1
  8. package/assets/skills/jobs/SKILL.md +104 -0
  9. package/assets/skills/jobs/references/audit-prep.md +319 -0
  10. package/assets/skills/jobs/references/bank-recon.md +234 -0
  11. package/assets/skills/jobs/references/building-blocks.md +135 -0
  12. package/assets/skills/jobs/references/credit-control.md +273 -0
  13. package/assets/skills/jobs/references/fa-review.md +267 -0
  14. package/assets/skills/jobs/references/gst-vat-filing.md +250 -0
  15. package/assets/skills/jobs/references/month-end-close.md +308 -0
  16. package/assets/skills/jobs/references/payment-run.md +246 -0
  17. package/assets/skills/jobs/references/quarter-end-close.md +268 -0
  18. package/assets/skills/jobs/references/supplier-recon.md +330 -0
  19. package/assets/skills/jobs/references/year-end-close.md +341 -0
  20. package/assets/skills/transaction-recipes/SKILL.md +1 -1
  21. package/dist/__tests__/amortization.test.js +101 -0
  22. package/dist/__tests__/asset-disposal.test.js +249 -0
  23. package/dist/__tests__/blueprint.test.js +72 -0
  24. package/dist/__tests__/depreciation.test.js +125 -0
  25. package/dist/__tests__/ecl.test.js +134 -0
  26. package/dist/__tests__/fixed-deposit.test.js +214 -0
  27. package/dist/__tests__/fx-reval.test.js +115 -0
  28. package/dist/__tests__/jobs-audit-prep.test.js +125 -0
  29. package/dist/__tests__/jobs-bank-recon.test.js +108 -0
  30. package/dist/__tests__/jobs-credit-control.test.js +98 -0
  31. package/dist/__tests__/jobs-fa-review.test.js +104 -0
  32. package/dist/__tests__/jobs-gst-vat.test.js +113 -0
  33. package/dist/__tests__/jobs-month-end.test.js +162 -0
  34. package/dist/__tests__/jobs-payment-run.test.js +106 -0
  35. package/dist/__tests__/jobs-quarter-end.test.js +155 -0
  36. package/dist/__tests__/jobs-supplier-recon.test.js +115 -0
  37. package/dist/__tests__/jobs-validate.test.js +181 -0
  38. package/dist/__tests__/jobs-year-end.test.js +149 -0
  39. package/dist/__tests__/lease.test.js +96 -0
  40. package/dist/__tests__/loan.test.js +80 -0
  41. package/dist/__tests__/provision.test.js +141 -0
  42. package/dist/__tests__/validate.test.js +81 -0
  43. package/dist/calc/asset-disposal.js +17 -13
  44. package/dist/calc/fixed-deposit.js +26 -17
  45. package/dist/calc/lease.js +7 -3
  46. package/dist/commands/jobs.js +184 -0
  47. package/dist/index.js +2 -0
  48. package/dist/jobs/audit-prep.js +211 -0
  49. package/dist/jobs/bank-recon.js +163 -0
  50. package/dist/jobs/credit-control.js +126 -0
  51. package/dist/jobs/fa-review.js +121 -0
  52. package/dist/jobs/format.js +102 -0
  53. package/dist/jobs/gst-vat.js +187 -0
  54. package/dist/jobs/month-end.js +232 -0
  55. package/dist/jobs/payment-run.js +199 -0
  56. package/dist/jobs/quarter-end.js +135 -0
  57. package/dist/jobs/supplier-recon.js +132 -0
  58. package/dist/jobs/types.js +36 -0
  59. package/dist/jobs/validate.js +115 -0
  60. package/dist/jobs/year-end.js +153 -0
  61. package/dist/types/index.js +2 -1
  62. package/package.json +5 -2
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: api
3
- version: 2.6.0
3
+ version: 2.8.0
4
4
  description: Complete reference for the Jaz/Juan REST API — the accounting platform backend. Use this skill whenever building, modifying, debugging, or extending any code that calls the API — including API clients, integrations, data seeding, test data, or new endpoint work. Contains every field name, response shape, error, gotcha, and edge case discovered through live production testing.
5
5
  license: MIT
6
6
  compatibility: Requires Jaz/Juan API key (x-jk-api-key header). Works with Claude Code, Claude Cowork, Claude.ai, and any agent that reads markdown.
@@ -22,7 +22,7 @@ You are working with the **Jaz/Juan REST API** — the backend for Jaz (Singapor
22
22
 
23
23
  **Base URL**: `https://api.getjaz.com`
24
24
  **Auth**: `x-jk-api-key: <key>` header on every request — key has `jk-` prefix (e.g., `jk-a1b2c3...`). NOT `Authorization: Bearer` or `x-api-key`.
25
- **Content-Type**: `application/json` for all POST/PUT/PATCH
25
+ **Content-Type**: `application/json` for all POST/PUT/PATCH (except multipart endpoints: `createBusinessTransactionFromAttachment` FILE mode, `importBankStatementFromAttachment`, and attachment uploads)
26
26
  **All paths are prefixed**: `/api/v1/` (e.g., `https://api.getjaz.com/api/v1/invoices`)
27
27
 
28
28
  ## Critical Rules
@@ -129,6 +129,14 @@ You are working with the **Jaz/Juan REST API** — the backend for Jaz (Singapor
129
129
  55. **Scheduled endpoints support date aliases** — `txnDateAliases` middleware (mapping `issueDate`/`date` → `valueDate`) now applies to all scheduled create/update endpoints: `POST/PUT /scheduled/invoices`, `POST/PUT /scheduled/bills`, `POST/PUT /scheduled/journals`, `POST/PUT /scheduled/subscriptions`.
130
130
  56. **Kebab-case URL aliases** — `capsuleTypes` endpoints also accept kebab-case paths: `/capsule-types` (list, search, CRUD). `moveTransactionCapsules` also accepts `/move-transaction-capsules`. Both camelCase and kebab-case work identically.
131
131
 
132
+ ### Jaz Magic — Extraction & Autofill
133
+ 57. **When the user starts from an attachment, always use Jaz Magic** — if the input is a PDF, JPG, or any document image (invoice, bill, receipt), the correct path is `POST /magic/createBusinessTransactionFromAttachment`. Do NOT manually construct a `POST /invoices` or `POST /bills` payload from an attachment — Jaz Magic handles the entire extraction-and-autofill pipeline server-side: OCR, line item detection, contact matching, CoA auto-mapping via ML learning, and draft creation with all fields pre-filled. Only use `POST /invoices` or `POST /bills` when building transactions from structured data (JSON, CSV, database rows) where the fields are already known.
134
+ 58. **Two upload modes with different content types** — `sourceType: "FILE"` requires **multipart/form-data** with `sourceFile` blob (JSON body fails with 400 "sourceFile is a required field"). `sourceType: "URL"` accepts **application/json** with `sourceURL` string. The OAS only documents URL mode — FILE mode (the common case) is undocumented.
135
+ 59. **Three required fields**: `sourceFile` (multipart blob — NOT `file`), `businessTransactionType` (`"INVOICE"` or `"BILL"` only — `EXPENSE` rejected), `sourceType` (`"FILE"` or `"URL"`). All three are validated server-side.
136
+ 60. **Response maps transaction types**: Request `BILL` → response `businessTransactionType: "PURCHASE"`. Request `INVOICE` → response `businessTransactionType: "SALE"`. S3 paths follow: `/purchases/` vs `/sales/`.
137
+ 61. **Extraction is asynchronous** — the API response is immediate (file upload confirmation only). The actual Magic pipeline — OCR, line item extraction, contact matching, CoA learning, and autofill — runs asynchronously. The `subscriptionFBPath` in the response (e.g., `magic_transactions/{orgId}/purchase/{fileId}`) is a Firebase Realtime Database path for subscribing to extraction status updates.
138
+ 62. **Accepts PDF and JPG/JPEG** — both file types confirmed working. Handwritten documents are accepted at upload stage (extraction quality varies). `fileType` in response reflects actual format: `"PDF"`, `"JPEG"`.
139
+
132
140
  ## Supporting Files
133
141
 
134
142
  For detailed reference, read these files in this skill directory:
@@ -154,6 +162,8 @@ The backend DX overhaul is live. Key improvements now available:
154
162
 
155
163
  ## Recommended Client Patterns
156
164
 
165
+ - **Starting from an attachment?** → Use Jaz Magic (`POST /magic/createBusinessTransactionFromAttachment`). Never manually parse a PDF/JPG to construct `POST /invoices` or `POST /bills` — let the extraction & autofill pipeline handle it.
166
+ - **Starting from structured data?** → Use `POST /invoices` or `POST /bills` directly with the known field values.
157
167
  - **Serialization (Python)**: `model_dump(mode="json", by_alias=True, exclude_unset=True, exclude_none=True)`
158
168
  - **Field names**: All request bodies use camelCase
159
169
  - **Date serialization**: Python `date` type → `YYYY-MM-DD` strings
@@ -54,8 +54,9 @@ Resources MUST be created in this order. Steps at the same level can run in para
54
54
  - `POST /items` → create items (needs CoA + tax profile IDs from Levels 0-1)
55
55
 
56
56
  ### Level 3: Transactions (parallel)
57
- - `POST /invoices` → create invoices (needs contacts + CoA + tax profiles)
58
- - `POST /bills` → create bills (same deps, can embed payments)
57
+ - `POST /magic/createBusinessTransactionFromAttachment` → **starting from an attachment (PDF/JPG)?** Use Jaz Magic extraction & autofill creates a draft invoice or bill with all fields pre-filled. See SKILL.md Rules 57-62.
58
+ - `POST /invoices` → create invoices from structured data (needs contacts + CoA + tax profiles)
59
+ - `POST /bills` → create bills from structured data (same deps, can embed payments)
59
60
  - `POST /journals` → create journal entries (needs CoA)
60
61
  - `POST /cash-in-journals` → cash receipts (needs bank account from CoA)
61
62
  - `POST /cash-out-journals` → cash payments (needs bank account from CoA)
@@ -790,6 +790,84 @@ Valid `datatypeCode`: `TEXT`, `NUMBER`, `BOOLEAN`, `DATE`, `LINK`.
790
790
 
791
791
  ---
792
792
 
793
+ ## 14g. Jaz Magic — Extraction & Autofill
794
+
795
+ ### POST /api/v1/magic/createBusinessTransactionFromAttachment
796
+
797
+ **When the user starts from an attachment (PDF, JPG, document image), this is the endpoint to use.** Do not manually parse files to construct `POST /invoices` or `POST /bills` — Jaz Magic handles the full extraction-and-autofill pipeline server-side: OCR, line item detection, contact matching, and CoA auto-mapping via ML learning. Creates a complete draft transaction with all fields pre-filled. Use `POST /invoices` or `POST /bills` only when building from structured data where the fields are already known.
798
+
799
+ Processing is **asynchronous** — the API response confirms file upload immediately. The extraction pipeline runs server-side and pushes status updates via Firebase Realtime Database.
800
+
801
+ **Two modes** — content type depends on `sourceType`:
802
+
803
+ #### FILE mode (multipart/form-data) — most common
804
+
805
+ ```
806
+ POST /api/v1/magic/createBusinessTransactionFromAttachment
807
+ Content-Type: multipart/form-data
808
+
809
+ Fields:
810
+ - sourceFile: PDF or JPG file blob (NOT "file")
811
+ - businessTransactionType: "INVOICE" or "BILL" (NOT "EXPENSE")
812
+ - sourceType: "FILE"
813
+ ```
814
+
815
+ ```json
816
+ / Response (201):
817
+ {
818
+ "data": {
819
+ "businessTransactionType": "PURCHASE",
820
+ "filename": "NB64458.pdf",
821
+ "invalidFiles": [],
822
+ "validFiles": [{
823
+ "subscriptionFBPath": "magic_transactions/{orgId}/purchase/{fileId}",
824
+ "errorCode": null,
825
+ "errorMessage": null,
826
+ "fileDetails": {
827
+ "fileId": "6e999313b8b53ccef0757394ee6c7e6a",
828
+ "fileType": "PDF",
829
+ "fileURL": "https://s3.ap-southeast-1.amazonaws.com/.../{resourceId}.PDF",
830
+ "fileName": "NB64458.pdf"
831
+ }
832
+ }]
833
+ }
834
+ }
835
+ ```
836
+
837
+ #### URL mode (application/json) — for remote files
838
+
839
+ ```json
840
+ / Request:
841
+ POST /api/v1/magic/createBusinessTransactionFromAttachment
842
+ Content-Type: application/json
843
+
844
+ {
845
+ "businessTransactionType": "BILL",
846
+ "sourceType": "URL",
847
+ "sourceURL": "https://example.com/invoice.pdf"
848
+ }
849
+
850
+ / Response: same shape as FILE mode
851
+ ```
852
+
853
+ **What Jaz Magic extracts and autofills:**
854
+ - Line items (description, quantity, unit price, amounts)
855
+ - Contact name and details (matched against existing contacts)
856
+ - Chart of Accounts mapping (ML-based learning from past transactions)
857
+ - Tax amounts and profiles
858
+ - Document reference numbers, dates, currency
859
+
860
+ **Key gotchas:**
861
+ - `sourceFile` is the field name (NOT `file`) — same pattern as bank statement endpoint
862
+ - Only `INVOICE` and `BILL` accepted — `EXPENSE` returns 422
863
+ - Response maps types: `INVOICE` → `SALE`, `BILL` → `PURCHASE`
864
+ - JSON body with `sourceType: "FILE"` always fails (400) — MUST use multipart
865
+ - `subscriptionFBPath` is the Firebase path for tracking extraction progress
866
+ - All three fields (`sourceFile`/`sourceURL`, `businessTransactionType`, `sourceType`) are required — omitting any returns 422
867
+ - File types confirmed: PDF, JPG/JPEG (handwritten documents accepted — extraction quality varies)
868
+
869
+ ---
870
+
793
871
  ## 15. Bank Records
794
872
 
795
873
  ### POST /api/v1/magic/importBankStatementFromAttachment (multipart)
@@ -14,7 +14,7 @@ Key capabilities: draft/approval workflows, multi-currency (auto-fetch ECB rates
14
14
 
15
15
  If payment date equals invoice date, it's recorded as a cash transaction (not AR). Transaction fees are deducted from cash received. RGL = `(Invoice payment / Transaction Rate) - (Cash received / Payment Rate)`.
16
16
 
17
- **API**: CRUD `GET/POST/PUT/DELETE /invoices`, `POST /invoices/search`, `POST /invoices/:id/payments`, `GET /invoices/:id/payments`, `POST /invoices/:id/credits`, `GET /invoices/:id/download`, `POST/GET/DELETE /invoices/:id/attachments`, `PUT /invoices/:id/approve`, `POST /scheduled/invoices` (CRUD), `POST /scheduled/subscriptions` (recurring). Generic payment ops: `GET/PUT/DELETE /payments/:id`
17
+ **API**: CRUD `GET/POST/PUT/DELETE /invoices`, `POST /invoices/search`, `POST /invoices/:id/payments`, `GET /invoices/:id/payments`, `POST /invoices/:id/credits`, `GET /invoices/:id/download`, `POST/GET/DELETE /invoices/:id/attachments`, `PUT /invoices/:id/approve`, `POST /scheduled/invoices` (CRUD), `POST /scheduled/subscriptions` (recurring). Generic payment ops: `GET/PUT/DELETE /payments/:id`. **Starting from a PDF/JPG attachment?** Use `POST /magic/createBusinessTransactionFromAttachment` instead — Jaz Magic handles extraction & autofill (see AI Agents section).
18
18
 
19
19
  ---
20
20
 
@@ -26,7 +26,7 @@ Key capabilities: bill receipts (short-form template creating bill + payment tog
26
26
 
27
27
  Transaction fees are added to cash spent (not deducted like invoices). RGL = `(Cash spent / Payment rate) - (Bill payment / Transaction rate)`.
28
28
 
29
- **API**: CRUD `GET/POST/PUT/DELETE /bills`, `POST /bills/search`, `POST /bills/:id/payments`, `GET /bills/:id/payments`, `POST /bills/:id/credits`, `POST/GET/DELETE /bills/:id/attachments`, `PUT /bills/:id/approve`, `POST /scheduled/bills` (CRUD). Generic payment ops: `GET/PUT/DELETE /payments/:id`
29
+ **API**: CRUD `GET/POST/PUT/DELETE /bills`, `POST /bills/search`, `POST /bills/:id/payments`, `GET /bills/:id/payments`, `POST /bills/:id/credits`, `POST/GET/DELETE /bills/:id/attachments`, `PUT /bills/:id/approve`, `POST /scheduled/bills` (CRUD). Generic payment ops: `GET/PUT/DELETE /payments/:id`. **Starting from a PDF/JPG attachment?** Use `POST /magic/createBusinessTransactionFromAttachment` instead — Jaz Magic handles extraction & autofill (see AI Agents section).
30
30
 
31
31
  ---
32
32
 
@@ -173,9 +173,9 @@ Fixed assets lock their linked line items — cannot edit account, amounts, or e
173
173
 
174
174
  **Agent Builder**: Configure custom AI agents in Settings > Agent Builder with name, email (a-z, 0-9, + symbol), and workflow preferences.
175
175
 
176
- **Jaz Magic**: Contact-level setting controlling auto-extraction behavior line items (detailed extraction), summary totals (single amount), or none. Up to 10 images can be merged into a single PDF.
176
+ **Jaz Magic**: The extraction & autofill engine. When users start from an attachment (PDF, JPG, document image), Jaz Magic is the correct path — it handles OCR, line item detection, contact matching, and CoA auto-mapping via ML learning, producing a complete draft transaction. Contact-level settings control extraction behavior: line items (detailed extraction), summary totals (single amount), or none. Up to 10 images can be merged into a single PDF. **Do not manually parse attachments to construct `POST /invoices` or `POST /bills` — always use Jaz Magic when the input is a file.**
177
177
 
178
- **API**: `POST /magic/createBusinessTransactionFromAttachment` (OCR PDF → draft transaction), `POST /magic/importBankStatementFromAttachment`, `PUT /invoices/magic-update`, `PUT /bills/magic-update`, `PUT /journals/magic-update`, `GET /invoices/magic-search`, `GET /bills/magic-search` (all magic endpoints use `x-magic-api-key`)
178
+ **API**: `POST /magic/createBusinessTransactionFromAttachment` (**attachment → draft transaction** — the primary endpoint for file-based creation), `POST /magic/importBankStatementFromAttachment` (bank statements), `PUT /invoices/magic-update`, `PUT /bills/magic-update`, `PUT /journals/magic-update`, `GET /invoices/magic-search`, `GET /bills/magic-search` (all magic endpoints use `x-magic-api-key`)
179
179
 
180
180
  ---
181
181
 
@@ -260,6 +260,23 @@ When POSTing, `classificationType` must be one of these exact strings (same as `
260
260
 
261
261
  ---
262
262
 
263
+ ## Jaz Magic — Extraction & Autofill
264
+
265
+ | What You'd Guess | Actual API Field | Notes |
266
+ |------------------|-------------------|-------|
267
+ | `file` | `sourceFile` | Multipart blob — same pattern as bank statement |
268
+ | `type: "BILL"` | `businessTransactionType: "BILL"` | Request accepts `INVOICE` or `BILL` only |
269
+ | Response `"BILL"` | Response `"PURCHASE"` | Response maps: `BILL` → `PURCHASE`, `INVOICE` → `SALE` |
270
+ | JSON body | multipart/form-data | FILE mode requires multipart — JSON returns 400 |
271
+ | Sync response | Async extraction | Response = upload confirmation; extraction & autofill run async |
272
+ | `status` field | `subscriptionFBPath` | Firebase path for tracking extraction progress |
273
+
274
+ **Content-Type depends on sourceType:**
275
+ - `sourceType: "FILE"` → `Content-Type: multipart/form-data` (MUST use multipart)
276
+ - `sourceType: "URL"` → `Content-Type: application/json` (JSON body works)
277
+
278
+ ---
279
+
263
280
  ## Bank Records
264
281
 
265
282
  | What You'd Guess | Actual API Field | Notes |
@@ -386,7 +386,7 @@
386
386
 
387
387
  | Method | Path | Description |
388
388
  |--------|------|-------------|
389
- | POST | `/magic/createBusinessTransactionFromAttachment` | OCR: Convert PDF → transaction |
389
+ | POST | `/magic/createBusinessTransactionFromAttachment` | **Jaz Magic: Extraction & Autofill.** Upload PDF/JPGfull extraction pipeline (OCR, line items, contact matching, CoA ML learning) → draft invoice or bill with all fields autofilled. FILE mode = multipart (`sourceFile` blob), URL mode = JSON (`sourceURL`). Async — returns `subscriptionFBPath` for tracking extraction progress. Request `INVOICE` → response `SALE`, `BILL` → `PURCHASE`. |
390
390
  | POST | `/magic/importBankStatementFromAttachment` | Convert bank statement → entries |
391
391
  | PUT | `/invoices/magic-update` | AI-enhanced invoice update |
392
392
  | PUT | `/bills/magic-update` | AI-enhanced bill update |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: conversion
3
- version: 2.6.0
3
+ version: 2.8.0
4
4
  description: Accounting data conversion skill — migrates customer data from Xero, QuickBooks, Sage, MYOB, and Excel exports to Jaz. Covers config, quick, and full conversion workflows, Excel parsing, CoA/contact/tax/items mapping, clearing accounts, TTB, and TB verification.
5
5
  ---
6
6
 
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: jobs
3
+ version: 2.8.0
4
+ description: 10 accounting jobs for SMB bookkeepers and accountants — month-end, quarter-end, and year-end close playbooks plus 7 ad-hoc operational jobs (bank recon, GST/VAT filing, payment runs, credit control, supplier recon, audit prep, fixed asset review). Each job is a step-by-step blueprint with API calls, recipe references, calculator commands, and verification checks. Paired with an interactive CLI blueprint generator (jaz jobs).
5
+ license: MIT
6
+ compatibility: Works with Claude Code, Claude Cowork, Claude.ai, and any agent that reads markdown. For API payloads, load the jaz-api skill. For individual transaction patterns, load the transaction-recipes skill.
7
+ ---
8
+
9
+ # Jobs Skill
10
+
11
+ You are helping an **SMB accountant or bookkeeper** complete recurring accounting tasks in Jaz — period-end closes, bank reconciliation, tax filing, payment processing, and operational reviews. These are the real jobs that keep the books accurate and the business compliant.
12
+
13
+ **Jobs combine recipes, calculators, and API calls into complete business processes.** If recipes are ingredients, jobs are the meal.
14
+
15
+ ## When to Use This Skill
16
+
17
+ - Closing the books for a month, quarter, or year
18
+ - Catching up on bank reconciliation
19
+ - Preparing GST/VAT returns for filing
20
+ - Running a payment batch to clear outstanding bills
21
+ - Chasing overdue invoices (credit control)
22
+ - Reconciling supplier statements against AP ledger
23
+ - Preparing for an audit or tax filing
24
+ - Reviewing the fixed asset register
25
+
26
+ ## Job Catalog
27
+
28
+ ### Period-Close Jobs (Layered)
29
+
30
+ Period-close jobs build on each other. Quarter = month + extras. Year = quarter + extras. Each level runs **standalone by default** (includes all steps from lower levels). Use `--incremental` to generate only the extras.
31
+
32
+ | Job | CLI Command | Description |
33
+ |-----|-------------|-------------|
34
+ | **Month-End Close** | `jaz jobs month-end --period YYYY-MM` | 5 phases: pre-close prep, accruals, valuations, verification, lock. The foundation. |
35
+ | **Quarter-End Close** | `jaz jobs quarter-end --period YYYY-QN` | Month-end for each month + GST/VAT, ECL review, bonus accruals, intercompany, provisions. |
36
+ | **Year-End Close** | `jaz jobs year-end --period YYYY` | Quarter-end for each quarter + true-ups, dividends, CYE rollover, audit prep, final lock. |
37
+
38
+ ### Ad-Hoc Jobs
39
+
40
+ | Job | CLI Command | Description |
41
+ |-----|-------------|-------------|
42
+ | **Bank Recon** | `jaz jobs bank-recon` | Clear unreconciled items: match, categorize, resolve. |
43
+ | **GST/VAT Filing** | `jaz jobs gst-vat --period YYYY-QN` | Tax ledger review, discrepancy check, filing summary. |
44
+ | **Payment Run** | `jaz jobs payment-run` | Select outstanding bills by due date, process payments. |
45
+ | **Credit Control** | `jaz jobs credit-control` | AR aging review, overdue chase list, bad debt assessment. |
46
+ | **Supplier Recon** | `jaz jobs supplier-recon` | AP vs supplier statement, identify mismatches. |
47
+ | **Audit Preparation** | `jaz jobs audit-prep --period YYYY` | Compile reports, schedules, reconciliations for auditor/tax. |
48
+ | **FA Review** | `jaz jobs fa-review` | Fixed asset register review, disposal/write-off processing. |
49
+
50
+ ## How Jobs Work
51
+
52
+ Each job produces a **blueprint** — a phased checklist of steps, each annotated with:
53
+
54
+ - **API call** — the exact endpoint + request body to execute the step
55
+ - **Recipe reference** — link to the transaction-recipes skill for complex accounting patterns
56
+ - **Calculator command** — `jaz calc` command for financial calculations
57
+ - **Verification check** — how to confirm the step was completed correctly
58
+ - **Conditional flag** — steps that only apply in certain situations (e.g., "only if multi-currency org")
59
+
60
+ **For AI agents:** Read the blueprint and execute each step using the jaz-api skill for payloads.
61
+ **For developers:** Use `--json` output to build automation pipelines.
62
+ **For accountants:** Use the formatted checklist to work through the close systematically.
63
+
64
+ ## CLI Usage
65
+
66
+ ```bash
67
+ # Period-close (standalone = full plan, --incremental = extras only)
68
+ jaz jobs month-end --period 2025-01 [--currency SGD] [--json]
69
+ jaz jobs quarter-end --period 2025-Q1 [--incremental] [--json]
70
+ jaz jobs year-end --period 2025 [--incremental] [--json]
71
+
72
+ # Ad-hoc
73
+ jaz jobs bank-recon [--account "DBS Current"] [--period 2025-01] [--json]
74
+ jaz jobs gst-vat --period 2025-Q1 [--json]
75
+ jaz jobs payment-run [--due-before 2025-02-28] [--json]
76
+ jaz jobs credit-control [--overdue-days 30] [--json]
77
+ jaz jobs supplier-recon [--supplier "Acme Corp"] [--period 2025-01] [--json]
78
+ jaz jobs audit-prep --period 2025 [--json]
79
+ jaz jobs fa-review [--json]
80
+ ```
81
+
82
+ ## Relationship to Other Skills
83
+
84
+ | Skill | Role |
85
+ |-------|------|
86
+ | **api** | Provides the exact API payloads for each step (field names, gotchas, error handling) |
87
+ | **transaction-recipes** | Provides the accounting patterns for complex steps (accruals, FX reval, ECL, etc.) |
88
+ | **jobs** (this skill) | Combines recipes + API into sequenced, verifiable business processes |
89
+
90
+ **Load all three skills together** for the complete picture. Jobs reference recipes by name — an AI agent should read the referenced recipe for implementation details.
91
+
92
+ ## Supporting Files
93
+
94
+ - **[references/building-blocks.md](./references/building-blocks.md)** — Shared concepts: accounting periods, lock dates, period verification, conventions
95
+ - **[references/month-end-close.md](./references/month-end-close.md)** — Month-end close: 5 phases, ~18 steps
96
+ - **[references/quarter-end-close.md](./references/quarter-end-close.md)** — Quarter-end close: monthly + quarterly extras
97
+ - **[references/year-end-close.md](./references/year-end-close.md)** — Year-end close: quarterly + annual extras
98
+ - **[references/bank-recon.md](./references/bank-recon.md)** — Bank reconciliation catch-up
99
+ - **[references/gst-vat-filing.md](./references/gst-vat-filing.md)** — GST/VAT filing preparation
100
+ - **[references/payment-run.md](./references/payment-run.md)** — Payment run (bulk bill payments)
101
+ - **[references/credit-control.md](./references/credit-control.md)** — Credit control / AR chase
102
+ - **[references/supplier-recon.md](./references/supplier-recon.md)** — Supplier statement reconciliation
103
+ - **[references/audit-prep.md](./references/audit-prep.md)** — Audit preparation pack
104
+ - **[references/fa-review.md](./references/fa-review.md)** — Fixed asset register review
@@ -0,0 +1,319 @@
1
+ # Audit Preparation
2
+
3
+ Compile the complete report pack, supporting schedules, and reconciliations that an auditor or tax agent needs. For most SMBs, this is an annual exercise — either for the statutory audit (if required) or for the annual tax filing with IRAS (SG) or BIR (PH).
4
+
5
+ **CLI:** `jaz jobs audit-prep --period 2025 [--json]`
6
+
7
+ ---
8
+
9
+ ## Who Needs This
10
+
11
+ | Situation | SG | PH |
12
+ |-----------|----|----|
13
+ | **Statutory audit required** | Companies with revenue > S$10M, assets > S$10M, or employees > 50 | All stock corporations, companies with paid-up capital > PHP 50K |
14
+ | **Tax filing (no audit)** | All companies file Form C/C-S with IRAS | All companies file ITR with BIR |
15
+ | **Compilation by accountant** | Small exempt private companies — no audit but accountant prepares financial statements | N/A |
16
+
17
+ Even if you're a small exempt company not requiring an audit, your external accountant or tax agent needs the same reports to prepare your financial statements and tax return. This job produces the full pack.
18
+
19
+ ---
20
+
21
+ ## Phase 1: Core Financial Reports
22
+
23
+ Generate the three primary financial statements. These form the backbone of any audit or tax filing.
24
+
25
+ ### Step 1: Trial Balance
26
+
27
+ The master reconciliation tool. Everything else derives from this.
28
+
29
+ ```
30
+ POST /api/v1/generate-reports/trial-balance
31
+ { "startDate": "2025-01-01", "endDate": "2025-12-31" }
32
+ ```
33
+
34
+ **What the auditor checks:** Debits = Credits (always). Any imbalance indicates a system error.
35
+
36
+ ### Step 2: Profit & Loss Statement
37
+
38
+ ```
39
+ POST /api/v1/generate-reports/profit-and-loss
40
+ { "primarySnapshotDate": "2025-12-31", "secondarySnapshotDate": "2025-01-01" }
41
+ ```
42
+
43
+ **Comparative:** If the auditor needs prior year comparison:
44
+
45
+ ```
46
+ POST /api/v1/generate-reports/profit-and-loss
47
+ { "primarySnapshotDate": "2024-12-31", "secondarySnapshotDate": "2024-01-01" }
48
+ ```
49
+
50
+ ### Step 3: Balance Sheet
51
+
52
+ ```
53
+ POST /api/v1/generate-reports/balance-sheet
54
+ { "primarySnapshotDate": "2025-12-31" }
55
+ ```
56
+
57
+ **Key check:** Assets = Liabilities + Equity.
58
+
59
+ ---
60
+
61
+ ## Phase 2: Supporting Ledgers
62
+
63
+ Detailed transaction-level data behind the summary reports.
64
+
65
+ ### Step 4: General Ledger — grouped by account
66
+
67
+ ```
68
+ POST /api/v1/generate-reports/general-ledger
69
+ { "startDate": "2025-01-01", "endDate": "2025-12-31", "groupBy": "ACCOUNT" }
70
+ ```
71
+
72
+ This is the auditor's primary working document. Every transaction, grouped by CoA account, with opening balance, movements, and closing balance.
73
+
74
+ ### Step 5: Cashflow Statement
75
+
76
+ ```
77
+ POST /api/v1/generate-reports/cashflow
78
+ { "primaryStartDate": "2025-01-01", "primaryEndDate": "2025-12-31" }
79
+ ```
80
+
81
+ Classifies cash movements into Operating, Investing, and Financing activities.
82
+
83
+ ### Step 6: Equity Movement
84
+
85
+ ```
86
+ POST /api/v1/generate-reports/equity-movement
87
+ { "primarySnapshotStartDate": "2025-01-01", "primarySnapshotEndDate": "2025-12-31" }
88
+ ```
89
+
90
+ Shows opening equity, net profit, dividends, and other movements during the year.
91
+
92
+ ---
93
+
94
+ ## Phase 3: Aging Reports
95
+
96
+ ### Step 7: AR Aging (Accounts Receivable)
97
+
98
+ ```
99
+ POST /api/v1/generate-reports/ar-report
100
+ { "endDate": "2025-12-31" }
101
+ ```
102
+
103
+ **Auditor use:** Tests recoverability of receivables. Aging > 90 days triggers bad debt assessment. The AR total MUST tie to the Accounts Receivable balance on the trial balance.
104
+
105
+ ### Step 8: AP Aging (Accounts Payable)
106
+
107
+ ```
108
+ POST /api/v1/generate-reports/ap-report
109
+ { "endDate": "2025-12-31" }
110
+ ```
111
+
112
+ **Auditor use:** Completeness assertion — are all liabilities recorded? The AP total MUST tie to the Accounts Payable balance on the trial balance.
113
+
114
+ ---
115
+
116
+ ## Phase 4: Bank and Cash
117
+
118
+ ### Step 9: Bank Reconciliation Summary
119
+
120
+ ```
121
+ POST /api/v1/generate-reports/bank-reconciliation-summary
122
+ { "primarySnapshotDate": "2025-12-31" }
123
+ ```
124
+
125
+ **This is non-negotiable for auditors.** The bank recon proves that the cash balance per books matches the bank statement. Any unreconciled items at year-end must be explained.
126
+
127
+ **For detailed reconciliation (per bank account):**
128
+
129
+ ```
130
+ POST /api/v1/generate-reports/bank-reconciliation-details
131
+ { "primarySnapshotDate": "2025-12-31" }
132
+ ```
133
+
134
+ ### Step 10: Bank Balance Summary
135
+
136
+ ```
137
+ POST /api/v1/generate-reports/bank-balance-summary
138
+ { "primarySnapshotDate": "2025-12-31" }
139
+ ```
140
+
141
+ Summary of all bank account balances at year-end. Cross-reference to bank confirmation letters (which the auditor will request directly from your banks).
142
+
143
+ ---
144
+
145
+ ## Phase 5: Fixed Assets
146
+
147
+ ### Step 11: Fixed Assets Register
148
+
149
+ ```
150
+ POST /api/v1/generate-reports/fixed-assets-summary
151
+ ```
152
+
153
+ Shows all fixed assets: acquisition date, cost, depreciation method, useful life, accumulated depreciation, and net book value.
154
+
155
+ **For FA reconciliation (movements during the year):**
156
+
157
+ ```
158
+ POST /api/v1/generate-reports/fixed-assets-recon-summary
159
+ ```
160
+
161
+ This shows: opening NBV + additions - disposals - depreciation = closing NBV. The auditor reconciles this to the trial balance.
162
+
163
+ ---
164
+
165
+ ## Phase 6: Tax
166
+
167
+ ### Step 12: Tax Ledger / GST Summary
168
+
169
+ ```
170
+ POST /api/v1/generate-reports/vat-ledger
171
+ { "startDate": "2025-01-01", "endDate": "2025-12-31" }
172
+ ```
173
+
174
+ Full year tax ledger for the auditor to verify GST returns filed during the year. The annual total should reconcile to the sum of the four quarterly GST F5 returns.
175
+
176
+ ---
177
+
178
+ ## Phase 7: Data Exports
179
+
180
+ Auditors and tax agents often need the data in Excel format for their own workpapers.
181
+
182
+ ### Step 13: Export all key reports
183
+
184
+ ```
185
+ POST /api/v1/data-exports/trial-balance
186
+ { "startDate": "2025-01-01", "endDate": "2025-12-31" }
187
+ ```
188
+
189
+ ```
190
+ POST /api/v1/data-exports/profit-and-loss
191
+ { "startDate": "2025-01-01", "endDate": "2025-12-31" }
192
+ ```
193
+
194
+ ```
195
+ POST /api/v1/data-exports/general-ledger
196
+ { "startDate": "2025-01-01", "endDate": "2025-12-31", "groupBy": "ACCOUNT" }
197
+ ```
198
+
199
+ ```
200
+ POST /api/v1/data-exports/ar-report
201
+ { "endDate": "2025-12-31" }
202
+ ```
203
+
204
+ ```
205
+ POST /api/v1/data-exports/ap-report
206
+ { "endDate": "2025-12-31" }
207
+ ```
208
+
209
+ **Note:** Data export endpoints use simpler field names than generate-reports. P&L export uses `startDate`/`endDate` instead of `primarySnapshotDate`/`secondarySnapshotDate`.
210
+
211
+ ---
212
+
213
+ ## Phase 8: Supporting Schedules
214
+
215
+ These are typically prepared manually by extracting data from the general ledger. The schedules explain what sits behind specific balance sheet line items.
216
+
217
+ ### Step 14: Compile supporting schedules
218
+
219
+ **Prepaid Expenses Schedule:**
220
+ - Search the general ledger for prepaid asset accounts
221
+ - List each prepaid item: description, original amount, amortization to date, remaining balance
222
+ - If using capsules for prepaid workflows, group the GL by capsule for a clean view
223
+
224
+ **Loan Schedule:**
225
+ - For each active loan: original principal, interest rate, monthly payment, balance at year-end
226
+ - Extract from the loan capsule GL entries
227
+ - **Calculator:** `jaz calc loan` produces the full amortization table
228
+
229
+ **Provision Schedule:**
230
+ - List all provisions: ECL/bad debt, employee leave, warranty, legal, etc.
231
+ - For each: opening balance, additions, utilizations, reversals, closing balance
232
+ - ECL provision: `jaz calc ecl` for the year-end calculation
233
+
234
+ **Lease Schedule (if IFRS 16 applies):**
235
+ - Right-of-use asset: opening, depreciation, closing
236
+ - Lease liability: opening, interest, payments, closing
237
+ - **Calculator:** `jaz calc lease` for the complete schedule
238
+
239
+ **Fixed Deposit Schedule:**
240
+ - List all fixed deposits: bank, principal, rate, maturity date, accrued interest
241
+ - **Calculator:** `jaz calc fixed-deposit` for interest calculations
242
+
243
+ **Intercompany Balances (if applicable):**
244
+ - Receivables and payables with related parties
245
+ - Must be disclosed separately in financial statements
246
+
247
+ ---
248
+
249
+ ## Phase 9: Final Checks
250
+
251
+ ### Step 15: Reconciliation checklist
252
+
253
+ Before handing the pack to the auditor, verify these tie:
254
+
255
+ | Account | Report | Should Match |
256
+ |---------|--------|-------------|
257
+ | Cash / Bank | Bank Recon Summary (Step 9) | Bank statements |
258
+ | Accounts Receivable | AR Aging (Step 7) | Trial balance AR line |
259
+ | Accounts Payable | AP Aging (Step 8) | Trial balance AP line |
260
+ | Fixed Assets (NBV) | FA Register (Step 11) | Trial balance FA lines |
261
+ | Revenue | P&L (Step 2) | GST return Box 1+2+3 totals |
262
+ | GST Receivable/Payable | Tax Ledger (Step 12) | Sum of quarterly GST returns |
263
+
264
+ ### Step 16: Review for completeness
265
+
266
+ Run through this checklist:
267
+
268
+ - [ ] All bank accounts reconciled at year-end (zero unreconciled items or documented timing differences)
269
+ - [ ] All supplier statements reconciled for major suppliers
270
+ - [ ] Lock date set to year-end (prevents backdated entries during audit)
271
+ - [ ] No draft transactions in the period (search for status = DRAFT and resolve)
272
+ - [ ] Depreciation posted for all 12 months
273
+ - [ ] Accruals and prepayments up to date
274
+ - [ ] Intercompany balances agree with counterparty
275
+ - [ ] Related party transactions identified and documented
276
+
277
+ ---
278
+
279
+ ## Audit Prep Checklist (Quick Reference)
280
+
281
+ | # | Step | Phase | Report/Endpoint |
282
+ |---|------|-------|----------------|
283
+ | 1 | Trial Balance | Core | `POST /generate-reports/trial-balance` |
284
+ | 2 | P&L | Core | `POST /generate-reports/profit-and-loss` |
285
+ | 3 | Balance Sheet | Core | `POST /generate-reports/balance-sheet` |
286
+ | 4 | General Ledger | Ledgers | `POST /generate-reports/general-ledger` |
287
+ | 5 | Cashflow | Ledgers | `POST /generate-reports/cashflow` |
288
+ | 6 | Equity Movement | Ledgers | `POST /generate-reports/equity-movement` |
289
+ | 7 | AR Aging | Aging | `POST /generate-reports/ar-report` |
290
+ | 8 | AP Aging | Aging | `POST /generate-reports/ap-report` |
291
+ | 9 | Bank Recon Summary | Bank | `POST /generate-reports/bank-reconciliation-summary` |
292
+ | 10 | Bank Balance Summary | Bank | `POST /generate-reports/bank-balance-summary` |
293
+ | 11 | FA Register | Assets | `POST /generate-reports/fixed-assets-summary` |
294
+ | 12 | Tax Ledger | Tax | `POST /generate-reports/vat-ledger` |
295
+ | 13 | Data Exports | Export | `POST /data-exports/*` |
296
+ | 14 | Supporting schedules | Schedules | Manual from GL + calculators |
297
+ | 15 | Reconciliation checks | Final | Cross-reference all reports |
298
+ | 16 | Completeness review | Final | Checklist |
299
+
300
+ ---
301
+
302
+ ## Tips for SMBs
303
+
304
+ **Start early.** Don't wait for the auditor's request list. Generate the report pack in January for the prior year and have it ready before the engagement begins. A well-prepared client gets a faster, cheaper audit.
305
+
306
+ **The auditor will ask for bank confirmation letters.** These are letters from your bank confirming balances at year-end. Request them from your bank in early January — they can take 2-4 weeks to arrive.
307
+
308
+ **Keep a "passed adjustments" list.** If the auditor proposes adjustments you disagree with (within materiality), track them. Below-materiality items may accumulate — the auditor must consider cumulative effect.
309
+
310
+ **IRAS filing deadlines (SG):**
311
+ - Form C-S/C: November 30 of the following year (e.g., FY 2025 due Nov 30, 2026)
312
+ - ECI (Estimated Chargeable Income): Within 3 months of financial year-end
313
+ - GST F5: 1 month after each quarter-end
314
+
315
+ **Common audit queries you can pre-empt:**
316
+ - "Can you provide a schedule of revenue by customer?" → Run AR summary report
317
+ - "What are the top 10 expenses?" → Run P&L, sort expense lines
318
+ - "Are there any related party transactions?" → Tag them during the year, not at audit time
319
+ - "Can you explain the $X increase in expenses?" → Have month-by-month P&L ready for variance analysis