/anafpy-workflows:declaratie-preparefrom anafpy workflows
Builds, validates, renders, signs, and files Romanian tax declarations (ANAF) from unstructured source data like emails, spreadsheets, or verbal requests. Handles form identification, CUI lookups, XML authoring, and portal submission.
Ships in anafpy workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are preparing a legal tax declaration for Romania's tax authority (ANAF) from whatever the user gives you — raw numbers, a document, or just a request. The flow is local until the filing step: identify the form → read its completion guide → infer what a lookup can answer → ask for everything else → author the XML → validate until ANAF's validator agrees → render → user review → sign → file on the portal (or hand off for manual filing) → confirm with the status tools.
Three rules override everything else:
declaratie_sign and
declaratie_portal_login fire the user's certificate PIN/2FA, and
declaratie_submit files a real declaration on the production portal
(declarations have no test environment). Call each only after the user
explicitly approved that step here, never chained on a single earlier "yes".If the user already named the form (or it is unambiguous from their request),
do not ask again — state which form you are preparing ("Working on D300,
the VAT return for 06/2026") and move on. Otherwise infer it from the data and
situation using the inventory resource
anafref://declaratii/forms/README (173 forms, bucketed by SME usage) —
e.g. VAT numbers for a month → D300; per-partner domestic invoice lists →
D394; intra-EU lines → D390; payroll → D112; a prior-period correction of a
D100 → D710. Only when two forms remain plausible, present the candidates with
one line on who files each and ask.
Call declaratie_duk_status: it confirms DUKIntegrator is configured and
whether the form's validator jar is current. DUKIntegrator not
installed, or the form's state is not installed → offer
declaratie_duk_install (naming the form), then check again. stale → offer
declaratie_duk_install for that form; if the user declines, continue with a
caveat (ANAF may reject what a stale validator passes). Only a missing Java
runtime needs the setup guide.
Fetch anafref://declaratii/forms/d<nnn> before authoring anything. It
is the map for the whole task: purpose and legal basis, who files and when
(sanity-check the user's situation and deadline), the row-by-row → XSD
attribute mapping, DUK-validated example instances to pattern-match against,
and the researched gotchas (control-sum formulas, mirror rules, cross-form
checks). Large code lists live in the sibling resource
anafref://declaratii/forms/d<nnn>-nomenclatoare where the guide links one.
Only if the form has no guide (outside the covered twelve): fall back to the raw XSD from the form's soft page and converge through the validate loop.
Take the CUI from the source data or the configured default. Call
anaf_lookup_taxpayers and use the answer to:
den, fiscal address →
adresa) — show the user what the lookup returned so they can catch a stale
registry entry;sistemTVA), inactive/radiat
flags — surface a mismatch before wasting the user's time;Map every fact in the source onto the guide's rows and show the mapping. Then ask — in one batch, not a drip — for what remains:
tip_decont monthly/quarterly cannot be looked up — it is the taxpayer's
election);solicit_ramb refund election, the reverse-charge
sector checkboxes; D112: quarterly-filer status; D101: liquidation status);Author from the guide's mapping and its validated example instances: derived
rows and cascades are computed per the guide's formulas (totals, control sums
like totalPlata_A — each form defines its own), enum conventions verbatim
(D/N, name-vs-code). Compute nr_evid with declaratie_nr_evid, passing
the right form (D300 needs tip_decont; D100/D710 need cod_oblig +
scadenta; D101 adds in_liquidation; D301 takes mijl_trans) — never
by hand, it has a check digit.
declaratie_validate with the form and XML. On ok=false, the findings are
DUK's own messages — precise enough (rule ids, attribute names, expected
values) to dictate each fix; iterate until ok=true. Some forms (D700) are
warning-only by design: ok=true with warnings is a pass — relay the notice,
don't chase a bare ok.
Before rendering, run through the guide's cross-form checks and say what ANAF will reconcile this filing against (D300 ↔ D394 ↔ D390 totals, e-Factura, SAF-T, the pre-filled e-TVA decont). Ask the user to confirm the numbers tie out with the sibling declarations for the same period — a mismatch triggers a conformity notification that cannot be un-filed.
declaratie_render to a save_pdf_as path the user names. Summarise the
declaration (form, period, CUI, key amounts, amount payable / refundable) and
ask the user to open and review the PDF.
On explicit approval: warn that the certificate prompt (token PIN / phone 2FA)
is about to fire, then declaratie_sign with the PDF path and confirm=true.
One attempt per call; on signed=false relay the guidance and retry only
with the user's go-ahead.
Filing is REAL: the portal is production-only. If chain_complete was false,
mention the signature is leaf-only and portal acceptance of that is
unverified.
With the portal tools available (declaratie_submit in the tool list):
declaratie_portal_status — no PIN/2FA fires. If the session lapsed, ask
the user to approve a portal login, warn their certificate prompt is about
to fire, then declaratie_portal_login with confirm=true. Sessions die
after ~10 idle minutes, so do this right before filing, not earlier.declaratie_prepare with the signed PDF path. Recap what is about to be
filed — form, period, CUI, amount payable/refundable — and ask for explicit
approval of the filing (the earlier signature approval does not carry
over). Heed looks_signed=false: it means the PDF has no embedded
signature and the portal will reject it.declaratie_submit with the same path, the token, and
confirm=true. The token is single-use and bound to the exact bytes; a
lapsed session comes back as "token NOT consumed" — log in again and retry
with the same token. Relay the verdict: accepted=true gives the upload
index (tell the user to note it); accepted=false carries the portal's
rejection reason — fix and re-prepare; accepted=null means the outcome is
unknown — check declaratie_status before ever re-filing.If the portal tools are absent (opted out via ANAFPY_DECLARATII_UPLOAD),
hand back the signed PDF; the user files it at anaf.ro → Depunere
declarații and notes the upload index the portal shows.
With the upload index: declaratie_status (no login needed) — relay ANAF's
state verbatim: In prelucrare means check again later; Documentul este valid means accepted; a validation-error state means fix and refile — say so
plainly. Once valid, offer declaratie_recipisa to save the signed receipt to
a path the user names and advise archiving it (ANAF keeps it downloadable only
~60 days).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/etransport-declareFile a Romanian RO e-Transport declaration and obtain a UIT code from transport data found in any source — an email, a PDF invoice, a CMR, a spreadsheet, or the conversation. Use when the user wants to declare a transport, get/generate a UIT, file an e-Transport declaration, correct an already-issued one, or asks whether a transport must be declared and what the law requires of them. Trigger on Romanian phrasing too, with or without diacritics — "am de făcut un UIT" / "am de facut un UIT", "trebuie să declar un transport" / "trebuie sa declar un transport", "vreau un cod UIT", "am de declarat o marfă". Drives the anafpy MCP tools (etransport_prepare_declaration → etransport_submit).
/personal-income-summarySummarize a person's realized income over one or more fiscal years from Romania's ANAF SPV, using the income certificates (Adeverință de venit) and the Declarația Unică duplicate (D212) filed under their CNP. ALWAYS use this skill when the user asks about their income / "veniturile mele" / "ce am câștigat" / "cât am făcut" over a year or period, asks to pull income from ANAF, the tax return, or the declarația unică, or asks for an income summary / income report / adeverință de venit. Defaults to PERSONAL income (the CNP on the certificate), picks the right SPV reports automatically, and optionally produces an Excel summary. Trigger even for casual phrasing like "cât am câștigat anul trecut" or "arată-mi veniturile pe ultimii ani".npx claudepluginhub robert-malai/anafpy --plugin anafpy-workflowsOther plugins' skills for the same job