jaz-clio 5.74.2 → 6.0.1

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 (45) hide show
  1. package/README.md +8 -8
  2. package/assets/skills/api/SKILL.md +3 -36
  3. package/assets/skills/cli/SKILL.md +18 -28
  4. package/assets/skills/cli/references/agent-gotchas.md +2 -2
  5. package/assets/skills/cli/references/command-catalog.md +15 -31
  6. package/assets/skills/cli/references/common-workflows.md +19 -28
  7. package/assets/skills/conversion/SKILL.md +1 -1
  8. package/assets/skills/jaz-kit/SKILL.md +1 -1
  9. package/assets/skills/jaz-kit/references/flows.md +2 -2
  10. package/assets/skills/jaz-pseudo-sql/SKILL.md +1 -1
  11. package/assets/skills/jobs/SKILL.md +42 -42
  12. package/assets/skills/jobs/references/audit-prep.md +8 -8
  13. package/assets/skills/jobs/references/bank-match.md +1 -1
  14. package/assets/skills/jobs/references/bank-recon.md +6 -6
  15. package/assets/skills/jobs/references/building-blocks.md +49 -30
  16. package/assets/skills/jobs/references/credit-control.md +13 -12
  17. package/assets/skills/jobs/references/document-collection.md +6 -6
  18. package/assets/skills/jobs/references/fa-review.md +28 -29
  19. package/assets/skills/jobs/references/gst-vat-filing.md +3 -3
  20. package/assets/skills/jobs/references/month-end-close.md +37 -33
  21. package/assets/skills/jobs/references/payment-run.md +3 -4
  22. package/assets/skills/jobs/references/quarter-end-close.md +20 -18
  23. package/assets/skills/jobs/references/supplier-recon.md +5 -5
  24. package/assets/skills/jobs/references/year-end-close.md +31 -21
  25. package/assets/skills/transaction-recipes/SKILL.md +54 -117
  26. package/assets/skills/transaction-recipes/references/accrued-expenses.md +86 -61
  27. package/assets/skills/transaction-recipes/references/asset-disposal.md +135 -93
  28. package/assets/skills/transaction-recipes/references/bad-debt-provision.md +87 -65
  29. package/assets/skills/transaction-recipes/references/bank-loan.md +104 -70
  30. package/assets/skills/transaction-recipes/references/building-blocks.md +168 -72
  31. package/assets/skills/transaction-recipes/references/capital-wip.md +9 -8
  32. package/assets/skills/transaction-recipes/references/declining-balance.md +91 -64
  33. package/assets/skills/transaction-recipes/references/deferred-revenue.md +105 -68
  34. package/assets/skills/transaction-recipes/references/dividend.md +100 -64
  35. package/assets/skills/transaction-recipes/references/employee-accruals.md +111 -73
  36. package/assets/skills/transaction-recipes/references/fixed-deposit.md +116 -63
  37. package/assets/skills/transaction-recipes/references/fx-revaluation.md +28 -19
  38. package/assets/skills/transaction-recipes/references/hire-purchase.md +45 -44
  39. package/assets/skills/transaction-recipes/references/ifrs16-lease.md +108 -73
  40. package/assets/skills/transaction-recipes/references/intercompany.md +8 -6
  41. package/assets/skills/transaction-recipes/references/prepaid-amortization.md +104 -65
  42. package/assets/skills/transaction-recipes/references/provisions.md +116 -64
  43. package/assets/templates/platform-rules/jaz-agent-rules.md +10 -9
  44. package/cli.mjs +528 -606
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-jobs
3
- version: 5.74.2
3
+ version: 6.0.1
4
4
  description: >-
5
5
  Use this skill for recurring accounting workflows: month/quarter/year-end
6
6
  close, bank reconciliation, GST/VAT filing, payment runs, credit control,
@@ -18,14 +18,24 @@ You are helping an **SMB accountant or bookkeeper** complete recurring accountin
18
18
 
19
19
  > **Jaz-native, not generic.** Every job in this skill names specific Jaz tools (`search_invoices`, `quick_reconcile`, `bulk_finalize_drafts`, `reconcile_with_payments`, report tools like `generate_trial_balance`, `download_export`), Jaz reconciliation modes, and Jaz capsule patterns. It is NOT an interchangeable accounting workflow reference; it is the operating manual for running these processes through the Jaz platform tools. When the playbook says "match bank entries", it means call the 5-phase cascade matcher (`clio jobs bank-recon match` for a local CLI run, or follow the cascade logic in `references/bank-match.md` and drive the `reconcile_*` tools directly), not "use any matching algorithm".
20
20
 
21
- **Jobs combine recipes, calculators, and platform tools into complete business processes.** If recipes are ingredients, jobs are the meal. Each per-job reference is the canonical end-to-end orchestration: it lists the phases, and for each step names the exact report tool, recipe, or API call to run.
21
+ **Jobs combine accounting patterns, calculators, and platform tools into complete business processes.** Each per-job reference is the only description of its job: it lists the phases, and for each step names the exact report tool, calculator, or API call to run.
22
22
 
23
23
  ## How to run a job
24
24
 
25
25
  You orchestrate the **real platform tools directly**, following the phase sequence in the per-job reference:
26
26
 
