Agent skill

Rust Coding Style

by hashintel in hashintel/hash

HASH Rust coding style. An agent skill from hashintel/hash.

AGPL-3.0Auto-check passedDevelopment

Install Rust Coding Style

skills CLI
$ npx skills add hashintel/hash --skill rust-coding-style -a claude-code

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

GitHub CLI
$ gh skill install hashintel/hash rust-coding-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/hashintel/hash.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/rust-coding-style .claude/skills/rust-coding-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-coding-style
GitHub stars
1.7k
Token cost
~2.2k tokens
SKILL.md length
822 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
AGPL-3.0

At a glance

HASH Rust coding style. An agent skill from hashintel/hash.

  • Reviewing Rust code
  • SKILL.md covers Project-Specific Patterns, Type System, Async Patterns and Function Arguments, plus 10 more sections
  • Calls cargo
  • Function arguments

What it does

Rust Coding Style is an agent skill from hashintel/hash. HASH Rust coding style. Use when writing or reviewing Rust code, choosing types, imports, function arguments, or naming.

Its SKILL.md is about 2.2k 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: 🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation. The licence is AGPL-3.0.

When your agent uses it

  • Reviewing Rust code
  • Function arguments

Example prompts

  • “/rust-coding-style”

What it can do on your machine

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

    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

Rust Coding Style loads about 2.2k tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 822 words of instructions outside code blocks.

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

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 hashintel/hash at commit e189ab2, republished under its AGPL-3.0 licence (© hashintel). 822 words, ~2,223 tokens.

