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/katopz/katgpt-rs/rust-optimizenpx skills add katopz/katgpt-rs --skill rust-optimizegit clone --depth 1 https://github.com/katopz/katgpt-rsWrote 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/katopz/katgpt-rs/rust-optimize)<a href="https://agentmods.dev/skills/katopz/katgpt-rs/rust-optimize"><img src="https://agentmods.dev/badge/skills/katopz/katgpt-rs/rust-optimize.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 | $0.00031 | $0.07312 |
| Opus 5 | $0.00015 | $0.03656 |
| Sonnet 5 | $0.00006 | $0.01462 |
| Haiku 4.5 | $0.00003 | $0.00731 |
Grade A, and why
rust-optimize scanned grade A with 1 finding 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 today.
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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- **Boundary-vs-volume (Stokes / divergence theorem)**: to compute a region's total mass / energy / activation magnitude, integrate over the boundary `∂M` (surface area, `O(n^{(d-1)/d})` cells) instead of the interior `M How it starts
The opening of the file, as written. The whole thing — 556 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Optimization
Optimize *.rs files in the target scope using the checklist below.
This is a LOOP. You keep optimizing until you cannot find anything to optimize.
Termination
After each turn, end your response with exactly one of:
Continue optimizing remaining files.— you made code changes this turnNo optimizations this pass.— you read files but changed nothing
If you only summarized what you read without changing code, say "no optimizations this pass".
Checklist
- Complexity: O(n) scan → O(1) lookup, merge HashMap lookups, merge loops, boundary-vs-volume (Stokes/divergence theorem: integrate boundary
O(n^{(d-1)/d})instead of interiorO(n)for low-dim d≤3 region mass queries — curse-of-dim caps it at d≤3) - Allocations:
String→&'static str, pre-allocate, eliminate.to_string() - Layout: field reorder (u64→u32→u8),
#[repr(u8)]enums, remove#[repr(C)] - Arithmetic:
f32counters →u32/u64 - Iterators: fix double
chunks_exact(), use index arithmetic - Concurrency:
Arc<RwLock<HashMap>>→papaya,Mutex<u32>→AtomicU32 - SIMD: chunked loops, branch-free inner loops
- Caching: pre-compute lookup tables, compute once not N×M
- Errors:
unwrap()→?,let _ =→.log_err() - Bevy / Real-time loop (see § Bevy / Real-time Loop for details):
- Event loop spin:
WinitSettings::default()(Continuous) pegs CPU at 100% even idle — switch toUpdateMode::reactive_low_power(max_wait)matching tick rate - Vsync ≠ event loop:
PresentMode::Fifocontrols GPU only, independent of CPU loop spin - Static geometry: bake to
LineList/TriangleListmesh once, NEVER redraw viagizmos.line()per-frame (each call is CPU + per-frame buffer grow) - Asset lifecycle: despawning a Bevy
Entitydoes NOT release itsAssets<Mesh>/Assets<StandardMaterial>handles — callmeshes.remove(handle.0.id())+materials.remove(...)on despawn or leak indefinitely (regrow-on-new-EntityId patterns leak ~N assets per cycle) - GUI repaint storms:
bevy_eguisetsset_request_repaint_callbackthat firesbevy_winit::WakeUpondelay.is_zero()— bypasses reactivemax_waitand spins the loop. Diagnose via in-process perf overlay before assuming the engine itself is the hog. - Frame-rate cap fallback: a
Last-schedulestd::thread::sleepsystem capped at e.g. 60 FPS is a belt-and-suspenders defense when vsync + reactive mode somehow don't throttle
- Event loop spin:
- Perf diagnosis: ship an in-process perf overlay (
sysinfofor CPU/RAM + Bevy'sTime::delta()for FPS) inside the GUI itself — externalpssampling misses focused-window swings and requires keeping a terminal attached
What ships with it
1 file 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.
- today Changed · +1 lines f5751ef61004
- 5d ago First seen · 555 lines · 31 tokens per session scan A 1039c342e37a
rust-optimize is a skill published in the GitHub repository katopz/katgpt-rs (98 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 7,312 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
lint-js
Lint JS/TS code only. Use before opening a PR when only JavaScript or TypeScript files were changed (no Rust).
rust-code-quality
Run a focused Rust quality review when the user requests one, when reviewing a Rust PR/commit, or when another selected review workflow delegates Rust-specific checks. Do not auto-load for every implementation edit.
rust-pro
Master modern Rust (2024 edition) with async patterns, advanced type system features, and production-ready systems programming. Expert in the current Rust ecosystem including Tokio, axum, and modern crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.
switchyard-rust-review
Review Switchyard Rust changes for correctness and maintainability. Use for pull requests or diffs touching crates, PyO3 bindings, async runtime behavior, streaming, protocol types, translation, algorithms, or LLM clients.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
bevy-ecs
Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the Time resource for frame-rate-independent motion. Use when building or debugging a Bevy game in Rust — when the user mentions…