agentleFS
ulpi-ioulpi-io/browse/.agents/skills/rust/SKILL.md

rust

Skill15 starsChanged 8 months agoApache-2.0View on GitHub

Rust systems programming — storage engines, binary formats, SIMD, wire protocols, DataFusion/Arrow, tantivy search, HNSW vectors, arena allocation, graph engines, R-tree geo, async tokio, mmap, MVCC, zero-copy, io_uring. Use when working on any Rust crate involving database internals, storage, query execution, network protocols, search, vectors, or high-performance data structures.

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 5 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

    python

    Python 3.13 with uv package manager via mise. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `python` work when listed in TEAM.yaml or explicitly requested.

    Also in 6 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

  • 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

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Async with tokio: All I/O is async. CPU-bound work (SIMD, compression, hashing) runs on spawn_blocking or dedicated threads.

    line 25
  2. Distinctive:

    Before writing any Rust code:

    line 34
  3. Distinctive:

    Read the matching reference file(s) from the routing table

    line 37
  4. Distinctive:

    Check crate dependencies — is this a library crate (thiserror) or binary (anyhow)?

    line 38
  5. Very specific:

    Prefer &[u8] over Vec<u8> in function signatures.

    line 68
  6. Very specific:

    Document all public items.

    line 70

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<EXTREMELY-IMPORTANT> These rules apply to ALL Rust code you write. Violating any produces unsafe, slow, or unmaintainable output.
  1. Safe Rust by default. unsafe only in storage hot paths: mmap, SIMD intrinsics, arena internals. Every unsafe block gets a // SAFETY: comment explaining the invariant.
  2. Zero-copy where possible. mmap'd segments, &str/&[u8] references into pages, SIMD on contiguous arrays. Never copy data between storage and execution without reason.
  3. Narrow on disk, wide in execution. Store the tightest encoding. Widen to uniform register-sized types (I64, F64) for SIMD and branch-free processing.
  4. Trait-based abstraction. Pluggable backends, storage providers, distance metrics — all behind traits. Concrete types for hot paths, dyn Trait only at configuration boundaries.
  5. Error types per crate. thiserror enums. Never anyhow in library crates — only in binaries and tests. Never unwrap() in production code paths.
  6. Async with tokio. All I/O is async. CPU-bound work (SIMD, compression, hashing) runs on spawn_blocking or dedicated threads. Never block the tokio runtime.
  7. Property tests for invariants. proptest for serialization round-trips, type coercion, binary format parsing. Unit tests for logic. Integration tests for cross-crate behavior.
  8. Workspace crate structure. One crate per subsystem. Depend downward — never circular. Storage at the bottom, server at the top.</EXTREMELY-IMPORTANT>

Rust Systems Programming

MANDATORY FIRST RESPONSE PROTOCOL

Before writing any Rust code:

  1. Identify which subsystem the task touches
  2. Read the matching reference file(s) from the routing table
  3. Check crate dependencies — is this a library crate (thiserror) or binary (anyhow)?
  4. State the approach before implementing

Routing Table

Task / AreaRead
Toolchain, workspace layout, key crates, Cargo conventionsreferences/stack.md
WAL, mmap, segments, MVCC, compaction, io_uring, backendsreferences/storage-engine.md
Custom on-disk formats, zero-copy parsing, packed structsreferences/binary-formats.md
Database type system, disk/exec types, Arrow interopreferences/type-system.md
DataFusion table providers, UDFs, Arrow RecordBatch, planningreferences/datafusion-arrow.md
pgwire server, MySQL protocol, dialect mapping, ORM compatreferences/wire-protocols.md
tantivy FTS, HNSW vectors, SIMD distance, hybrid searchreferences/search-vector.md
bumpalo arenas, graph adjacency, traversal algorithmsreferences/arena-graph.md
R-tree spatial index, geo predicates, WGS84 distancereferences/geo-rtree.md
tokio async, io_uring, crossbeam, lock-free structures, MVCCreferences/async-concurrency.md
proptest, deterministic testing, integration test patternsreferences/testing.md
thiserror hierarchies, unsafe patterns, safety invariantsreferences/error-unsafe.md

Multiple tasks? Read multiple files.

Quick Rules

  1. cargo fmt before commit. cargo clippy -- -D warnings must pass.
  2. Explicit use imports — no glob imports except in test modules.
  3. #[must_use] on functions returning Result or computed values.
  4. #[inline] only on small functions called in hot loops — never on public API.
  5. Feature flags for optional crate dependencies — #[cfg(feature = "tantivy")].
  6. Send + Sync bounds on all trait objects that cross async boundaries.
  7. Prefer &[u8] over Vec<u8> in function signatures. Own data at boundaries, borrow inside.
  8. #[derive(Debug)] on all public types. #[derive(Clone)] only when cheap.
  9. Document all public items. //! module docs. /// item docs with examples.
  10. Integration tests in tests/ directory. Unit tests in #[cfg(test)] mod tests.

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.