Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/pauljphilp/effectpatterns/add-custom-metrics-to-your-applicationgit clone --depth 1 https://github.com/PaulJPhilp/EffectPatternsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/pauljphilp/effectpatterns/add-custom-metrics-to-your-application)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/add-custom-metrics-to-your-application"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/add-custom-metrics-to-your-application.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00389 | $0.00389 |
| Opus 5 | $0.00195 | $0.00195 |
| Sonnet 5 | $0.00078 | $0.00078 |
| Haiku 4.5 | $0.00039 | $0.00039 |
Grade A, and why
add-custom-metrics-to-your-application scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
description: Use Effect's Metric module to define and update custom metrics for business and performance monitoring. globs: "**/*.ts" alwaysApply: true
Add Custom Metrics to Your Application
Rule: Use Effect's Metric module to define and update custom metrics for business and performance monitoring.
Example
import { Effect, Metric } from "effect";
// Define a counter metric for processed jobs
const jobsProcessed = Metric.counter("jobs_processed");
// Increment the counter when a job is processed
const processJob = Effect.gen(function* () {
// ... process the job
yield* Effect.log("Job processed");
yield* Metric.increment(jobsProcessed);
});
// Define a gauge for current active users
const activeUsers = Metric.gauge("active_users");
// Update the gauge when users sign in or out
const userSignedIn = Metric.set(activeUsers, 1); // Set to 1 (simplified example)
const userSignedOut = Metric.set(activeUsers, 0); // Set to 0 (simplified example)
// Define a histogram for request durations
const requestDuration = Metric.histogram("request_duration", [
0.1, 0.5, 1, 2, 5,
] as any); // boundaries in seconds
// Record a request duration
const recordDuration = (duration: number) =>
Metric.update(requestDuration, duration);
Explanation:
Metric.countertracks counts of events.Metric.gaugetracks a value that can go up or down (e.g., active users).Metric.histogramtracks distributions (e.g., request durations).Effect.updateMetricupdates the metric in your workflow.
Explanation:
Metrics provide quantitative insight into your application's behavior and performance.
By instrumenting your code with metrics, you can monitor key events, detect anomalies, and drive business decisions.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 49 lines · 389 tokens per session scan A 50d8fd180b3a
add-custom-metrics-to-your-application is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (796 stars, last pushed 2mo ago), licensed MIT. It adds 389 tokens to every session, about $0.0019 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
flutter-core-rules
Applies Flutter best practices and coding guidelines to the core directory, focusing on constants, themes, utilities, and widgets.
django-url-routing
Ensures Django's URL routing system is used in URL configuration files. This promotes consistent and maintainable URL management across Django projects.
astro-project-structure
Enforce the recommended Astro project structure.
no-summaries-rule
This rule instructs the AI not to summarize changes made.
globalexceptionhandler-class
Structure of GlobalExceptionHandler class.
hub-spoke-graph
Hub-and-spoke (MOC) linking for Obsidian vault notes — no peer mesh, leaves up-link only.