ksef

ksef is a skill for Claude Code from dithiothreitol/jdg-ksiegowy. It costs 197 tokens per session (1,316 once invoked), scanned A, original, MIT.

A tool for sending Polish electronic invoices in FA(3) XML format to KSeF and checking the KSeF inbox for purchase invoices. KSeF is Poland’s national e-invoicing system.

In plain words
What is it for?
Use it to submit a sales invoice, retrieve incoming purchase invoices, save related costs, and report the KSeF reference number or error.
Why use it?
It removes the need to manually submit invoice files and check incoming invoices through separate KSeF steps.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 skills/ksef/scripts/submit.py --xml-path data/faktury/2026/04/faktura_A1_04_2026.xml.

Good fit Use it to submit a sales invoice, retrieve incoming purchase invoices, save related costs, and report the KSeF reference number or error.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/dithiothreitol/jdg-ksiegowy
agentmods
npx agentmods add skills/dithiothreitol/jdg-ksiegowy/ksef

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ksef

README.md
[![agentmods](https://agentmods.dev/badge/skills/dithiothreitol/jdg-ksiegowy/ksef/github.svg)](https://agentmods.dev/skills/dithiothreitol/jdg-ksiegowy/ksef)
Your own site
<a href="https://agentmods.dev/skills/dithiothreitol/jdg-ksiegowy/ksef"><img src="https://agentmods.dev/badge/skills/dithiothreitol/jdg-ksiegowy/ksef/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ksef

Your own site · 80×15
<a href="https://agentmods.dev/skills/dithiothreitol/jdg-ksiegowy/ksef"><img src="https://agentmods.dev/badge/skills/dithiothreitol/jdg-ksiegowy/ksef.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 197 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,316 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00197 $0.01316
Opus 5 $0.00098 $0.00658
Sonnet 5 $0.00039 $0.00263
Haiku 4.5 $0.00020 $0.00132

Measured 12d ago against content hash 4c1ea031188d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ksef scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/ksef/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Wysyłka faktury do KSeF

Wysyła plik XML FA(3) do KSeF API (środowiska: test / demo / prod) przez SDK ksef2. Zwraca numer referencyjny KSeF lub opis błędu.

Wymagane dane

  • xml-path — pełna ścieżka do pliku XML FA(3) (zwykle data/faktury/YYYY/MM/faktura_*.xml)

Jeśli user mówi "wyślij fakturę A1/04/2026" ale nie podaje ścieżki — znajdź w data/faktury/ po numerze, nie wymyślaj ścieżki.

Wywołanie

python3 skills/ksef/scripts/submit.py --xml-path data/faktury/2026/04/faktura_A1_04_2026.xml

Zwraca JSON:

{
  "success": true,
  "reference_number": "20260417-...",
  "error": null,
  "env": "test"
}

Zmienne środowiskowe (z .env)

  • KSEF_TOKEN — token autoryzacyjny z portalu KSeF (wymagane)
  • KSEF_NIP — NIP podatnika
  • KSEF_ENVtest | demo | prod (domyślnie test)

Jeśli skrypt zwróci "KSeF nie skonfigurowany" — przerwij i poinstruuj usera żeby ustawił KSEF_TOKEN w .env.

Po wysyłce

  • Sukces: pokaż reference_number i środowisko (env). Jeśli env=test, zaznacz wyraźnie że to wysyłka testowa, nie produkcyjna.
  • Błąd: pokaż error dosłownie i zasugeruj sprawdzenie tokena / poprawności XML.

Odpytanie inboxu (faktury zakupowe → koszty)

Pobiera metadane faktur, w których podatnik jest nabywcą (rola buyer), i opcjonalnie zapisuje je jako koszty w rejestrze SQLite. Użyteczne gdy user ma paragon/„potwierdzenie transakcji" (Shell, Orlen…) — właściwa faktura VAT jest w KSeF, więc zamiast OCR-ować paragon pobieramy autorytatywne dane wprost z systemu.

# Preview (NIC nie zapisuje) — pokaż co jest w KSeF za maj 2026:
python3 skills/ksef/scripts/inbox.py --month 5 --year 2026

# Zapis nowych faktur do rejestru (pobiera też XML jako dowód):
python3 skills/ksef/scripts/inbox.py --month 5 --year 2026 --save

Każda faktura w odpowiedzi ma status:

  • new — jest w KSeF, jeszcze nie w rejestrze (zapisze się przy --save),
  • exists — już w rejestrze (pomijana, idempotentnie),
  • manual — korekta / waluta obca / samofakturowanie → nie zapisuj automatycznie, pokaż manual_reason i obsłuż ręcznie (skill expense),
  • saved — właśnie zapisana (tylko przy --save).

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 83 lines · 197 tokens per session scan A 4c1ea031188d

Subscribe to this mod's changes

ksef is a skill published in the GitHub repository dithiothreitol/jdg-ksiegowy (5 stars, last pushed 1mo ago), licensed MIT. It adds 197 tokens to every session and 1,316 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

jangbu-jongso

A Korean tax-document checklist generator for individuals, freelancers, sole-company owners, mixed earners, and certain business owners.

kimlawtech/korean-jangbu-for · 139 tokens

brazil-vat

> Use esta skill sempre que perguntarem sobre tributos indiretos brasileiros, IVA, tributos sobre o consumo, PIS, Cofins, ICMS, ISS, IPI, CBS, IBS, Imposto Seletivo, NF-e (Nota Fiscal Eletronica), NFS-e, Simples Nacional, registro de CNPJ, reforma tributaria (EC 132/2023, LC 214/2025, LC 227/2026) ou qualquer questao…

openaccountants/openaccountants · 213 tokens

canada-gst-hst

Use this skill whenever asked to prepare, review, or classify transactions for a Canadian GST/HST return (Form GST34) for a self-employed individual or small business in Canada. Trigger on phrases like "prepare GST return", "file HST", "Canadian sales tax", "GST/HST return", "Form GST34", "input tax credits", "ITC…

openaccountants/openaccountants · 193 tokens

albania-vat

Use this skill whenever asked to prepare, review, or classify transactions for an Albanian VAT (TVSH) return for any client. Trigger on phrases like "Albania VAT", "Albanian TVSH", "TVSH return", "DPT filing", "Albanian tax", or any request involving Albanian VAT filing. Also trigger when classifying transactions for…

openaccountants/openaccountants · 162 tokens

austria-vat-return

Use this skill whenever asked to prepare, review, or classify transactions for an Austrian VAT return (Umsatzsteuervoranmeldung / UVA) or annual declaration (Umsatzsteuererklärung / U1) for a self-employed individual or small business in Austria. Trigger on phrases like "prepare UVA", "Austrian VAT return"…

openaccountants/openaccountants · 185 tokens

belgium-vat-return

Use this skill whenever asked to prepare, review, or classify transactions for a Belgian VAT return (déclaration périodique TVA / periodieke BTW-aangifte) for a self-employed individual or small business in Belgium. Trigger on phrases like "prepare Belgian VAT return", "Belgian BTW", "déclaration TVA Belgique"…

openaccountants/openaccountants · 168 tokens