phoenix-precision-guard

Enforce Decimal.js precision and type safety in Phoenix VC fund P0 paths.

Updated Jul 21, 2025
One-click install
npx skills add https://github.com/nikhillinit/Updog_restore --skill phoenix-precision-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-precision-guard
Source: https://github.com/nikhillinit/Updog_restore/tree/main/.claude/skills/phoenix-precision-guard
Command: npx skills add https://github.com/nikhillinit/Updog_restore --skill phoenix-precision-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Decimal.js.

What problem does it solve?

This Skill eliminates costly calculation errors in VC fund modeling by enforcing Decimal.js usage and removing parseFloat from critical paths.

Frequently Asked Questions about phoenix-precision-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent numeric drift in financial calculations?

Numeric drift in financial calculations occurs when floating-point arithmetic accumulates rounding errors. This Skill prevents drift by enforcing Decimal.js usage across critical P0 calculation paths, replacing parseFloat with precise decimal operations, and adding validation tests to ensure calculations maintain accuracy throughout your VC fund model.

Why should I use Decimal.js instead of parseFloat for fund modeling?

Decimal.js provides arbitrary-precision arithmetic that preserves exact decimal values, whereas parseFloat converts strings to binary floats that introduce rounding errors. This Skill enforces Decimal.js configuration centrally and removes parseFloat from P0 paths to eliminate compounding precision loss in financial calculations.

How do I add TypeScript type safety to my financial calculation code?

Type safety in financial code catches precision errors at compile time. This Skill configures incremental TypeScript strictness (noImplicitAny, strictNullChecks, strictFunctionTypes, noImplicitReturns) and sets ESLint rules to enforce explicit radix for parseInt, preventing implicit type coercion in numeric operations.

What's the best way to test precision in a financial modeling system?

Precision testing validates that calculations maintain accuracy after refactoring. This Skill adds precision-focused tests across server analytics and client engines, preserves truth-case baselines after decimal conversions, and enforces Decimal.js validation to ensure all P0 paths produce auditable results.

Can I apply this approach incrementally to an existing codebase?

Yes. This Skill enables incremental TypeScript strictness and triages parseFloat occurrences rather than forcing a rewrite. You configure ESLint and TypeScript gradually, validate Decimal.js usage in P0 paths first, and preserve existing test baselines to maintain stability during the transition.

Does this prevent all calculation errors in financial software?

This Skill eliminates errors from floating-point rounding and implicit type coercion in P0 calculation paths through Decimal.js enforcement and type checking. It does not address logic errors or domain-specific validation rules, which require separate review and testing.