Download SKILL.mdSave it as .claude/skills/rust-coding-style/SKILL.md (or your agent's skills folder).
name
rust-coding-style
description
HASH Rust coding style. Use when writing or reviewing Rust code, choosing types, imports, function arguments, or naming.
license
AGPL-3.0

Rust Coding Style

Project-Specific Patterns

  • Use the 2024 edition of Rust
  • Prefer derive_more over manual trait implementations
  • Feature flags in this codebase use the #[cfg(feature = "...")] pattern
  • Invoke cargo clippy with --all-features, --all-targets, and --no-deps from the root
  • Use cargo doc --no-deps --all-features for checking documentation
  • Use rustfmt to format the code
  • Use #[expect(lint, reason = "...")] over #[allow(lint)]

Type System

  • Create strong types with newtype patterns for domain entities
  • Consider visibility carefully (avoid unnecessary pub)
rust
#[derive(Debug, Copy, Clone, Eq, Hash, PartialEq, derive_more::Display)]
pub struct UserId(Uuid);

Async Patterns

  • Use impl Future<Output = T> + Send in trait definitions:
rust
fn get_data(
    &self,
    id: String,
) -> impl Future<Output = Result<Data, Report<DataError>>> + Send {
    async move {
        // Implementation
    }
}

Function Arguments

  • Functions should never take more than 7 arguments. If a function requires more than 7 arguments, encapsulate related parameters in a struct.
  • Functions that use data immutably should take a reference to the data, while functions that modify data should take a mutable reference. Never take ownership of data unless the function explicitly consumes it.
  • Make functions const whenever possible.
  • Prefer the following argument types when applicable, but only if this does not reduce performance:
    • impl AsRef<str> instead of &str or &String
    • impl AsRef<Path> instead of &Path or &PathBuf
    • impl IntoIterator<Item = &T> when only iterating over the data
    • &[T] instead of &Vec<T>
    • &mut [T] instead of &mut Vec<T> when the function doesn't need to resize the vector
    • impl Into<Cow<T>> instead of Cow<T>
    • impl Into<Arc<T>> instead of Arc<T>
    • impl Into<Rc<T>> instead of Rc<T>
    • impl Into<Box<T>> instead of Box<T>
  • Never use impl Into<Option<_>> as from reading the caller site, it's not visible that None could potentially be passed

From and Into

  • Generally prefer From implementations over Into implementations. The Rust compiler will automatically derive Into from From, but not vice versa.
  • When converting between types, prefer using the from method over into for clarity. The from method makes the target type explicit in the code, while into requires type inference.
  • For wrapper types like Cow, Arc, Rc, Report, and Box, prefer using explicit constructors (e.g., Cow::from, Arc::new) instead of .into(). This improves readability by clearly indicating the target type.

Smart Pointers

  • When cloning smart pointers such as Arc and Rc, always use Arc::clone(&pointer) and Rc::clone(&pointer) instead of pointer.clone(). This explicitly indicates you're cloning the reference, not the underlying data.

Instrumentation

  • Annotate functions that perform significant work with #[tracing::instrument]
  • Use tracing macros (e.g., trace!, debug!, info!, warn!, error!) instead of println! or eprintln! for logging

Allocations

  • Minimize allocations when possible. For example, reuse a Vec in a loop instead of creating a new one in each iteration.
  • Prefer borrowed data over owned data where appropriate.
  • Balance performance and readability—if an allocation makes code significantly more readable or maintainable, the trade-off may be worthwhile.

Types

  • Use newtypes when a value should carry specific semantics beyond its underlying type. This improves type safety and code clarity.

For example:

rust
struct UserId(u64);  // instead of `type UserId = u64;` or `u64`
Show full SKILL.md (374 more words)Show less

Naming Conventions

When suggesting names for variables, functions, or types:

  • Do not prefix test-function names with test_, this would otherwise result in test::test_<name> names.
  • Provide a concise list of naming options with brief explanations of why each fits the context
  • Choose names of appropriate length—avoid names that are too long or too short
  • Avoid abbreviations unless they are widely recognized in the domain (e.g., Http or Json is acceptable, but Ctx instead of Context is not)
  • Do not suffix names with their types (e.g., use users instead of usersList)
  • Do not repeat the type name in variable names (e.g., use user instead of userUser)

Crate Preferences

  • Use similar_asserts for test assertions
  • Use insta for snapshot tests
  • Use test_log for better test output (#[test_log::test])
  • Use tracing macros, not log macros
  • Prefer tracing::instrument for function instrumentation

Import Style

  • Don't use local imports within functions, or blocks
  • Avoid wildcard imports like use super::*;, or use crate::module::*;
  • Never use a prelude use crate::prelude::*
  • Prefer explicit imports to make dependencies clear and improve code readability
  • We prefer core over alloc over std for imports to minimize dependencies
    • Use core for functionality that doesn't require allocation
    • Use alloc when you need allocation but not OS-specific features
    • Only use std when necessary for OS interactions or when using core/alloc would be unnecessarily complex
  • Prefer qualified imports (use foo::Bar; let x = Bar::new()) over fully qualified paths (let x = foo::Bar::new()) for frequently used types
  • Use pub use re-exports in module roots to create a clean public API
  • Avoid importing items with the same name from different modules; use qualified imports
  • Import traits using use module::Trait as _; when you only need the trait's methods and not the trait name itself
    • This pattern brings trait methods into scope without name conflicts
    • Use this especially for extension traits or when implementing foreign traits on local types
rust
// Good - Importing a trait just for its methods:
use std::io::Read as _;

// Example with trait methods:
fn read_file(file: &mut File) -> Result<String, std::io::Error> {
    // Read methods available without importing the Read trait name
    let mut content = String::new();
    file.read_to_string(&mut content)?;
    Ok(content)
}

// Bad - Directly importing trait when only methods are needed:
use std::io::Read;

// Good - Importing trait for implementing it:
use std::io::Write;
impl Write for MyWriter { /* implementation */ }

// Bad - Wildcard import:
mod tests {
    use super::*;  // Wildcard import

    #[test]
    fn test_something() {
        // Test implementation
    }
}

// Good - Explicit imports:
mod tests {
    use crate::MyStruct;
    use crate::my_function;

    #[test]
    fn test_something() {
        // Test implementation
    }
}

// Bad - Local import:
fn process_data() {
    use std::collections::HashMap;  // Local import
    let map = HashMap::new();
    // Implementation
}

// Good - Module-level import:
use std::collections::HashMap;

fn process_data() {
    let map = HashMap::new();
    // Implementation
}

// Bad - Using std when core would suffice:
use std::fmt::Display;

// Good - Using core for non-allocating functionality:
use core::fmt::Display;

// Bad - Using std when alloc would suffice:
use std::collections::BTreeSet;

// Good - Using alloc for allocation without full std dependency:
use alloc::vec::Vec;

// Appropriate - Using std when needed:
use std::fs::File;  // OS-specific functionality requires std

Libraries and Components

  • Abstract integrations with third-party systems behind traits to maintain clean separation of concerns

Comments and Assertions

  • Do not add comments after a line of code; place comments on separate lines above the code they describe
  • When using assertions, include descriptive messages using the optional description parameter rather than adding a comment
  • All expect() messages should follow the format "should ..." to clearly indicate the expected behavior

For example:

rust
// Bad:
assert_eq!(result, expected); // This should match the expected value

// Good:
assert_eq!(result, expected, "Values should match expected output");

// Bad:
some_value.expect("The value is not None"); // This should never happen

// Good:
some_value.expect("should contain a valid value");

© hashintel, AGPL-3.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 .agents/skills/rust-coding-style of hashintel/hash.

Open the folder on GitHubat commit e189ab2

Compare with similar skills

Rust Coding 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 Coding Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Coding Style this skillhashintel/hash1.7k—~2.2kAutomated safety check: PassAGPL-3.0
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
OpenLogi macOS Permissions TriageAprilNEA/OpenLogi23k—~2.5kAutomated safety check: NotesApache-2.0
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Release Skillsnexmoe/eve4213 repos~3.3kAutomated safety check: PassNone

Similar skills

  • 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.

    41k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    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 4 days ago
    DevelopmentAuto-check: notes
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Release Skills

    nexmoe/eve

    Universal release workflow. An agent skill from nexmoe/eve.

    421 GitHub starsUsed in 3 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Pnpm Engine

    teambit/bit

    Work on the pnpm Rust engine (@pnpm/napi, the pacquet crates) that bit install runs through.

    18k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from hashintel/hash

All 17 skills in this repo
  • Documenting Rust Code

    hashintel/hash

    Rust documentation practices for HASH codebase. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Handling Rust Errors

    hashintel/hash

    HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

    1.7k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Cargo.toml dependency management patterns for HASH workspace.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Testing Hashql

    hashintel/hash

    HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

    1.7k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • HashQL diagnostic writing patterns using hashql-diagnostics crate.

    1.7k GitHub stars~724 tokensUpdated today
    Auto-check passed
  • Writing Hashql Jexpr

    hashintel/hash

    HashQL J-Expr syntax for writing queries. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Rust Coding Style

What does Rust Coding Style do?

HASH Rust coding style. An agent skill from hashintel/hash. Rust Coding Style is an agent skill from hashintel/hash. HASH Rust coding style.

When should I use Rust Coding Style?

Rust Coding Style fits situations like: reviewing Rust code; function arguments.

How do I install Rust Coding Style in Claude Code?

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

How do I install Rust Coding Style in Codex?

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

Can I use Rust Coding 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 hashintel/hash --skill rust-coding-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-coding-style, .gemini/skills/rust-coding-style, .github/skills/rust-coding-style and .opencode/skills/rust-coding-style in your project.

What does Rust Coding Style need to run?

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

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

Rust Coding Style is published under the AGPL-3.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Coding Style use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 Coding Style?

Skills that share tags, products or a category with Rust Coding Style: Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars), Rust Best Practices (farm-fe/farm, 5.6k stars), OpenLogi macOS Permissions Triage (AprilNEA/OpenLogi, 23k stars) and RTK Rust Design Patterns (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Coding Style?

hashintel (a GitHub organization) maintains it in hashintel/hash, which has 1,668 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

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