Agent skill

Rust Trait API Design

by hashgraph-online in hashgraph-online/awesome-codex-plugins

Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces.

MITAuto-check passedBackend & APIs

Install Rust Trait API Design

skills CLI
$ npx skills add hashgraph-online/awesome-codex-plugins --skill rust-trait-api-design -a claude-code

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

GitHub CLI
$ gh skill install hashgraph-online/awesome-codex-plugins rust-trait-api-design --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/hashgraph-online/awesome-codex-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/LVTD-LLC/skills/skills/rust-trait-api-design .claude/skills/rust-trait-api-design && 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-trait-api-design
GitHub stars
1.2k
Token cost
~929 tokens
SKILL.md length
451 words
Files
3 (incl. references)
Skills in repo
686
Repo updated
First seen
Licence
MIT

At a glance

Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces.

  • Works in 7 steps: Identify whether the API consumes,… → Start with concrete types for local… → Use generic bounds for compile-time… → …
  • Reviewing traits
  • SKILL.md covers Core Workflow, API Design Rules, Trait Object Review and Common Smells
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Rust Trait API Design is an agent skill from hashgraph-online/awesome-codex-plugins. Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces. Use when designing, refactoring, or reviewing traits, generics, trait objects, associated types, impl Trait, From/TryFrom, AsRef, Borrow, or crate APIs.

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/trait-api-patterns.md`). Compatibility notes: Codex, Claude Code, and other Agent Skills-compatible clients.

It sits in Backend & APIs, covering API design and Refactoring. It works with Rust. The repository describes itself as: A curated list of awesome OpenAI Codex / ChatGPT plugins, skills, and resources. The 1 Codex Marketplace. See live plugins at: https://hol.org/plugins/best-codex-plugins. The licence is MIT.

When your agent uses it

  • Reviewing traits
  • Associated types

Example prompts

  • “/rust-trait-api-design”

Requirements

  • Compatibility (from SKILL.md): Codex, Claude Code, and other Agent Skills-compatible clients.

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify whether the API consumes, borrows, returns, stores, or dispatches
  2. Start with concrete types for local code. Generalize only when at least two
  3. Use generic bounds for compile-time polymorphism and inlining. Use `dyn
  4. Place bounds at the point that needs them. Prefer where clauses when
  5. Decide whether a trait is intended for downstream implementation. Seal it,
  6. Use standard conversion traits where they match exactly. Do not invent a
  7. Add compile tests, unit tests, or examples that prove the public API is

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md.

    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.

  • Compatibility

    Codex, Claude Code, and other Agent Skills-compatible clients.

    From compatibility in the SKILL.md frontmatter.

Context cost

Rust Trait API Design loads about 929 tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 74 tokens; SKILL.md has 451 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~929
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

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 hashgraph-online/awesome-codex-plugins at commit 78497e5, republished under its MIT licence (© hashgraph-online). 451 words, ~929 tokens.

Download SKILL.mdSave it as .claude/skills/rust-trait-api-design/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
rust-trait-api-design
description
Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces. Use when designing, refactoring, or reviewing traits, generics, trait objects, associated types, impl Trait, From/TryFrom, AsRef, Borrow, or crate APIs.
compatibility
Codex, Claude Code, and other Agent Skills-compatible clients.
license
MIT
metadata.version
0.1.0
metadata.displayName
Rust Trait API Design
metadata.category
Rust
metadata.tags
rust,traits,generics,api-design,trait-objects

Rust Trait API Design

Use this skill to make Rust APIs generic where useful, concrete where simpler, and object-safe when dynamic dispatch is part of the design. Optimize for the smallest capability contract that callers and implementors can understand.

Core Workflow

  1. Identify whether the API consumes, borrows, returns, stores, or dispatches behavior.
  2. Start with concrete types for local code. Generalize only when at least two callers or implementations need the flexibility.
  3. Use generic bounds for compile-time polymorphism and inlining. Use dyn Trait for heterogeneous values, plugin-like extension points, or runtime dispatch.
  4. Place bounds at the point that needs them. Prefer where clauses when bounds are long or involve associated types.
  5. Decide whether a trait is intended for downstream implementation. Seal it, keep fields private, or use constructors when invariants must not be implemented externally.
  6. Use standard conversion traits where they match exactly. Do not invent a custom conversion trait before checking From, TryFrom, AsRef, AsMut, Borrow, ToOwned, and Cow.
  7. Add compile tests, unit tests, or examples that prove the public API is callable the way the skill expects future users to call it.

API Design Rules

  • Accept impl Trait or a named generic for parameters when callers should pass many concrete types.
  • Return impl Trait when hiding one concrete return type. Return Box<dyn Trait> when the concrete type varies at runtime.
  • Prefer associated types when each implementation has one natural related type. Prefer generic trait parameters when one implementation supports many target types.
  • Implement From for infallible conversions and TryFrom for fallible conversions. Implementing these gives callers Into and TryInto.
  • Use AsRef for cheap reference-to-reference conversion. Use Borrow only when borrowed and owned forms have equivalent Eq, Hash, and Ord behavior.
  • Avoid Copy bounds unless the algorithm semantically requires bitwise copy.
Show full SKILL.md (153 more words)Show less

Trait Object Review

Read references/trait-api-patterns.md when choosing between generics and dyn Trait, or when public traits fail object-safety checks.

Before making a public trait object-safe, check:

  • Methods do not use generic type parameters.
  • Methods do not return Self unless constrained with where Self: Sized.
  • Associated types are specified on the trait object where needed.
  • The object is behind a pointer such as &dyn Trait, Box<dyn Trait>, or Arc<dyn Trait + Send + Sync>.