27
- - **Hosted / MCP agent (no shell):** the per-job reference is your checklist. Walk its phases in order and call the named platform tools: `plan_recipe` / `execute_recipe`, `search_invoices` / `search_bills` / `search_bank_records`, the `generate-reports/*` report tools (`generate_trial_balance`, `generate_aged_ar`, `generate_vat_ledger`, …), `reconcile_*`, `create_journal`, `bulk_finalize_drafts`, `update_account` lockDate, and so on. There is no separate "blueprint tool" to call; the reference IS the plan.
28
- - **Local CLI convenience:** if you're running `clio` in a terminal (e.g. Claude Code), `clio jobs <type> --json` prints the same phased checklist for the period so a human or script can follow it. This is a convenience, not the main path for a hosted agent; the platform tools above are the path that actually does the work.
27
+ - **The per-job reference is your checklist.** Walk its phases in order and call the named platform tools: `calculate`, `search_invoices` / `search_bills` / `search_bank_records`, the `generate-reports/*` report tools (`generate_trial_balance`, `generate_aged_ar`, `generate_vat_ledger`, …), `reconcile_*`, `create_capsule`, `create_journal`, `bulk_finalize_drafts`, `update_account` lockDate, and so on. There is no "blueprint tool" or checklist command to call; the reference IS the plan.
28
+ - **Local CLI helpers:** five `clio jobs` sub-tools do real work for specific steps (see "CLI helpers" below).
29
+
30
+ ### Scheduled and calculated entries
31
+
32
+ When a step needs a calculated schedule, do it in three steps (there is no one-call recipe execution):
33
+
34
+ 1. **Calculate:** `calculate` with `type` = `loan` | `lease` | `depreciation` | `prepaid-expense` | `deferred-revenue` | `ecl` | `provision` | `fixed-deposit` | `asset-disposal` | `accrued-expense` | `leave-accrual` | `dividend` (CLI: `clio calc <type> ... --json`). Offline; returns the schedule and, with a start date, dated steps with journal lines. Posts nothing.
35
+ 2. **Group:** `list_capsule_types`, then `create_capsule` with the matching `capsuleTypeResourceId` and a `title`.
36
+ 3. **Post:** one `create_journal` / `create_bill` / `create_invoice` / `create_cash_in` / `create_cash_out` per step, each with `capsuleResourceId`. A fixed amount repeating every period can be one `create_scheduled_journal` instead of N journals.
37
+
38
+ `fx-reval` is verification only: Jaz revalues foreign-currency balances itself, so never post its result.
29
39
 
30
40
  ## When to Use This Skill
31
41
 
@@ -43,71 +53,61 @@ You orchestrate the **real platform tools directly**, following the phase sequen
43
53
 
44
54
  ### Period-Close Jobs (Layered)
45
55
 
46
- 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.
56
+ Period-close jobs build on each other. Quarter = month + extras. Year = quarter + extras. Each reference covers the full run and marks which phases are the extras.
47
57
 
48
- | Job | CLI (local convenience) | Description |
49
- |-----|-------------------------|-------------|
50
- | **Month-End Close** | `clio jobs month-end --period YYYY-MM` | 5 phases: pre-close prep, accruals, valuations, verification, lock. The foundation. |
51
- | **Quarter-End Close** | `clio jobs quarter-end --period YYYY-QN` | Month-end for each month + GST/VAT, ECL review, bonus accruals, intercompany, provision unwinding. |
52
- | **Year-End Close** | `clio jobs year-end --period YYYY` | Quarter-end for each quarter + true-ups, dividends, retained-earnings rollover, audit prep, final lock. |
58
+ | Job | Reference | Description |
59
+ |-----|-----------|-------------|
60
+ | **Month-End Close** | `references/month-end-close.md` | 5 phases: pre-close prep, accruals, valuations, verification, lock. The foundation. |
61
+ | **Quarter-End Close** | `references/quarter-end-close.md` | Month-end for each month + GST/VAT, ECL review, bonus accruals, intercompany, provision unwinding. |
62
+ | **Year-End Close** | `references/year-end-close.md` | Quarter-end for each quarter + true-ups, dividends, retained-earnings rollover, audit prep, final lock. |
53
63
 
54
64
  ### Ad-Hoc Jobs
55
65
 
56
- | Job | CLI (local convenience) | Description |
57
- |-----|-------------------------|-------------|
58
- | **Bank Recon** | `clio jobs bank-recon` | Clear unreconciled items: match, categorize, resolve. **Match to EXISTING open bills/invoices/payments (`reconcile_with_payments`) is the primary path; create-new only when nothing matches.** Drive end-to-end via the `view_auto_reconciliation` decision gate: per-entry, so fetch ids with `search_bank_records` first (auto-commit high-confidence, checkpoint the rest; see `references/bank-recon.md` Step 4a). Cascade matcher: `clio jobs bank-recon match`. |
59
- | **Document Collection** | `clio jobs document-collection` | Scan and classify client documents from local directories and cloud links (Dropbox, Drive, OneDrive). Outputs file paths for upload via Jaz Magic. Ingest helper: `clio jobs document-collection ingest`. |
60
- | **GST/VAT Filing** | `clio jobs gst-vat --period YYYY-QN` | Tax ledger review, discrepancy check, filing summary. |
61
- | **Payment Run** | `clio jobs payment-run` | Select outstanding bills by due date, process payments. |
62
- | **Credit Control** | `clio jobs credit-control` | AR aging review, overdue chase list, bad debt assessment. Run on-demand when AR aging deteriorates. |
63
- | **Supplier Recon** | `clio jobs supplier-recon` | AP vs supplier statement, identify mismatches. Run for major suppliers and at year-end for audit AP confirmations. |
64
- | **Audit Preparation** | `clio jobs audit-prep --period YYYY` | Compile reports, schedules, reconciliations for auditor/tax. |
65
- | **FA Review** | `clio jobs fa-review` | Fixed asset register review, disposal/write-off processing. Run as part of year-end. |
66
- | **Statutory Filing** | `clio jobs statutory-filing` | Corporate income tax computation. CLI engines: `clio jobs statutory-filing sg-cs` (Form C-S computation), `clio jobs statutory-filing sg-ca` (capital allowance schedule). See the SG Form C-S section below. |
66
+ | Job | Reference | Description |
67
+ |-----|-----------|-------------|
68
+ | **Bank Recon** | `references/bank-recon.md` | Clear unreconciled items: match, categorize, resolve. **Match to EXISTING open bills/invoices/payments (`reconcile_with_payments`) is the primary path; create-new only when nothing matches.** Drive end-to-end via the `view_auto_reconciliation` decision gate: per-entry, so fetch ids with `search_bank_records` first (auto-commit high-confidence, checkpoint the rest; see `references/bank-recon.md` Step 4a). Cascade matcher: `clio jobs bank-recon match`. |
69
+ | **Document Collection** | `references/document-collection.md` | Scan and classify client documents from local directories and cloud links (Dropbox, Drive, OneDrive). Outputs file paths for upload via Jaz Magic. Ingest helper: `clio jobs document-collection ingest`. |
70
+ | **GST/VAT Filing** | `references/gst-vat-filing.md` | Tax ledger review, discrepancy check, filing summary. |
71
+ | **Payment Run** | `references/payment-run.md` | Select outstanding bills by due date, process payments. Outstanding-bills helper: `clio jobs payment-run outstanding`. |
72
+ | **Credit Control** | `references/credit-control.md` | AR aging review, overdue chase list, bad debt assessment. Run on-demand when AR aging deteriorates. |
73
+ | **Supplier Recon** | `references/supplier-recon.md` | AP vs supplier statement, identify mismatches. Run for major suppliers and at year-end for audit AP confirmations. |
74
+ | **Audit Preparation** | `references/audit-prep.md` | Compile reports, schedules, reconciliations for auditor/tax. |
75
+ | **FA Review** | `references/fa-review.md` | Fixed asset register review, disposal/write-off processing. Run as part of year-end. |
76
+ | **Statutory Filing** | `references/sg-tax/wizard-workflow.md` | Corporate income tax computation. CLI engines: `clio jobs statutory-filing sg-cs` (Form C-S computation), `clio jobs statutory-filing sg-ca` (capital allowance schedule). See the SG Form C-S section below. |
67
77
 
