Rust compiler skill for systems programming. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passedDevelopment

Install Rustc Basics

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill rustc-basics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills rustc-basics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rust/rustc-basics .claude/skills/rustc-basics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rustc-basics
GitHub stars
253
Token cost
~1.5k tokens
SKILL.md length
313 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

Rust compiler skill for systems programming. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 8 steps: Choose a build mode → Cargo.toml profile configuration → RUSTFLAGS → …
  • Selecting RUSTFLAGS
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Calls cargo and rustc

What it does

Rustc Basics is an agent skill from mohitmishra786/low-level-dev-skills. Rust compiler skill for systems programming. Use when selecting RUSTFLAGS, configuring Cargo profiles, tuning release builds, reading assembly or MIR output, understanding monomorphization, or diagnosing compilation errors. Activates on queries about rustc flags, Cargo.toml profiles, opt-level, LTO, codegen-units, target-cpu, emit asm, MIR, or Rust build performance.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/rustflags-profiles.md`).

It sits in Development, covering Project scaffolding and App store release. It works with Rust. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Selecting RUSTFLAGS
  • Configuring Cargo profiles
  • Tuning release builds
  • Reading assembly

Example prompts

  • “/rustc-basics”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Choose a build mode
  2. Cargo.toml profile configuration
  3. RUSTFLAGS
  4. Inspect assembly output
  5. Understand monomorphization
  6. Binary size reduction
  7. Common error triage
  8. Useful rustc flags

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo
    • rustc

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rustc Basics loads about 1.5k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 313 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 313 words, ~1,531 tokens.

Download SKILL.mdSave it as .claude/skills/rustc-basics/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rustc-basics
description
Rust compiler skill for systems programming. Use when selecting RUSTFLAGS, configuring Cargo profiles, tuning release builds, reading assembly or MIR output, understanding monomorphization, or diagnosing compilation errors. Activates on queries about rustc flags, Cargo.toml profiles, opt-level, LTO, codegen-units, target-cpu, emit asm, MIR, or Rust build performance.

rustc Basics

Purpose

Guide agents through Rust compiler invocation: RUSTFLAGS, Cargo profile configuration, build modes, MIR and assembly inspection, monomorphization, and common compilation error patterns.

Triggers

  • "How do I configure a release build in Rust for maximum performance?"
  • "How do I see the assembly output for a Rust function?"
  • "What is monomorphization and why is it making my compile slow?"
  • "How do I enable LTO in Rust?"
  • "My Rust binary is too large — how do I shrink it?"
  • "How do I read Rust MIR output?"

Workflow

1. Choose a build mode
bash
# Debug (default) — fast compile, no optimization, debug info
cargo build

# Release — optimized, no debug info by default
cargo build --release

# Check only (fastest, no codegen)
cargo check

# Build for specific target
cargo build --release --target aarch64-unknown-linux-gnu
2. Cargo.toml profile configuration
toml
[profile.release]
opt-level = 3          # 0-3, "s" (size), "z" (aggressive size)
debug = false          # true = full, 1 = line tables only, 0 = none
lto = "thin"           # false | "thin" | true (fat LTO)
codegen-units = 1      # 1 = max optimization, higher = faster compile
panic = "abort"        # "unwind" (default) | "abort" (smaller binary)
strip = "symbols"      # "none" | "debuginfo" | "symbols"
overflow-checks = false # default true in debug, false in release

[profile.release-with-debug]
inherits = "release"
debug = true           # release build with debug symbols
strip = "none"

[profile.dev]
opt-level = 1          # Speed up debug builds slightly
SettingImpact
lto = true (fat)Best optimization, slowest link
lto = "thin"Good optimization, parallel link
codegen-units = 1Best inlining, slower compile
panic = "abort"Removes unwind tables, smaller binary
opt-level = "z"Aggressive size reduction
3. RUSTFLAGS
bash
# Set for a single build
RUSTFLAGS="-C target-cpu=native" cargo build --release

# Enable all target CPU features
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx2,+bmi2" cargo build --release

# Control codegen at invocation level
RUSTFLAGS="-C opt-level=3 -C codegen-units=1 -C lto=on" cargo build --release

Persistent in .cargo/config.toml:

toml
[build]
rustflags = ["-C", "target-cpu=native"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-cpu=native", "-C", "link-arg=-fuse-ld=lld"]
4. Inspect assembly output
bash
# Using cargo-show-asm (recommended)
cargo install cargo-show-asm
cargo asm --release 'myapp::module::function_name'

# Using rustc directly
rustc --emit=asm -C opt-level=3 -C target-cpu=native src/lib.rs
cat lib.s

# View MIR (mid-level IR, before codegen)
rustc --emit=mir -C opt-level=3 src/lib.rs
cat lib.mir

# View LLVM IR
rustc --emit=llvm-ir -C opt-level=3 src/lib.rs
cat lib.ll

# Use Compiler Explorer (Godbolt) patterns locally
RUSTFLAGS="--emit=asm" cargo build --release
find target/ -name "*.s"
5. Understand monomorphization

Rust generics are monomorphized — each concrete type instantiation produces separate code. This causes:

  • Binary size bloat
  • Longer compile times
  • Potential i-cache pressure
bash
# Measure monomorphization bloat
cargo install cargo-llvm-lines
cargo llvm-lines --release | head -30

# Shows: lines of LLVM IR per function (monomorphized copies visible)

Mitigation strategies:

rust
// 1. Type erasure with dyn Trait (trades monomorphization for dispatch)
fn process(iter: &mut dyn Iterator<Item = i32>) { ... }

// 2. Non-generic inner function pattern
fn my_generic<T: AsRef<str>>(s: T) {
    fn inner(s: &str) { /* actual work */ }
    inner(s.as_ref())  // monomorphization only in thin wrapper
}
6. Binary size reduction
toml
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = "symbols"
bash
# Check binary size breakdown
cargo install cargo-bloat
cargo bloat --release --crates      # per-crate size
cargo bloat --release -n 20         # top 20 largest functions

# Compress executable (at cost of startup time)
upx --best --lzma target/release/myapp
7. Common error triage
ErrorCauseFix
cannot find function in this scopeMissing use or wrong module pathAdd use crate::module::fn_name
the trait X is not implemented for YMissing impl or wrong generic boundImplement trait or adjust bounds
lifetime may not live long enoughBorrow checker lifetime issueAdd explicit lifetime annotations
cannot borrow as mutable because also borrowed as immutableAliasing violationRestructure borrows to not overlap
use of moved valueValue used after move into closure or functionUse .clone() or borrow instead
mismatched types: expected &str found StringString vs &str confusionUse .as_str() or &my_string
8. Useful rustc flags
bash
# Show all enabled features at a given opt level
rustc -C opt-level=3 --print cfg

# List available targets
rustc --print target-list

# Show target-specific features
rustc --print target-features --target x86_64-unknown-linux-gnu

# Explain an error code
rustc --explain E0382

For RUSTFLAGS reference and Cargo profile patterns, see references/rustflags-profiles.md.

  • Use skills/rust/cargo-workflows for workspace management and Cargo tooling
  • Use skills/rust/rust-debugging for debugging Rust binaries with GDB/LLDB
  • Use skills/rust/rust-profiling for profiling and flamegraphs
  • Use skills/rust/rust-sanitizers-miri for memory safety validation

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/rust/rustc-basics of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/rustflags-profiles.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Rustc Basics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rustc Basics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rustc Basics this skillmohitmishra786/low-level-dev-skills253—~1.5kAutomated safety check: PassMIT
Frb Code Generationfzyzcjy/flutter_rust_bridge5.4k—~1.5kAutomated safety check: PassMIT
Kmp Starter Create Fresh AppDevAtrii/Kmp-Starter-Template167—~1.4kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0
New CrateDevolutions/IronRDP3.2k—~236Automated safety check: PassApache-2.0
Jinja Codegenxberg-io/alef100—~735Automated safety check: PassMIT

Similar skills

  • Frb Code Generation

    fzyzcjy/flutter_rust_bridge

    A skill your agent uses when modifying Rust APIs, codegen, generated examples, or platform scaffolds in flutterrustbridge to select generation commands and preserve source-of-truth and convergence…

    5.4k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Kmp Starter Create Fresh App

    DevAtrii/Kmp-Starter-Template

    Research and plan a brand-new app before scaffolding it on the KMP Starter Template.

    167 GitHub stars~1.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 29 days ago
    DevelopmentAuto-check passed
  • New Crate

    Devolutions/IronRDP

    Create and integrate a new Rust crate in the IronRDP workspace.

    3.2k GitHub stars~236 tokensUpdated today
    DevelopmentAuto-check passed
  • Jinja Codegen

    xberg-io/alef

    Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings.

    100 GitHub stars~735 tokensUpdated today
    DevelopmentAuto-check passed
  • Rocky Codegen

    rocky-data/rocky

    Rocky CLI JSON-output schema cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Rustc Basics

What does Rustc Basics do?

Rust compiler skill for systems programming. An agent skill from mohitmishra786/low-level-dev-skills. Rustc Basics is an agent skill from mohitmishra786/low-level-dev-skills. Rust compiler skill for systems programming.

When should I use Rustc Basics?

Rustc Basics fits situations like: selecting RUSTFLAGS; configuring Cargo profiles; tuning release builds; reading assembly.

How do I install Rustc Basics in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill rustc-basics -a claude-code`. Or copy the skill folder (skills/rust/rustc-basics in mohitmishra786/low-level-dev-skills) into .claude/skills/rustc-basics in your project. Claude Code loads it when a task matches its description.

How do I install Rustc Basics in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill rustc-basics -a codex`. Or copy the skill folder (skills/rust/rustc-basics in mohitmishra786/low-level-dev-skills) into .agents/skills/rustc-basics in your project. Codex loads it when a task matches its description.

Can I use Rustc Basics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill rustc-basics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rustc-basics, .gemini/skills/rustc-basics, .github/skills/rustc-basics and .opencode/skills/rustc-basics in your project.

What does Rustc Basics need to run?

Going by SKILL.md and its folder, Rustc Basics needs the command-line tools its instructions call (cargo and rustc).

Does Rustc Basics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rustc Basics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rustc Basics use?

Rustc Basics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rustc Basics use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to Rustc Basics?

Skills that share tags, products or a category with Rustc Basics: Frb Code Generation (fzyzcjy/flutter_rust_bridge, 5.4k stars), Kmp Starter Create Fresh App (DevAtrii/Kmp-Starter-Template, 167 stars), Rust Hygiene Audit (tsz-org/tsz, 577 stars) and New Crate (Devolutions/IronRDP, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rustc Basics?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.