More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Safe Money Handling

    2

    A float turns 0.29 into 28.999…, a three-way split loses a cent, a tax line doesn't match the bank statement, a retried job posts the same interest twice.

    $6.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Safe Money Handling

    Safe Money Handling

    Example session with this skill installed

    Our app credits monthly interest on savings accounts (3% annual, 19% tax withheld at source). Users say the amounts are a few cents off from their bank statement, and last month a few accounts got October's interest twice. Here's the current code:

        const avg = balances.reduce((a, b) => a + b, 0) / balances.length / 100
        const interest = avg * 0.03 / 12
        const net = interest * 0.81
        await db.insert('transactions', { account_id, amount: net, date: firstOfMonth })
    

    Fix it.

    • Read your context and instructions
    • Compiled the safe money handling

    Diagnosis

    Four money bugs are mixed together here

    #ProblemEffect
    1avg × rate ÷ 12 treats every month as 1/12 of a yearA 31-day month earns too little and February too much; banks accrue daily (ACT/365)
    2Euros as floats (/ 100, * 0.81)Drift such as 11.149999…; the stored value depends on float rounding
    3Net derived as interest × 0.81Tax is never rounded on its own, so gross ≠ tax + net and nothing reconciles with the bank
    4Insert without claiming the periodTwo overlapping runs (page loads, cron, retries) both post October

    Fix

    Integer cents end to end, rates as integers, one rounding point, tax rounded up, and the period claimed before writing.

    // lib/money.ts — the only module that does money arithmetic
    export function accruedInterest(dailyBalancesCents: number[], rateBasisPoints: number, dayCount = 365): number {
      const sum = dailyBalancesCents.reduce((acc, b) => acc + BigInt(Math.max(b, 0)), 0n)
      const denominator = 10_000n * BigInt(dayCount)
      return Number((2n * sum * BigInt(rateBasisPoints) + denominator) / (2n * denominator)) // round half up, once
    }
    
    export function withholding(grossCents: number, ratePermille: number) {
      if (grossCents <= 0) return { gross: 0, tax: 0, net: 0 }
      const tax = Number((BigInt(grossCents) * BigInt(ratePermille) + 999n) / 1000n) // tax rounded up
      return { gross: grossCents, tax, net: grossCents - tax } // gross === tax + net, always
    }
    
    // jobs/credit-interest.ts
    const { rowCount } = await db.query(
      `update accounts set interest_next_date = $1
        where id = $2 and interest_next_date = $3`,   // claim the period first
      [nextDate, accountId, paymentDate]
    )
    if (rowCount === 0) return // another run already took this period
    
    const gross = accruedInterest(dailyEndOfDayBalancesCents, 300) // 3.00 %
    const { tax, net } = withholding(gross, 190)                    // 19 %
    try {
      await db.insert('transactions', {
        account_id: accountId,
        amount_cents: net,
        date: paymentDate,
        description: `October interest · ${fmt(gross)} gross − ${fmt(tax)} withholding (19 %)`,
      })
    } catch (e) {
      await db.query('update accounts set interest_next_date = $1 where id = $2', [paymentDate, accountId]) // release
      throw e
    }
    

    Tests

    test('31 days at 5,405.75 and 3 % → 13.77 gross, 2.62 tax, 11.15 net', () => {
      const gross = accruedInterest(Array(31).fill(540_575), 300)
      expect(gross).toBe(1377)
      expect(withholding(gross, 190)).toEqual({ gross: 1377, tax: 262, net: 1115 })
    })
    
    test('gross always equals tax + net', () => {
      for (let g = 1; g < 5000; g++) {
        const r = withholding(g, 190)
        expect(r.tax + r.net).toBe(g)
      }
    })
    
    test('overdrawn days earn nothing', () => {
      expect(accruedInterest([100_000, -50_000], 365)).toBe(10)
    })
    

    Next steps

    • Migrate amount to amount_cents bigint and add check (amount_cents <> 0).
    • Check one real statement against the new numbers. Some banks round tax differently, so adjust withholding if they do.
    • Existing credits are not recalculated. Correct the duplicated October rows by hand (or soft-delete them) after deploying.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Money bugs are quiet. A float turns 0.29 into 28.999…, a three-way split loses a cent, a tax line doesn't match the bank statement, a retried job posts the same interest twice. Nobody notices until a user does. This skill gives your agent one clear set of rules for any code that touches money, plus tested reference code to copy.

    What it does

    • Integer cents everywhere: amounts stored as bigint minor units, aggregated in SQL, BigInt for large intermediate products.
    • One conversion module: user input parsed from the string straight into cents (1.234,56, 1,234.56, 12,50 €), rejecting extra decimals instead of rounding them away.
    • Validation in two places: schema at the edge, plus database constraints for clients that can reach your API directly.
    • Server-side signs: users type positive amounts; the server signs them from the entry type. Transfers stay out of income and expense totals.
    • One rounding policy: round once per calculation. Tax and fees reconcile exactly (gross = tax + net), and splits always add up to the total (largest remainder).
    • Interest done like a bank: daily accrual with an explicit day-count convention and integer rates.
    • Idempotent postings: recurring entries, interest and fees claim their period before writing, so overlapping runs never duplicate.
    • No silent truncation: totals are never computed over a capped result set.
    • Mandatory tests: a checklist of the edge cases every money change must cover, with a pinned timezone.

    What's included

    • SKILL.md: the rules and a review checklist your agent applies while writing or reviewing code.
    • reference/money.ts: dependency-free implementations (parseAmountToMinor, applySign, allocate, withholding, accruedInterest, exceedsPercent).
    • reference/money.test.ts: tests you can run with node --test. No install.

    Who it's for

    Anyone building a budgeting app, a SaaS with invoices or payouts, a marketplace that splits payments, or anything that must match a bank statement to the cent.

    Extracted from a personal-finance app in production, where these rules were added one real bug at a time.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Guidance plus reference code, not a library: your agent adapts the functions to your codebase. No currency conversion or FX rates, and amounts in different currencies are never mixed. Reference parsing and the amount cap assume 2-decimal currencies (the parser takes a decimals parameter; adjust the cap for 0- or 3-decimal currencies). Tax rounding rules vary by country: the default (withholding rounded up) must be checked against your bank or tax authority. SQL examples use PostgreSQL syntax. Optional tests need Node.js 22.18+.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 11 days ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed11 days ago

    What's inside

    Frequently Asked Questions

    You still use numbers, just never for fractional euros or dollars. The skill makes your agent store and compute integer cents, parse what users type directly into cents (0.29 never becomes 28.999…), and switch to BigInt only where a product could exceed 2^53. That removes rounding drift, lost cents in splits and totals that don't match the bank.

    SKILL.md with ten rule sections and a review checklist; reference/money.ts with dependency-free functions (parseAmountToMinor, applySign, allocate, withholding, accruedInterest, exceedsPercent); and reference/money.test.ts, 9 test groups you can run with node --test without installing anything.

    None in particular. The rules apply to any language and database. The reference code is plain TypeScript (easy to port to JavaScript or Python), and the SQL examples use PostgreSQL. Running the optional tests needs Node.js 22.18+.

    Yes. allocate(total, weights) splits an amount by any integer weights using the largest-remainder method, so the parts always add up to the total, including negative totals and 1-cent edge cases. It works for shared bills, instalments, payouts to partners or allocations across funds.

    Partly. The rules apply, but quantities and unit prices (8+ decimals) should live in numeric columns, not cents: round to the currency's minor unit only when a value becomes an amount of money. The reference parser accepts a decimals parameter, but its amount cap is sized for 2-decimal fiat currencies, so adjust it, or keep BigInt end to end, for satoshi- or wei-scale values.

    Users always enter positive amounts and validation rejects negatives. The server then applies the sign from the entry type with one pure function (applySign): income positive, expenses and unknown types negative. It takes the absolute value first, so a minus sign sent by the client can never flip a transaction.

    New in Agents & Orchestration