agentleFS
Salberg87Salberg87/fiken-folio-skills/skills/fiken-kladd/SKILL.md

fiken-kladd

Skill0 starsChanged 28 days agoApache-2.0View on GitHub

Prepare bookkeeping in Fiken (fiken.no) without touching the ledger — create purchase, offer and invoice drafts (kladd), upload receipts to the inbox (mottak), attach receipts to drafts, and create or update contacts, contact persons, projects, activities and time entries. Use when the user wants to register a cost, draft an invoice or offer, upload a kvittering, add a customer, or log hours in Fiken. Never posts to the ledger; the user posts drafts in Fiken.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Deep links into the Fiken UI: use the draft's uuid, not the numeric draftId: purchase draft → …

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fiken kladd (prepare)

Creates drafts and inbox uploads in Fiken. Nothing here changes the ledger. All commands go through scripts/fiken-kladd.sh. Use the fiken skill to read (contacts, accounts, existing drafts).

Bokføring is not in this skill. There is no command to post a draft. When a draft is ready, tell the user to review and post it in Fiken (or, if they have installed the opt-in fiken-bokforing skill, ask them first). Don't write your own API call to post it.

Setup (one-time):

export FIKEN_WRITE_TOKEN=...           # a token from a Fiken user with full access
export FIKEN_COMPANY_SLUG=your-company-as
# or: export FIKEN_ENV=~/.config/fiken/.env

Every write is logged as a JSON line to ~/.local/state/fiken-folio-skills/audit.jsonl (override with FIKEN_FOLIO_AUDIT_LOG), and the created draft is read back from Fiken. A write is never retried automatically: if a call times out or fails with 5xx, check fiken drafts before trying again, or you may create a duplicate.

Workflows

F=~/.claude/skills/fiken-kladd/scripts/fiken-kladd.sh

Upload a receipt to mottak (staging, not booking):

bash "$F" inbox-upload ~/Downloads/kvittering.pdf "Batterier"

Register a cost as a DRAFT (kladd — the user reviews and posts it in Fiken):

# Line account goes in "incomeAccount" even for a purchase (Fiken quirk). Øre.
bash "$F" draft-purchase '{"cash":true,"paid":true,"currency":"NOK","invoiceIssueDate":"2026-05-26",
  "lines":[{"text":"Batterier","vatType":"HIGH","incomeAccount":"6560","net":10800,"gross":13500}]}'
bash "$F" attach-draft <draftId> ~/Downloads/kvittering.pdf

Create a sales offer / invoice DRAFT (kladd — review and send in Fiken). Sales lines use unitPrice + quantity in øre (not net/gross), and type + daysUntilDueDate are required on both:

# Tilbud-kladd
bash "$F" draft-offer '{"type":"offer","customerId":12345,"daysUntilDueDate":14,
  "lines":[{"description":"Nettsideredesign","unitPrice":2500000,"vatType":"HIGH","quantity":1,"incomeAccount":"3020"}]}'

# Faktura-kladd (also needs bankAccountNumber + cash)
bash "$F" draft-invoice '{"type":"invoice","customerId":12345,"daysUntilDueDate":14,
  "bankAccountNumber":"<your account number>","cash":false,
  "lines":[{"description":"Nettsideredesign","unitPrice":2500000,"vatType":"HIGH","quantity":1,"incomeAccount":"3020"}]}'

Contacts, projects, activities and time entries — no wrapped command, use raw. Writes through raw are limited to an allow-list in the script: POST/PUT/PATCH on contacts, contacts/{id}/contactPerson, projects, activities, timeEntries, purchase/offer/invoice drafts and inbox under your own company. Everything else is refused, including every create* action that turns a draft into a real document.

bash "$F" raw POST /companies/$FIKEN_COMPANY_SLUG/contacts '{"name":"Acme AS","customer":true}'
bash "$F" raw PATCH /companies/$FIKEN_COMPANY_SLUG/timeEntries/123 '{"hours":2.5}'
bash "$F" raw GET /companies/$FIKEN_COMPANY_SLUG/projects                    # reads work too

Fiken's UI link to a draft uses its uuid: https://fiken.no/foretak/{slug}/handelsutkast/kjop/{uuid} (sales: …/handelsutkast/salg/{uuid}). Give the user that link so they can post it.

Sharp edges (learned in production)

  • Line text/description max 200 characters — the API answers 400 on longer ones. Shorten before sending.
  • Booked entries can never be deleted — DELETE on a booked purchase gives HTTP 405. Corrections are a credit note or reversing entry in the Fiken UI, not via the API.
  • vatType is validated per account — e.g. EXEMPT is rejected on some balance accounts. On "ikke gyldig mva kode for kontoen", change vatType or account; check the account's VAT setup in Fiken instead of guessing variants.
  • The cost account goes in incomeAccount even for purchases (repeated here because it surprises every time).
  • Amounts are øre everywhere in raw JSON; only the report commands convert.
  • type + daysUntilDueDate are required on both offer and invoice drafts.
  • Attachments on sales drafts: POST /companies/{slug}/offers/drafts/{draftId}/attachments, multipart with filename, comment, file. Works on drafts only — the same path on a finished offer gives 404. Delete with the attachment's uuid field: DELETE …/attachments/{uuid} → 204.
  • curl -F text fields lose UTF-8 — comment=Avtalevilkår is stored as AvtalevilkÃ¥r. Leave æ/ø/å out of multipart text fields, or build the request in Python with explicit encoding. File contents are not affected.
  • Services bought from abroad (SaaS etc.) are reverse charge (snudd avregning, mval. § 3-30), not an ordinary HIGH purchase. Ask before drafting these.
  • Deep links into the Fiken UI use the draft's uuid, not the numeric draftId: purchase draft → https://fiken.no/foretak/{slug}/handelsutkast/kjop/{uuid}, sales draft → …/handelsutkast/salg/{uuid}.

Full reference

Draft schemas, VAT types and gotchas: see REFERENCE.md.


Part of fiken-folio-skills by Fredrik Skorge Salberg (Pifre AS). Not affiliated with Fiken.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.