agentleFS
vllm-projectvllm-project/agentic-api/.agents/skills/rust-skills/SKILL.md

rust-skills

Skill346 starsChanged 7 days agoApache-2.0View on GitHub

Apply idiomatic Rust ownership, typed API design, serde, error handling, async, numeric safety, and lint guidance when implementing, refactoring, or reviewing Rust in agentic-api. Includes a focused set of rules selected for this gateway.

15 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Read root AGENTS.md, Cargo.toml, and clippy.toml.

    line 20
  2. Very specific:

    Keep unsafe_code = "forbid".

    line 25
  3. Very specific:

    Put use imports at the top of the file.

    line 26
  4. Distinctive:

    Use the repository's MSRV, edition, dependency versions, and deployment targets.

    line 29
  5. Distinctive:

    Search existing types, methods, traits, conversions, and callers before introducing another implementation.

    line 31
  6. Distinctive:

    Prefer derived serde and existing conversions.

    line 35
  7. Distinctive:

    Check design choices against the relevant Rust Cookbook recipe and Rust API Guidelines.

    line 58
  8. Very specific:

    Keep this selection focused on demonstrated needs in agentic-api.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Rust design for agentic-api

Apply this skill with the shared engineering workflow. If that preparation is already complete, continue from it; do not restart discovery. This skill supplies Rust design guidance, while the engineering workflow owns architecture discovery, provider parity, recorder usage, and verification.

Repository constraints come first

Read root AGENTS.md, Cargo.toml, and clippy.toml. The bundled upstream rules are general reference material; the following agentic-api requirements take precedence over conflicting examples or recommendations:

  • Fix Clippy warnings at their cause. Do not add allow/expect attributes or weaken lint configuration to pass checks. Use the workspace lint configuration; do not add per-crate overrides to bypass it.
  • Keep unsafe_code = "forbid"; do not relax the workspace policy.
  • Put use imports at the top of the file. Use imported names in implementation code instead of inline paths such as crate::name::some_name::Type or crate::name::some_name::function(). Resolve naming conflicts with import aliases (use ... as ...), not fully qualified paths in the middle of the code.
  • Use the repository's MSRV, edition, dependency versions, and deployment targets. Do not copy generic Cargo, runtime, feature, allocator, or compiler settings into the project without a task-specific need and evidence.
  • Search existing types, methods, traits, conversions, and callers before introducing another implementation. Extend the responsible owner; avoid duplicate validators, normalization paths, string allowlists, and scattered per-kind workarounds. A new wrapper, builder, trait, newtype, lifetime, or generic parameter needs a concrete invariant or caller benefit. Keep simple concrete code simple.
  • Prefer derived serde and existing conversions. Match the actual wire contract: unknown-field rejection, defaults, omitted versus null fields, and enum fallback behavior require protocol evidence. Do not apply generic deny_unknown_fields, skip_serializing_if, or non_exhaustive advice mechanically.
  • Borrow or move before cloning. Use Cow, Arc, collection wrappers, and preallocation only when the actual ownership or measured workload warrants them. Do not replace a readable match with repeated collect chains.
  • Preserve checked numeric semantics. A range-check example followed by as is not proof that precision, truncation, signedness, and the repository's Clippy requirements are satisfied. Inspect boundary cases and use existing checked conversion facilities where available; never suppress warnings to retain the cast.

Read rules for the affected design

These 20 rules cover recurring gateway design concerns. Read only the rows relevant to the changed path. Architecture discovery, provider parity, and tests remain in the engineering skill rather than a second rule catalog.

ConcernRules
Simple typed designAvoid over-abstraction, avoid stringly typed APIs, exhaustive enum matches
Ownership and conversionsBorrow before cloning, accept slices, move out without cloning, avoid intermediate collections, fallible conversions
Wire types and validationEnum tagging, defaults and compatibility, derive with validation
Errors and arithmeticTyped library errors, preserve error sources, checked casts, explicit overflow handling
Async execution and streamingLocks across await, bounded channels, cancellation safety, structured task ownership
OptimizationProfile before optimizing

Check design choices against the relevant Rust Cookbook recipe and Rust API Guidelines. Verify APIs and caveats in official standard-library, Serde, and dependency documentation for the versions used here. Catalog examples are illustrative, not a substitute for type-checking, Clippy, contract tests, or understanding agentic-api's existing architecture.

For a review, tie each finding to a concrete changed path, observable failure or maintenance burden, and the smallest clean fix. Do not turn a generic recipe into a mandatory abstraction or report unsupported stylistic preferences.

Source and maintenance

The selected rules are adapted from leonardomso/rust-skills at fd2a861, version 1.5.1. Copyright and MIT terms are retained in LICENSE. The entrypoint is specific to agentic-api; rule text retains upstream examples with whitespace cleaned and cross-references to omitted rules removed.

Keep this selection focused on demonstrated needs in agentic-api. Generic naming, packaging, macros, unsafe code, compiler tuning, and specialized collection guides are intentionally omitted. Before adding a rule, check whether this skill or the engineering workflow already covers the concern. Preserve attribution and validate links when updating; do not import the entire upstream catalog or replace repository constraints with upstream defaults.

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.