Agent skill

Adversarial Rust

by pproenca in pproenca/dot-skills

A skill your agent uses when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C, garbage-collected object graphs, exception-style…

MITAuto-check passedDevelopment

Install Adversarial Rust

skills CLI
$ npx skills add pproenca/dot-skills --skill adversarial-rust -a claude-code

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

GitHub CLI
$ gh skill install pproenca/dot-skills adversarial-rust --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/pproenca/dot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.experimental/adversarial-rust .claude/skills/adversarial-rust && 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
adversarial-rust
GitHub stars
214
Token cost
~2.8k tokens
SKILL.md length
1,010 words
Files
29 (incl. references, assets)
Skills in repo
182
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C, garbage-collected object graphs, exception-style…

  • Works in 7 steps: Enterprise Ceremony & Fake OO → Ownership Fought, Not Used → Anemic & Stringly Data → …
  • Refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C
  • SKILL.md covers When to Apply, Rule Categories, Quick Reference and How to Use, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Adversarial Rust is an agent skill from pproenca/dot-skills. Use this skill when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C, garbage-collected object graphs, exception-style control flow, or imperative loops ported onto the borrow checker. It is the adversarial, architecture-level counterpart to greenfield idiom advice — it names the paradigm the code betrays and prescribes the deep refactor that collapses it, up to deleting whole layers (single-impl DI traits, Deref inheritance, Manager/Service…

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 31 other files, including reference files and assets (for example `AGENTS.md`, `assets/templates/_template.md` and `metadata.json`).

It sits in Development, covering Refactoring and Linting and formatting. It works with Rust, Java and C#. The repository describes itself as: A collection of AI agent skills following the Agent Skills open format. The licence is MIT.

When your agent uses it

  • Refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C
  • Garbage-collected object graphs
  • Exception-style control flow
  • Imperative loops ported onto the borrow checker

Example prompts

  • “make this Rust actually Rust”
  • “flatten this architecture”
  • “/adversarial-rust”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Enterprise Ceremony & Fake OO
  2. Ownership Fought, Not Used
  3. Anemic & Stringly Data
  4. Exception-Style Control Flow
  5. Dynamic Dispatch by Habit
  6. Imperative Iteration
  7. Concurrency From Another Runtime

What it can do on your machine

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

Context cost

Adversarial Rust loads about 2.8k tokens when it runs, and up to ~20k if it reads all its reference files. Until then it costs about 260 tokens; SKILL.md has 1,010 words of instructions outside code blocks.

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

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 pproenca/dot-skills at commit cf93c57, republished under its MIT licence (© pproenca). 1,010 words, ~2,814 tokens.

Download SKILL.mdSave it as .claude/skills/adversarial-rust/SKILL.md (or your agent's skills folder). This skill also uses 28 other files; get the full folder from GitHub.
name
adversarial-rust
description
Use this skill when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C#, garbage-collected object graphs, exception-style control flow, or imperative loops ported onto the borrow checker. It is the adversarial, architecture-level counterpart to greenfield idiom advice — it names the paradigm the code betrays and prescribes the deep refactor that collapses it, up to deleting whole layers (single-impl DI traits, Deref inheritance, Manager/Service structs, reflexive builders, Rc<RefCell> webs, clone-until-it-compiles, bool/String state machines, sentinel returns, catch_unwind try/catch, reflexive Box<dyn>, blocking calls inside async, fire-and-forget spawns). Every rule is grounded in the codex-rs production workspace (openai/codex) — the prescriptions are what that codebase actually does and lint-enforces. Applies whenever the work is "make this Rust actually Rust", "flatten this architecture", or a pedantic review of code fighting the language.

Adversarial Rust

An adversarial, architecture-level review-and-refactor pass for Rust. Where a greenfield idiom skill answers "which tool should I reach for now?", this skill takes code that already exists and imported the wrong mental model — objects and interfaces from Java/C#, shared-everything graphs from garbage-collected languages, exceptions, C-style loops and sentinels, detached-promise concurrency — names the paradigm it betrays, and prescribes the refactor that collapses it back to idiomatic Rust.

Every rule is grounded in a single production codebase: the codex-rs workspace (github.com/openai/codex, codex-rs/ at commit f1affbac5e, ~125 crates / ~2,500 Rust files). The Correct side of each rule is what that codebase actually does, the enforcement evidence is its workspace lint config (unwrap_used, redundant_clone, needless_collect, await_holding_lock and ~30 more denied), and the carve-outs are the real exceptions it keeps — so "when NOT to apply" is never hypothetical. There is no rule for things a capable model already gets right.

When to Apply

  • Reviewing or refactoring existing Rust for architecture, not just style — "make this actually idiomatic", "why does this feel like Java in Rust"
  • Flattening ported ceremony — dependency-injection traits with one implementation, Deref-simulated inheritance, stateless *Manager/*Service structs, getter/setter boilerplate, a builder for every struct
  • Untangling fought ownership — .clone() sprinkled until it compiles, Rc<RefCell<T>> object graphs, self-referential struct attempts
  • Fixing anemic data — boolean/string state machines, parallel Option fields, raw primitives carrying domain meaning, god-structs of Options escaping the serde boundary
  • Removing exception-style flow — unwrap on expected failures, sentinel returns, catch_unwind as try/catch, anyhow on library API surfaces
  • Collapsing habitual indirection — Box<dyn Trait> for closed sets, boxed callback parameters, index loops and per-step collect() chains
  • Repairing imported concurrency habits — blocking calls inside async fn, guards held across .await, async task fan-out for CPU-bound work, fire-and-forget tokio::spawn

For greenfield "which pattern, which crate, which discipline" decisions while writing new Rust — async cancellation, error enum design, sandboxing, testing architecture — use openai-codex-rust-patterns instead; this skill is its diagnostic, layer-flattening counterpart drawn from the same codebase.

Rule Categories

#CategoryPrefixThe alien model it rips out
1Enterprise Ceremony & Fake OOarch-DI traits, Deref inheritance, Manager structs, getter ceremony, reflexive builders → concrete types, delegation, module functions, public fields, struct literals
2Ownership Fought, Not Usedown-clone-to-compile, Rc<RefCell> graphs, self-referential structs → designed clones, owning ID-keyed maps, single owners
3Anemic & Stringly Datatype-bool/String states, parallel Options, raw primitives, escaped god-structs → data-carrying enums, newtypes, one wire-to-domain resolve
4Exception-Style Control Flowflow-unwrap-as-handling, sentinels, catch_unwind, opaque library errors → Result + ?, Option, thiserror enums, anyhow at the rim
5Dynamic Dispatch by Habitdyn-Box<dyn> for closed sets, boxed callback params → tagged enums, generic Fn at the API, channels over listeners
6Imperative Iterationiter-index loops, mut accumulators, collect-per-step → named combinators, one lazy chain, collect into Result
7Concurrency From Another Runtimeconc-blocking in async, guards across await, async CPU fan-out, orphan spawns → spawn_blocking, narrowed locks, bounded thread pools, owned handles

Quick Reference

1. Enterprise Ceremony & Fake OO
2. Ownership Fought, Not Used
Show full SKILL.md (407 more words)Show less
3. Anemic & Stringly Data
4. Exception-Style Control Flow
5. Dynamic Dispatch by Habit
6. Imperative Iteration
7. Concurrency From Another Runtime

How to Use

Read a reference file when its smell shows up in the code under review. Each rule names the alien pattern, explains why Rust rejects it, and shows the refactor with real codex-rs names and a permalink into the codebase at the pinned commit. Prefer the deepest refactor the change budget allows — redesigning ownership beats sprinkling clone; deleting the DI trait beats mocking through it. Every example compiles on Rust 1.86 (2021 edition).

  • openai-codex-rust-patterns — the greenfield counterpart distilled from the same codex-rs workspace: which pattern to reach for while writing production Rust (async cancellation, error enum design, sandboxing, testing, workspace layout). Use it for authoring decisions; use this skill for adversarial review and ceremony-flattening refactors. Several rules here hand off to it once the flatten is done (flow-thiserror-library-anyhow-application → its errors- rules, flow-result-over-unwrap-expected → defensive-deny-unwrap-workspace-wide, arch-drop-di-trait-single-impl → its testing seams).

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and source references

© pproenca, 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 28 other files (references, assets) in skills/.experimental/adversarial-rust of pproenca/dot-skills.

  • SKILL.md
  • AGENTS.md
  • assets/templates/_template.md
  • metadata.json
  • references/_sections.md
  • references/arch-default-literal-over-builder.md
  • references/arch-drop-di-trait-single-impl.md
  • references/arch-free-functions-over-manager-struct.md
  • references/arch-no-deref-inheritance.md
  • references/arch-public-fields-over-getter-ceremony.md
  • references/conc-blocking-pool-over-async-cpu-fanout.md
  • references/conc-narrow-locks-before-await.md
  • references/conc-own-spawned-task-handles.md
  • references/conc-spawn-blocking-over-blocking-async.md
  • references/dyn-enum-over-box-dyn-closed-set.md
  • references/dyn-generics-over-boxed-callbacks.md
  • references/flow-no-catch-unwind-try-catch.md
  • references/flow-option-over-sentinel-values.md
  • … and 11 more

Open the folder on GitHubat commit cf93c57

Compare with similar skills

Adversarial Rust 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.

Adversarial Rust compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Adversarial Rust this skillpproenca/dot-skills214—~2.8kAutomated safety check: PassMIT
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz572—~1.5kAutomated safety check: PassApache-2.0
Code Revieweralirezarezvani/claude-skills28k1 repos~1.6kAutomated safety check: PassMIT
Precheckayutaz/piper-plus218—~647Automated safety check: PassMIT
Rust Best Practicesscott-fryxell/brayness124—~888Automated safety check: PassMIT

Similar skills

  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    572 GitHub stars~1.5k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • Code Reviewer

    alirezarezvani/claude-skills

    Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin, C, .NET, Java, C, C++, Rust, Ruby, PHP, and Dart/Flutter.

    28k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Precheck

    ayutaz/piper-plus

    PR 作成前の lint + format + test 一括実行。引数で scope (python/rust/cs/go/js/cpp/all) を指定可能。未指定なら git diff から自動判定。

    218 GitHub stars~647 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Rust Best Practices

    scott-fryxell/brayness

    Idiomatic Rust guide based on Apollo GraphQL's best practices handbook.

    124 GitHub stars~888 tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Dotnet

    managedcode/dotnet-skills

    Primary router skill for broad .NET work. An agent skill from managedcode/dotnet-skills.

    486 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from pproenca/dot-skills

All 182 skills in this repo
  • Audio Voice Recovery

    pproenca/dot-skills

    Audio forensics and voice recovery guidelines for CSI-level audio analysis.

    214 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Codemod React Pipeline

    pproenca/dot-skills

    Guided, scripted pipeline for running JSX/TSX/React codemods safely across large legacy codebases.

    214 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    214 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Dx Harness

    pproenca/dot-skills

    Developer-experience friction auditing and fixing — slow onboarding, repeated manual setup steps, missing bootstrap/reset/seed scripts, undiscoverable conventions.

    214 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Language Spec Author

    pproenca/dot-skills

    Turn a rough idea for a language into a complete, implementable specification — a DSL, query, config/data, template, or protocol language — by interviewing the author dimension by dimension until…

    214 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    214 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Adversarial Rust

What does Adversarial Rust do?

A skill your agent uses when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C, garbage-collected object graphs, exception-style…. Adversarial Rust is an agent skill from pproenca/dot-skills. Use this skill when reviewing or refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C, garbage-collected object graphs, exception-style control flow, or imperative loops ported onto the borrow checker.

When should I use Adversarial Rust?

Adversarial Rust fits situations like: refactoring existing Rust code that carries an alien mental model — OO/enterprise ceremony from Java/C; garbage-collected object graphs; exception-style control flow; imperative loops ported onto the borrow checker.

How do I install Adversarial Rust in Claude Code?

Run `npx skills add pproenca/dot-skills --skill adversarial-rust -a claude-code`. Or copy the skill folder (skills/.experimental/adversarial-rust in pproenca/dot-skills) into .claude/skills/adversarial-rust in your project. Claude Code loads it when a task matches its description.

How do I install Adversarial Rust in Codex?

Run `npx skills add pproenca/dot-skills --skill adversarial-rust -a codex`. Or copy the skill folder (skills/.experimental/adversarial-rust in pproenca/dot-skills) into .agents/skills/adversarial-rust in your project. Codex loads it when a task matches its description.

Can I use Adversarial Rust 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 pproenca/dot-skills --skill adversarial-rust -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adversarial-rust, .gemini/skills/adversarial-rust, .github/skills/adversarial-rust and .opencode/skills/adversarial-rust in your project.

What does Adversarial Rust need to run?

SKILL.md names no scripts, command-line tools or credentials: Adversarial Rust is instructions for the agent only.

Does Adversarial Rust 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 Adversarial Rust 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 Adversarial Rust use?

Adversarial Rust is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Adversarial Rust use?

About 2.8k tokens (SKILL.md is roughly 11k 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 17k tokens, read only when the agent opens those files.

What are the alternatives to Adversarial Rust?

Skills that share tags, products or a category with Adversarial Rust: Rust Best Practices (farm-fe/farm, 5.6k stars), Rust Hygiene Audit (tsz-org/tsz, 572 stars), Code Reviewer (alirezarezvani/claude-skills, 28k stars) and Precheck (ayutaz/piper-plus, 218 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Adversarial Rust?

pproenca (a GitHub user) maintains it in pproenca/dot-skills, which has 214 GitHub stars. The repository holds 182 skills in this directory. The repository was last updated on August 15, 2026.

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