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 ccashwell/evm-cortex --skill gas-optimizationgit clone --depth 1 https://github.com/ccashwell/evm-cortexWrote 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/ccashwell/evm-cortex/gas-optimization)<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/gas-optimization"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/gas-optimization/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/skills/ccashwell/evm-cortex/gas-optimization"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/gas-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00051 | $0.01475 |
| Opus 5.5 | $0.00020 | $0.00590 |
| Sonnet 5.5 | $0.00010 | $0.00295 |
| Haiku 4.5 | $0.00005 | $0.00147 |
Grade A, and why
gas-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 1mo 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 — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Gas Optimization
Measure First
Never optimize blindly. Use forge snapshots and gas reports.
# Gas report for all tests
forge test --gas-report
# Snapshot to compare before/after
forge snapshot
# ...make changes...
forge snapshot --diff
Custom Errors Over Require Strings
Custom errors save ~50 gas on deployment and ~200 gas per revert vs require("string").
// BAD: ~24,000 gas on revert (stores string in bytecode + memory)
require(amount > 0, "Amount must be greater than zero");
// GOOD: ~24 gas for error selector encoding
error ZeroAmount();
if (amount == 0) revert ZeroAmount();
Calldata vs Memory
Use calldata for read-only external function parameters. Avoids copying to memory.
// BAD: copies entire array to memory (~3 gas per byte + allocation)
function processOrders(Order[] memory orders) external { ... }
// GOOD: reads directly from calldata
function processOrders(Order[] calldata orders) external { ... }
// Gas savings scale with input size:
// 100 bytes: ~600 gas saved
// 1KB: ~6,000 gas saved
// 10KB: ~60,000 gas saved
Immutable and Constant
// constant: compile-time value, inlined everywhere. 0 gas for SLOAD.
uint256 public constant MAX_SUPPLY = 10_000;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name)");
// immutable: set once in constructor, stored in bytecode. 0 gas for SLOAD.
address public immutable FACTORY;
uint256 public immutable DEPLOYMENT_TIMESTAMP;
constructor(address factory) {
FACTORY = factory;
DEPLOYMENT_TIMESTAMP = block.timestamp;
}
// Regular storage variable: 2,100 gas (cold) or 100 gas (warm) per SLOAD
address public admin; // avoid if value never changes after deployment
Unchecked Arithmetic
When overflow is impossible (e.g., loop counters bounded by array length), use unchecked to skip overflow checks (~40 gas per operation).
// BAD: overflow checks on every increment
for (uint256 i = 0; i < arr.length; i++) { ... }
// GOOD: i cannot overflow (bounded by array length, which fits in uint256)
for (uint256 i; i < arr.length;) {
// process arr[i]
unchecked { ++i; }
}
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.
- 1mo ago First seen · 218 lines · 51 tokens per session scan A 1e551f1acaa3
gas-optimization is a skill published in the GitHub repository ccashwell/evm-cortex (131 stars, last pushed 17d ago), licensed MIT. It adds 51 tokens to every session and 1,475 once invoked, about $0.0002 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.
Other skills, from other repositories
signature-replay
Signature replay attacks — missing nonces, missing chain ID, ecrecover zero address, signature malleability, cross-chain replay.
official-sui-skills
Pointer to the official Mysten Labs skills for building on Sui — language fundamentals, object model, PTBs, SDKs, publishing, upgrades, frontend integration, accessing on-chain data. Maintained upstream at github.com/MystenLabs/skills; pinned to the same ref the audit catalog derives from (see…
bridge
Cross-chain token transfers using Wormhole and CCTP.
onchainkit
Build onchain apps with Coinbase's OnchainKit React components - wallets, swaps, NFTs, payments.
marginfi
MarginFi — Solana lending and borrowing.
devtools-event-client
Create typed EventClient for a library. Define event maps with typed payloads, pluginId auto-prepend namespacing, emit()/on()/onAll()/onAllPluginEvents() API. Connection lifecycle (5 retries, 300ms), event queuing, enabled/disabled state, SSR fallbacks, singleton pattern. Unique pluginId requirement to avoid event…