agentleFS
ekala-projectekala-project/ekala-claude-skills/skills/rust/SKILL.md

rust

Skill1 starsChanged 9 months agoMITView on GitHub

Package a Rust crate for corepkgs. Use when writing or editing a buildRustPackage derivation — covers cargoHash, cargoBuildFlags, checkFlags, shell completions, and cross-compilation.

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use java, node and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • testdino-hqSkill

    java

    Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.

    Also in 4 projects that use this

  • mcollinaSkill

    node

    Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    golang

    Go development environment. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `golang` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • trotsky1997Skill

    ast-grep

    Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

    Also in 3 projects that use this

  • OpenAISkill

    nextjs

    Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.

    Also in 3 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

The file

Files
SKILL.md

Rust Packages

Rust packages live in pkgs/<name>/default.nix using rustPlatform.buildRustPackage.

Minimal Example

{
  lib,
  rustPlatform,
  fetchFromGitHub,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "example";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "example";
    repo = "example";
    tag = "v${finalAttrs.version}";
    hash = "sha256-...";
  };

  cargoHash = "sha256-...";

  meta = {
    description = "Example Rust tool";
    license = lib.licenses.mit;
    mainProgram = "example";
  };
})

Essential Attributes

  • cargoHash — SRI hash of vendored Cargo dependencies. Set to lib.fakeHash to get the correct value from the build error.
  • cargoBuildFlags — extra flags passed to cargo build (e.g., [ "--package" "foo" "--bin" "foo" ] for workspaces)
  • cargoTestFlags — extra flags passed to cargo test
  • checkFlags — flags appended to the test command. Use --skip to disable specific tests:
    checkFlags = [
      "--skip=tests::network_test"
      "--skip=tests::flaky_timing"
    ];

Auto-Generated Tests

buildRustPackage automatically provides passthru.tests.build — a variant that re-runs with doCheck = true. User-supplied passthru.tests entries merge alongside it.

Native Dependencies

Rust crates that link C libraries need explicit inputs:

nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl zlib ];

Shell Completions

nativeBuildInputs = [ installShellFiles ];

postInstall = ''
  installShellCompletion --cmd example \
    --bash <($out/bin/example completions bash) \
    --fish <($out/bin/example completions fish) \
    --zsh <($out/bin/example completions zsh)
'';

Guard with build platform check when cross-compiling:

postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
  installShellCompletion ...
'';

Complete Example

{
  lib,
  rustPlatform,
  fetchFromGitHub,
  pkg-config,
  erlang,
  git,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "gleam";
  version = "1.18.1";

  src = fetchFromGitHub {
    owner = "gleam-lang";
    repo = "gleam";
    tag = "v${finalAttrs.version}";
    hash = "sha256-...";
  };

  cargoHash = "sha256-...";

  nativeBuildInputs = [ pkg-config erlang ];
  nativeCheckInputs = [ git ];

  checkFlags = [
    "--skip=tests::all_files_have_copyright_notice"
    "--skip=tests::echo::"
  ];

  meta = {
    description = "Statically typed language for the Erlang VM";
    homepage = "https://gleam.run/";
    license = lib.licenses.asl20;
    mainProgram = "gleam";
  };
})

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.