src/skills/jaz-pseudo-sql/SKILL.md
Use this skill when answering ad-hoc data questions that aren't covered by download_export (canonical reports — anomaly, audit, aging, P&L, BS, GL, statement of account) or search_* tools (entity listings with structured filters). Pseudo-SQL is a read-only DSL against Jaz's curated reporting schema — single SELECT statement, ≤100 row sync preview or full async CSV export. Tools: get_pseudo_sql_schema (call FIRST — returns live catalog + downloadable jaz-pseudo-sql.md skill body), preview_pseudo_sql, export_pseudo_sql, get_pseudo_sql_export, run_pseudo_sql_and_download.
npx skillsauth add teamtinvio/jaz-ai jaz-pseudo-sqlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are running ad-hoc data queries against the curated reporting schema in Jaz — a read-only SQL DSL exposed via the Jaz API at /api/v1/reports/sql-query/*. Use this skill when:
download_export(exportType=...) canonical report.search_* tools can't express cleanly.NOT a general-purpose database surface. Curated schema only — no DML (DELETE/UPDATE/INSERT), no multi-statement input, no access to private columns. Validators reject anything that isn't a single SELECT against an allowed table. See
references/error-catalog.mdfor the full error vocabulary.
Always call get_pseudo_sql_schema first. The response returns the live curated catalog (~70 tables, 91 join edges, 47 functions) AND the canonical jaz-pseudo-sql.md skill body in agentSkillsDoc.content. That .md body is the authoritative syntax guide — drop it into your context and use it instead of any cached column list.
The version field is a stable 16-char hex hash; cache by it. If you've already called the tool this session and the version is unchanged on a re-call, the schema and skill body are identical to your cached copy — no need to re-read.
Don't write a pseudo-SQL query from memory. The catalog grows; column names change; the live schema is the only source you should trust.
| Use this instead | When |
|---|---|
| download_export(exportType='analysis-anomalous-invoices') etc. | Canonical anomaly / audit / risk reports — they're tuned, parameterized, and faster than re-deriving them in SQL. See jaz-api Rule 141. |
| download_export(exportType='trial-balance') etc. | Statements (TB, BS, P&L, GL, cashflow). The reporting engine handles period closing rules, intercompany eliminations, FX revaluation. SQL would miss these. |
| search_invoices(filter:...), search_bills, etc. | Listing entities with structured filters. Returns typed objects, supports pagination, faster than SQL. |
| get_invoice(resourceId) etc. | Single-entity lookup by ID. |
| view_auto_reconciliation | Bank reconciliation match suggestions. |
get_pseudo_sql_schema — call FIRST. Returns the live curated catalog (tables/columns/joins/functions) plus the canonical jaz-pseudo-sql.md skill body in agentSkillsDoc.content. Drop the .md body into context as the syntax guide. Use the response's version (16-char hex) as a session-stable cache key. Org-agnostic.preview_pseudo_sql — sync, ≤100 rows. Use for any agent-loop question where you need to look at the data quickly.export_pseudo_sql + get_pseudo_sql_export — async kickoff + polling. Use when you want explicit job control (manual retry, parallel jobs, polling at your own cadence) or when the result set is too big for preview's 100-row cap.run_pseudo_sql_and_download — one-shot composite: kickoff + poll + fetch CSV. Use for "give me the file" flows. Default returns the CSV buffer; pass downloadToFile=true to write to ~/Downloads/.PSEUDOSQL_VALIDATION_ERROR "only SELECT queries are supported".SELECT 1; SELECT 2; → 422 PSEUDOSQL_PARSE_ERROR "only a single SELECT statement is allowed per query". A trailing semicolon on one statement is fine.SELECT 1 (no FROM) → 422 PSEUDOSQL_VALIDATION_ERROR.validation_error "query must be a maximum of 16,384 characters in length". Note: this is the request-shape validator (different error_type from the SQL-engine validators).PSEUDOSQL_VALIDATION_ERROR "unknown table <name>" (lowercased in the error message). Call get_pseudo_sql_schema for the live inventory.truncated:true means "MORE rows matched than were returned in this preview" — NOT "you hit the cap". To interpret: compare rowCount against your LIMIT clause or the preview cap (100). If you need every row, switch to export_pseudo_sql.downloadUrl is short-lived. S3 pre-signed, ~15min expiry (X-Amz-Expires=900). Fetch immediately. If a fetch returns 403, call get_pseudo_sql_export(jobId) again for a fresh URL.Idempotency-Key dedups server-side. Same key + DIFFERENT query body returns the prior job's result (the server doesn't cross-check). run_pseudo_sql_and_download auto-keys from sha256(query).slice(0,16) so dedup is query-tied automatically. If you call export_pseudo_sql directly with a manual key, don't reuse it across different intents.get_pseudo_sql_schema (live, ~30 KB response with tables / joins / functions + the canonical jaz-pseudo-sql.md body for context).Agent intent: "show me the 10 largest unpaid invoices"
preview_pseudo_sql({
query: `
SELECT invoice_number, total, balance, contact_id, due_date
FROM invoices
WHERE balance > 0
ORDER BY balance DESC
LIMIT 10
`
})
→ { data: { columns: [...], rows: [...], rowCount: 10, truncated: false } }
tools
Use this skill whenever an accounting practitioner is doing client work in Jaz — closing the books, filing GST, year-end statutory, onboarding a new client. Covers the practitioner workspace at ~/Documents/Jaz Practice (clients/<slug>/CLIENT.md and engagements/<slug>/ENGAGEMENT.md), engagement routing (monthly-close | quarterly-gst | annual-statutory | onboarding | adhoc), and how the agent loads client context before invoking jaz-jobs blueprints, jaz-recipes recipes, and jaz-api tools. Triggers on intent like "close the books for X", "file GST for Y", "onboard new client Z", "what's outstanding for Acme this month". Pair with jaz-jobs (workflow blueprints), jaz-recipes (IFRS recipes + calculators), jaz-api (REST gotchas), and jaz-conversion (data migration during onboarding).
tools
Use this skill when answering ad-hoc data questions that aren't covered by download_export (canonical reports — anomaly, audit, aging, P&L, BS, GL, statement of account) or search_* tools (entity listings with structured filters). Pseudo-SQL is a read-only DSL against Jaz's curated reporting schema — single SELECT statement, ≤100 row sync preview or full async CSV export. Tools: get_pseudo_sql_schema (call FIRST — returns live catalog + downloadable jaz-pseudo-sql.md skill body), preview_pseudo_sql, export_pseudo_sql, get_pseudo_sql_export, run_pseudo_sql_and_download.
tools
Use this skill whenever an accounting practitioner is doing client work in Jaz — closing the books, filing GST, year-end statutory, onboarding a new client. Covers the practitioner workspace at ~/Documents/Jaz Practice (clients/<slug>/CLIENT.md and engagements/<slug>/ENGAGEMENT.md), engagement routing (monthly-close | quarterly-gst | annual-statutory | onboarding | adhoc), and how the agent loads client context before invoking jaz-jobs blueprints, jaz-recipes recipes, and jaz-api tools. Triggers on intent like "close the books for X", "file GST for Y", "onboard new client Z", "what's outstanding for Acme this month". Pair with jaz-jobs (workflow blueprints), jaz-recipes (IFRS recipes + calculators), jaz-api (REST gotchas), and jaz-conversion (data migration during onboarding).
development
Use this skill when modeling complex multi-step accounting transactions — anything that spans multiple periods, involves changing amounts, or requires linked entries. Covers 16 IFRS-compliant recipes (prepaid amortization, deferred revenue, loans, IFRS 16 leases, hire purchase, fixed deposits, asset disposal, FX revaluation, ECL, IAS 37 provisions, dividends, intercompany, capital WIP) and 13 financial calculators that produce execution-ready blueprints. Also use when the user mentions depreciation, amortization, lease accounting, loan schedules, or any IFRS calculation.