Agent skill

Rust Style

by rocky-data in rocky-data/rocky

Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments.

Apache-2.0Auto-check passedDevelopment

Install Rust Style

skills CLI
$ npx skills add rocky-data/rocky --skill rust-style -a claude-code

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

GitHub CLI
$ gh skill install rocky-data/rocky rust-style --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/rocky-data/rocky.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engine/.claude/skills/rust-style .claude/skills/rust-style && 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
rust-style
GitHub stars
304
Token cost
~1.8k tokens
SKILL.md length
575 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
Apache-2.0

At a glance

Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments.

  • Reviewing Rust code in any engine crate
  • SKILL.md covers What this skill is and isn't, Early returns: use let ... else, Pattern matching: use if let… and Variable naming: shadow, don't…, plus 6 more sections
  • Calls git and cargo

What it does

Rust Style is an agent skill from rocky-data/rocky. Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments. Use when writing or reviewing Rust code in any engine crate.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Rust. The repository describes itself as: A SQL transformation engine that type-checks your whole pipeline and catches breaking changes before they run — branches, replay, column-level lineage, compile-time contracts… The licence is Apache-2.0.

When your agent uses it

  • Reviewing Rust code in any engine crate

Example prompts

  • “/rust-style”

What it can do on your machine

Read from SKILL.md and the folder at commit 9c3d777. 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:

    • git
    • cargo

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

  • Network

    Links to these hosts (documentation or services it may open):

    • gist.github.com

    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

Rust Style loads about 1.8k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 575 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

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 rocky-data/rocky at commit 9c3d777, republished under its Apache-2.0 licence (© rocky-data). 575 words, ~1,816 tokens.

Download SKILL.mdSave it as .claude/skills/rust-style/SKILL.md (or your agent's skills folder).
name
rust-style
description
Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments. Use when writing or reviewing Rust code in any engine crate.

Rocky Rust style

Source: partially vendored from davidbarsky/8fae6dc45c294297db582378284bd1f2 @ 191b2ee46088920de97d682561e2abd1edd64a42 (SKILL-2.md).

What this skill is and isn't

This is a cherry-pick of Barsky's rust-style gist, not a verbatim vendor. Barsky himself flags that his gist is personal preference. The rules below are the ones that fit Rocky's existing code; the rules that conflict with idiomatic Rocky are deliberately omitted.

Rules deliberately dropped from the upstream gist
Upstream ruleWhy Rocky doesn't enforce it
"Use for loops, not iterator chains"Rocky uses iter().filter().map().collect() freely throughout the codebase — it's idiomatic Rust and the codebase is already consistent with it. Swapping to mutable-accumulator loops would be a large and contentious rewrite.
"Avoid the matches! macro"matches! is the standard Rust idiom for boolean variant checks. Rocky uses it; removing it would produce more verbose code, not clearer code.
"Always use explicit destructuring for struct field access"Too strict for a workspace this size. Dot-access is fine for ad-hoc reads; reserve destructuring for match arms and when all fields are consumed.

The rules below are the ones that are enforced.

Early returns: use let ... else

Use let ... else to extract values and exit early on failure. This keeps the happy path unindented.

rust
// DO
let Some(user) = get_user(id) else {
    return Err(Error::NotFound);
};
let Ok(session) = user.active_session() else {
    return Err(Error::NoSession);
};
// continue with user and session

// DON'T
if let Some(user) = get_user(id) {
    if let Ok(session) = user.active_session() {
        // deeply nested code
    } else {
        return Err(Error::NoSession);
    }
} else {
    return Err(Error::NotFound);
}
rust
// DO
let Some(value) = maybe_value else { continue };
let Ok(parsed) = input.parse::<i32>() else { continue };

Pattern matching: use if let only for short, no-else cases

rust
// ACCEPTABLE: short action, no else
if let Some(callback) = self.on_change {
    callback();
}

// DO: use let-else when you need the value to continue
let Some(config) = load_config() else {
    return default_config();
};

// DO: use match for multiple branches
match result {
    Ok(value) => process(value),
    Err(Error::NotFound) => use_default(),
    Err(e) => return Err(e),
}

Variable naming: shadow, don't rename

Shadow variables through transformations. Avoid prefixes like raw_, parsed_, trimmed_.

rust
// DO
let input = get_raw_input();
let input = input.trim();
let input = input.to_lowercase();
let input = parse(input)?;

// DON'T
let raw_input = get_raw_input();
let trimmed_input = raw_input.trim();
let lowercase_input = trimmed_input.to_lowercase();
let parsed_input = parse(lowercase_input)?;

Comments: minimise noise

Keep comments to what the code can't say for itself.

  • No inline comments explaining what obvious code does.
  • No section headers or dividers (// --- Section ---).
  • No TODO comments — use the plans backlog.
  • No commented-out code — use git log.
  • Exception: doc comments (///) on public items are required and follow the rust-doc skill. SAFETY: comments on unsafe blocks are required and follow the rust-unsafe skill.
rust
// DON'T
// Check if user is valid
if user.is_valid() {
    // Update the timestamp
    user.touch();
}

// --- Helper functions ---

// TODO: refactor this later
fn helper() { }

// Old implementation:
// fn old_way() { }

// DO
if user.is_valid() {
    user.touch();
}

fn helper() { }

Type safety: newtypes over raw strings

Wrap strings in newtypes to add semantic meaning and prevent mixing. Rocky already uses this pattern for SQL identifiers and catalog/schema/table names — see rocky-sql/src/validation.rs.

rust
// DO
struct TenantId(String);
struct CatalogName(String);

fn create_catalog(tenant: TenantId, catalog: CatalogName) { }

// DON'T
fn create_catalog(tenant: String, catalog: String) { }

When to not create a newtype: transient locals that never escape a function, or values that are immediately passed through unchanged. Don't cargo-cult this rule.

Show full SKILL.md (233 more words)Show less

Type safety: enums over bools

Use enums with meaningful variant names instead of bool parameters.

rust
// DO
enum Visibility {
    Public,
    Private,
}
fn create_repo(name: &str, visibility: Visibility) { }

// DON'T
fn create_repo(name: &str, is_public: bool) { }
rust
// DO — already used in Rocky for materialization strategies
enum RefreshMode {
    FullRefresh,
    Incremental,
}

// DON'T
fn run_pipeline(full: bool) { }

Pattern matching: never wildcard-match an enum you own

Always match all variants explicitly so the compiler errors when a variant is added. This is load-bearing for Rocky because MaterializationStrategy, PipelineType, and the various *Output enums all grow over time and we want the compiler to find every site that needs updating.

rust
// DO
match strategy {
    MaterializationStrategy::FullRefresh => handle_full(),
    MaterializationStrategy::Incremental => handle_incremental(),
    MaterializationStrategy::Merge => handle_merge(),
    MaterializationStrategy::MaterializedView => handle_mv(),
    MaterializationStrategy::DynamicTable => handle_dt(),
    MaterializationStrategy::TimeInterval => handle_ti(),
}

// DON'T
match strategy {
    MaterializationStrategy::FullRefresh => handle_full(),
    _ => handle_other(),
}

Exception: wildcard-matching an enum you don't own (e.g. std::io::ErrorKind, which is #[non_exhaustive]) is fine and often required. The rule is about enums defined inside the Rocky workspace.

If a wildcard seems unavoidable for a Rocky-owned enum, stop and reconsider — it usually means a variant-specific case was overlooked.

Code navigation: prefer rust-analyzer LSP

When searching or navigating Rust code in the multi-crate workspace, prefer LSP operations over raw text search — they respect type resolution and paths:

  • goToDefinition — find where a symbol is defined
  • findReferences — find all references (respects re-exports)
  • hover — type info and documentation
  • documentSymbol — all symbols in a file
  • goToImplementation — find trait implementations (especially useful for the Adapter trait family)

For structural refactors, see the rust-analyzer-ssr skill.

  • rust-doc — RFC 1574 doc comment conventions for public items
  • rust-error-handling — thiserror (lib) vs anyhow (bin) decision tree
  • rust-async-tokio — Tokio, #[async_trait], AIMD concurrency
  • rust-unsafe — SAFETY: comment conventions for the engine's few unsafe sites (mmap, a repr(transparent) cast, serialised test env mutation)
  • rust-clippy-triage — playbook when cargo clippy -D warnings fires

© rocky-data, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in engine/.claude/skills/rust-style of rocky-data/rocky.

Open the folder on GitHubat commit 9c3d777

Compare with similar skills

Rust Style 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.

Rust Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Style this skillrocky-data/rocky304—~1.8kAutomated safety check: PassApache-2.0
SeekDB Code Reviewoceanbase/seekdb3.1k—~2.1kAutomated safety check: PassApache-2.0
Clippy CIlakeops-org/queryflux144—~458Automated safety check: PassApache-2.0
Mz ProfileMaterializeInc/materialize6.4k—~480Automated safety check: PassCustom licence
Rust Projectmajiayu000/spellbook287—~2.9kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0

Similar skills

  • SeekDB Code Review

    oceanbase/seekdb

    Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.

    3.1k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Clippy CI

    lakeops-org/queryflux

    Run QueryFlux Clippy the same way CI does (-D warnings, workspace, exclude queryflux-bench) and fix failures before opening or updating a PR.

    144 GitHub stars~458 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Mz Profile

    MaterializeInc/materialize

    Trigger: "profile Materialize", "check memory usage", "analyze binary size", "debug performance", or mentions profiling, samply, heaptrack, flame graphs, memory checking, binary size, slow queries…

    6.4k GitHub stars~480 tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Project

    majiayu000/spellbook

    Modern Rust project architecture guide for 2025. An agent skill from majiayu000/spellbook.

    287 GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: notes

More from rocky-data/rocky

All 22 skills in this repo
  • Fivetran

    rocky-data/rocky

    Fivetran REST API reference for Rocky's source adapter. An agent skill from rocky-data/rocky.

    304 GitHub stars~914 tokensUpdated today
    Auto-check passed
  • Databricks

    rocky-data/rocky

    Databricks REST API and SQL reference for Rocky's warehouse adapter.

    304 GitHub stars~2k tokensUpdated today
    Auto-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
    Auto-check passed
  • Rocky Dev

    rocky-data/rocky

    Top-level router for Rocky development tasks. An agent skill from rocky-data/rocky.

    304 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Rocky Dsl Change

    rocky-data/rocky

    Rocky DSL (.rocky file) cross-subproject cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Rocky New Adapter

    rocky-data/rocky

    Adding a new warehouse or source adapter crate to the Rocky engine.

    304 GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Rust Style

What does Rust Style do?

Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments. Rust Style is an agent skill from rocky-data/rocky. Rocky's Rust coding style — let-else early returns, shadowing, newtypes, enums over bools, no wildcard matches, no noise comments.

When should I use Rust Style?

Rust Style fits situations like: reviewing Rust code in any engine crate.

How do I install Rust Style in Claude Code?

Run `npx skills add rocky-data/rocky --skill rust-style -a claude-code`. Or copy the skill folder (engine/.claude/skills/rust-style in rocky-data/rocky) into .claude/skills/rust-style in your project. Claude Code loads it when a task matches its description.

How do I install Rust Style in Codex?

Run `npx skills add rocky-data/rocky --skill rust-style -a codex`. Or copy the skill folder (engine/.claude/skills/rust-style in rocky-data/rocky) into .agents/skills/rust-style in your project. Codex loads it when a task matches its description.

Can I use Rust Style 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 rocky-data/rocky --skill rust-style -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-style, .gemini/skills/rust-style, .github/skills/rust-style and .opencode/skills/rust-style in your project.

What does Rust Style need to run?

Going by SKILL.md and its folder, Rust Style needs the command-line tools its instructions call (git and cargo).

Does Rust Style access the network?

SKILL.md names 1 domain. As links in the text: gist.github.com. This is read from the text; nothing was executed.

Is Rust Style 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 Rust Style use?

Rust Style is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Style use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rust Style?

Skills that share tags, products or a category with Rust Style: SeekDB Code Review (oceanbase/seekdb, 3.1k stars), Clippy CI (lakeops-org/queryflux, 144 stars), Mz Profile (MaterializeInc/materialize, 6.4k stars) and Rust Project (majiayu000/spellbook, 287 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Style?

rocky-data (a GitHub organization) maintains it in rocky-data/rocky, which has 304 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 9, 2026.

Source: rocky-data/rocky on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.