Agent skill

Metrics

by alsk1992 in alsk1992/CloddsBot

System metrics, telemetry, and performance monitoring. An agent skill from alsk1992/CloddsBot.

MITAuto-check passedBackend & APIs

Install Metrics

skills CLI
$ npx skills add alsk1992/CloddsBot --skill metrics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alsk1992/CloddsBot metrics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alsk1992/CloddsBot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/bundled/metrics .claude/skills/metrics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
metrics
GitHub stars
2.9k
Token cost
~2.1k tokens
SKILL.md length
143 words
Files
2
Skills in repo
116
Repo updated
First seen
Licence
MIT

At a glance

System metrics, telemetry, and performance monitoring. An agent skill from alsk1992/CloddsBot.

  • Works in 5 steps: Monitor latency percentiles — P99… → Set alerts proactively — Catch issues… → Track custom metrics — Business-specific… → …
  • Backend & APIs work in your project
  • SKILL.md covers Chat Commands, TypeScript API Reference, Metric Types and Built-in Metrics, plus 1 more section
  • Runs TypeScript scripts from its folder

What it does

Metrics is an agent skill from alsk1992/CloddsBot. System metrics, telemetry, and performance monitoring

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `index.ts`).

It sits in Backend & APIs. The repository describes itself as: Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes… The licence is MIT.

When your agent uses it

  • Backend & APIs work in your project

Example prompts

  • “/metrics”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Monitor latency percentiles — P99 matters more than average
  2. Set alerts proactively — Catch issues before users notice
  3. Track custom metrics — Business-specific KPIs
  4. Review daily reports — Spot trends early
  5. Export for analysis — Use external tools for deep dives

What it can do on your machine

Read from SKILL.md and the folder at commit c930628. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Metrics loads about 2.1k tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 143 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alsk1992/CloddsBot at commit c930628, republished under its MIT licence (© alsk1992). 143 words, ~2,135 tokens.

Download SKILL.mdSave it as .claude/skills/metrics/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
metrics
description
System metrics, telemetry, and performance monitoring
emoji
📈

Metrics - Complete API Reference

Monitor system health, track performance metrics, and analyze telemetry data.


Chat Commands

System Metrics
/metrics                               Show current metrics
/metrics system                        CPU, memory, latency
/metrics api                           API performance stats
/metrics ws                            WebSocket health
Trading Metrics
/metrics trades                        Trade execution stats
/metrics fills                         Fill rate metrics
/metrics latency                       Order latency stats
/metrics errors                        Error rates
Custom Metrics
/metrics track <name> <value>          Track custom metric
/metrics query <name>                  Query metric history
/metrics alert <name> > 100            Set metric alert
Export & Reports
/metrics export csv                    Export to CSV
/metrics report daily                  Generate daily report
/metrics dashboard                     Open metrics dashboard

TypeScript API Reference

Create Metrics Service
typescript
import { createMetricsService } from 'clodds/metrics';

const metrics = createMetricsService({
  // Collection
  collectInterval: 5000,  // ms
  retention: '30d',

  // Storage
  storage: 'sqlite',
  dbPath: './metrics.db',

  // Export
  enablePrometheus: true,
  prometheusPort: 9090,
});

// Start collection
await metrics.start();
System Metrics
typescript
const system = await metrics.getSystemMetrics();

console.log('=== System Health ===');
console.log(`CPU Usage: ${system.cpuUsage}%`);
console.log(`Memory: ${system.memoryUsed}MB / ${system.memoryTotal}MB`);
console.log(`Uptime: ${system.uptimeHours}h`);
console.log(`Active connections: ${system.activeConnections}`);
console.log(`Event loop lag: ${system.eventLoopLag}ms`);
API Metrics
typescript
const api = await metrics.getApiMetrics();

console.log('=== API Performance ===');
console.log(`Total requests: ${api.totalRequests}`);
console.log(`Requests/sec: ${api.requestsPerSecond}`);
console.log(`Avg latency: ${api.avgLatency}ms`);
console.log(`P50 latency: ${api.p50Latency}ms`);
console.log(`P95 latency: ${api.p95Latency}ms`);
console.log(`P99 latency: ${api.p99Latency}ms`);
console.log(`Error rate: ${api.errorRate}%`);

