AgentSkillsCN

categorization

丹麦商家知识与交易分类规则。在将交易归类为支出类别时,可参考此规则。

SKILL.md
--- frontmatter
name: categorization
description: Danish merchant knowledge and transaction categorization rules. Reference this when classifying transactions into spending categories.

Categorization

Purpose

Provides Claude with Danish merchant knowledge and categorization rules for classifying bank transactions into spending categories.

Categories

15 Danish spending categories with subcategories:

CategorySubcategoriesDescription
BoligHusleje, El, Vand, Varme, ForsikringHousing costs
DagligvarerSupermarked, SpecialbutikGroceries
TransportOffentlig, Bil, Taxi, CykelTransportation
AbonnementerStreaming, Fitness, Software, TelefonSubscriptions
RestauranterRestaurant, Café, TakeawayDining out
ShoppingTøj, Elektronik, Bolig, AndetShopping
SundhedApotek, Læge, TandlægeHealth
UnderholdningBiograf, Koncert, SpilEntertainment
RejserFly, Hotel, FerieTravel
BørnDaginstitution, Tøj, LegetøjChildren
Personlig plejeFrisør, KosmetikPersonal care
UddannelseKurser, Bøger, MaterialerEducation
OpsparingOverførsler til opsparingSavings transfers
IndkomstLøn, RefusionIncome
AndetUkategoriseretOther / fallback

Merchant Pattern Database

Map raw transaction text patterns to normalized merchant names and categories. Patterns use * as wildcard.

Dagligvarer (Groceries)

PatternMerchantSubcategory
*NETTO*NettoSupermarked
*FØTEX* or *FOETEX*FøtexSupermarked
*REMA*1000* or *REMA1000*Rema 1000Supermarked
*IRMA*IrmaSupermarked
*LIDL*LidlSupermarked
*ALDI*AldiSupermarked
*BILKA*BilkaSupermarked
*MENY*MenySupermarked
*SPAR*SparSupermarked
*FAKTA*FaktaSupermarked
*COOP*CoopSupermarked
*DAGLIG*BRUGSEN* or *DAGLI*BRUGSEN*Dagli'BrugsenSupermarked
*SUPER*BRUGSEN*SuperBrugsenSupermarked
*KVICKLY*KvicklySupermarked

Transport

PatternMerchantSubcategory
*DSB*DSBOffentlig
*REJSEKORT*RejsekortOffentlig
*MOVIA*MoviaOffentlig
*Q8*Q8Bil
*CIRCLE*K*Circle KBil
*SHELL*ShellBil
*OK BENZIN* or *OK PLUS*OKBil
*UBER*UberTaxi
*TAXA* or *DANTAXI*TaxaTaxi
*DONKEY*REPUBLIC*Donkey RepublicCykel

Abonnementer (Subscriptions)

PatternMerchantSubcategory
*NETFLIX*NetflixStreaming
*SPOTIFY*SpotifyStreaming
*DISNEY*PLUS* or *DISNEYPLUS*Disney+Streaming
*HBO* or *MAX*STREAMING*HBO MaxStreaming
*VIAPLAY*ViaplayStreaming
*TV2*PLAY* or *TV 2 PLAY*TV2 PlayStreaming
*YOUTUBE*PREMIUM* or *GOOGLE*YOUTUBE*YouTube PremiumStreaming
*APPLE*MUSIC*Apple MusicStreaming
*FITNESS*WORLD*Fitness WorldFitness
*FITNESS*DK*Fitness DKFitness
*SATS*SATSFitness
*TDC* or *YOUSEE*TDCTelefon
*TELENOR*TelenorTelefon
*TELIA*TeliaTelefon
*ADOBE*Adobe CCSoftware
*MICROSOFT*365* or *MICROSOFT*OFFICE*Microsoft 365Software
*ICLOUD* or *APPLE.COM/BILL*iCloudSoftware
*DROPBOX*DropboxSoftware

