Skip to content

Repository files navigation

rust-engineer-skill

English | Simplified Chinese

An open Agent Skill for designing, implementing, diagnosing, refactoring, and reviewing Rust with explicit ownership models, minimal Trait boundaries, real execution paths, and evidence-driven verification.

The method is intentionally stricter than a collection of Rust tips:

problem and constraints -> value and ownership model -> type and error model -> minimal Trait boundary -> smallest real path -> compiler-guided iteration -> layered verification -> source review -> repeat

It retains three guiding ideas throughout that loop: reason from first principles, use focused learning and deliberate practice to close the current model gap, and repeat a learn-build-reflect-correct cycle against real evidence.

What It Covers

  • ownership, borrowing, lifetimes, type design, and error modeling;
  • minimal caller-oriented Traits, static versus dynamic dispatch, and public async Trait compatibility;
  • modules, crates, workspaces, binaries, tests, fixtures, and build boundaries;
  • concurrency, cancellation, networking, unsafe, FFI, performance, and macros;
  • public API, serialization, protocol, persistence, and migration contracts;
  • dependency and feature selection grounded in the pinned graph and target workload;
  • observability, evidence boundaries, and source-driven dependency review.

The skill follows the Agent Skills specification. Repository documentation, evaluation data, and governance files remain outside the installable skills/rust-engineer/ directory so agents load only operational material.

Portability comes from the standard SKILL.md contract and its relative resources. agents/openai.yaml is optional OpenAI-specific appearance and invocation metadata; it is not required by other hosts and does not replace the portable skill definition. Compatibility here means tools that implement the Agent Skills format directly or are supported by the Skills CLI, not literally every agent product.

Install

The local commands below are executable from a clone today. The GitHub-source commands become executable after this repository is published at github.com/nanlong/rust-engineer-skill.

Install from the published repository:

npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g

Target one supported agent explicitly:

# Codex
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a codex -y

# Claude Code
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a claude-code -y

# Cursor
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a cursor -y

# Gemini CLI
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a gemini-cli -y

# GitHub Copilot
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a github-copilot -y

# OpenCode
npx -y skills@1.5.21 add nanlong/rust-engineer-skill --skill rust-engineer -g -a opencode -y

The target names and flags above follow the current open Skills CLI. Agent support can evolve, so check that project when scripting installation for another tool.

For local development:

npx -y skills@1.5.21 add . --list
npx -y skills@1.5.21 add . --skill rust-engineer -g -a codex -y

Detect and Apply Updates

For an installation made from the published repository, ask the Skills CLI to resolve the source again and apply available changes:

# One globally installed skill
npx -y skills@1.5.21 update rust-engineer -g -y

# All globally installed skills
npx -y skills@1.5.21 update -g -y

Run that command manually, from a shell alias, or from your own scheduled job. The skill does not execute a background updater or modify its own installation.

Local-path development installs are best refreshed by running skills add again; update tracking is intended for a supported remote source.

Use

Invoke the skill by name when your agent supports explicit activation:

Use $rust-engineer to review this async Rust boundary and its cancellation semantics.

The description also lets compatible agents activate it for Rust source, Cargo manifests, compiler diagnostics, APIs, contracts, dependency work, and verification.

Validate

Run the deterministic gates:

make validate

This checks the official skill structure, public-content boundaries, behavior-evaluation definitions, runner unit tests, and the source-review fixture.

Run a quick single-mode behavior evaluation separately:

mkdir -p eval-results
python3 tools/run_behavior_evals.py \
  --model gpt-5.6-sol \
  --reasoning-effort medium \
  --grader-model gpt-5.6-luna \
  --grader-reasoning-effort max \
  --jobs 3 \
  --output eval-results/latest.json

Behavior evaluation commands require an installed, authenticated codex CLI and access to the selected models. They are intentionally excluded from deterministic CI because they are credentialed, costly, and nondeterministic.

For a publishable baseline, run repeated paired skill and no-skill controls with a separate grader model:

python3 tools/run_paired_baseline.py \
  --candidate-model gpt-5.6-sol \
  --candidate-reasoning-effort medium \
  --grader-model gpt-5.6-luna \
  --grader-reasoning-effort max \
  --repeats 3 \
  --jobs 6

The paired runner:

  • loads this repository's skill by exact path;
  • gives the control group an empty workspace without the skill;
  • starts candidates with user configuration and repository rules disabled;
  • copies writable fixtures into isolated temporary workspaces;
  • randomizes paired tasks and uses a different, blinded grader model;
  • repeats every case and reports run variation, criterion coverage, paired deltas, and bootstrap intervals;
  • passes candidate and grader reasoning efforts explicitly despite disabled user configuration and records both in provenance;
  • keeps full answers in ignored local results while committing only a compact summary;
  • fails a case unless every required criterion is met, no prohibited behavior appears, and the score reaches 80.

Model behavior is nondeterministic and model-specific. Treat any recorded run as a dated baseline, not a universal quality claim.

Current Baseline

The current 2026-07-31 paired baseline used gpt-5.6-sol candidates at medium reasoning effort and a blinded gpt-5.6-luna grader at max reasoning effort. It covered 15 cases with three repeats per mode, for 45 samples per mode.

Metric Control Skill Paired effect
Strict pass rate 11/45 (24.44%) 28/45 (62.22%) +37.78 pp (95% case-cluster bootstrap CI: +17.78 to +57.78 pp)
Mean score 85.13 93.00 +7.87 (95% case-cluster bootstrap CI: +2.40 to +15.20)
Required-criterion coverage 64.58% 83.33% +18.75 pp
Prohibited-criterion violation rate 0.00% 0.00% 0.00 pp
Paired outcome Count
Skill score higher 33
Scores tied 5
Control score higher 7
Skill-only pass 17
Control-only pass 0
Both pass 11
Both fail 17

These results establish an effect on this fixed harness, not universal Rust quality, cross-agent parity, or production effectiveness. Four cases still had zero skill pass rate, and two showed a negative mean score delta. See the full compact evidence and limitations in evals/baselines/2026-07-31-gpt-5.6-sol-medium-paired.json.

The earlier gpt-5.6-terra / gpt-5.6-sol baseline remains available as historical evidence. Do not compare its absolute numbers directly with the current baseline because the candidate, grader, explicit reasoning-effort policy, and harness version differ.

Command Verification Status

Audited on 2026-07-31:

Command family Evidence Current status
make validate Executed against the complete repository gates Passing
Local discovery and six-agent install Executed with Skills CLI 1.5.21 in an isolated home directory Passing
GitHub-source skills add Syntax and flags match Skills CLI 1.5.21; the named repository does not exist yet Available after publication
skills update Syntax matches Skills CLI 1.5.21; a remote-backed install is required for an end-to-end update check Available after publication and install
Behavior runners CLI parsing, unit tests, and a complete paired baseline have been exercised Requires authenticated Codex and model access

The GitHub workflow covers deterministic validation, local discovery, and an isolated multi-agent installation smoke test. Its action revisions and CLI dependencies are pinned. A successful hosted run can only be claimed after the repository is pushed and GitHub Actions executes it.

Repository Layout

skills/rust-engineer/   installable Agent Skill
evals/                  behavior cases, grader schema, and isolated fixtures
tools/                  deterministic validators and the behavior runner
.github/workflows/      continuous validation

Contributing

See CONTRIBUTING.md. Changes to core instructions should include a behavior case or explain why existing cases already cover the invariant.

License

Apache-2.0. See LICENSE.

About

An evidence-driven Agent Skill for designing, implementing, diagnosing, refactoring, and reviewing Rust.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages