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 skills/krusemediallc/cursor-ad-agent/meta-performance-loopnpx skills add krusemediallc/cursor-ad-agent --skill meta-performance-loopgit clone --depth 1 https://github.com/krusemediallc/cursor-ad-agentWrote 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/skills/krusemediallc/cursor-ad-agent/meta-performance-loop)<a href="https://agentmods.dev/skills/krusemediallc/cursor-ad-agent/meta-performance-loop"><img src="https://agentmods.dev/badge/skills/krusemediallc/cursor-ad-agent/meta-performance-loop.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.00144 | $0.02400 |
| Opus 5 | $0.00072 | $0.01200 |
| Sonnet 5 | $0.00029 | $0.00480 |
| Haiku 4.5 | $0.00014 | $0.00240 |
Grade A, and why
meta-performance-loop 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 269 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Meta performance loop
Run a read-only post-deployment measurement loop. The script makes Meta Insights
GET requests, writes local reports, appends one history record, and appends
performance.snapshot events through scripts/lib/ad_agent_lineage.py.
Hard rules
- Read only. Never pause, activate, archive, create, or edit an ad, campaign, ad set, audience, bid, schedule, or budget.
- No asset generation. Recommendations describe a possible next test only. Do not invoke an image/video/copy generator from this workflow.
- Human thresholds only. Ask the user for the decision thresholds. Do not silently infer targets from account history or invent profitability goals.
- Exact action type. Confirm the Meta
action_typethat represents the conversion.purchase,omni_purchase, andoffsite_conversion.fb_pixel_purchaseare distinct. - Preserve lineage. Every selected ad must map to an existing lineage run.
Never fabricate a run ID. If deployment/explicit IDs cannot be matched to an
ad.deployedevent, ask for--lineage-run-id. - Never expose credentials. Load
META_ACCESS_TOKENfrom the environment or.env; never pass it as an argument, print it, or persist token-bearing request/pagination URLs. - Cite every recommendation. Keep the structured metric/threshold citations in JSON and the rendered citations in Markdown.
- No implied causality. Aggregate performance can rank an ad, but it does not prove which creative element caused the result.
Read the data and classification contract before changing thresholds, source parsing, metrics, or report fields. Use the scheduling examples when the user wants a recurring job; never install a scheduler automatically.
Prerequisites
From the repository root:
python3 --version
python3 -m pip install -r skills/meta-performance-loop/requirements.txt
Requirements:
- Python 3.9+
META_ACCESS_TOKENwithads_readaccessMETA_AD_ACCOUNT_IDin.env, or--ad-account- An existing
outputs/ad-agent/lineage.jsonlrun containing deployment provenance - Operator-selected thresholds for minimum spend, winner ROAS, loser ROAS, and winner purchase count
What ships with it
16 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/data-contract.md 6.3 KB
- references/scheduling.md 5.1 KB
- requirements.txt 23 B
- scripts/lib/__init__.py 58 B runs code
- scripts/lib/classifier.py 17 KB runs code
- scripts/lib/common.py 3.7 KB runs code
- scripts/lib/insights_client.py 7.2 KB runs code
- scripts/lib/metrics.py 5.8 KB runs code
- scripts/lib/report.py 13 KB runs code
- scripts/lib/sources.py 14 KB runs code
- scripts/poll_meta_performance.py 13 KB runs code
- tests/fixtures/deployment_results.json 609 B
- tests/fixtures/lineage.jsonl 551 B
- tests/fixtures/meta_comparison.json 1.4 KB
- tests/fixtures/meta_primary.json 2.4 KB
- tests/test_poll_meta_performance.py 24 KB runs code
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.
- 5d ago First seen · 269 lines · 144 tokens per session scan A 9f4c2b2c1f76
meta-performance-loop is a skill published in the GitHub repository krusemediallc/cursor-ad-agent (10 stars, last pushed 1mo ago), licensed MIT. It adds 144 tokens to every session and 2,400 once invoked, about $0.0007 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-31.
Other skills, from other repositories
RunAPI Media Generator
Use when the user asks to generate an image, create a video, make music, create audio, synthesize speech, submit a media task, poll a task, or produce generated media through RunAPI. Triggers include "generate an image", "create a video", "make music", "generate audio", "生成图片", "生成视频", "生成音乐", "创建音频", and "check this…
RunAPI Model Explorer
Use when the user asks what RunAPI models are available, compares models, needs pricing, asks for required fields, searches by modality, or wants a recommendation. Triggers include "what models", "compare models", "cheapest", "pricing", "required params", "有哪些模型", "比较模型", and "价格".
uni1-image-ad
Use when the user wants to generate a Meta/Facebook image ad with Luma uni-1 and attach it to an existing Meta ad set. Triggers on phrases like "uni-1 ad", "make a Luma ad creative", "new image ad in ", "uni-1 image ad for Meta", "generate uni-1 ad creative", "upload uni-1 image as Meta ad". Anchors on uni-1 + Meta…
imaginode
Generate AI images and videos through the Imaginode MCP server (imaginode.ai). Use when the user asks to create, generate or illustrate an image, picture, visual, thumbnail, or a short video clip, and the Imaginode MCP tools (generateimage, generatevideo, listmodels, getgenerationstatus) are available.
image-ad-clone
Use when the user wants to reverse-engineer an existing image ad into a reusable, parameterizable prompt template that can be reused with any brand and any product. Triggers on phrases like "clone this ad as a template", "reverse engineer this ad", "turn this ad into a prompt", "extract a template from this image"…
distribea-media
Generate or place on-brand media (images, video, music, voice) with Distribea. Use whenever a project needs imagery or audio — a hero/illustration/avatar, a page full of placeholders, a video clip, background music, or a voice-over — instead of shipping stock photos, placeholders, CSS-gradient-only sections, or raw…