68
78
  ## How Jobs Work
69
79
 
70
80
  Each per-job reference is a **phased checklist** of steps. Each step names:
71
81
 
72
82
  - **API call**: the exact platform tool + request body to execute the step
73
- - **Recipe reference**: link to the transaction-recipes skill for complex accounting patterns
74
- - **Calculator command**: `clio calc` command for independent financial cross-checks
83
+ - **Recipe reference**: the transaction-recipes pattern behind a complex step
84
+ - **Calculator**: the `calculate` type (or `clio calc` command) for the schedule or cross-check
75
85
  - **Verification check**: how to confirm the step was completed correctly
76
86
  - **Conditional flag**: steps that only apply in certain situations (e.g., "only if multi-currency org")
77
87
 
78
88
  Steps that carry real judgment (hold, defer, accept a variance, resume after a failure) also name the jot to record at that moment via the `jot` tool. Mechanical steps never do: a jot marks a choice among real alternatives, not activity.
79
89
 
80
- **For AI agents (hosted or CLI):** walk the phases in the per-job reference and call the named platform tools directly. Use the jaz-api skill for payload shapes.
81
- **For developers / scripts:** `clio jobs <type> --json` prints the phased checklist as JSON to drive automation pipelines.
82
- **For accountants:** use the formatted checklist (`clio jobs <type>`) to work through the close systematically.
90
+ Use the jaz-api skill for payload shapes.
83
91
 
84
- ## CLI Usage (local convenience)
92
+ ## CLI helpers
85
93
 
86
- These commands print the phased checklist for a period. They are a terminal convenience; a hosted agent drives the platform tools named in each reference directly.
94
+ `clio jobs` holds five working sub-tools, not checklists.
87
95
 
88
96
  ```bash
89
- # Period-close (standalone = full plan, --incremental = extras only)
90
- clio jobs month-end --period 2025-01 [--currency SGD] [--json]
91
- clio jobs quarter-end --period 2025-Q1 [--incremental] [--json]
92
- clio jobs year-end --period 2025 [--incremental] [--json]
93
-
94
- # Ad-hoc
95
- clio jobs bank-recon [--account "DBS Current"] [--period 2025-01] [--json]
96
- clio jobs gst-vat --period 2025-Q1 [--json]
97
- clio jobs payment-run [--due-before 2025-02-28] [--json]
98
- clio jobs credit-control [--overdue-days 30] [--json]
99
- clio jobs supplier-recon [--supplier "Acme Corp"] [--period 2025-01] [--json]
100
- clio jobs audit-prep --period 2025 [--json]
101
- clio jobs fa-review [--json]
97
+ clio jobs bank-recon match --input bank-data.json [--tolerance 0.01] [--date-window 14] [--json]
98
+ clio jobs payment-run outstanding [--due-before 2025-02-28] [--supplier "Acme Corp"] [--currency SGD] [--json]
99
+ clio jobs document-collection ingest --source ./client-docs [--upload] [--bank-account "DBS Current"] [--json]
102
100
  ```
103
101
 
102
+ The other two, `clio jobs statutory-filing sg-cs` and `sg-ca`, are shown in the Singapore Form C-S section below.
103
+
104
104
  ## Relationship to Other Skills
105
105
 
106
106
  | Skill | Role |
107
107
  |-------|------|
108
108
  | **jaz-api** | Provides the exact API payloads for each step (field names, gotchas, error handling) |
109
109
  | **jaz-recipes** | Provides the accounting patterns for complex steps (accruals, FX reval, ECL, etc.) |
110
- | **jaz-jobs** (this skill) | Combines recipes + platform tools into sequenced, verifiable business processes |
110
+ | **jaz-jobs** (this skill) | Combines those patterns + platform tools into sequenced, verifiable business processes |
111
111
 
112
112
  **Load all three skills together** for the complete picture. Jobs reference recipes by name; read the referenced recipe for implementation details.
113
113
 
@@ -1,8 +1,8 @@
1
1
  # Audit Preparation
2
2
 
3
- > Compile the report pack + supporting schedules + reconciliations an auditor or tax agent needs to issue an opinion or file a return. Walk the steps below in order, calling the named platform tools directly. (Local CLI convenience: `clio jobs audit-prep --period <YYYY>` prints this same phased deliverables checklist.)
3
+ > Compile the report pack + supporting schedules + reconciliations an auditor or tax agent needs to issue an opinion or file a return. Walk the steps below in order, calling the named platform tools directly.
4
4
 
5
- ## Tools, recipes, calculators this job uses
5
+ ## Tools and calculators this job uses
6
6
 
7
7
  ### Platform tools: financial statements
8
8
  - **`generate_trial_balance(endDate: <FY-end>)`** (step 2): master reconciliation. Every other report ties back to this.
@@ -32,7 +32,7 @@
32
32
  ### Calculators (cross-check schedules, no API key needed)
33
33
  - **`clio calc loan --principal --rate --term --start-date --json`** (step 8): independent loan amortization for the loan schedule.
34
34
  - **`clio calc lease --payment --term --rate --json`** (step 8): IFRS 16 ROU + lease liability schedule.
35
- - **`clio calc ecl --receivables <json> --json`** (step 8): ECL provision matrix per IFRS 9.
35
+ - **`clio calc ecl --current --30d --60d --90d --120d --rates --json`** (step 8): ECL provision matrix per IFRS 9.
36
36
  - **`clio calc fixed-deposit --principal --rate --term --json`** (step 8): FD interest accrual.