Restauranter (Dining)

PatternMerchantSubcategory
*WOLT*WoltTakeaway
*JUST*EAT*Just EatTakeaway
*TOO GOOD TO GO* or *TOOGOODTOGO*Too Good To GoTakeaway
*STARBUCKS*StarbucksCafé
*JOE*THE*JUICE* or *JOE & THE JUICE*Joe & The JuiceCafé
*LAGKAGEHUSET*LagkagehusetCafé
*MCDONALDS* or *MC DONALDS*McDonald'sRestaurant
*BURGER*KING*Burger KingRestaurant

Shopping

PatternMerchantSubcategory
*H&M* or *H M * or *HM *H&MTøj
*ZALANDO*ZalandoTøj
*IKEA*IKEABolig
*ELGIGANTEN*ElgigantenElektronik
*POWER*PowerElektronik
*NORMAL*NormalAndet
*FLYING*TIGER*Flying TigerAndet
*SØSTRENE*GRENE* or *SOSTRENE*GRENE*Søstrene GreneAndet
*AMAZON*AmazonAndet
*JYSK*JyskBolig

Bolig (Housing)

PatternMerchantSubcategory
*ØRSTED* or *OERSTED*ØrstedEl
*HOFOR*HOFORVand
*TRYG*TrygForsikring
*TOPDANMARK*TopdanmarkForsikring
*ALKA* or *CODAN*CodanForsikring
*HUSLEJE* or *FAST OVERFØRSEL*HUSLEJE*HuslejeHusleje
*NORLYS*NorlysEl
*EWII*EwiiEl

Sundhed (Health)

PatternMerchantSubcategory
*APOTEK*ApoteketApotek
*MATAS*MatasApotek
*TANDLÆGE* or *TANDLAEGE*TandlægeTandlæge
*LÆGE* or *LAEGE*LægeLæge

Underholdning (Entertainment)

PatternMerchantSubcategory
*NORDISK*FILM*Nordisk FilmBiograf
*CINEMAXX*CinemaxXBiograf
*TICKETMASTER*TicketmasterKoncert
*BILLETLUGEN*BilletlugenKoncert

Rejser (Travel)

PatternMerchantSubcategory
*SAS* or *SCANDINAVIAN*AIRLINES*SASFly
*NORWEGIAN*NorwegianFly
*RYANAIR*RyanairFly
*AIRBNB*AirbnbHotel
*HOTELS.COM* or *BOOKING.COM*Booking.comHotel

Personlig pleje

PatternMerchantSubcategory
*SEPHORA*SephoraKosmetik
*FRISØR* or *FRISOER* or *CUTTERS*FrisørFrisør

Uddannelse (Education)

PatternMerchantSubcategory
*SAXO*SaxoBøger
*AMAZON*KINDLE*Amazon KindleBøger

Normalization Rules

Before matching patterns, normalize the raw transaction text:

  1. Convert to uppercase for matching
  2. Replace Danish characters: ØOE, ÆAE, ÅAA (for pattern matching only — preserve originals in raw_text)
  3. Collapse multiple spaces into one
  4. Trim leading/trailing whitespace

Transaction Type Detection

Use the transaction description prefix to identify the payment method:

Prefix PatternTypeNotes
Dankort-købCard payment (physical)Danish debit card
Visa-købCard payment (physical)Visa card
OverførselBank transferInternal or external
Fast overførselStanding orderRecurring transfer
PBS or BetalingsserviceDirect debitSubscriptions and bills
MobilePayMobile paymentPerson-to-person or merchant
Løn fraSalaryIncome — categorize as Indkomst
HævningATM withdrawalCategorize as Andet

Matching Order

