Agent skill

Support 3rdparty Traits

by cmpute in cmpute/dashu

This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ...

Apache-2.0Auto-check passedDevelopment

Install Support 3rdparty Traits

skills CLI
$ npx skills add cmpute/dashu --skill support-3rdparty-traits -a claude-code

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

GitHub CLI
$ gh skill install cmpute/dashu support-3rdparty-traits --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/cmpute/dashu.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/support-3rdparty-traits .claude/skills/support-3rdparty-traits && 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
support-3rdparty-traits
GitHub stars
142
Token cost
~3.9k tokens
SKILL.md length
1,753 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ...

  • Asks to support a trait from another crate
  • SKILL.md covers Repository context…, Decision: which branch?, Branch A — Support a trait… and Branch B — Support a new major…, plus 2 more sections
  • Calls cargo
  • Implement a third-party trait

What it does

Support 3rdparty Traits is an agent skill from cmpute/dashu. This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ... support", "add a feature flag for a new dependency", "wire up crate X behind a feature", "expose type X for crate Y", or "support a new major version of rand / serde / num-traits / diesel / postgres-types" (e.g. "add randv09 alongside randv08", "support diesel v3"). It provides the SOP for adding an optional third-party…

Its SKILL.md is about 3.9k 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, covering Operations and SOPs and Changelog and release notes. It works with PostgreSQL and Rust. The repository describes itself as: A library set of arbitrary precision numbers implemented in Rust. The licence is Apache-2.0.

When your agent uses it

  • Asks to support a trait from another crate
  • Implement a third-party trait
  • Add an integration for crate X
  • Add num-traits / serde / rand / ..

Example prompts

  • “support a trait from another crate”
  • “implement a third-party trait”
  • “add an integration for crate X”
  • “/support-3rdparty-traits”

What it can do on your machine

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

Support 3rdparty Traits loads about 3.9k tokens when it runs. Until then it costs about 190 tokens; SKILL.md has 1,753 words of instructions outside code blocks.

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

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 cmpute/dashu at commit aadb058, republished under its Apache-2.0 licence (© cmpute). 1,753 words, ~3,858 tokens.