37
37
  - **`clio calc depreciation --cost --salvage --life --method --json`** (step 8): per-asset depreciation cross-check vs FA register.
38
38
 
@@ -56,7 +56,7 @@ Even small exempt SG companies need this pack for the external accountant who pr
56
56
 
57
57
  ## Step 1: Scope the deliverables
58
58
 
59
- The jurisdiction-specific deliverable list. SG: TB / BS / P&L / CF / EM / AR aging / AP aging / bank recon / FA register / GST F5 yearly / supporting schedules. PH: same + ITR-specific schedules. (Local CLI: `clio jobs audit-prep --period 2025` prints this deliverables checklist.)
59
+ The jurisdiction-specific deliverable list. SG: TB / BS / P&L / CF / EM / AR aging / AP aging / bank recon / FA register / GST F5 yearly / supporting schedules. PH: same + ITR-specific schedules.
60
60
 
61
61
  ## Step 2: Trial balance (the master)
62
62
 
@@ -109,11 +109,11 @@ Use `endDate` not `startDate` (rule 36, point-in-time snapshot). Assert:
109
109
  - `aged_ar.totalOutstanding == TB['Accounts Receivable'].balance` (recoverability gate; auditor tests > 90d aging for ECL adequacy).
110
110
  - `aged_ap.totalOutstanding == TB['Accounts Payable'].balance` (completeness gate).
111
111
 
112
- If ECL provision feels inadequate for the > 90d bucket, run the ECL recipe immediately:
112
+ If ECL provision feels inadequate for the > 90d bucket, run the ECL calculator immediately:
113
113
  ```
114
- plan_recipe(recipe: 'ecl', buckets: <aged AR buckets as [{name, balance, rate}]>, existingProvision, startDate, ...)
114
+ calculate(type: 'ecl', buckets: <aged AR buckets as [{name, balance, rate}]>, existingProvision, startDate)
115
115
  ```
116
- And post any top-up provision via `execute_recipe`. This avoids an auditor-proposed adjustment at fieldwork.
116
+ And post any top-up provision yourself: `create_capsule` (type `ECL Provision`), then `create_journal` with `capsuleResourceId` (the three-step flow in `building-blocks.md` § Calculated schedules). This avoids an auditor-proposed adjustment at fieldwork.
117
117
 
118
118
  ## Step 7: Bank reconciliation (NON-NEGOTIABLE)
119
119
 
@@ -220,7 +220,7 @@ The SG Form C-S wizard walks the user field-by-field through the C-S form, prefi
220
220
  | Source | Error | Recovery |
221
221
  |--------|-------|----------|
222
222
  | `generate_*` | 422 `period_not_closed` | Year-end close incomplete. Route to `year-end-close.md` first. |
223
- | `generate_bank_recon_*` | `unreconciledCount > 0` | Route to `bank-recon.md`; do NOT hand pack with this open. |
223
+ | `generate_bank_recon_summary` / `generate_bank_recon_details` | `unreconciledCount > 0` | Route to `bank-recon.md`; do NOT hand pack with this open. |
224
224
  | `download_export` | 422 `period_too_long` | GL XLSX rejected for >12 months. Split into per-quarter exports. |
225
225
  | `download_export` | 504 timeout | Large org. Re-run with smaller `endDate` range or contact infrastructure team. |
226
226
  | `update_account` | 422 `lock_date_in_future` | The CoA `lockDate` must be ≤ the period end date. Use today if unsure. |
@@ -291,7 +291,7 @@ When bank records and transactions are in different currencies, the calculator a
291
291
 
292
292
  ## Integration with Bank Recon Job
293
293
 
294
- This calculator is designed to work as a pre-matching step in the `clio jobs bank-recon` workflow:
294
+ This calculator is designed to work as a pre-matching step in the bank recon job (`bank-recon.md`):
295
295
 
296
296
  1. **Pull data:** Fetch unreconciled bank records + cashflow transactions from Jaz API
297
297
  2. **Run matcher:** `clio jobs bank-recon match --input data.json --json`
@@ -1,8 +1,8 @@
1
1
  # Bank Reconciliation
2
2
 
3
- > Clear unreconciled bank statement entries by matching, creating, or flagging. Highest-leverage book-accuracy job in Jaz: clean cash means everything else has a fighting chance. Walk the steps below in order, calling the named platform tools directly. (Local CLI convenience: `clio jobs bank-recon` prints this same phased checklist.)
3
+ > Clear unreconciled bank statement entries by matching, creating, or flagging. Highest-leverage book-accuracy job in Jaz: clean cash means everything else has a fighting chance. Walk the steps below in order, calling the named platform tools directly.
4
4
 
5
- ## Tools, recipes, calculators this job uses
5
+ ## Tools and calculators this job uses
6
6
 
7
7
  ### Platform tools: discovery + auto-match
8
8
  - **`list_bank_accounts()`** (step 1): pull all bank-type CoA accounts (per `jaz-api/SKILL.md` rule 18: GET `/bank-accounts` returns flat array `[{...}]`, NOT the standard paginated `{ data, totalElements, totalPages }` shape; normalize before consuming).
@@ -29,7 +29,7 @@
29
29
  - **`reconcile_cash_transfer(...)`**: inter-account transfer.
30
30
 
31
31
  ### Platform tools: create missing transactions
32
- - **`mcp magic create --file <pdf>` / `create_bt_from_attachment(...)`** (step 6 path B): OCR + autofill bill or invoice from receipt PDF/JPG.
32
+ - **`create_bt_from_attachment(...)`** (step 6 path B): OCR + autofill bill or invoice from receipt PDF/JPG. Local CLI: `clio magic create --file <pdf> --type bill`.
33
33
  - **`create_cash_in(...)` / `create_cash_out(...)`** (step 6 path C): bank fees, interest, FX charges that have no source document.
34
34
  - **`create_bank_rule(...)`** (preventive): build a rule for any recurring pattern you handled this run (subscription, rent, utility) so it auto-applies next time.
35
35
 
@@ -50,7 +50,7 @@
50
50
 
51
51
  ## Steps
52
52
 
53
- Walk steps 1-8 below. (Local CLI: `clio jobs bank-recon --period 2025-01` prints the same phased checklist.)
53
+ Walk steps 1-8 below.
54
54
 
