Borrowing it
Nothing to install: this file belongs to katopz/katgpt-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/katopz/katgpt-rs/develop/.agents/skills/rust-optimize/SKILL.mdgit 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/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/katopz/katgpt-rs/rust-optimize"><img src="https://agentmods.dev/badge/skills/katopz/katgpt-rs/rust-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium analysis-evasion · line 1 Suspicious Unicode normalization or mixed-script contentFix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
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.00031 | $0.08653 |
| Opus 5.5 | $0.00012 | $0.03461 |
| Sonnet 5.5 | $0.00006 | $0.01731 |
| Haiku 4.5 | $0.00003 | $0.00865 |
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 3d 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.
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 — 591 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 - Sorted indexes & scans (see § Sorted Indexes & Scans for details): seek to a prefix (never skip-walk), visitor/borrowing scans (0 alloc), bulk insert via sorted merge, order maintained at mutation not per-read, sort keys computed once, early-exit bounded scans
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.
- 3d ago Changed · +35 lines 0a68e2254be9
- 1mo ago Changed · +1 lines f5751ef61004
- 2mo 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 (140 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 8,653 once invoked, about $0.0001 per session on Opus 5.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
rust-patterns
Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.
update-v8-version
Update Codex's pinned v8 / rustyv8 versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update rustyv8 artifacts, prepare or validate a V8 release candidate, check v8-canary, or diagnose why a V8 version update no longer builds.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
omh-rust
This is an OMH rust workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
azure-keyvault-secrets-rust
Client library for Azure Key Vault Secrets — secure storage for passwords, API keys, and other secrets.
rust-error
Define, wrap, convert, classify, report or test Rust error types in litellm-rust with thiserror. Use when adding an error type or variant, mapping one crate's error into another, turning an error into a gateway response or Python exception, deciding retry or fault from an error, or replacing call sites that build…