← ALL PLUGINS
ESTONIAv1.0.0·MIT · FORKABLE

Estonian Payroll Calculator.

artifi-ee-payroll-calculator

Gross-to-net payroll with TSD declaration

A complete Estonian payroll calculation engine that processes gross-to-net for all employees in a payroll run. Applies all Estonian tax formulas: 33% social tax (employer), 22% income tax, 1.6% unemployment insurance (employee), 0.8% unemployment insurance (employer), and funded pension at 2%, 3%, or 6% depending on the employee's tier. Handles the basic tax exemption, pre-tax and post-tax voluntary deductions, and pro-rating for mid-month starts/exits. Generates TSD declaration XML files for direct upload to the EMTA (Estonian Tax and Customs Board) portal.

All Estonian tax formulas (social, income, unemployment, pension)Multiple funded pension tiers (2%, 3%, 6%)Pre-tax and post-tax deduction handlingTSD declaration XML generation for EMTA
COMMANDS · 2

Slash commands, shipped.

Each command is a guided procedure Claude follows step by step — with your review at every decision point.

/calculate-payroll
Gross-to-net payroll calculation

Calculate gross-to-net payroll for all employees in a payroll run. Loads the payroll run, fetches employees with compensation/tax settings/deductions, applies all Estonian tax formulas, validates net pay within 0.02 tolerance, and submits calculated results. Shows summary table with per-employee breakdown.

/generate-tsd
Generate TSD XML for EMTA

Generate the Estonian monthly TSD declaration XML for EMTA filing. Fetches calculated payroll data, builds structured JSON input, and runs the generate_tsd.py script to produce validated XML with correct namespace and per-employee data (personal ID, gross pay, income tax, social tax, unemployment, pension).

HOW IT BEHAVES

One run, step by step.

The plugin prepares, validates, and previews. You confirm. Only then does anything reach the ledger — through the same governed gateway everything else uses.

Payroll Calculation
Load payroll run and verify status is "draft"
Fetch all active employees with compensation records, tax settings, and voluntary deductions
Load Estonian tax rates from payroll tax jurisdiction configuration
For each employee: calculate gross pay (pro-rated if mid-month start/exit)
Calculate employee deductions: unemployment insurance (1.6%), funded pension (2%/3%/6%)
Apply pre-tax voluntary deductions
Calculate taxable income = gross - unemployment - pension - pre-tax deductions - basic exemption
Calculate income tax = max(0, taxable income x 22%)
Apply post-tax voluntary deductions
Calculate net pay = gross - all employee taxes and deductions
Calculate employer costs: social tax (33%), employer unemployment (0.8%)
Validate: net pay = gross - total taxes - total deductions (within 0.02 tolerance)
Submit calculation results and show summary table
TSD Declaration Generation
Fetch calculated or approved payroll run data
Build structured JSON input with per-employee tax details
Run generate_tsd.py script to produce validated XML
Output includes header, summary totals, and Annex 1 per-employee lines
XML ready for upload to e-MTA portal
VALIDATION GATE · 6 CHECKS

Every run
must pass.

If any checkpoint fails, the workflow stops and reports the issue. Nothing posts to the ledger until every check passes — the same dry-run-first discipline as the rest of the platform.

Payroll run exists and is in "draft" status
All employees in the run have active compensation records
All employees have tax settings (pension tier, basic exemption)
Tax rates loaded from payroll tax jurisdiction (country_code = "EE")
For each employee: net pay equals gross minus total taxes minus deductions (within 0.02)
Submission succeeds without validation errors
REFERENCE DATA · 3 FILES

Knowledge you can read and edit.

Formulas, templates, and regulatory rules live in plain files — not hardcoded values. Swap them for your firm’s policies when you fork.

estonian-tax-formulas.md

Complete tax rate formulas: 22% income tax, 33% social tax, 1.6%/0.8% unemployment, 2%/3%/6% pension tiers, basic exemption rules

submission-format.md

JSON structure for payroll calculation submission with per-employee tax lines and deduction details

tsd-declaration.md

TSD structure with Header, Summary, and Annex 1 per-employee field reference

MIT · BUILT FOR ARTIFI · OPEN FOR EVERYONE

Run it here.
Or take it with you.

Out of the box it works with the Artifi ledger: Claude fetches your data, runs the procedure, validates the result, and submits through the governed gateway via MCP.

Or fork it. Skills, commands, validation logic, and reference data are all MIT-licensed. Swap the MCP tool calls for your own backend, or use the reference files as standalone Claude project resources.

MORE ESTONIA PLUGINS