console.log('\nBy Endpoint:');
for (const endpoint of api.byEndpoint) {
  console.log(`  ${endpoint.path}: ${endpoint.avgLatency}ms (${endpoint.calls} calls)`);
}
WebSocket Metrics
typescript
const ws = await metrics.getWebSocketMetrics();

console.log('=== WebSocket Health ===');
console.log(`Active connections: ${ws.activeConnections}`);
console.log(`Messages/sec: ${ws.messagesPerSecond}`);
console.log(`Avg message size: ${ws.avgMessageSize} bytes`);
console.log(`Reconnections: ${ws.reconnections}`);
console.log(`Dropped messages: ${ws.droppedMessages}`);

console.log('\nBy Feed:');
for (const feed of ws.byFeed) {
  console.log(`  ${feed.name}: ${feed.messagesPerSecond}/s, ${feed.latency}ms lag`);
}
Trade Execution Metrics
typescript
const trades = await metrics.getTradeMetrics();

console.log('=== Trade Execution ===');
console.log(`Total orders: ${trades.totalOrders}`);
console.log(`Fill rate: ${trades.fillRate}%`);
console.log(`Partial fills: ${trades.partialFillRate}%`);
console.log(`Rejections: ${trades.rejectionRate}%`);
console.log(`Avg fill time: ${trades.avgFillTime}ms`);
console.log(`Avg slippage: ${trades.avgSlippage}%`);

console.log('\nBy Platform:');
for (const platform of trades.byPlatform) {
  console.log(`  ${platform.name}:`);
  console.log(`    Fill rate: ${platform.fillRate}%`);
  console.log(`    Avg latency: ${platform.avgLatency}ms`);
}
Latency Breakdown
typescript
const latency = await metrics.getLatencyBreakdown();

console.log('=== Latency Breakdown ===');
console.log(`Total order latency: ${latency.total}ms`);
console.log(`  Signal processing: ${latency.signalProcessing}ms`);
console.log(`  Order construction: ${latency.orderConstruction}ms`);
console.log(`  Network round-trip: ${latency.networkRoundTrip}ms`);
console.log(`  Exchange processing: ${latency.exchangeProcessing}ms`);
console.log(`  Confirmation: ${latency.confirmation}ms`);
Error Metrics
typescript
const errors = await metrics.getErrorMetrics();

console.log('=== Error Rates ===');
console.log(`Total errors: ${errors.totalErrors}`);
console.log(`Error rate: ${errors.errorRate}%`);
console.log(`Errors/hour: ${errors.errorsPerHour}`);

console.log('\nBy Type:');
for (const type of errors.byType) {
  console.log(`  ${type.name}: ${type.count} (${type.percentage}%)`);
}

console.log('\nBy Platform:');
for (const platform of errors.byPlatform) {
  console.log(`  ${platform.name}: ${platform.errorRate}%`);
}
Custom Metrics
typescript
// Track custom metric
metrics.track('edge_detected', 1, {
  market: 'trump-2028',
  edgeSize: 0.05,
});

// Increment counter
metrics.increment('trades_executed');

// Set gauge
metrics.gauge('active_positions', 5);

// Record timing
const timer = metrics.startTimer('order_execution');
// ... execute order ...
timer.end();

// Histogram
metrics.histogram('slippage', 0.003, {
  platform: 'polymarket',
});
Query Metrics
typescript
const query = await metrics.query({
  metric: 'edge_detected',
  period: '7d',
  aggregation: 'sum',
  groupBy: 'market',
});

console.log('Edge Detection by Market:');
for (const row of query.results) {
  console.log(`  ${row.market}: ${row.value} detections`);
}
Metric Alerts
typescript
// Set alert threshold
metrics.setAlert({
  metric: 'error_rate',
  condition: '>',
  threshold: 5,  // > 5% error rate
  window: '5m',
  action: 'notify',
});

