shift: Skill for Claude Code

.agents/skills/rust/SKILL.md

rust is a skill for Claude Code, Codex from shift-editor/shift. It costs 98 tokens per session (3,035 once invoked), scanned A, original, Apache-2.0.

A set of rules for writing and reviewing Rust code in Shift's code libraries. Rust is a programming language, and these rules cover repeated error handling, entity lookups, checked arithmetic, and shared helper functions.

In plain words
What is it for?
Use it when adding or changing Rust files, especially code that reports missing entities, handles conversion or arithmetic failures, or reuses error helpers.
Why use it?
It prevents the same failure cases from being implemented differently in many places. That makes errors and data-handling code more consistent when Rust code changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is shift-editor/shift's own configuration. It tells Claude Code and Codex how to work on shift itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything shift configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shift-editor/shift. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shift-editor/shift/main/.agents/skills/rust/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shift-editor/shift

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust

README.md
[![agentmods](https://agentmods.dev/badge/skills/shift-editor/shift/rust/github.svg)](https://agentmods.dev/skills/shift-editor/shift/rust)
Your own site
<a href="https://agentmods.dev/skills/shift-editor/shift/rust"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/rust/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust

Your own site · 80×15
<a href="https://agentmods.dev/skills/shift-editor/shift/rust"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,035 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00098 $0.03035
Opus 5.5 $0.00039 $0.01214
Sonnet 5.5 $0.00020 $0.00607
Haiku 4.5 $0.00010 $0.00303

Measured yesterday against content hash 269227e7c83f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/rust/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/rust — How Rust is written in Shift

Shift's crates had the same failure built by hand at hundreds of sites: .ok_or_else(|| CoreError::GlyphNotFound(glyph_id.clone()))?, .map_err(|_| SlugError::LengthOverflow)?, StoreError::MissingEntity { kind, id } struct literals. Every copy drifted a little: different kind strings, eager ok_or cloning ids on the success path, lookups cloning an id just to pass it by value. The rules below keep a failure defined once and named at the call site.

The rule

A failure that recurs for the same reason is constructed in exactly one place. Call sites say what they need (require_glyph, or_overflow, or_missing), not how to build the error.

ok_or_else with a site-specific error is fine. A message that only makes sense at one site, such as InvalidLibValue("missing value") in a parser, belongs inline. The second time the same error appears for the same reason, extract it.

Error helpers that already exist

Use these before writing an error by hand:

Failure Helper Crate
Entity missing from a Font font.require_glyph(&id)?, require_layer, require_layer_mut, require_layer_owner, require_source, require_axis shift-font (ir/font.rs)
Entity missing from any other lookup lookup.require(&id)? (Require + EntityRef; the id's type picks the *NotFound variant) shift-font (error.rs)
Contour, point, or anchor missing from a layer layer.require_contour_mut(id)?, require_point_mut, require_point_contour shift-font (layer_edit.rs)
Length or offset overflow a.checked_add(b).or_overflow()?, u32::try_from(n).or_overflow()?, length::to_u32, length::ensure_total, length::within shift-slug (length.rs)
Row missing from the store lookup.or_missing("glyph", &id)?, order_index(conn, table, kind, &id)? shift-store (error.rs, change_set.rs)
Retained-source index out of range identity.glyph_id(index)?, glyph_index, axis_id, source_id shift-bridge (SourceIdentity)

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed 269227e7c83f
  2. 5d ago Changed · +11 lines 8cb8f69ee5c8
  3. 7d ago Changed · +19 lines 10085a2d79fa
  4. 11d ago Changed · +4 lines 5a7d2aa94305
  5. 17d ago Changed · +12 lines 290cde54c93f
  6. 21d ago First seen · 62 lines · 98 tokens per session scan A d3d7c2737b64

Subscribe to this mod's changes

rust is a skill published in the GitHub repository shift-editor/shift (379 stars, last pushed today), licensed Apache-2.0. It adds 98 tokens to every session and 3,035 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-08.

Related

Other skills, from other repositories

ax-rust-signature

Use when writing Rust code with axllm for string signatures, field descriptors, JSON schema output, validation, and typed tool argument shapes.

ax-llm/ax · 36 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

ax-rust-llm

Use when writing Rust code with axllm for using the generated Ax package, factory functions, package docs, examples, and API reference.

ax-llm/ax · 37 tokens

solana-toolkit-guide

Guide to the Solana Wallet Toolkit — vanity address generation with multi-threaded search, official Solana Labs libraries, Rust and TypeScript implementations. Includes wallet generation, custom address prefixes, and OG names on the blockchain.

nirholas/three.ws · 50 tokens

solana

Use when working on Solana software, including one or more of: Solana client code using TypeScript, Rust libraries that use Solana crates, Anchor programs, Quasar programs, LiteSVM tests, including Rust program files, TypeScript tests, and Anchor.toml or Quasar.toml configuration. Designed to create minimal, reusable…

quicknode/solana-finance-claude-plugin · 76 tokens

docstring-generator

Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Use when asked to "add docs", "document this file", "generate docstrings", "add JSDoc", "add Rustdoc", "write TSDoc", or when working with TypeScript or Rust source files that need documentation comments. Supports…

espennilsen/pi · 118 tokens