constants-governance

Enforce shared financial default constants and NaN-safety guards across server and client codebases.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Norfolk-Group/H-Analytics --skill constants-governance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: constants-governance
Source: https://github.com/Norfolk-Group/H-Analytics/tree/main/.claude/archive/agents-skills-snapshot/constants-governance
Command: npx skills add https://github.com/Norfolk-Group/H-Analytics --skill constants-governance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents undefined or inconsistent financial defaults and NaN propagation in a hospitality financial model by centralizing constants, enforcing naming rules, and applying numeric guards and tests.

Core Features & Use Cases

  • Single source of truth for financial defaults in a shared constants file so server and client use identical fallback values.
  • Client barrel pattern that re-exports shared constants and defines client-only presentation defaults.
  • Safe-number guard patterns and zero-guards around loan calculations to stop NaN and Infinity from corrupting downstream results.
  • Automated detection tests that prevent magic numbers and ensure tests derive expectations from constants.
  • Use when adding or changing financial constants, diagnosing NaN incidents, or writing tests that depend on default values.

Quick Start

Validate and update the shared constants file, add safe-number guards around any new arithmetic, and run the hardcoded-number detection test to confirm no magic literals were introduced.

Frequently Asked Questions about constants-governance

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

FAQPage Schema
How do I prevent NaN propagation in financial model calculations?

Prevent NaN propagation by adding safe-number guards and zero-guards around arithmetic boundaries in your financial engine, stopping undefined or Infinity values from corrupting downstream financial calculations.

What is the best way to manage shared financial constants across server and client codebases?

Manage shared financial constants by centralizing default values in a single shared constants file, then use a client barrel pattern to re-export them so server and client codebases use identical fallback values.

How do I detect hardcoded magic numbers in financial model tests?

Detect hardcoded magic numbers in financial model tests by running automated hardcoded-number detection tests that verify all test expectations derive from the shared constants file rather than literal values.

Why does my hospitality financial model return inconsistent default values?

Inconsistent default values occur when financial constants are not centralized in a single shared file, causing server and client codebases to use different fallback values across the hospitality financial model.

Do I need a client barrel pattern to enforce consistent financial defaults?

You need a client barrel pattern to enforce consistent financial defaults when your architecture requires re-exporting shared constants while also defining client-only presentation defaults separately from server values.

When should I add safe-number guards to financial arithmetic boundaries?

Add safe-number guards to financial arithmetic boundaries whenever you are adding or changing financial defaults, diagnosing NaN incidents, or performing loan calculations to prevent undefined values from propagating.