rust-intel

A set of strict guidelines for writing Rust code that compiles and passes tests but may still fail in production. Rust is a programming language, and the guidance covers issues such as unsafe code, concurrency, asynchronous work, and compatibility between library versions.

In plain words
What is it for?
Use it before writing or reviewing Rust in an existing project, especially when checking production behavior, unsafe code, concurrency, or public library changes.
Why use it?
A successful build and test run does not catch every performance, safety, data-corruption, or library-compatibility problem. These rules focus on those less visible failures.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/phpcraftdream/rust-intel/skill
Any agent
npx skills add PHPCraftdream/rust-intel --skill skill
Clone the repo
git clone --depth 1 https://github.com/PHPCraftdream/rust-intel

Made for: Claude Code, Codex.

Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 20,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00123 $0.20622
Opus 5 $0.00062 $0.10311
Sonnet 5 $0.00025 $0.04124
Haiku 4.5 $0.00012 $0.02062

Measured yesterday against content hash 530b97b62197, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-intel 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (audit-project.workflow.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

| "download in build.rs", "fetch protoc/schema at build time", "fetch the model/binary during build", "curl in the build script" | §A1 network in `build.rs` | unpinned bytes entering the build outside the lockfile — no `
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skill/SKILL.md · 508 lines

How it starts

The opening of the file, as written. The whole thing — 508 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Intel — Defense Against LLM Failure Modes

Scope, stated up front. This spec assumes your code already compiles. It assumes cargo test is green. That is not enough. The categories below cover the failure modes that survive rustc, clippy, and the test suite, and only manifest as production incidents, semver breakage, performance collapse under load, or silent data corruption. Compilation-only failures (lifetime variance in safe code, trait bound mismatch, GAT lifetime bound errors, object-safety violations through generic methods, cyclic workspace deps, ? in main, HRTB depth, recursive macro limits, self-referential structs in safe Rust, no_std reflexive std::* imports, From/Into cycles) are deliberately omitted — rustc already catches them and the LLM cannot ship them. (Exception: variance soundness in unsafe raw-pointer wrappers is not caught by the compiler — that is §B18a, and it is in-scope. Second exception: a method added to a published library's public trait without where Self: Sized loses object-safety only at the consumer's dyn Trait call site — rustc cannot flag it in the author's own crate, so it stays in-scope under Operating mode item 3 and §C1, mechanically backstopped by cargo-semver-checks in Post-flight.) This spec covers what ships anyway.

The fifty-nine categories (held in this skill's theme modules — see the category→module map below) rest on an empirical base — a published 6-month field report on ~80k LOC of production LLM-generated Rust, academic benchmarks (RustEvo², SafeTrans, CRUST-Bench, SafeGenBench, Rust-SWE-Bench, AkiraRust), the error distribution observed across Claude/GPT/Cursor through 2025–2026, and real supply-chain incidents (CrateDepression 2022, faster_log/async_println 2025). (The count is of numbered categories; §B1, §B3, §B4, §B15, §B18, §B25, §C1, §C12, and §D1 split into lettered sub-sections — §B1a/b, §B3a, §B4a, §B15a–e, §B18a, §B25a, §C1a, §C12a, §D1a — that are referenced and triggered individually but counted under their parent.) Citations, URLs, sample sizes, and every percentage live in references/sources.md; load it alongside this file when a figure is load-bearing. The category→module map below is the index; the category bodies live in the theme modules, not in this file.

Industry signal: per Faros AI and Lightrun studies (2026), shifting from low to high AI adoption more than doubles the incidents-to-PR ratio, and 43% of AI-generated code changes need debugging in production; among surveyed engineering leaders, zero rated themselves "very confident" that AI-generated code behaves correctly once deployed. (These figures concern AI-generated code in general, not Rust specifically — see references/sources.md.) This is the empirical context this document defends against.

The categories split into six tiers and a meta-layer, listed below:

  • Self-monitoring: a triggers table (phrase- and code-pattern-based) that maps user-request patterns to risk categories. Scanned before generating code.
  • Tier A — Compile-fix reflexes that leave silent residue (§A1, §A2, §A3): not "the compiler caught it and you fixed it correctly", but "the compiler caught it and the cheapest fix compiles while leaving a real defect behind". Stale-but-valid APIs, supply-chain via slopsquatting, reflexive Arc<Mutex<T>>, pub as a hammer for E0603 that silently expands the public API.
  • Tier B — Silent correctness bugs (§B1–§B29): pass compilation, often pass tests, fail in production. This is where the spec lives. Includes UB, async pitfalls (basic and advanced), lock ordering, memory leaks, silent task dropping, cryptographic insecurity, TOCTOU races, backpressure neglect, Mutex poisoning, equality/hash contracts, runtime borrow panics, manual Send/Sync, iterator invalidation through indirection, serde field-presence drift, JoinHandle semantics, the async-Drop impossibility, select! side-effect cancellation, timing-attack-prone equality on secrets, panic / ownership across extern "C" FFI, lossy numeric conversions, wall-clock vs monotonic time, and UTF-8 string-boundary hazards.
  • Tier C — Architecture and ergonomics (§C1–§C12, and §C12a): design-level mistakes that are expensive to undo. Reflexive .clone(), procedural macro hygiene, Cargo feature flag hygiene, channel-and-runtime mismatch, tracing span leakage, workspace feature unification, Deref polymorphism, reinventing a solved problem (or a whole subsystem) that a world-recognized crate already handles correctly on the input the hand-rolled version misses.
  • Tier D — Testing and CI gaps (§D1–§D5): code passes tests not because it's correct but because the tests are blind. Timing-based async tests, #[should_panic] without expected, unit-vs-integration placement drift, test/prod divergence of build profile, scale, and concurrency, grep-filtered runner output hiding hangs, Windows zombie-process link wedges.
  • Tier E — Systemic cost (§E1–§E6): correct in the small, wrong at scale — performance, allocation, complexity, and contention costs that survive rustc/clippy/tests and only bite under load. A different axis from A–D (cost, not correctness); enforced 🟡/🟢, never 🔴.
  • Tier F — Semantic conformance (§F1–§F4): defects of meaning, not mechanism. The code is self-consistent, compiles, passes its own tests and clippy — and implements the wrong thing: it diverges from the named spec or reference implementation, contradicts the project's own documented guarantees, mishandles the boundary/error-path lifecycle of a connection or resource, or ships an encode/decode pair with no round-trip obligation. No grep finds these; they are found by reading the claim (RFC, README, function name, doc comment) and checking the code against it counterfactually. Reviewer stance for this tier is different — see "Tier F — how to review for meaning" below.

Read the full file on GitHub · 508 lines

Changes

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.

  1. yesterday First seen · 508 lines · 123 tokens per session scan A 530b97b62197

Subscribe to this mod's changes

rust-intel is a skill published in the GitHub repository PHPCraftdream/rust-intel (1 stars, last pushed 13d ago), licensed Apache-2.0. It adds 123 tokens to every session and 20,622 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

ui-enhancer-radar

Systematic iOS/SwiftUI UI audit with design intent interview, 14-domain analysis (including Color Audit with adaptive Color Profile, iPad Sheet Sizing caller-side audit, Button Hit Region three-factor interaction audit, and Silent Picker menu-presentation audit), element compaction, cross-view consistency checks…

Terryc21/radar-suite · 148 tokens

roundtrip-radar

Per-journey code audit tracing data through complete user flows for bugs, data safety, performance, and round-trip completeness. Discovers workflows, audits each end-to-end, rolls up cross-cutting issues, and supports natural-language flow tracing. Triggers: "roundtrip audit", "trace user journey", "/roundtrip-radar".

Terryc21/radar-suite · 73 tokens

ui-path-radar

UI path tracer for SwiftUI/UIKit apps. 5-layer audit with 34 issue categories and 19 automated checks: discover entry points, trace flows, detect dead ends and broken promises, evaluate UX impact, verify data wiring. Supports targeted trace, diff against previous audits, and handoff to planning skills. Triggers…

Terryc21/radar-suite · 86 tokens

capstone-radar

Unified A-F grading and ship/no-ship decisions for the 6-skill radar family (5 companions + capstone). Aggregates handoffs from data-model, ui-path, roundtrip, time-bomb, and ui-enhancer; owns 5 grep-reliable domains; tracks velocity; celebrates improvements. Triggers: "capstone radar", "can I ship", "grade codebase"…

Terryc21/radar-suite · 91 tokens

time-bomb-radar

Finds deferred operations that crash on aged data -- code that passes every test but breaks weeks or months after release. Covers cascade deletes, cache expiry, trial paths, background accumulation, date-threshold transitions, and scheduled side effects. Triggers: "time bomb", "time-bomb", "/time-bomb-radar", "aged…

Terryc21/radar-suite · 80 tokens

radar-suite

Unified entry point for the 6-skill radar family (5 companions + capstone). Routes to individual skills, runs targeted (Tier 2) or full (Tier 3) audit sequences, owns the unified ledger, and provides cross-skill operations (status, verify, ledger, link, deferred, fresh/no-fresh). Triggers: "radar suite", "full audit"…

Terryc21/radar-suite · 94 tokens