log-metrics

Persist agent metrics to Supabase and CSV backup with filtering.

Updated Oct 24, 2025
One-click install
npx skills add https://github.com/5hdaniel/Mad --skill log-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: log-metrics
Source: https://github.com/5hdaniel/Mad/tree/main/.claude/skills/log-metrics
Command: npx skills add https://github.com/5hdaniel/Mad --skill log-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Teams need a reliable way to record and query agent metrics generated during automation runs, preserving a primary source of truth in Supabase and a lightweight CSV backup for traceability.

Core Features & Use Cases

  • Automatic capture of agent metrics to the Supabase pm_token_metrics table and an append-only CSV token log for backup.
  • Flexible querying and labeling by task_id, agent_type, session_id, date, and agent_id to analyze sprint progress and individual performance.
  • Use Case: During a sprint, consolidate metrics across agents to measure total input/output tokens, API calls, and durations to guide optimization decisions.

Quick Start

Log a metric entry for engineer TASK-1775 with 5000 input_tokens and 3000 output_tokens.

Frequently Asked Questions about log-metrics

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

FAQPage Schema
How do I log agent metrics from automation runs to a database?

To log agent metrics, this Skill captures input/output tokens, API calls, and durations, persisting them to a primary Supabase database table and an append-only CSV backup for reliable traceability.

Can I query task tracking metrics by agent_id and session_id in Supabase?

Yes, you can query task tracking metrics by filtering on task_id, agent_type, session_id, date, and agent_id to analyze sprint progress and individual agent performance.

How do I back up agent token logs to CSV during sprint analysis?

You can back up agent token logs to an append-only CSV file, which runs alongside your primary Supabase database to ensure a lightweight, traceable record for sprint analysis.

What is the best way to consolidate unlabeled metrics rows for performance reviews?

The best way to consolidate unlabeled rows is using the Skill's reliable labeling mechanism, which enforces a stable schema for the metrics table and supports end-to-end aggregation workflows.

Do I need Supabase to record agent metrics, or can I use a CSV backup only?

Supabase is used as the primary source of truth for recording agent metrics, while the CSV token log serves as a lightweight backup for traceability, ensuring reliable data redundancy.