55
55
  ## Step 1: Discover bank accounts
56
56
 
@@ -156,7 +156,7 @@ For unreconciled rows that have no book-side counterpart yet:
156
156
 
157
157
  **Path B, has document (PDF/JPG):**
158
158
  ```
159
- mcp magic create --file <invoice-or-receipt-path>
159
+ clio magic create --file <invoice-or-receipt-path> --type bill # or --type invoice
160
160
  # OR equivalent MCP call:
161
161
  create_bt_from_attachment(
162
162
  businessTransactionType: 'BILL' | 'INVOICE',
@@ -259,7 +259,7 @@ Per account: `bookBalance == bankStatementBalance ± documentedTimingDifference`
259
259
 
260
260
  ## Tips
261
261
 
262
- - **Weekly cadence beats monthly catch-up.** Monday-morning 15-min recon vs end-of-month 3-hour scramble. Recipe + cascade matcher amortize across short queues much faster.
262
+ - **Weekly cadence beats monthly catch-up.** Monday-morning 15-min recon vs end-of-month 3-hour scramble. Bank rules + the cascade matcher clear short queues much faster.
263
263
  - **Bank rules are the highest-ROI investment.** Every recurring transaction (rent, subscription, utility) handled this run = a one-line `create_bank_rule` away from never seeing it again.
264
264
  - **Aspire + Airwallex direct feeds eliminate CSV imports.** No file step before step 2.
265
265
  - **Common bank-fee account suggestions:** `Bank Charges` / `Bank Fees` (Operating Expense), `Interest Expense` (for overdraft / loan interest paid to bank), `Interest Income` (savings / deposits), `Foreign Exchange Gain/Loss` (for FX conversion spreads).
@@ -1,6 +1,6 @@
1
1
  # Building Blocks for Jobs
2
2
 
3
- > Shared concepts every job uses. Names of platform tools + Jaz primitives + recipe-engine entry points. Read this before any per-job reference.
3
+ > Shared concepts every job uses. Names of platform tools + Jaz primitives + the calculate-then-post flow. Read this before any per-job reference.
4
4
 
5
5
  ## Accounting periods
6
6
 
@@ -48,46 +48,64 @@ Standard assertions:
48
48
  - TB AP == `generate_aged_ap(endDate)` total.
49
49
  - TB Cash == `generate_bank_balance_summary(primarySnapshotDate)` per-bank total (via `bank-recon.md`).
50
50
 
51
- ## Pre-emitted DRAFT journal pattern
51
+ ## Calculated schedules: calculate, capsule, post
52
52
 
53
- Recipe engine creates ALL future-dated journals upfront as DRAFT (loan: 60 monthly journals; prepaid-expense: 12 monthly journals; lease: termMonths monthly journals; etc.). The recipe engine does NOT use Jaz schedulers; pre-emitted DRAFTs are the canonical pattern.
53
+ There is no one-call "recipe" execution. Any job step that needs a schedule (loan, lease, prepaid, deferred revenue, accrual, ECL, provision, dividend, disposal) is three steps you perform yourself:
54
+
55
+ ```
56
+ calculate(type: 'prepaid-expense', amount: 12000, periods: 12, startDate: '2025-01-01')
57
+ list_capsule_types()
58
+ create_capsule(capsuleTypeResourceId: <type id>, title: <blueprint.capsuleName>, description: <blueprint.capsuleDescription>)
59
+ create_journal(valueDate: <step date>, autoReference: true, journalEntries: [<step lines>], capsuleResourceId: <capsule id>)
60
+ ```
61
+
62
+ 1. **`calculate`** is offline and read-only (local CLI: `clio calc <type> ... --json`). It returns the schedule and, when `startDate` is given, a `blueprint`: `capsuleType`, `capsuleName`, `capsuleDescription`, and `steps[]`, each with an `action` (`journal`, `bill`, `invoice`, `cash-in`, `cash-out`, `fixed-asset`, `note`), a `date`, and `lines[]` of `{account, debit, credit}`. Without a start date most calculators return the schedule only. It posts nothing.
63
+ 2. **Capsule:** `list_capsule_types`, match the blueprint's `capsuleType` by name, then `create_capsule`. If the type is missing, `create_capsule_type(displayName: <capsuleType>)` first.
64
+ 3. **Post each step** with the tool its `action` names: `create_journal`, `create_bill`, `create_invoice`, `create_cash_in`, `create_cash_out`, each with `capsuleResourceId`. The blueprint's `account` values are generic names ("Prepaid Asset", "Cash / Bank Account"): resolve each to the org's own account with `search_accounts` and confirm the mapping with the user before posting. A cash step can only carry lines on the side opposite the bank: if a cash-in or cash-out step has another line on the bank's side (for example withholding tax), post the net cash entry and a separate journal for that line. A fixed amount repeating every period can be one `create_scheduled_journal` instead of N journals.
65
+
66
+ `fx-reval` is verification only: Jaz revalues foreign-currency balances at period end, so posting its result double-counts.
67
+
68
+ ## Future-dated DRAFT journal pattern
69
+
70
+ When a schedule was posted up front as future-dated DRAFT journals (creates default to draft), each close finalizes the current period's journal:
54
71
 
55
- Monthly action per recipe-managed capsule:
56
72
  ```
57
73
  search_journals(filter: {valueDate: {between: [<period-start>, <period-end>]}, status: {eq: 'DRAFT'}})