metrics.setAlert({
  metric: 'latency_p99',
  condition: '>',
  threshold: 1000,  // > 1000ms
  window: '1m',
  action: 'escalate',
});

// Alert handlers
metrics.on('alert', (alert) => {
  console.log(`🚨 Alert: ${alert.metric} ${alert.condition} ${alert.threshold}`);
  console.log(`  Current value: ${alert.currentValue}`);
});
Export Metrics
typescript
// Export to CSV
await metrics.export({
  format: 'csv',
  metrics: ['api_latency', 'trade_fill_rate', 'error_rate'],
  period: '30d',
  outputPath: './metrics-export.csv',
});

// Export to Prometheus
const prometheusFormat = metrics.toPrometheus();

// Export to JSON
const jsonMetrics = await metrics.toJSON({
  period: '24h',
});
Generate Reports
typescript
const report = await metrics.generateReport({
  type: 'daily',
  include: ['summary', 'api', 'trades', 'errors'],
});

console.log('=== Daily Metrics Report ===');
console.log(`Date: ${report.date}`);
console.log(`\nSummary:`);
console.log(`  Uptime: ${report.summary.uptime}%`);
console.log(`  Total requests: ${report.summary.totalRequests}`);
console.log(`  Total trades: ${report.summary.totalTrades}`);
console.log(`  Error rate: ${report.summary.errorRate}%`);
console.log(`\nHighlights:`);
for (const highlight of report.highlights) {
  console.log(`  - ${highlight}`);
}
Real-time Streaming
typescript
// Stream metrics in real-time
const stream = metrics.stream(['cpu', 'memory', 'latency']);

stream.on('data', (data) => {
  console.log(`CPU: ${data.cpu}%, Memory: ${data.memory}MB, Latency: ${data.latency}ms`);
});

// Stop streaming
stream.stop();

Metric Types

TypeDescriptionExample
CounterMonotonic increasingtrades_total
GaugePoint-in-time valueactive_positions
HistogramDistributionlatency_ms
TimerDuration measurementorder_execution_time

Built-in Metrics

CategoryMetrics
Systemcpu_usage, memory_used, uptime, connections
APIrequest_count, latency_p50/p95/p99, error_rate
WebSocketmessages_per_sec, lag, reconnections
Tradesorders_total, fill_rate, slippage, execution_time
Errorserror_count, error_rate_by_type

Best Practices

  1. Monitor latency percentiles — P99 matters more than average
  2. Set alerts proactively — Catch issues before users notice
  3. Track custom metrics — Business-specific KPIs
  4. Review daily reports — Spot trends early
  5. Export for analysis — Use external tools for deep dives

© alsk1992, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in src/skills/bundled/metrics of alsk1992/CloddsBot.

  • SKILL.md
  • index.ts

Open the folder on GitHubat commit c930628

Compare with similar skills

Metrics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Metrics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Metrics this skillalsk1992/CloddsBot2.9k—~2.1kAutomated safety check: PassMIT
Binance Datatoollostleaf/binance-datatool148—~2.5kAutomated safety check: NotesBSD-3-Clause
Backtraderagiprolabs/claude-trading-skills410—~2.4kAutomated safety check: PassMIT
Polymarket2025Emma/vibe-coding-cn23k1 repos~1.6kAutomated safety check: PassMIT
Okx Cex Authokx/agent-skills1862 repos~4.5kAutomated safety check: PassMIT
Trust Wallet APItrustwallet/tw-agent-skills104—~424Automated safety check: PassMIT