Download SKILL.mdSave it as .claude/skills/support-3rdparty-traits/SKILL.md (or your agent's skills folder).
name
support-3rdparty-traits
description
This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ... support", "add a feature flag for a new dependency", "wire up crate X behind a feature", "expose type X for crate Y", or "support a new major version of rand / serde / num-traits / diesel / postgres-types" (e.g. "add rand_v09 alongside rand_v08", "support diesel v3"). It provides the SOP for adding an optional third-party dependency behind the project's versioned-feature-flag policy, placing the trait impls in the right module, forwarding the feature across crates and the meta crate, and keeping the no_std/MSRV/changelog invariants intact.

Supporting Third-Party Traits in dashu

Standard operating procedure for two related changes:

  • Branch A — implement traits from a new third-party crate (e.g. add borsh, arbitrary, bytemuck support, or a trait crate the repo doesn't depend on yet).
  • Branch B — support a new major version of a crate that is already integrated (e.g. add rand_v09 alongside rand_v08, or diesel_v3 alongside diesel_v2).

Both share the same invariants; Branch B reuses Branch A's steps plus a versioning layer.

Repository context (load-bearing facts)

Read these before touching anything — they are the conventions every existing integration follows.

  • Impls live in <crate>/src/third_party/, one file per external crate. <crate>/src/third_party/mod.rs gates each submodule with #[cfg(feature = "...")]. <crate>/src/lib.rs declares mod third_party; (private) then pub use third_party::*; to expose any public items.
  • Two visibility flavors in mod.rs:
    • pub mod rand; — when the file defines new public types (e.g. UniformBits, UniformUBig) that users import from crate::rand.
    • mod num_traits; / mod serde; — when the file only impls an external trait for a local type; the impl is globally reachable once compiled, so nothing public needs re-exporting.
  • "Stable" vs "unstable" dependencies (this split is explicit in every Cargo.toml, marked # stable dependencies / # unstable dependencies):
    • Stable = the crate's API is essentially frozen across versions (serde, zeroize, num-order). One feature, named after the crate. Example: serde = ["dep:serde", "dashu-int/serde"].
    • Unstable = breaking changes between major versions (rand, num-traits, num-integer, diesel, postgres-types). Always a versioned feature/dep with a _vXX suffix, plus an unversioned alias feature pointing at the current default.
  • Versioned dependency = renamed optional dep. The dep key carries the suffix and package = resolves it to the real crate:
    toml
    rand_v08 = { optional = true, version = "0.8.3", package = "rand", default-features = false }
    In Rust code you import by the suffixed key: use rand_v08::{Rng, ...};. Inside a file you may alias it back to the natural name for readability: use num_traits_v02 as num_traits;.
  • Versioned feature enables its own dep AND forwards downstream. Because float/rational re-export int's types, their feature must also turn on the matching feature in the lower crate:
    toml
    num-traits_v02 = ["dep:num-traits_v02", "dashu-int/num-traits_v02"]
  • Unversioned alias points at the latest version: rand = ["rand_v08"], num-traits = ["num-traits_v02"]. Users write features = ["rand"]; the alias decides which real version that means.
  • Multiple major versions coexist as peers (see diesel): diesel_v1 and diesel_v2 are both real, each with its own versioned dep + feature + module file (third_party/postgres/diesel_v1.rs, diesel_v2.rs). Shared conversion logic lives in third_party/postgres/mod.rs; each version file only wires that logic to its own diesel traits.
  • Private helper deps use a leading-underscore key and are never given their own user-facing feature. Enabled as a side effect: num-order = ["dep:num-order", "dep:_num-modular"] (rational).
  • no_std: every optional dep is declared default-features = false so it cannot drag std into the default (no_std) build. If the dep itself needs std, the feature must pull in std (e.g. postgres-types_v02 = ["dep:postgres-types_v02", "dep:_bytes", "std"]).
  • Meta crate dashu (root Cargo.toml) forwards every feature to all sub-crates that have it — both the versioned form and the unversioned alias: rand_v08 = ["dashu-int/rand_v08", "dashu-float/rand_v08", "dashu-ratio/rand_v08"] and rand = ["dashu-int/rand", ...].
  • MSRV is 1.68. A new dep must build on 1.68; if it doesn't, it must be stripped from MSRV builds via .github/workflows/drop_incompatible_deps_for_msrv.py (see pre-publish-check skill, Step 6).
  • Two Cargo.toml styles coexist in the repo: integer uses the legacy style where optional = true deps auto-create an implicit feature (so serde/zeroize/num-order aren't listed in [features]). float/rational use the modern explicit style with dep: syntax. Prefer the dep: (modern) style for any new work; match the surrounding crate's existing style when editing an existing feature.

Decision: which branch?

  • The crate is not yet in any Cargo.toml → Branch A.
  • The crate is already integrated and you're adding a second major version (or replacing the supported one) → Branch B.

Branch A — Support a trait from a new third-party crate

Step A1 — Classify the dependency: stable or unstable?

If the upstream crate has a history of breaking changes between major versions (rand, num-traits, num-integer) or is pre-1.0, treat it as unstable → you need the versioned suffix machinery. If its API is effectively frozen at 1.x (serde, zeroize, num-order) → stable → a single unversioned feature suffices. When in doubt, choose unstable; the cost is one extra alias line and you avoid a painful migration later.

Step A2 — Declare the optional dependency in the target crate's Cargo.toml

Under the matching # stable dependencies or # unstable dependencies comment. Always default-features = false.

Stable:

toml
borsh = { optional = true, version = "1.x", default-features = false }

Unstable (note the _vXX key + package =):

toml
arbitrary_v1 = { optional = true, version = "1.x", package = "arbitrary", default-features = false }
Step A3 — Define the feature flag(s)

Stable (modern dep: style):

toml
borsh = ["dep:borsh"]

Unstable — two entries: the versioned feature (with cross-crate forwarding if a lower crate also exposes the type) plus the unversioned alias:

toml
arbitrary_v1 = ["dep:arbitrary_v1"]
arbitrary = ["arbitrary_v1"]

If the trait must also be enabled on a crate this one depends on (because it re-exports that crate's types), add the downstream feature to the versioned feature list — see load-bearing fact above.

Step A4 — Create the implementation module

Add <crate>/src/third_party/<crate_name>.rs. Import the external crate by its dep key (alias back to the natural name if it reads better). impl the external trait(s) for the local types (UBig/IBig/FBig/RBig). Follow existing files as a template: integer/src/third_party/num_traits.rs (pure trait impls), integer/src/third_party/rand.rs (defines new public types + a module-level # Examples doc), float/src/third_party/postgres/ (multi-version, shared logic).

If the file defines new public items the user will name, declare it pub mod in mod.rs; otherwise plain mod.

Step A5 — Wire it into third_party/mod.rs
rust
#[cfg(feature = "borsh")]
mod borsh;
// or, if it exposes public types:
#[cfg(feature = "arbitrary_v1")]
pub mod arbitrary;

No change to lib.rs is needed beyond the existing pub use third_party::*; — that line already re-exports anything pub from these modules.

Step A6 — Forward the feature across crates (if applicable)

If the same trait makes sense on types from more than one sub-crate, repeat Steps A2–A5 in each crate, and make each higher crate's versioned feature turn on the lower crate's matching feature (load-bearing fact). Keep the feature name identical across crates (arbitrary_v1 everywhere).

Step A7 — Forward the feature in the meta crate

In the root Cargo.toml [features], add both forms (versioned + unversioned alias), each forwarding to every sub-crate that implements it:

toml
arbitrary_v1 = ["dashu-int/arbitrary_v1", "dashu-float/arbitrary_v1", "dashu-ratio/arbitrary_v1"]
arbitrary = ["dashu-int/arbitrary", "dashu-float/arbitrary", "dashu-ratio/arbitrary"]

List only the sub-crates that actually have the feature — do not forward to a crate that doesn't implement it (that's a build error).

Step A8 — Tests, doc examples, dev-dependencies
  • Add a [[test]] with required-features = ["<feature>"] (see the random / serde tests in each Cargo.toml), or put unit tests in a #[cfg(test)] mod tests at the bottom of the new module file.
  • Re-declare the dep (un-suffixed or suffixed to match) under [dev-dependencies] without optional, so doctests/examples resolve.
  • Any public item documented at module level (like rand.rs) needs a # Examples block; in examples use the dep by its dep key (use rand_v08::{...}).
Show full SKILL.md (709 more words)Show less
Step A9 — MSRV check

Confirm the new dep's rust-version (or last-known-compatible release) is ≤ 1.68. If not, add it to drop_incompatible_deps_for_msrv.py so MSRV CI builds strip it.

Step A10 — Changelog

Add an entry under ### Add in the ## Unreleased section of every crate whose Cargo.toml you changed (target crate, any crate that got cross-crate forwarding, and note the meta crate has no changelog). New optional deps are additive → patch bump.


Branch B — Support a new major version of an existing crate

Example below uses adding rand_v09 alongside rand_v08; substitute names as needed.

Step B1 — Add the new versioned dependency

Keep the old one; add the new one beside it under # unstable dependencies:

toml
rand_v08 = { optional = true, version = "0.8.3", package = "rand", default-features = false }
rand_v09 = { optional = true, version = "0.9.0", package = "rand", default-features = false }

Both keys resolve to the real rand crate via package =. They coexist fine because the keys differ.

Step B2 — Add the versioned feature

In every crate that supports it, mirroring the old version's feature line and its cross-crate forwarding:

toml
rand_v09 = ["dep:rand_v09", "dashu-int/rand_v09"]   # in float/rational
rand_v09 = ["dep:rand_v09"]                          # in integer
Step B3 — Decide the unversioned alias target

The alias rand = [...] selects the default version users get. Two options:

  • Keep the alias on the old version (rand = ["rand_v08"]) — purely additive, no behavior change for existing features = ["rand"] users. Recommended default.
  • Move the alias to the new version (rand = ["rand_v09"]) — existing users silently upgrade. This is a breaking change in effect; only do it deliberately, call it out in the changelog under ### Change, and require at least a minor bump (pre-1.0 rule).

If you move the alias, the old versioned feature still exists for users who need to pin it explicitly.

Step B4 — Create/adapt the implementation module

Add <crate>/src/third_party/rand_v09.rs (or whatever splits cleanly). Often you can share logic with the old-version file by extracting the version-independent core into a helper (the postgres/mod.rs Numeric struct + conversion fns are the model: shared core, version-specific trait wiring in diesel_v1.rs/diesel_v2.rs). Gate the new module in mod.rs:

rust
#[cfg(feature = "rand_v08")]
pub mod rand;      // existing
#[cfg(feature = "rand_v09")]
pub mod rand_v09;  // new

Port every trait impl from the old file, adjusting for API differences in the new major version.

Step B5 — Cross-crate + meta forwarding

Repeat Step B2 in every implementing crate, and add rand_v09 = [...] (and, if you moved the alias, the updated rand = [...]) to the root Cargo.toml forwarding to all sub-crates that have it.

Step B6 — Tests, doc examples, dev-dependencies

Add a dev-dependency for the new version, and either a new [[test]] gated on rand_v09 or extend the existing one to cover both versions. Mirror the old version's doctest coverage using the new dep key.

Step B7 — Changelog

Under ### Add in each affected crate's ## Unreleased: "Add support for rand 0.9 (behind the rand_v09 feature)." If you moved the unversioned alias (Step B3 option 2), also add a ### Change entry and treat the release as breaking.


Verification

After either branch, confirm the feature compiles in isolation and that the no_std path still holds:

sh
# feature on, 64-bit Word
cargo check -p <crate> --features <feature>
# feature on, 32-bit Word (NTT and some paths are 32-bit-specific)
RUSTFLAGS='--cfg force_bits="32"' cargo check -p <crate> --features <feature>
# no_std still builds (the new dep must not have pulled in std)
cargo build -p <crate> --no-default-features --features <feature>
# clippy clean with the feature on
cargo clippy -p <crate> --features <feature> -- -D warnings
# doctests/examples for the new module
cargo test -p <crate> --features <feature> --doc
# meta crate forwards correctly
cargo check -p dashu --features <feature>

If the feature exists in multiple sub-crates, run the --features check on each and on -p dashu.

Common failure modes

  • Forgot the package = rename on a versioned dep — rand_v09 without package = "rand" makes cargo look for a (nonexistent) crate literally named rand_v09. Every versioned dep needs package = "<real crate name>".
  • Forgot cross-crate forwarding — float/rational's num-traits_v02 feature must list dashu-int/num-traits_v02; without it, enabling the feature on the higher crate doesn't give the lower crate's types the impl.
  • Forwarded a feature to a crate that doesn't have it — dashu-base has no rand feature; listing it in the meta crate's rand forwarding is a build error. Only forward to crates that actually define the feature.
  • Dep without default-features = false — silently breaks the no_std build (serde/zeroize pull std by default). Every optional dep in this repo sets it.
  • #[cfg] feature name ≠ Cargo feature name — mod.rs gates on the feature name (rand_v08), not the dep key's package. They usually match the key, but if you renamed via package =, the cfg still uses the key/feature name, not rand.
  • Added an unstable dep without the unversioned alias — users expect features = ["rand"] to work; a versioned-only feature breaks that contract.
  • New dep exceeds MSRV — builds fine on stable CI, fails the 1.68 matrix job. Must be stripped in drop_incompatible_deps_for_msrv.py.
  • Visibility mismatch — declared mod foo in mod.rs but the module defines public types the user needs (crate::foo::UniformBits). If users name items from the module, it must be pub mod.
  • Missed a changelog — every Cargo.toml you edited (target crate + forwarded crates) needs an ## Unreleased entry; the meta crate has none.

© cmpute, Apache-2.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 .claude/skills/support-3rdparty-traits of cmpute/dashu.

Open the folder on GitHubat commit aadb058

Compare with similar skills

Support 3rdparty Traits 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.

Support 3rdparty Traits compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Support 3rdparty Traits this skillcmpute/dashu142—~3.9kAutomated safety check: PassApache-2.0
Rsigmatimescale/rsigma159—~1.2kAutomated safety check: PassMIT
Releasesignageos/vscode-sops122—~2.2kAutomated safety check: NotesMIT
Release Skillsnexmoe/eve4213 repos~3.3kAutomated safety check: PassNone
Aptos CLI Releaseaptos-labs/aptos-core6.4k—~431Automated safety check: PassCustom licence
Worktrunk Release Workflowmax-sixty/worktrunk9k—~6.9kAutomated safety check: PassCustom licence

Similar skills

  • Rsigma

    timescale/rsigma

    Use the rsigma CLI and MCP server: engine eval, engine daemon, rule lint, rule draft, rule tune, rule backtest, backend convert, mcp serve.

    159 GitHub stars~1.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Release

    signageos/vscode-sops

    Releases the vscode-sops extension end-to-end: determines the next version from the bump history, updates CHANGELOG.md and package.json/package-lock.json, builds via vscode:prepublish, publishes to…

    122 GitHub stars~2.2k tokensUpdated 6 mo ago
    DevelopmentAuto-check: notes
  • 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
  • Aptos CLI Release

    aptos-labs/aptos-core

    A skill your agent uses when cutting or preparing a new Aptos CLI release, bumping the aptos crate version, or editing crates/aptos/CHANGELOG.md for a release

    6.4k GitHub stars~431 tokensUpdated today
    DevelopmentAuto-check passed
  • Worktrunk Release Workflow

    max-sixty/worktrunk

    Walks a maintainer through cutting a Worktrunk release: sync the release branch, pass two test gates, review the changes, then publish.

    9k GitHub stars~6.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Cut Release

    delexw/claude-code-trace

    Cuts a new versioned release of claude-code-trace end-to-end without asking any questions.

    377 GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed

More from cmpute/dashu

  • Pre Publish Check

    cmpute/dashu

    Runs formatting/lint/test/semver checks before publishing. An agent skill from cmpute/dashu.

    142 GitHub stars~3.1k tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Support 3rdparty Traits

What does Support 3rdparty Traits do?

This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ... Support 3rdparty Traits is an agent skill from cmpute/dashu. This skill should be used when the user asks to "support a trait from another crate", "implement a third-party trait", "add an integration for crate X", "add num-traits / serde / rand / ...

When should I use Support 3rdparty Traits?

Support 3rdparty Traits fits situations like: asks to support a trait from another crate; implement a third-party trait; add an integration for crate X; add num-traits / serde / rand / ..

How do I install Support 3rdparty Traits in Claude Code?

Run `npx skills add cmpute/dashu --skill support-3rdparty-traits -a claude-code`. Or copy the skill folder (.claude/skills/support-3rdparty-traits in cmpute/dashu) into .claude/skills/support-3rdparty-traits in your project. Claude Code loads it when a task matches its description.

How do I install Support 3rdparty Traits in Codex?

Run `npx skills add cmpute/dashu --skill support-3rdparty-traits -a codex`. Or copy the skill folder (.claude/skills/support-3rdparty-traits in cmpute/dashu) into .agents/skills/support-3rdparty-traits in your project. Codex loads it when a task matches its description.

Can I use Support 3rdparty Traits 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 cmpute/dashu --skill support-3rdparty-traits -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/support-3rdparty-traits, .gemini/skills/support-3rdparty-traits, .github/skills/support-3rdparty-traits and .opencode/skills/support-3rdparty-traits in your project.

What does Support 3rdparty Traits need to run?

Going by SKILL.md and its folder, Support 3rdparty Traits needs the command-line tools its instructions call (cargo).

Does Support 3rdparty Traits 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 Support 3rdparty Traits 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 Support 3rdparty Traits use?

Support 3rdparty Traits is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Support 3rdparty Traits use?

About 3.9k tokens (SKILL.md is roughly 15k 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 Support 3rdparty Traits?

Skills that share tags, products or a category with Support 3rdparty Traits: Rsigma (timescale/rsigma, 159 stars), Release (signageos/vscode-sops, 122 stars), Release Skills (nexmoe/eve, 421 stars) and Aptos CLI Release (aptos-labs/aptos-core, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Support 3rdparty Traits?

cmpute (a GitHub user) maintains it in cmpute/dashu, which has 142 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 4, 2026.

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