agentleFS
The-Artificer-of-Ciphers-LLCThe-Artificer-of-Ciphers-LLC/skills-from-the-artificer/money-boundary-judgment/SKILL.md

money-boundary-judgment

Skill6 starsChanged 34 days agoMITView on GitHub

How to cross an API that forces Double (framework parameters, chart plot values, any Double-only library) without breaking a "Decimal for money" rule. Use when a lint flags decimal-for-money, or when writing code that converts between Double and Decimal for monetary values.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check the API's accepted types in the framework's current documentation before assuming.

    line 12
  2. Very specific:

    Put // money-boundary: <which framework, which direction> on the declaration line, for example // money-boundary: charts plot value, …

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

money-boundary-judgment

Policy assumed: all monetary values are Decimal. Some frameworks only accept Double. The rule is kept by converting exactly once, at the edge, in the right direction.

1. Is Double actually forced?

Check the API's accepted types in the framework's current documentation before assuming. If Decimal works, use it and stop.

2. Which direction?

DirectionWhere it happensRule
Decimal -> DoubleDisplay-only sinks (chart plot values, progress)Convert at the last line before the framework (NSDecimalNumber(decimal:).doubleValue). The Double never flows back into money math.
Double -> DecimalInputs (framework parameters, parsed numbers)Do not use Decimal(double): it carries binary error (e.g. 0.1 becomes 0.1000000000000000055...). Go through a string or round to currency minor units, then use only the Decimal.

3. Is there math on the Double side?

Averages, sums, percentages of money are computed in Decimal first and converted after. A Double on a money-named variable that feeds arithmetic is not a boundary; it is the bug.

4. Mark it

Put // money-boundary: <which framework, which direction> on the declaration line, for example // money-boundary: charts plot value, Decimal -> Double. This is an optional convention: any linter or grep-based check for Double-typed money variables can look for the marker and accept the line, and the reason stays on record.

5. Test the conversion

For Double -> Decimal inputs: a test at limit-1, limit, limit+1 of the minor-unit precision (e.g. 19.989, 19.99, 19.991), asserting the exact Decimal.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.