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 skills add keep-starknet-strange/starknet-agentic --skill cairo-optimizationgit clone --depth 1 https://github.com/keep-starknet-strange/starknet-agenticWrote 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/keep-starknet-strange/starknet-agentic/cairo-optimization)<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-optimization"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-optimization.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.00055 | $0.02279 |
| Opus 5 | $0.00028 | $0.01140 |
| Sonnet 5 | $0.00011 | $0.00456 |
| Haiku 4.5 | $0.00006 | $0.00228 |
Grade A, and why
cairo-optimization 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 7d 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 — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cairo Optimization
You are a Cairo optimization assistant. Your job is to profile existing code, identify hotspots, apply targeted optimizations, and verify no regressions were introduced. Apply only after tests pass and behavior is locked.
When to Use
- Reducing gas/steps in hot paths after correctness is established.
- Profiling Cairo functions to find bottlenecks.
- Rewriting expensive arithmetic, loops, or storage patterns.
- Applying BoundedInt optimizations for limb assembly and modular arithmetic.
- Packing storage fields to reduce slot usage.
When NOT to Use
- Early feature prototyping without tests (write tests first with
cairo-testing). - Contract architecture decisions (
cairo-contract-authoring). - Security audit (
cairo-auditor). - Deployment operations (
cairo-deploy).
Quick Start
- Confirm tests pass with
snforge test. - Profile hot paths with
python3 skills/cairo-optimization/scripts/profile.py profile. - Load references based on optimization type — see the table in Orchestration.
- Apply one optimization class at a time, re-test after each.
- Compare before/after profiles and document measurable deltas for changed hotspots.
- Encode stable optimization regressions in
../../evals/cases/contract_skill_benchmark.jsonlto prevent benchmark drift. - Emit a handoff block using
../references/skill-handoff.md;optimization → testingis optional for regression hardening, butoptimization → auditoris mandatory before merge.
Rationalizations to Reject
- "Let's optimize before we have tests."
- "We can skip re-profiling — the change is obviously better."
- "BoundedInt types are too complex — let's use raw u128 math."
- "We can calculate bounds by hand instead of using the CLI tool."
Mode Selection
- profile: User wants to find bottlenecks. Run profiler, identify hotspots.
- arithmetic: User wants to optimize math (DivRem, loops, Poseidon). Apply rules from legacy-full.md.
- bounded-int: User wants BoundedInt optimization for limb assembly or modular arithmetic.
- storage: User wants to pack storage fields or reduce slot usage.
What ships with it
9 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.
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.
- 7d ago First seen · 180 lines · 55 tokens per session scan A a5d5a12847a2
cairo-optimization is a skill published in the GitHub repository keep-starknet-strange/starknet-agentic (80 stars, last pushed 2d ago), licensed MIT. It adds 55 tokens to every session and 2,279 once invoked, about $0.0003 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 skills, from other repositories
performance-analysis
Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms.
performance-expert
Expert-level performance optimization, profiling, benchmarking, and tuning. Use when the user mentions optimization, profiling, benchmarking, or scalability, or when the task involves Performance Fundamentals, Optimization Areas, Profiling Tools, or General.
golang-performance
Use when profiling Go applications (pprof), running benchmarks, optimizing memory/CPU usage, or debugging performance bottlenecks in production Go code.
gas-optimization
Gas optimization skill for EVM chains. Use when batching txs, optimizing gas estimates, predicting base fee, or deciding when and how to send transactions cheaper (EIP-4844 blob, batch vs separate).
Cairo — StarkNet Smart Contract Reference
Use when writing Cairo smart contracts for StarkNet, looking up syntax and types, defining storage and events, generating contract templates, or reviewing test patterns.
gas-oracle
Analyze gas price history and predict optimal transaction fees.