58
- update_journal(resourceId: <this period's pre-emitted journal>, saveAsDraft: false)
74
+ update_journal(resourceId: <this period's journal>, saveAsDraft: false)
59
75
  ```
60
76
 
61
- For Jaz-scheduler-driven recurrences (`create_scheduled_journal`, `create_scheduled_invoice`, `create_scheduled_bill`, subscriptions): scheduler templates auto-fire and create new ACTIVE entries each period. Different primitive; the recipe engine doesn't use these.
77
+ For Jaz-scheduler-driven recurrences (`create_scheduled_journal`, `create_scheduled_invoice`, `create_scheduled_bill`, subscriptions): scheduler templates auto-fire and create new ACTIVE entries each period, so there is nothing to finalize.
62
78
 
63
79
  ## Capsule conventions
64
80
 
65
- Every recipe-engine call attaches its outputs to a capsule. Search across all capsules of a type for cross-cutting reporting:
81
+ Every calculated schedule is posted into a capsule. Search across capsules for cross-cutting reporting:
66
82
 
67
83
  ```
68
84
  search_capsules(filter: {status: {eq: 'ACTIVE'}})
69
85
  ```
70
86
 
71
- Capsule types used by jobs:
72
- - `Prepaid Expenses`: recipe `prepaid-expense`
73
- - `Deferred Revenue`: recipe `deferred-revenue`
74
- - `Accrued Expenses`: recipe `accrued-expense` (also bonus accruals)
75
- - `Loan Repayment`: recipe `loan`
76
- - `Lease`: recipe `lease` (incl. hire-purchase)
77
- - `Depreciation`: recipe `depreciation` (DDB / 150DB; SL goes through Jaz native FA)
78
- - `Fixed Deposit`: recipe `fixed-deposit`
79
- - `Asset Disposal`: recipe `asset-disposal`
80
- - `Provisions`: recipe `provision` (IAS 37)
81
- - `ECL Provision`: recipe `ecl` (IFRS 9 simplified)
82
- - `Employee Benefits`: recipes `leave-accrual` + `accrued-expense` (bonus)
83
- - `Dividends`: recipe `dividend`
84
- - `Intercompany`: manual (no engine)
87
+ Capsule types used by jobs (the `capsuleType` each calculator's blueprint names):
88
+ - `Prepaid Expenses`: calculator `prepaid-expense`
89
+ - `Deferred Revenue`: calculator `deferred-revenue`
90
+ - `Accrued Expenses`: calculator `accrued-expense` (also bonus accruals)
91
+ - `Loan Repayment`: calculator `loan`
92
+ - `Lease Accounting`: calculator `lease`
93
+ - `Hire Purchase`: calculator `lease` with a useful life (hire purchase)
94
+ - `Depreciation`: calculator `depreciation` (DDB / 150DB; SL goes through Jaz native FA)
95
+ - `Fixed Deposit`: calculator `fixed-deposit`
96
+ - `Asset Disposal`: calculator `asset-disposal`
97
+ - `Provisions`: calculator `provision` (IAS 37)
98
+ - `ECL Provision`: calculator `ecl` (IFRS 9 simplified)
99
+ - `Employee Benefits`: calculators `leave-accrual` + `accrued-expense` (bonus)
100
+ - `Dividends`: calculator `dividend`
101
+ - `Intercompany`: manual (no calculator)
85
102
  - `Capital Projects`: manual (CWIP-to-FA)
86
103
  - `M&A` / `Restructuring` / `Insurance Claim` / `Bad Debt Write-off` / `Investments`: manual (per `transaction-recipes/references/building-blocks.md` § Capsules)
87
104
 
88
105
  Group GL by capsule for the auditor:
89
106
  ```
90
- get_capsule(resourceId) # returns totalTransactions (a COUNT), not the transactions; GL cannot group by capsule
107
+ generate_general_ledger(startDate: <period-start>, endDate: <period-end>, groupBy: 'CAPSULE') # the ledger grouped by capsule
108
+ get_capsule(resourceId) # returns totalTransactions (a COUNT), not the transactions
91
109
  ```
92
110
 
93
111
  ## Platform tools every job uses
@@ -103,8 +121,9 @@ get_capsule(resourceId) # returns totalTransactions (a COUNT), not the transac
103
121
  | `generate_general_ledger` | Investigation + audit-prep |
104
122
  | `generate_fa_summary` / `generate_fa_recon_summary` | FA review, year-end |
105
123
  | `search_journals` / `search_invoices` / `search_bills` | Discovery + filter, every job |
106
- | `search_capsules` | Recipe-managed lifecycle discovery |
107
- | `bulk_finalize_drafts` | Monthly-close + every job that finalizes pre-emitted DRAFTs |
124
+ | `calculate` | Schedules + journal lines for every calculated step (posts nothing) |
125
+ | `search_capsules` | Capsule lifecycle discovery |
126
+ | `bulk_finalize_drafts` / `bulk_update_journals` | Monthly-close + every job that finalizes DRAFTs (journals go through `bulk_update_journals`) |
108
127
  | `update_account` lockDate | Period close |
109
128
 
110
129
  ## Job sequencing
@@ -113,7 +132,7 @@ Period-close jobs layer on each other; the ad-hoc jobs slot into the period clos
113
132
 
114
133
  | Job | Builds on / invokes |
115
134
  |-----|---------------------|
116
- | `month-end-close` | foundation: bank-recon (step 3), document-collection (capture late bills), per-recipe finalize (accruals, prepaid, deferred, depreciation, loan) |
135
+ | `month-end-close` | foundation: bank-recon (step 3), document-collection (capture late bills), per-schedule finalize (accruals, prepaid, deferred, depreciation, loan) |
117
136
  | `quarter-end-close` | month-end-close ×3 + GST/VAT filing, ECL review, bonus true-up, intercompany recon, provision unwinding |
118
137
  | `year-end-close` | quarter-end-close ×4 + FA reconciliation, true-ups, dividends, retained-earnings rollover; hands off to audit-prep |
119
138
  | `audit-prep` | runs after year-end-close; consumes fa-review, supplier-recon (majors), bank-recon outputs; feeds statutory-filing |
@@ -146,7 +165,7 @@ Every leg carries its own explicit `org_id`: a wrong "active" org silently posts
146
165
 
147
166
  ## Cross-references
148
167
 
149
- - `transaction-recipes/references/building-blocks.md`: recipe-side primitives (capsules, schedulers, the engine itself, recipe-name aliases). Pair with this file for full context.
168
+ - `transaction-recipes/references/building-blocks.md`: recipe-side primitives (capsules, schedulers, calculators). Pair with this file for full context.
150
169
  - `jaz-api/SKILL.md`: endpoint-by-endpoint API rules. Cited per-job for specific gotchas.
151
170
 
152
171
  ### Filter limits on capsules and journals (measured 2026-09-07)
@@ -167,10 +186,10 @@ compare case-insensitively with separators normalized rather than testing equali
167
186
  `capsuleResourceId`, no `fixedAssetResourceId`. There is no reverse route either: a capsule exposes
168
187
  only `totalTransactions` (a count), and no `/capsules/{id}/journals` endpoint exists. Narrow with
169
188
  the declared fields (`valueDate`, `status`, `type`, `templateType`, `tags`, `reference`) and report the capsule
170
- and its `totalTransactions` count and let the practitioner identify the journals. Do NOT assume the
171
- recipe left a link to match on: `referencePrefix` is optional with no default (`core/recipe/types.ts`),
172
- is caller-chosen text unrelated to the capsule id, and the engine sets no tags on anything it creates
173
- (`core/recipe/engine.ts`). Note `tags` is PLURAL; `tag` is rejected.
189
+ and its `totalTransactions` count and let the practitioner identify the journals. `get_journal` does
190
+ return the link per journal as `capsule: {resourceId, type, title}`, so a candidate can be checked
191
+ one at a time. When you post a schedule yourself, give its journals a shared `reference` prefix or
192
+ tag so the next close can find them. Note `tags` is PLURAL; `tag` is rejected.
174
193
 
175
194
  **Capsules cannot be filtered by date either.** `startDate` and `endDate` are declared on
176
195
  `CapsuleFilter` and pass validation, but every form measured on 2026-09-07 (`{gte}`, `{between}`,
@@ -1,8 +1,8 @@
1
1
  # Credit Control / AR Chase
2
2
 
3
- > Systematically chase overdue customer invoices, assess collection risk, identify bad debt. Walk the steps below in order, calling the named platform tools directly. (Local CLI convenience: `clio jobs credit-control` prints this same phased checklist.)
3
+ > Systematically chase overdue customer invoices, assess collection risk, identify bad debt. Walk the steps below in order, calling the named platform tools directly.
4
4
 
5
- ## Tools, recipes, calculators this job uses
5
+ ## Tools and calculators this job uses
6
6
 
7
7
  ### Platform tools
8
8
  - **`generate_aged_ar(endDate: <date>)`**: step 1: AR aging report with bucket breakdown.
@@ -11,19 +11,19 @@
11
11
  - **`get_contact_signals(resourceId: <id>, btType: 'SALE')`**: step 3: pull cadence + outlier signals + outstanding balance for the customer. Mid-7 endpoint.
12
12
  - **`apply_credits_to_invoice(...)`** / **`create_customer_credit_note(...)`**: step 6: write-off path A for stage-3 specific impairment.
13
13
  - **`pay_invoice(... paymentMethod: 'DEBT_WRITE_OFF' ...)`**: step 6: write-off path B (direct).
14
- - **`plan_recipe(recipe: 'ecl', ...)` + `execute_recipe(...)`**: step 7: ECL collective top-up if material change in aging.
14
+ - **`calculate(type: 'ecl', ...)`**, then `create_capsule` + `create_journal` with `capsuleResourceId`: step 7: ECL collective top-up if material change in aging.
15
15
  - **`download_export(exportType: 'analysis-receivables-customer-risk', startDate, endDate)`**: step 8: pre-empt audit by surfacing high-risk customers.
16
16
 
17
17
  ### Cross-references
18
18
  - Run inside the month-end close (AR aging review + flag overdue) and ad-hoc whenever the overdue threshold is hit.
19
19
  - Sibling jobs: `bank-recon.md` (newly-cleared customer payments shift the aging), `audit-prep.md` step 6 (year-end AR aging review).
20
- - Recipes: `ecl` for the collective provision; path A/B for specific write-offs. See the transaction-recipes skill.
20
+ - Calculator: `ecl` for the collective provision; path A/B for specific write-offs. See the transaction-recipes skill for the pattern.
21
21
 
22
22
  ---
23
23
 
24
24
  ## Steps
25
25
 
26
- Walk steps 1-8 below. (Local CLI: `clio jobs credit-control --overdue-days 30` prints the same phased checklist.)
26
+ Walk steps 1-8 below.
27
27
 
28
28
  ## Step 1: AR aging snapshot
29
29
 
@@ -130,22 +130,23 @@ pay_invoice(
130
130
  )
131
131
  ```
132
132
 
133
- Per memory rule [Bad Debt Write-off]: `paymentMethod: 'DEBT_WRITE_OFF'` is the canonical method enum. Bad Debt Expense GL must exist in CoA.
133
+ `paymentMethod: 'DEBT_WRITE_OFF'` is the canonical method enum. Bad Debt Expense GL must exist in CoA.
134
134
 
135
135
  Future-receivable reversal: if the customer eventually pays after write-off (rare but possible), post via `create_journal`: Dr Cash / Cr Bad Debt Recoveries (separate revenue line for transparency).
136
136
 
137
137
  ## Step 7: ECL collective top-up (if material aging shift)
138
138
 
139
- If the AR aging shifted materially this period (e.g., $50K moved from current to 90d+): invoke the `ecl` recipe for the collective top-up.
139
+ If the AR aging shifted materially this period (e.g., $50K moved from current to 90d+): run the `ecl` calculator for the collective top-up.
140
140
 
141
141
  ```
142
142
  clio calc ecl --current <c> --30d <30> --60d <60> --90d <90> --120d <120> --rates <org ECL loss-rate matrix> --existing-provision <TB Allowance balance> --json
143
143
  ```
144
144
 
145
- If `topUpRequired > materiality threshold`:
145
+ If `adjustmentRequired > materiality threshold`:
146
146
  ```
147
- plan_recipe(recipe: 'ecl', ...)
148
- execute_recipe(...) // creates its own ECL Provision capsule; regroup with move_transaction_capsules if needed
147
+ calculate(type: 'ecl', buckets: <[{name, balance, rate}]>, existingProvision: <TB Allowance balance>, startDate: <period-end>)
148
+ create_capsule(capsuleTypeResourceId: <ECL Provision type id, from list_capsule_types>, title: <blueprint.capsuleName>)
149
+ create_journal(valueDate: <period-end>, autoReference: true, journalEntries: [<the calculator's journal lines, accounts resolved via search_accounts>], capsuleResourceId: <capsule id>)
149
150
  bulk_update_journals(items: [{resourceId: <id>, saveAsDraft: false}, ...])
150
151
  ```
151
152
 
@@ -169,7 +170,7 @@ Returns XLSX with high-risk customer flags (rising aging trends, recently-defaul
169
170
  | Step 3 | `get_contact_signals` returns `null` | The freshness layer is offline; skip the signals step and use aging alone. Don't halt the job. |
170
171
  | Step 6 Path A | `apply_credits_to_invoice` 422 `credit_exceeds_balance` | Split the credit across multiple invoices, OR reduce the credit amount to match the bill balance. |
171
172
  | Step 6 Path B | `paymentMethod: 'DEBT_WRITE_OFF'` rejected | Verify the enum value via `jaz-api/SKILL.md` (some orgs may have custom payment-method config; default supports DEBT_WRITE_OFF). |
172
- | Step 7 ECL recipe | Top-up causes Bad Debt Expense to spike | Expected: material aging shift = material P&L impact. Surface to practitioner; potentially split across multiple periods if it's a known one-off (rare). |
173
+ | Step 7 ECL top-up | Top-up causes Bad Debt Expense to spike | Expected: material aging shift = material P&L impact. Surface to practitioner; potentially split across multiple periods if it's a known one-off (rare). |
173
174
  | Customer files insolvency mid-chase | (process) | Stop chase. Move directly to step 6 specific write-off. Document the insolvency filing reference. |
174
175
  | Customer pays post-write-off | (rare) | Post `create_journal`: Dr Cash / Cr Bad Debt Recoveries. Don't reverse the original write-off; keep the audit trail clean. |
175
176
 
@@ -189,4 +190,4 @@ Returns XLSX with high-risk customer flags (rising aging trends, recently-defaul
189
190
  - `month-end-close.md`: AR aging review + chase activity log inside the period close.
190
191
  - `quarter-end-close.md` Q2: formal ECL provision review (collective).
191
192
  - `audit-prep.md` step 6: year-end AR aging; specific impairments documented via path A/B with capsules.
192
- - Recipes: `ecl`. See the transaction-recipes skill.
193
+ - Calculator: `ecl`. See the transaction-recipes skill for the pattern.
@@ -1,11 +1,11 @@
1
1
  # Document Collection
2
2
 
3
- > Scan + classify client docs (invoices, bills, credit notes, bank statements) from local dirs or cloud links (Dropbox, Google Drive, OneDrive); decrypt encrypted PDFs (`qpdf`); upload via Jaz Magic. Walk the steps below in order, calling the named platform tools directly. (Local CLI convenience: `clio jobs document-collection` prints this same phased checklist; the `ingest` subcommand below does the local/cloud scan.)
3
+ > Scan + classify client docs (invoices, bills, credit notes, bank statements) from local dirs or cloud links (Dropbox, Google Drive, OneDrive); decrypt encrypted PDFs (`qpdf`); upload via Jaz Magic. Walk the steps below in order, calling the named platform tools directly. (Local CLI: the `clio jobs document-collection ingest` sub-tool below does the local/cloud scan.)
4
4
 
5
- ## Tools, recipes, calculators this job uses
5
+ ## Tools and calculators this job uses
6
6
 
7
7
  ### Platform tools
8
- - **`mcp magic create --file <pdf>` / `create_bt_from_attachment(businessTransactionType: 'BILL'|'INVOICE'|'CUSTOMER_CREDIT_NOTE'|'SUPPLIER_CREDIT_NOTE', sourceUrl)`**: step 4: OCR + line-item extraction + contact + CoA suggestion. Creates DRAFT transaction.
8
+ - **`create_bt_from_attachment(businessTransactionType: 'BILL'|'INVOICE'|'CUSTOMER_CREDIT_NOTE'|'SUPPLIER_CREDIT_NOTE', sourceUrl)`**: step 4: OCR + line-item extraction + contact + CoA suggestion. Creates DRAFT transaction. Local CLI: `clio magic create --file <pdf> --type bill`.
9
9
  - **`finalize_bill(...)` / `finalize_invoice(...)` / `finalize_customer_credit_note(...)`**: step 5: finalize practitioner-reviewed Magic-extracted DRAFTs.
10
10
  - **`import_bank_statement(accountResourceId, sourceUrl | attached file)`**: step 6: bank statements (CSV / OFX / PDF); creates bank records pending reconciliation per `bank-recon.md`.
11
11
  - **`search_background_jobs(filter: {resourceId: {eq: <jobId>}})`**: step 7: poll Magic / bank-import async jobs to terminal status.
@@ -13,7 +13,7 @@
13
13
  ### CLI tools (jaz-cli, offline)
14
14
  - **`clio jobs document-collection ingest --source <local-dir> --json`**: step 2 ingest local: scan a local directory, classify per file-type heuristics, output JSON with per-file metadata (`{path, classifiedAs, confidence, encrypted, suggestedAction}`).
15
15
  - **`clio jobs document-collection ingest --source 'https://www.dropbox.com/scl/fo/...' --json`**: step 2 ingest cloud: same flow over a Dropbox / Google Drive / OneDrive shared link. Recursive folder traversal. Files downloaded to a temp dir.
16
- - **step 3 decryption is AUTOMATIC; there is no flag.** The same `ingest` call detects password-protected PDFs and decrypts via `qpdf`. Per memory rule: if `__pw__<password>` is in the filename, the ingest tool extracts and uses the password automatically.
16
+ - **step 3 decryption is AUTOMATIC; there is no flag.** The same `ingest` call detects password-protected PDFs and decrypts via `qpdf`. If `__pw__<password>` is in the filename, the ingest tool extracts and uses the password automatically.
17
17
 
18
18
  ### External dependencies
19
19
  - **`qpdf`** binary: required for encrypted PDF decryption. Document-collection ingest detects encryption + invokes qpdf transparently. If qpdf missing: surface install instruction (`brew install qpdf` on macOS, `apt-get install qpdf` on Linux).
@@ -27,7 +27,7 @@
27
27
 
28
28
  ## Steps
29
29
 
30
- Walk steps 1-8 below. (Local CLI: `clio jobs document-collection --period 2025-01` prints the same phased checklist.)
30
+ Walk steps 1-8 below.
31
31
 
32
32
  ## Step 1: Identify the source
33
33
 
@@ -86,7 +86,7 @@ Decrypted files replace the original in the ingest manifest; original kept for a
86
86
  For each file with `suggestedAction: 'magic-create-bill' | 'magic-create-invoice' | 'magic-create-credit-note'`:
87
87
 
88
88
  ```
89
- mcp magic create --file <decrypted path> --type bill
89
+ clio magic create --file <decrypted path> --type bill
90
90
  # OR equivalent MCP call:
91
91
  create_bt_from_attachment(
92
92
  businessTransactionType: 'BILL',