一键导入
arch-crate-design
Use for Rust crate boundaries, workspace structure, feature flags, public versus internal APIs, layering, and testable module design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for Rust crate boundaries, workspace structure, feature flags, public versus internal APIs, layering, and testable module design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Migrate a Rust codebase to the Polonius borrow checker (location-sensitive analysis, nightly flag -Zpolonius=next) and evolve owned-value internal APIs into the reference-returning, borrow-centric designs that NLL discouraged. Use this skill whenever the user mentions Polonius, NLL limitations, borrow-checker workarounds, defensive clones, double map lookups, get-or-insert helpers, lending iterators, reducing clone counts, or asks to audit, simplify, de-clone, or redesign Rust APIs around borrowing. Also use it when reviewing Rust code containing clone-to-appease-borrowck patterns, entry() calls with cloned keys, id/index indirection standing in for references, or clone-modify-writeback sequences — even if the user does not name Polonius. Provides two modes (workaround retirement; ownership-model evolution), a pattern catalogue with lifetime-versus-aliasing discriminators, an API evolution playbook, worked examples, and a documentation strategy.
Route Rust work to the smallest useful skill. Use for Rust coding, design, compile errors, API questions, crate layout, async, performance, unsafe, or domain-specific Rust work.
Design and maintain Rust unit tests with clear helper boundaries, rstest fixtures and parameterization, serial_test isolation, fallible setup, and rich assertions with googletest, pretty_assertions, and insta. Use when refactoring assertion helpers, replacing brittle boolean assertions, shaping table tests, or deciding between equality, matcher, and snapshot assertions.
Capture architectural decisions in Rust projects using the Y-Statement format. Use when a choice is hard to reverse, when the rationale will outlive its author, or when reviewers keep asking "why did we pick this?". Especially relevant for typestate, trait bounds, public API shape, `unsafe` invariants, runtime selection, and verification tooling.
Audit and curate a Rust project's dependency graph. Use for `cargo-vet`, `cargo-audit`, `cargo-deny`, lockfile hygiene, version pinning, and the policy of who is trusted to ship what. Also for SemVer guardrails (`cargo-semver-checks`, `cargo-public-api`) at the publishing boundary.
Write and maintain Kani bounded model checking harnesses for Rust. Use when verifying structural invariants, unsafe code, bounded state machines, or dispatch logic via exhaustive symbolic execution.
| name | arch-crate-design |
| description | Use for Rust crate boundaries, workspace structure, feature flags, public versus internal APIs, layering, and testable module design. |
| globs | ["**/Cargo.toml","**/*.rs"] |
Use this when the hard part is where a Rust responsibility should live, not how to write the next function.
workspace.package is the right place for shared package metadata such as
version, edition, rust-version, licence, repository, and publish, but
members must opt in with {key}.workspace = true.cargo-binstall, make release artifacts stable
and predictable, then add [package.metadata.binstall] only once the
release URL, archive format, and binary path are known. Use overrides when
some targets ship different artifact names.arch-supply-chain skill; it covers
cargo-vet, cargo-audit, cargo-deny, cargo-semver-checks, and
cargo-public-api.my-product/
├── Cargo.toml
├── crates/
│ ├── core-lib/
│ │ ├── Cargo.toml
│ │ └── src/lib.rs
│ ├── http-api/
│ │ ├── Cargo.toml
│ │ └── src/lib.rs
│ ├── cli-app/
│ │ ├── Cargo.toml
│ │ └── src/main.rs
│ └── test-support/
│ ├── Cargo.toml
│ └── src/lib.rs
└── xtask/
├── Cargo.toml
└── src/main.rs
Suggested roles:
core-lib: reusable domain logic and typed APIs.http-api: transport and framework glue built on the library crates.cli-app: the user-facing binary with thin process wiring.test-support: private test helpers; keep publish = false unless it is
intentionally reusable outside the workspace.xtask: developer automation and release tooling; keep it out of the
publishable dependency graph.This shape is justified only when the split matches real boundaries. If
http-api and cli-app are just thin shells over core-lib, the workspace is
earning its keep. If all crates depend on each other freely, it is not.
binstall support before release artifacts and
naming are stable,