--- name: year-end description: Swedish year-end closing (bokslut). Use when the user says "bokslut", "arsbokslut", "arsredovisning", "stang aret", "year-end close", or asks about periodiseringsfond, resultatdisposition, NE-bilaga, or closing the fiscal year. argument-hint: [fiscal year] --- # Year-end Run the bokslut as a readiness-gated, step-by-step flow. This is the highest-stakes flow in the plugin: nothing here is improvised, and the final close runs only after readiness is green and the user explicitly confirms. ## Flow 1. If not already done this session, call `accounted_get_agent_briefing`: entity type decides the whole shape (aktiebolag: bolagsskatt and resultatdisposition; enskild firma: NE-bilaga, egenavgifter, rantefordelning). 2. Readiness first: call `accounted_year_end_readiness` (read-only preflight). Every blocker it reports is fixed through the other flows (`/accounted:bookkeep`, `/accounted:month-close`, `/accounted:vat`) before continuing. Do not start closing entries on a year that is not ready. 3. Load the knowledge: `accounted_load_skill("year-end-close")` (the procedure) and `accounted_load_skill("horizontal/swedish-year-end-closing")` (the law and the account-level detail). When the user wants to optimize (periodiseringsfond, overavskrivningar), also load `accounted_load_skill("horizontal/swedish-tax-planning")` and present options with trade-offs, not a single answer. 4. Work the bokslutstransaktioner in the loaded order, one staged operation at a time, each approved by the user with the amounts and accounts visible. 5. The final close (`accounted_run_year_end`) is high-risk: run it only after readiness is green again and the user has explicitly confirmed in this conversation. 6. Report what remains outside the ledger: arsredovisning and filing for AB (load `accounted_load_skill("horizontal/swedish-financial-reporting")` if asked), INK2 or NE underlag, deadlines from the product's data. ## Rules - Readiness gates everything; never bypass a red readiness check. - Every write stages a pending operation; the user approves each before it is booked. - Tax optimization questions get options with trade-offs from the loaded skills, never a single unexplained number. - Flow names: `/accounted:` is how Claude Code spells this plugin's flows. In another client, use the skill or command named ``, and give the user the name that client shows. - Company context: if the working directory (or a parent, nearest wins) contains `.accounted.json` with `{ "company_id": "", "name": "" }`, pass that `company_id` on every company-scoped call and say the company name once at the start. Otherwise, if `accounted_list_companies` is among your tools, the account reaches several companies: call it and ask once which company the task concerns (or whether it spans all of them) before any write, never write to a company the user did not name, and read back the `company: { company_id, name, is_default }` block that opens every result whenever it is not the company they named. If `accounted_list_companies` is not among your tools, the account has one company: results carry no company block and none of this applies.