{"id":75962,"plugin_id":"plugin_asdk_app_6ad131d6bf5c8191ba2b82e863cccc99","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-02T13:20:26.247Z","digest":"97905e09c9f3e7aec9467bbfc3c7a76b145e1ccc825cafda8149216422b01016","against":null,"payload":{"description":"How to do bookkeeping for a Trivis company through the Trivis tools. Use whenever the user asks about invoices, suppliers, customers, payments, VAT, the ledger or their company's numbers, or attaches a business document.","included_files":[],"name":"trivis-bookkeeping","skill_md_contents":"---\nname: trivis-bookkeeping\ndescription: How to do bookkeeping for a Trivis company through the Trivis tools. Use whenever the user asks about invoices, suppliers, customers, payments, VAT, the ledger or their company's numbers, or attaches a business document.\n---\n\n# Working in Trivis\n\nTrivis is the user's bookkeeping. One connection is bound to one company and to\nthe access level of the user's role there. Answer in the user's language; the\ntools speak English and Estonian terms are fine in replies.\n\n## Start of a session\n\nCall `get_plugin_context` first. It names the company, the person you act for,\ntheir access level and which workflows are available. Show the user which\ncompany you are working in before changing anything. If they want a different\ncompany, they reconnect Trivis and choose it; there is no tool for switching.\n\n## Conventions every tool shares\n\n- Money, quantities and percentages are decimal strings: \"90\", \"12.5\", \"20\".\n  Dates are YYYY-MM-DD. Records are addressed by UUID.\n- VAT is resolved by Trivis from the company's registration and the\n  counterparty's country. Never choose a rate yourself and never state a rate\n  you were not given back by a tool.\n- A write creates a draft. Posting to the ledger is a separate step\n  (`confirm_invoice`, `confirm_purchase_invoice`, `confirm_ledger_entry`) and\n  you do it only when the user asks for it in this conversation.\n- Some actions leave the company (email, e-invoice, payment run) or destroy\n  something. Those return an approval request instead of running. Relay the\n  link and the exact retry the tool text describes; approving happens in\n  Trivis, by a person, and you re-call the tool with the approval id.\n- A tool error is a result, not a reason to retry blindly. Read it, fix the\n  input, or tell the user what Trivis said.\n- Never fabricate a number. If a figure is not in a tool result, say so.\n\n## Create a sales invoice\n\n1. Find the customer with `list_contacts`. Several matches: ask which one.\n   None: confirm the details with the user, then `create_contact`.\n2. `create_invoice_draft` with the customer id and all the rows in one call:\n   description, quantity, unit price without VAT, optional unit and discount.\n   Products from the catalogue: `search_catalog_items`, then\n   `get_catalog_item_prices` for the unit price, and pass `item_id`. Generate a\n   fresh UUID as `idempotency_key`; reuse it only to retry that exact call.\n   Dates and the payment term: pass what the user said, otherwise leave them\n   out. Trivis then dates the invoice today, applies the company's default\n   payment term and counts the due date from the invoice date. Never invent a\n   term; \"pay within 7 days\" is `payment_term_days: 7`, \"on receipt\" is 0. The\n   result opens the editor card: the person can edit there while you talk. A\n   price you do not have: ask, or take it from the catalogue. Never open the\n   customer's earlier invoices in the editor to look one up; a card shows the\n   invoice being worked on, and an old draft on screen reads as the new one.\n3. Later changes go through `save_invoice_edits` against the `revision` you\n   last saw, as a batch of operations. A `conflict` means the person or someone\n   else saved meanwhile: read the `current` document it carries, then decide\n   with the user. `get_invoice_editor` reads the document at any time.\n4. Show rows, subtotal, VAT and total as Trivis calculated them, never your own\n   arithmetic. `get_invoice_preview` renders the real document into the card.\n   A unit from the company's list, a currency, a document type (offer or\n   waybill) or a tax rate the user names by hand take their ids from\n   `get_invoice_options`, read once per session. Leave the tax rate to Trivis\n   unless the user names one. `sort_order` on a row changes its place.\n5. Post only on request with `confirm_invoice`. Send only on request with\n   `send_invoice_email` or `send_invoice_einvoice` (`get_delivery_options`\n   first). If a send fails or its outcome is unknown, say so and do not create\n   another invoice or resend on your own.\n\nThere is no other way to build or change a sales invoice here: the generic row tools\nare not offered to this plugin, so every draft goes through the editor tools above.\n\n## Work with an existing sales invoice\n\n- `copy_invoice` makes a new draft from any invoice and opens it in the card.\n  `delete_invoice_draft` removes a draft for good; a posted invoice is\n  cancelled with `cancel_invoice` instead, and a wrong posted invoice is\n  corrected with `credit_invoice`, which makes a draft credit note: open it\n  with `get_invoice_editor` so the card shows it. Both ask for approval.\n- `create_invoice_share_link` makes the public page of a posted invoice: a link\n  where the recipient views, downloads and pays it by card. Give the user the\n  link; sending it is their call.\n- The card has buttons for confirm, cancel, credit note, sending, copy and\n  delete, and runs those tools itself. What it did reaches you through the\n  card's context (status, revision); do not redo it, and do not call\n  `get_invoice_editor` to check: a second card opened before a change shows\n  the old state, and the open card follows the invoice by itself.\n\n## Bring in purchase invoices\n\n1. Files attached to the message go to `start_invoice_batch` in one call,\n   all of them. It opens the purchase batch card and nothing posts from it\n   until the person chooses Post there, whatever the company's auto-confirm\n   setting. Do not open each file separately and do not use the upload link\n   for attached files; `request_invoice_upload` is for files that cannot be\n   attached here and for migrations.\n2. The card follows the batch while files are being read. Do not call\n   `get_invoice_batch` in a loop; call it when the person asks what the state\n   is, or after you changed a draft. Tell them what needs attention from the\n   tool's text: supplier, total, and the finding, one line per file.\n3. Fix a draft the card marks \"needs review\" through `check_purchase_invoice`\n   and `repair_purchase_invoice`, or the row tools; rows without an expense\n   account through `confirm_import_accounts` after asking which account.\n   Duplicates and mismatched totals are findings to report, not to fix\n   silently.\n4. Posting is the person's: they press Post in the card, which runs\n   `confirm_purchase_invoice` per selected draft. Call it yourself only when\n   they say in words to post a named invoice. Companies with approval rounds\n   keep them; a confirmation request in chat does not replace them.\n5. \"These three\" means the card's selection: it is in your context as the\n   batch id and the selected invoice ids.\n\n## Ask about the business\n\n`get_ar_summary`, `get_ap_summary`, `get_overdue_invoices`,\n`get_cashflow_forecast`, `get_revenue_summary`, `get_trial_balance`,\n`get_account_balance`, `list_ledger_entries`. The forecast is bucketed by due\ndate; call it that, not a bank balance. Drill into documents with\n`list_invoices` and `list_purchase_invoices` when the user asks what is behind\na figure.\n\n## Not in this plugin\n\nDo not present `calculate_payroll` as a payroll run; it returns an estimate and\nsays so. Do not use `db_query`. Do not mark a VAT report as filed unless the\nuser states they filed it with the tax authority. Do not cancel, credit or\ndelete anything without the user naming the document and confirming.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}