rate-anomalies

Detect anomalous per-unit rates in ReturnPro financial records using z-scores.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/clenisa/optimal-cli --skill rate-anomalies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-anomalies
Source: https://github.com/clenisa/optimal-cli/tree/main/skills/rate-anomalies
Command: npx skills add https://github.com/clenisa/optimal-cli --skill rate-anomalies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects anomalous per-unit rates across program-month entries in ReturnPro staged financial data to surface data entry errors, misclassified programs, and upstream reporting issues that distort financial KPIs and automated analytics.

Core Features & Use Cases

  • Compute per-unit rate for each program-month by reading revenue and unit rows from staged financials and casting amount fields to numeric.
  • Calculate historical mean and standard deviation per program, compute z-scores, and flag program-months that exceed a configurable threshold.
  • Support filtering by months and program name substrings, export results as a dense table or CSV, and sort anomalies by severity for triage and correction.
  • Use case: Run against the last six months to find rate spikes that indicate data entry mistakes or misattributed revenue streams before monthly close.

Quick Start

Run the rate-anomalies skill against recent ReturnPro staged financials to flag and export program-month $/unit outliers.

Frequently Asked Questions about rate-anomalies

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

FAQPage Schema
How do I detect anomalous per-unit rates in financial data?

Detect anomalous per-unit rates by computing rate z-scores for each program-month and flagging statistical outliers that exceed a configurable threshold. This process calculates rate as revenue divided by units and compares it to the historical mean and standard deviation per program.

What is the best way to find $/unit rate outliers before monthly close?

The best way to find $/unit rate outliers is to run anomaly detection against recent staged financials, filtering by selectable months and program names. It flags rate spikes indicating data entry mistakes or misattributed revenue streams for triage and correction.

How does z-score anomaly detection work for program-month financial records?

Z-score anomaly detection works by computing the historical mean and standard deviation of per-unit rates per program. It then calculates a z-score for each program-month entry, flagging records that exceed a statistical threshold as outliers requiring data quality review.

Do I need Supabase credentials to analyze ReturnPro staged financials?

Yes, you need Supabase credentials to analyze ReturnPro staged financials. The process requires RETURNPRO_SUPABASE_URL and RETURNPRO_SUPABASE_SERVICE_KEY environment variables to access and query the stg_financials_raw and dim_master_program tables.

Can I filter rate anomaly detection by specific months and program names?

Yes, you can filter rate anomaly detection by selectable months and program name substrings. This allows you to target specific time ranges and programs, sorting flagged anomalies by severity to support reporting corrections and downstream analytics.

Why are my financial KPIs distorted by misclassified program revenue?

Financial KPIs are distorted when misclassified program revenue creates anomalous per-unit rate outliers. Detecting these statistical outliers through z-score analysis surfaces upstream reporting issues and data entry errors, allowing corrections before they impact automated analytics.