About pma-rust
pma-rust is a Rust implementation and acceptance guide for PMA-managed projects. It sets production-readiness rules and points to focused references for project setup, runtime, data, and delivery.
Key features
- 01Production acceptance checklist
- 02Rust and TLS hard locks
- 03Workspace and toolchain guidance
- 04Runtime and data reference packs
- 05Testing and delivery requirements
Use cases
- 01Setting up a PMA-managed Rust service
- 02Checking Rust projects before production
- 03Finding guidance on CI and release delivery
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ zzci/ skills --skill pma-rustAfter installing, type/pma-rustin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlreferences/baseline.mddelivery.mdevidence.mdruntime-and-data.mdtoolchain-and-workspace.mdDetails
From the project READMERust Project Implementation & Acceptance Guide
Use this skill together with /pma. /pma controls workflow, approval, and task tracking; this guide defines the product-grade acceptance baseline for every PMA-Rust project.
This skill names no versions: every crate, toolchain, edition, and base image starts from its latest stable release verified at the registry (see /pma references/workflow.md Dependency Freshness). Versions inside references/evidence.md are evidence, not targets.
Hard Locks
Defined in references/baseline.md Hard Locks; loosening one follows its Known Trade-offs section. /pma refuses implementation approval when they are not enforced.
- Mature crates first; pure Rust is not required, but every release target must build
- rustls only, with the
aws-lc-rsprovider installed inmain() #![forbid(unsafe_code)]at every crate root- Deny warnings in
[workspace.lints], not on the CLI - MSRV declared and verified in CI
- No
unwrap/expect/panic!in runtime paths - Latest stable edition
- Quality gates green before merge (
references/delivery.md)
Standard-Bearer Anchors
Every recommendation is anchored to file:line evidence from 10 clone-verified projects (cargo, rust-analyzer, reth, vector, tokio, axum, linkerd2-proxy, uv, ruff, quickwit); citations live in references/evidence.md.
Loading Order
Always load references/baseline.md first. Then load the pack(s) relevant to the task:
references/baseline.md— hard locks, tech stack, naming, code quality (always required)references/toolchain-and-workspace.md— workspace layout, edition,[workspace.lints]vs build-flag pattern, toolchain pinning, dev-loop toolsreferences/runtime-and-data.md— Axum + tower + tokio runtime, error handling withIntoResponse, SQLx/SeaORM/Diesel selection, layered config, graceful shutdownreferences/delivery.md— security, secrets, OTLP observability, testing layers, supply-chain (cargo-deny/cargo-shear/typos), release automation, CIreferences/evidence.md— anchored citations (load when verifying or extending the skill)
Quick Routing
| If the task touches… | Load |
|---|---|
| New workspace, lints, toolchain, dev tooling | toolchain-and-workspace.md |
| Axum/tower handlers, DB access, config, shutdown | runtime-and-data.md |
| Tests, CI, observability, release, secrets, supply chain | delivery.md |
| "Why is this rule here?" / "What proves X is best practice?" | evidence.md |
| Anything else (always) | baseline.md |
Acceptance Checklist (PMA gate)
Before /pma accepts a Rust crate or service for production:
- Workspace declares the latest stable
editionandrust-version - Every crate has
# - CI runs: fmt + clippy with workspace deny-warnings policy + nextest +
--doctest + cargo-deny + cargo-shear (or machete) + typos + MSRV check (cargo hack check --rust-versionorcargo msrv verify) - No transitive
openssl/native-tls(verified bycargo deny bans) - All TLS uses rustls; the
aws-lc-rsprovider installed early inmain(canonical snippet:references/baseline.mdLock 2) - Tracing initialized with JSON formatter in prod; OTLP optional
-
/livez(liveness) +/readyz(readiness) endpoints exist for services - Graceful shutdown wired via
axum::serve(...).with_graceful_shutdown(...)+CancellationToken(or equivalent) - Secrets wrapped in
secrecy::SecretString/SecretBox<T>; neverDebug-formatted - Config layered: defaults → file → env → CLI; validated post-merge
- Errors typed per crate (
thiserror);anyhow/eyreonly in bin entry points - Release pipeline reproducible: tag → CI → signed binaries (cargo-dist or custom)
- Distributable binaries built against
*-unknown-linux-muslwith+crt-static(verified vialddsaying "not a dynamic executable") when the project ships portable CLI binaries -
[profile.dist]defined with size-tuned options (lto=fat,codegen-units=1,panic=abort,strip=symbols) when shipping CLI binaries - Container base image chosen with intent and documented in
docs/decisions/: pick by ops needs (minimal runtime, debug-friendly, glibc-bound, corporate base, multi-arch). No fixed size target — the right size is whatever the chosen base + binary needs - Core dumps suppressed at all reachable layers — in-process
rlimit::setrlimit(Resource::CORE, 0, 0)early inmain(always), plus systemdLimitCORE=0/ container--ulimit core=0:0/ K8s read-only rootfs / kernelkernel.core_pattern = \|/bin/falseper environment - Panic hook installed in
mainto emit a structuredtracing::error!with backtrace before the runtime aborts; production logs replace post-mortem cores
If any item fails, the project is not production-ready.