dinerojs/skills

dinero-currency-patterns

Currency handling patterns for the Dinero.js money library. Use when working with multiple currencies, converting between currencies, defining custom currencies, storing monetary values in databases, or integrating with payment services like Stripe or PayPal. Triggers on currency conversion, database schema design for money, or payment API integration with Dinero objects.

First seen Feb 28, 2026

Installation

$ npx skills add dinerojs/skills --skill dinero-currency-patterns

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from dinerojs/skills.

npx skills add dinerojs/skills

Browse all from dinerojs/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 2
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT
More metadata
author
dinerojs
version
1.0.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,598 B
  • docs SUMMARY.md 405 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 309 installs

SKILL.md

Dinero.js Currency Patterns

Patterns for handling currencies with Dinero.js: type safety, conversions, custom currencies, database storage, and payment service integration.

When to Apply

Reference these guidelines when:

  • Converting between currencies with convert
  • Defining custom currencies (e.g., cryptocurrencies, loyalty points)
  • Looking up currencies dynamically from external input
  • Storing monetary values in a database
  • Integrating with payment services (Stripe, PayPal, Square)

Rule Categories by Priority

Priority Category Impact Prefix
1 Type Safety HIGH types-
2 Conversion HIGH convert-
3 Storage HIGH storage-
4 Payment Integration MEDIUM payment-

Quick Reference

1. Type Safety (HIGH)

  • types-as-const - Define custom currencies with as const satisfies for compile-time safety
  • types-currency-mismatch - TypeScript catches currency mismatches in operations at compile time
  • types-lookup-validation - Validate currency codes from external sources at runtime

2. Conversion (HIGH)

  • convert-scaled-rates - Use scaled amounts for fractional exchange rates, not floats
  • convert-reusable - Build reusable converter functions with higher-order patterns

3. Storage (HIGH)

  • storage-database - Store amount, currency code, and scale as separate columns
  • storage-no-money-type - Avoid PostgreSQL's money type for multi-currency applications

4. Payment Integration (MEDIUM)

  • payment-services - Map Dinero objects to payment service formats with dedicated helpers

How to Use

Read individual rule files for detailed explanations and code examples:

rules/types-as-const.md
rules/convert-scaled-rates.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references