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.
git 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/instrument-and-observe-function-calls-with-effectfn)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/instrument-and-observe-function-calls-with-effectfn"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/instrument-and-observe-function-calls-with-effectfn/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/instrument-and-observe-function-calls-with-effectfn"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/instrument-and-observe-function-calls-with-effectfn.svg" alt="Reviewed on agentmods" width="80" 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.00374 | $0.00374 |
| Opus 5.5 | $0.00150 | $0.00150 |
| Sonnet 5.5 | $0.00075 | $0.00075 |
| Haiku 4.5 | $0.00037 | $0.00037 |
Grade A, and why
instrument-and-observe-function-calls-with-effectfn 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 2mo 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.fn to wrap functions with effectful instrumentation, such as logging, metrics, or tracing, in a composable and type-safe way. globs: "**/*.ts" alwaysApply: true
Instrument and Observe Function Calls with Effect.fn
Rule: Use Effect.fn to wrap functions with effectful instrumentation, such as logging, metrics, or tracing, in a composable and type-safe way.
Example
import { Effect } from "effect";
// A simple function to instrument
function add(a: number, b: number): number {
return a + b;
}
// Use Effect.fn to instrument the function with observability
const addWithLogging = Effect.fn("add")(add).pipe(
Effect.withSpan("add", { attributes: { "fn.name": "add" } })
);
// Use the instrumented function in an Effect workflow
const program = Effect.gen(function* () {
yield* Effect.logInfo("Calling add function");
const sum = yield* addWithLogging(2, 3);
yield* Effect.logInfo(`Sum is ${sum}`);
return sum;
});
// Run the program
Effect.runPromise(program);
Explanation:
Effect.fn("name")(fn)wraps a function with instrumentation capabilities, enabling observability.- You can add tracing spans, logging, metrics, and other observability logic to function boundaries.
- Keeps instrumentation separate from business logic and fully composable.
- The wrapped function integrates seamlessly with Effect's observability and tracing infrastructure.
Explanation:
Instrumenting function calls is essential for observability, especially in complex or critical code paths.
Effect.fn lets you add effectful logic (logging, metrics, tracing, etc.) before, after, or around any function call, without changing the function’s core logic.
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.
- 2mo ago First seen · 44 lines · 374 tokens per session scan A e94f8d084d76
instrument-and-observe-function-calls-with-effectfn is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 5mo ago), licensed MIT. It adds 374 tokens to every session, about $0.0015 per session on Opus 5.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-09-03.
instrument-and-observe-function-calls-with-effectfn compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| instrument-and-observe-function-calls-with-effectfnPaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 374 | Cursor |
| fastapi-components-and-validationWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 64 | Cursor |
| accessibilityWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| verify-information-ruleWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 46 | Cursor |
| new-user-experience-nux-flow-ruleWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| globalexceptionhandler-classWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 27 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 201k | 8d ago | MIT | A | 604 | Cursor |