money-path-safety

money-path-safety is a skill for Claude Code, Codex from oleg494/coding-kit. It costs 139 tokens per session (1,341 once invoked), scanned A, original, MIT.

A set of safety rules for code that handles money, paid credits, bonuses, refunds, quotas, or other user value. It covers locking, duplicate-request protection, balance separation, charging, logging, and tests.

In plain words
What is it for?
Use it when implementing or changing payments, subscriptions, promotional credits, refunds, usage limits, or any logic that adds or removes value.
Why use it?
It helps prevent double charges, missing refunds, incorrect deductions, and balances changing when an external operation fails.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/oleg494/coding-kit/money-path-safety
Any agent
npx skills add oleg494/coding-kit --skill money-path-safety
Clone the repo
git clone --depth 1 https://github.com/oleg494/coding-kit

Made for: Claude Code, Codex.

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 money-path-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/oleg494/coding-kit/money-path-safety.svg)](https://agentmods.dev/skills/oleg494/coding-kit/money-path-safety)
Your own site
<a href="https://agentmods.dev/skills/oleg494/coding-kit/money-path-safety"><img src="https://agentmods.dev/badge/skills/oleg494/coding-kit/money-path-safety.svg" alt="Measured on agentmods" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,341 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00139 $0.01341
Opus 5 $0.00069 $0.00671
Sonnet 5 $0.00028 $0.00268
Haiku 4.5 $0.00014 $0.00134

Measured 3d ago against content hash 2637e96c5e72, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

money-path-safety 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 3d 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.

skills/money-path-safety/SKILL.md · 59 lines

How it starts

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

Money path safety: money and value — a special class of code

Distilled from live billing sessions. Apply to ANY path where you deduct/credit/pay/limit.

1. Money: iron rules

  1. MONEY PATH IS SACRED — lock/transaction + idempotency + a log for every event + a test for double-submit. Check: pressed «pay» twice → balance +X, not +2X.
  2. IDEMPOTENCY BY DEFAULT — operation key (invoice_id, event_id) + credited flag + early return. Check: run the handler 2 times — second is a no-op.
  3. SEPARATE BUCKETS — trial/promo/purchase/subscription = different entities, not one balance field. Explicit deduction order: free → bonus → paid.
  4. HARD GATE BEFORE EXPENSIVE WORK — check entitlement/limit/money BEFORE the external call (CPU/API/LLM). With a zero balance the API is not called.
  5. CHARGE AFTER SUCCESS — success → debit; error → no debit (+ log). Inject a provider error → balance unchanged.
  6. LOG EVERY MUTATION — one line per credit/debit/grant/refund: charge uid=%s seconds=%.3f from_free=%.3f from_bonus=%.3f from_paid=%.3f. grep by user_id reconstructs the history.
  7. NO SILENT EXCEPT ON SIDE EFFECTS — except: pass is acceptable on cleanup, NOT acceptable on money/auth/data-loss. Money path: log + fallback or fail loud.
  8. READ-MODIFY-WRITE UNDER LOCK — «read→compute→write» without locking = lost update. Mutex/transaction over the whole RMW.
  9. ONE SOURCE OF TRUTH — UI/cache/log are derivatives. Truth is the storage. An incident starts with reading storage, not with a theory.

2. Atomicity in SQL (without races)

  • Atomic check-and-increment: UPDATE ... SET used = used + 1 WHERE used < max — one query, rowcount 0 = limit exhausted. NOT SELECT → IF → UPDATE.
  • Compound PK as idempotency: PRIMARY KEY (code, user_id) — a repeat is blocked at the DB level, without SELECT before INSERT.
  • SQLite: connect(timeout=30.0) + PRAGMA busy_timeout=30000 + journal_mode=WAL — three settings together.
  • Metric upsert: INSERT ... ON CONFLICT DO UPDATE SET value=value+excluded.value — without SELECT+UPDATE race.

Read the full file on GitHub · 59 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. 3d ago First seen · 59 lines · 139 tokens per session scan A 2637e96c5e72

Subscribe to this mod's changes

money-path-safety is a skill published in the GitHub repository oleg494/coding-kit (1 stars, last pushed 3d ago), licensed MIT. It adds 139 tokens to every session and 1,341 once invoked, about $0.0007 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

mobile-principles

Mobile-specific UX principles - touch targets, hover-less doctrine, thumb zones, safe areas, gestures, mobile perf budgets. Cross-platform (web mobile, iOS, Android).

Jwuthri/Tracely-ai · 40 tokens

lov-expense-report

Extract invoice data from images or text descriptions and generate a categorized Excel expense report. Supports receipt photos, scanned invoices, and manual text input. Auto-classifies into: business entertainment (客户餐费), travel-transport (机票/火车票/打车), travel-accommodation (酒店), travel-meals, office supplies…

lovstudio/skills · 127 tokens

google-fonts-curator

Recommend high-taste Google Fonts for websites based on brand tone, page type, and visual direction. Use when the user needs font selection, font pairing, or aesthetic judgment within the Google Fonts ecosystem for landing pages, brand sites, editorial pages, portfolios, or digital products.

flc1125/skills · 61 tokens

digest

Morning digest: markets, news topics, Reddit highlights, and optional X trends — composed from a per-vault config note and delivered per the Automated output convention (vault skill log first, then Telegram when configured). Use when the user asks for their morning digest, wants to set it up, or wants to change what…

onebrain-ai/onebrain · 101 tokens

sec-plain-english

Draft, rewrite, or audit investor-facing financial and legal disclosure using an independently expressed interpretation of official SEC plain-English guidance. Use for prospectus summaries, risk factors, shareholder letters, offering materials, and securities disclosures that must be easier to understand without…

Neeeophytee/agent-stylebooks · 67 tokens

least-cost-routing

Route a model-agnostic request to the cheapest capable (provider, model) via routerequest, subject to a quality-tier floor and a hard budget cap. Use when you do not care WHICH model runs a task, only that it is cheap enough and good enough.

verivus-oss/llm-cli-gateway · 58 tokens