export-kpis

Export KPI totals by program and client from ReturnPro financial data.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates exporting KPI totals aggregated by program, client, and month from ReturnPro financial data to remove manual SQL querying and table assembly for ad-hoc analysis, reporting, and validation.

Core Features & Use Cases

  • Aggregates KPI totals by month, program, and client using the get_kpi_totals_by_program_client RPC and flattens results into consumable rows.
  • Resolves months automatically (defaults to the three most recent with data), filters programs via partial name matches to dim_master_program, and formats output as a markdown table or CSV for downstream use.
  • Use case: generate a stakeholder-ready monthly KPI report across multiple programs or export CSVs for spreadsheet-based financial reconciliation.

Quick Start

Run the export-kpis command to fetch KPI totals for the latest three months and return a markdown table.

Frequently Asked Questions about export-kpis

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

FAQPage Schema
How do I export KPI totals by program and client from Supabase for financial reporting?

Export KPI totals by program and client from Supabase by querying the stg_financials_raw table through the get_kpi_totals_by_program_client RPC, which flattens aggregated financial data into consumable rows for stakeholder reporting and validation.

Can I filter financial KPI exports by partial program name matches?

Filter financial KPI exports by applying partial program name matches against the dim_master_program table, allowing flexible program selection without requiring exact identifiers when generating monthly KPI reports.

What Supabase credentials do I need to export KPI totals from ReturnPro?

Export KPI totals from ReturnPro by configuring the RETURNPRO_SUPABASE_URL and RETURNPRO_SUPABASE_SERVICE_KEY environment variables, which authenticate access to the stg_financials_raw table and the get_kpi_totals_by_program_client RPC.

Does the KPI export tool support CSV format for spreadsheet reconciliation?

The KPI export tool supports CSV format for spreadsheet reconciliation by formatting flattened RPC query results into downloadable files, alongside markdown table output for direct stakeholder presentation.

How are reporting months resolved when exporting month-over-month KPI comparisons?

Month-over-month KPI comparisons resolve months by defaulting to the three most recent months containing financial data in the stg_financials_raw table, ensuring empty periods are skipped automatically.

What's the best way to automate monthly KPI reporting across multiple programs instead of manual SQL?

Automate monthly KPI reporting across multiple programs by replacing manual SQL with the export-kpis Skill, which calls the get_kpi_totals_by_program_client RPC to aggregate and flatten data by month, program, and client into ready-to-use formats.