Similar skills

  • Binance Datatool

    lostleaf/binance-datatool

    Manage Binance historical market data from data.binance.vision using the binance-datatool CLI.

    148 GitHub stars~2.5k tokensUpdated 5 mo ago
    Backend & APIsAuto-check: notes
  • Backtrader

    agiprolabs/claude-trading-skills

    Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Polymarket

    2025Emma/vibe-coding-cn

    Comprehensive Polymarket skill covering prediction markets, API, trading, market data, and real-time WebSocket data streaming.

    23k GitHub starsUsed in 1 repo~1.6k tokens
    Backend & APIsAuto-check passed
  • Okx Cex Auth

    okx/agent-skills

    A skill your agent uses when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up credentials', 'first time setup', 'configure okx', '登录', '授权'…

    186 GitHub starsUsed in 2 repos~4.5k tokens
    Backend & APIsAuto-check passed
  • Trust Wallet API

    trustwallet/tw-agent-skills

    Trust Wallet API for crypto data — token search, prices, trending tokens, swap quotes, market data, security checks, address validation, asset info, and coin status across 100+ blockchains.

    104 GitHub stars~424 tokensUpdated 4 mo ago
    Backend & APIsAuto-check passed
  • Bankr Signals

    aAAaqwq/AGI-Super-Team

    Transaction-verified trading signals on Base blockchain. An agent skill from aAAaqwq/AGI-Super-Team.

    105 GitHub starsUsed in 2 repos~3.3k tokens
    Backend & APIsAuto-check passed

More from alsk1992/CloddsBot

All 116 skills in this repo
  • Qmd

    alsk1992/CloddsBot

    Local hybrid search for markdown notes and docs. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 3 repos~1.2k tokens
    Auto-check passed
  • AI Strategy

    alsk1992/CloddsBot

    AI Strategy - natural language to trades. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~670 tokensUpdated 7 days ago
    Auto-check passed
  • Alerts

    alsk1992/CloddsBot

    Create and manage price alerts for prediction markets. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~460 tokensUpdated 7 days ago
    Auto-check passed
  • Analytics

    alsk1992/CloddsBot

    Performance attribution, trade analytics, and strategy optimization

    2.9k GitHub stars~1.6k tokensUpdated 7 days ago
    Auto-check passed
  • Arbitrage

    alsk1992/CloddsBot

    Automated cross-platform arbitrage detection and monitoring. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~1.7k tokensUpdated 7 days ago
    Auto-check passed
  • Auto Reply

    alsk1992/CloddsBot

    Automatic response rules, patterns, and scheduled messages. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~1.5k tokensUpdated 7 days ago
    Auto-check passed

Questions about Metrics

What does Metrics do?

System metrics, telemetry, and performance monitoring. An agent skill from alsk1992/CloddsBot. Metrics is an agent skill from alsk1992/CloddsBot.

When should I use Metrics?

Metrics fits situations like: backend & APIs work in your project.

How do I install Metrics in Claude Code?

Run `npx skills add alsk1992/CloddsBot --skill metrics -a claude-code`. Or copy the skill folder (src/skills/bundled/metrics in alsk1992/CloddsBot) into .claude/skills/metrics in your project. Claude Code loads it when a task matches its description.

How do I install Metrics in Codex?

Run `npx skills add alsk1992/CloddsBot --skill metrics -a codex`. Or copy the skill folder (src/skills/bundled/metrics in alsk1992/CloddsBot) into .agents/skills/metrics in your project. Codex loads it when a task matches its description.

Can I use Metrics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alsk1992/CloddsBot --skill metrics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/metrics, .gemini/skills/metrics, .github/skills/metrics and .opencode/skills/metrics in your project.

What does Metrics need to run?

Going by SKILL.md and its folder, Metrics needs TypeScript for the scripts in its folder. Our summary lists: Node.js.

Does Metrics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Metrics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Metrics use?

Metrics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Metrics use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Metrics?

Skills that share tags, products or a category with Metrics: Binance Datatool (lostleaf/binance-datatool, 148 stars), Backtrader (agiprolabs/claude-trading-skills, 410 stars), Polymarket (2025Emma/vibe-coding-cn, 23k stars) and Okx Cex Auth (okx/agent-skills, 186 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Metrics?

alsk1992 (a GitHub user) maintains it in alsk1992/CloddsBot, which has 2,933 GitHub stars. The repository holds 116 skills in this directory. The repository was last updated on October 2, 2026.

Source: alsk1992/CloddsBot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.