rust-coder
Implement, refactor, and migrate production Rust with repository-grounded ownership, type-driven invariants, explicit errors, safe concurrency, minimal unsafe code, and verified Cargo workflows. Use for Rust features, crates, CLIs, services, libraries, async code, FFI, performance work, migrations, or substantial .rs and Cargo.toml changes, including requests such as 'rust-coder', 'write Rust', or 'implement this Rust feature with Codex'.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- rust-coder
- requires
- { "harness": [ { "need": "required", "slot": "4.shell" }, { "need": "required", "slot": "4.file-read-write" } ], "programs": [] }
- description
- Implement, refactor, and migrate production Rust with repository-grounded ownership, type-driven invariants, explicit errors, safe concurrency, minimal unsafe code, and verified Cargo workflows. Use for Rust features, crates, CLIs, services, libraries, async code, FFI, performance work, migrations, or substantial .rs and Cargo.toml changes, including requests such as 'rust-coder', 'write Rust', or 'implement this Rust feature with Codex'.
02 资源文件 3
- 参考文档agents/openai.yaml236 B
- 参考文档references/standards.md17.1 KB
- 脚本scripts/selftest/run-selftest.sh1.3 KB
03 SKILL.md 正文
Rust Coder
Implement directly in the current Codex session. Do not launch another Codex process.
Read references/standards.md completely before editing. Repository instructions and the declared toolchain override generic preferences.
Inspect
Read the smallest complete set of evidence:
- Nearest
AGENTS.md,CLAUDE.md, and repository instructions. - Root and target
Cargo.toml,Cargo.lock,rust-toolchain*, Cargo configuration, lint and format configuration, features, targets, and continuous-integration commands. - Every target file in full, its parent exports, immediate callers, traits, types, errors, feature gates, platform boundaries, focused tests, and one or two tested sibling modules.
- The exact format, check, test, Clippy, feature, and target commands used by the crate.
Determine the edit mode, crate kind, toolchain and minimum Rust version, public contract, ownership, resource lifecycle, error model, concurrency and cancellation, safety boundary, and invariants. Default to a hard cut; preserve compatibility only when an explicitly confirmed published contract requires it.
Ask only when an unresolved fact could change public behavior, durable state, safety, or migration semantics. Otherwise make repository-grounded assumptions and continue.
Design and implement
Resolve the change in this order:
- Domain invariants and invalid states.
- Ownership, borrowing boundaries, and resource lifetimes.
- Types, state transitions, public API, and errors.
- Concurrency, cancellation, and platform boundaries when relevant.
- Implementation mechanics and measured optimization.
Work directly with the available read and edit tools. Make the smallest coherent change and preserve unrelated work. Reuse existing crates, types, traits, errors, runtime, and helpers. Do not add dependencies, features, configuration, compatibility paths, unsafe, smart pointers, clones, lint suppressions, or abstractions merely to satisfy the compiler.
Treat borrow-checker and trait errors as design feedback. Keep checking and revising until the observable success criteria pass.
Verify
- Review the diff; every changed line must trace to the request.
- Run the repository's exact commands. Without stronger local commands, use focused equivalents of
cargo fmt --all --check,cargo check,cargo test, andcargo clippy --all-targets --all-features -- -D warnings. - Exercise every changed public feature combination and target that local tooling can validate.
- Search changed production Rust for unexplained
clone,Arc,Rc,Box, interior mutability,unwrap,expect, panics, placeholders,unsafe, and lint suppressions. - Add documentation, compile-fail, property, concurrency, Miri, package, or consumer checks only when the changed contract makes them relevant.
If a check fails, fix the exact observed failure and rerun it. Stop after three failed correction rounds and report the blocker instead of widening scope, cloning around ownership, adding unsafe code, or weakening validation.
Report
Lead with the outcome. Name changed files, consequential assumptions, ownership/type/error decisions, compatibility decisions, and every command actually run with its result.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.