When categorizing a transaction, check these sources in order — stop at the first match:

  1. learnings/categorization.md — Check for user corrections learned from previous sessions (confidence 1.0). These take precedence over all other rules.
  2. learnings/merchants.md — Check for merchant name aliases to normalize the raw text before pattern matching.
  3. merchant-overrides.csv — Check for a matching raw_pattern (confidence 1.0). These are learned from previous user corrections within the same session.
  4. Static pattern database — Check the merchant pattern tables above (confidence 1.0 exact / 0.8 partial).
  5. Intelligent classification — No pattern match, but Claude can infer category from transaction context (confidence 0.5–0.7).
  6. Fallback — Cannot determine category — assign to "Andet" (confidence 0.0).

Confidence Scoring

Assign a confidence score to each categorization:

Match TypeConfidenceDescription
Merchant override match1.0Transaction text matches a learned override in merchant-overrides.csv
Exact pattern match1.0Transaction text matches a known merchant pattern
Partial pattern match0.8Part of the text matches a known pattern
Intelligent classification0.5–0.7No pattern match, but Claude can infer from context
Unknown0.0Cannot determine category — assign to Andet

When manual_override is TRUE for a transaction, always use the user's category regardless of what patterns suggest.

Learning from Corrections

When a user manually corrects a transaction's category, the correction should be saved to learnings/categorization.md so future sessions automatically apply the learned rule.

How to record a categorization learning:

  1. Open learnings/categorization.md
  2. Append a new row to the Learnings table with:
    • Date: Today's date (YYYY-MM-DD)
    • Pattern: The normalized raw text pattern to match (uppercase, wildcards allowed)
    • Merchant: The normalized merchant name
    • Category: The user-corrected category
    • Subcategory: The user-corrected subcategory
    • Context: Brief note about why this correction was made

Example learning entry:

markdown
| 2026-01-15 | *NETFLIX* | Netflix | Underholdning | Streaming | User: "Netflix er underholdning, ikke abonnement" |

Also update merchant-overrides.csv for the current session:

  1. Take the corrected transaction's raw_text from transactions.csv
  2. Normalize it: uppercase, trim whitespace, collapse multiple spaces
  3. Use this as the raw_pattern
  4. Use the user-corrected merchant, category, and subcategory from categorized.csv
  5. Set created_at to the current timestamp
  6. Only append if no row with the same raw_pattern already exists

Ambiguous Merchants

  • Netto: Always Dagligvarer, even though they sell non-grocery items
  • 7-Eleven: Dagligvarer (most purchases are food/drink)
  • Amazon: Default to Shopping unless description contains "Prime" or "Kindle" (then Abonnementer or Uddannelse)
  • Normal: ShoppingAndet (sells mixed categories)
  • Matas: SundhedApotek (primarily health/beauty)
  • Wolt: RestauranterTakeaway unless the Wolt+ subscription charge (then Abonnementer)

Examples

Example 1: Clear Match

code
raw_text: "NETTO FO 1234 KØBENHAVN"
normalized: "NETTO FO 1234 KOEBENHAVN"
pattern match: *NETTO* → Netto
result: category=Dagligvarer, subcategory=Supermarked, merchant=Netto, confidence=1.0

Example 2: PBS Subscription

code
raw_text: "PBS FITNESS WORLD"
normalized: "PBS FITNESS WORLD"
pattern match: *FITNESS*WORLD* → Fitness World
result: category=Abonnementer, subcategory=Fitness, merchant=Fitness World, confidence=1.0, is_recurring=TRUE

Example 3: Intelligent Classification

code
raw_text: "RESTAURANT COFOCO KBH"
normalized: "RESTAURANT COFOCO KBH"
no pattern match — but "RESTAURANT" prefix suggests dining
result: category=Restauranter, subcategory=Restaurant, merchant=Cofoco, confidence=0.6

Example 4: Income

code
raw_text: "Løn fra Arbejdsgiver ApS"
prefix match: "Løn fra" → salary
result: category=Indkomst, subcategory=Løn, merchant=Arbejdsgiver ApS, confidence=1.0