@teakit/money

@teakit/money is a TypeScript money-domain library being designed for precise amounts, currency-aware operations, explicit rounding, and safe serialization.

Guide

Use this page as the short human entry point. Keep v1 direction in docs/proposals/, deeper project knowledge in docs/knowledge/, durable decisions in docs/memory/, and agent-facing instructions in skills/.

NeedRead
Understand the v1 directiondocs/proposals/v00-money.md
Understand the package conceptMoney Modeling
Compact rules for AI agentsLLMs
Repository workflowTeakit Money Skill

Current State

The repository contains a Money-named implementation seed aligned with Dinero.js v2 capabilities, with number and bigint entry points, ISO currency exports, and Bun behavior tests under tests/.

npm
yarn
pnpm
bun
deno
npm install @teakit/money

Use only APIs that exist in src and have tests. Keep proposed additions in docs/proposals/ or docs/specs/ until they are implemented.

v1 Direction

  • Model money as amount, currency, and scale, not display text.
  • Use scaled integers instead of floating-point money.
  • Reject unsafe currency mixing.
  • Make rounding, allocation, parsing, and serialization policies explicit.
  • Keep snapshots JSON-safe for APIs and databases.
  • Teach AI coding agents the correct money patterns through compact docs and skills.

Project Contract

  • Keep exported library code under src.
  • Keep tests under tests using bun:test.
  • Keep reusable project knowledge under docs/knowledge.
  • Keep durable project rules under docs/memory.
  • Keep agent-facing usage notes under skills.
  • Route non-trivial work through Billgo Skills before editing.
  • Keep proposal-only APIs out of public usage docs.

LLMs

AI agents should start with LLMs, then open only the relevant source, test, or project documentation file.