Common Smells

  • A public function takes &Vec<T> because it only needs iteration.
  • The API accepts String and immediately borrows it as &str.
  • The API implements Into directly instead of From.
  • A trait has many blanket bounds that only one method needs.
  • A trait object was used because lifetimes were confusing, not because runtime dispatch is required.
  • async-trait is used in a public trait without checking whether native async fn in traits, trait-variant, or boxed futures fit the dispatch and Send needs better.

© hashgraph-online, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/LVTD-LLC/skills/skills/rust-trait-api-design of hashgraph-online/awesome-codex-plugins.

  • SKILL.md
  • agents/openai.yaml
  • references/trait-api-patterns.md

Open the folder on GitHubat commit 78497e5

Compare with similar skills

Rust Trait API Design 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 Trait API Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Trait API Design this skillhashgraph-online/awesome-codex-plugins1.2k—~929Automated safety check: PassMIT
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
Dev Rulesrust-dd/tako162—~810Automated safety check: PassMIT
API Designaxone-protocol/contracts123—~1.1kAutomated safety check: PassBSD-3-Clause
Mas API ContractAUTO-MAS-Project/AUTO-MAS708—~1.9kAutomated safety check: PassAGPL-3.0

Similar skills

  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Rust Skills

    noh-rs/nohrs

    Comprehensive Rust coding guidelines with 179 rules across 14 categories.

    156 GitHub stars~5.3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Dev Rules

    rust-dd/tako

    General coding-style rules to apply to every project. An agent skill from rust-dd/tako.

    162 GitHub stars~810 tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • API Design

    axone-protocol/contracts

    Best practices for designing CosmWasm smart contract APIs. An agent skill from axone-protocol/contracts.

    123 GitHub stars~1.1k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed
  • Mas API Contract

    AUTO-MAS-Project/AUTO-MAS

    Define backend API contract standards for FastAPI services. An agent skill from AUTO-MAS-Project/AUTO-MAS.

    708 GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Rust Conventions

    Goldziher/ai-rulez

    Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and…

    158 GitHub stars~746 tokensUpdated today
    Backend & APIsAuto-check passed

More from hashgraph-online/awesome-codex-plugins

All 686 skills in this repo
  • Anime Reaction Gif

    hashgraph-online/awesome-codex-plugins

    Create original anime-style reaction stickers as looping GIFs and MP4 previews, using generated character pose sheets and timed key poses.

    1.2k GitHub stars~922 tokensUpdated today
    Auto-check passed
  • Calibredb

    hashgraph-online/awesome-codex-plugins

    Manage and query Calibre libraries with the calibredb CLI (local paths or Calibre Content server URLs).

    1.2k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Rust API Test Harness

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Rust HTTP APIs and services, especially when Codex needs black-box integration tests, random-port app startup, real database test…

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

    hashgraph-online/awesome-codex-plugins

    Make a studio's game look like something at build time — a cover from a real frame of the game (free), painted covers, backdrops, textures and character plates from image models through the…

    1.2k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Game Balance Economy

    hashgraph-online/awesome-codex-plugins

    Balance game difficulty, resources, rewards, probability, progression, economies, and dominant strategies.

    1.2k GitHub stars~618 tokensUpdated today
    Auto-check passed
  • Manuscript Engagement Analytics

    hashgraph-online/awesome-codex-plugins

    Analyze nonfiction manuscripts for reader engagement signals, including heading-level word counts, slow starts, long slogs, weak takeaway titles, value pacing, beta-reader comment dropoff, and…

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

Works with

Categories

Questions about Rust Trait API Design

What does Rust Trait API Design do?

Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces. Rust Trait API Design is an agent skill from hashgraph-online/awesome-codex-plugins. Design and review Rust trait APIs, generic bounds, dispatch models, and conversion contracts for clear public interfaces.

When should I use Rust Trait API Design?

Rust Trait API Design fits situations like: reviewing traits; associated types.

How do I install Rust Trait API Design in Claude Code?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill rust-trait-api-design -a claude-code`. Or copy the skill folder (plugins/LVTD-LLC/skills/skills/rust-trait-api-design in hashgraph-online/awesome-codex-plugins) into .claude/skills/rust-trait-api-design in your project. Claude Code loads it when a task matches its description.

How do I install Rust Trait API Design in Codex?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill rust-trait-api-design -a codex`. Or copy the skill folder (plugins/LVTD-LLC/skills/skills/rust-trait-api-design in hashgraph-online/awesome-codex-plugins) into .agents/skills/rust-trait-api-design in your project. Codex loads it when a task matches its description.

Can I use Rust Trait API Design 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 hashgraph-online/awesome-codex-plugins --skill rust-trait-api-design -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-trait-api-design, .gemini/skills/rust-trait-api-design, .github/skills/rust-trait-api-design and .opencode/skills/rust-trait-api-design in your project.

What does Rust Trait API Design need to run?

SKILL.md names no scripts, command-line tools or credentials: Rust Trait API Design is instructions for the agent only. Compatibility (from SKILL.md): Codex, Claude Code, and other Agent Skills-compatible clients..

Does Rust Trait API Design 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 Trait API Design 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 Trait API Design use?

Rust Trait API Design is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Trait API Design use?

About 929 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 504 tokens, read only when the agent opens those files.

What are the alternatives to Rust Trait API Design?

Skills that share tags, products or a category with Rust Trait API Design: Rust Skills (JMBeresford/retrom, 2.1k stars), Rust Skills (noh-rs/nohrs, 156 stars), Dev Rules (rust-dd/tako, 162 stars) and API Design (axone-protocol/contracts, 123 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Trait API Design?

hashgraph-online (a GitHub organization) maintains it in hashgraph-online/awesome-codex-plugins, which has 1,242 GitHub stars. The repository holds 686 skills in this directory. The repository was last updated on October 8, 2026.

Source: hashgraph-online/awesome-codex-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.