Dinero.js is a JavaScript and TypeScript library for representing, calculating, comparing, converting, and formatting monetary values. Applications use it to handle currencies and amounts with immutable operations, configurable numeric precision, and support for currencies with non-decimal subdivisions. Its catalogue skills guide coding agents in using the library.
Borrowing it
Nothing to install: this file belongs to dinerojs/dinero.js. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/dinerojs/dinero.js/main/.agents/skills/dinero-best-practices/SKILL.mdgit clone --depth 1 https://github.com/dinerojs/dinero.jsWrote 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.
[](https://agentmods.dev/skills/dinerojs/dinero.js/dinero-best-practices)<a href="https://agentmods.dev/skills/dinerojs/dinero.js/dinero-best-practices"><img src="https://agentmods.dev/badge/skills/dinerojs/dinero.js/dinero-best-practices/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.
<a href="https://agentmods.dev/skills/dinerojs/dinero.js/dinero-best-practices"><img src="https://agentmods.dev/badge/skills/dinerojs/dinero.js/dinero-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00070 | $0.00728 |
| Opus 5 | $0.00035 | $0.00364 |
| Sonnet 5 | $0.00014 | $0.00146 |
| Haiku 4.5 | $0.00007 | $0.00073 |
Grade A, and why
dinero-best-practices 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 11d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- dinero-best-practices — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dinero.js Best Practices
Core rules for working with Dinero.js, the JavaScript/TypeScript library for creating, calculating, and formatting money safely. Contains rules across 4 categories, prioritized by impact.
When to Apply
Reference these guidelines when:
- Creating Dinero objects from user input, API responses, or database values
- Performing arithmetic on monetary values (adding, splitting, multiplying)
- Choosing between
numberandbigintcalculators - Importing from
dinero.js,dinero.js/currencies, ordinero.js/bigint - Working with prices, costs, taxes, or any financial calculation
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Object Creation | CRITICAL | creation- |
| 2 | Arithmetic | CRITICAL | arithmetic- |
| 3 | Precision | HIGH | precision- |
| 4 | Imports | MEDIUM | imports- |
Quick Reference
1. Object Creation (CRITICAL)
creation-minor-units- Always pass amounts as integers in minor currency unitscreation-from-floats- Use a helper to convert float inputs to minor unitscreation-zero-exponent- Currencies with exponent 0 (e.g., JPY) take major units directly
2. Arithmetic (CRITICAL)
arithmetic-immutability- All operations return new objects; capture the return valuearithmetic-allocate-not-divide- Useallocatefor splitting money, not manual divisionarithmetic-scaled-amounts- Never multiply by a raw decimal; use scaled amountsarithmetic-percentages- Calculate percentages withallocateor scaledmultiply
3. Precision (HIGH)
precision-bigint- Usedinero.js/bigintfor amounts exceedingNumber.MAX_SAFE_INTEGERprecision-crypto- Cryptocurrencies require bigint due to high exponentsprecision-trim-scale- UsetrimScaleto remove trailing zeros after chained operations
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- rules/arithmetic-allocate-not-divide.md 1.2 KB
- rules/arithmetic-immutability.md 1.2 KB
- rules/arithmetic-percentages.md 1.5 KB
- rules/arithmetic-scaled-amounts.md 1.3 KB
- rules/creation-from-floats.md 1.3 KB
- rules/creation-minor-units.md 1.0 KB
- rules/creation-zero-exponent.md 1.0 KB
- rules/imports-bigint-currencies.md 1.2 KB
- rules/imports-tree-shaking.md 1.0 KB
- rules/precision-bigint.md 1.2 KB
- rules/precision-crypto.md 1.2 KB
- rules/precision-trim-scale.md 1.0 KB
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.
- 11d ago First seen · 79 lines · 70 tokens per session scan A 3284558f2e6c
dinero-best-practices is a skill published in the GitHub repository dinerojs/dinero.js (6,792 stars, last pushed yesterday), licensed MIT. It adds 70 tokens to every session and 728 once invoked, about $0.0003 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-30.
Other skills, from other repositories
alpaca-trade-api-sdk
Integrate and build on the @alpacahq/alpaca-trade-api TypeScript SDK for the Alpaca Trading and Market Data APIs (the unified Alpaca client, ergonomic order builders, normalized market-data shapes, pagination, typed errors, resilience, and real-time streaming). Use when writing or reviewing code that imports…
starter-dashboard
Scaffold a local Next.js Alpaca dashboard using the published @alpacahq/alpaca-trade-api SDK for paper Trading API and Market Data API workflows. Use when the user asks for starter-dashboard, a starter Alpaca dashboard, a local Trading API demo, a Market Data API dashboard, or a greenfield Next.js Alpaca SDK prototype.
reviewing-personhog-protocol
The full review process for personhog coordination-protocol changes — leases, fencing, handoffs, supervisors, failure budgets, warming, and changelog semantics. Use before pushing or requesting review on any personhog protocol changeset, when asked for an exhaustive or careful review of personhog code, and after any…
modeling-revenue-metrics
Build reusable revenue models — MRR, ARR, gross revenue, new/expansion/contraction/churn, ARPU, LTV, and per-customer/per-account revenue — on either PostHog data-warehouse views (HogQL) or an external dbt project. Use when the user wants to model, define, or compute recurring revenue, monthly/annual recurring…
auditing-llm-gateway-parity
Audits services/llm-gateway against PostHog/ai-gateway and updates services/llm-gateway/PARITY.md from current implementation evidence. Use when either gateway changes auth, attribution, billing, endpoints, providers, models, routing, or metadata; when reviewing a Python gateway change; or when asked to refresh…
django-startup-time
Keep heavy imports off the django.setup() path that every process (web, celery, temporal, migrate, shell, CI) pays for. Use when touching AppConfig.ready(), wiring signal receivers, editing the lazy API router (posthog/api/restrouter.py or its init.py shim), deferring a heavy import, when the startup-import-budget…