AGENT SKILL

zerocopy-development

Develop, modify, build, test, or validate code in google/zerocopy's zerocopy crate and its derive crate. Use for implementation work, compiler-version gating, generated macro code, UI or compile-fail tests, test placement, linting, feature-gate validation, and pre-submission checks.

License 许可
Apache-2.0
所属仓库
google/zerocopy
最近更新
2026-11-15
Stars
★ 2.6k
Forks
195

01 前言 Front Matter

name
zerocopy-development
description
Develop, modify, build, test, or validate code in google/zerocopy's zerocopy crate and its derive crate. Use for implementation work, compiler-version gating, generated macro code, UI or compile-fail tests, test placement, linting, feature-gate validation, and pre-submission checks.

02 资源文件 3

03 SKILL.md 正文

Zerocopy Development

Apply the repository-scoped instructions for the zerocopy/ subtree in addition to this skill. Commands in this skill assume the working directory is zerocopy/ unless stated otherwise.

Workflow

  1. Inspect the affected implementation, tests, configuration, and nearby abstractions before changing behavior. Reuse existing utilities and patterns where they fit.
  2. Use ./cargo.sh, never direct cargo. Read Toolchains and Version Gating when choosing toolchains or changing compiler-version-dependent behavior.
  3. Make the narrowest change that satisfies the task. Keep generated and handwritten behavior consistent.
  4. If the change authors or modifies unsafe Rust, an unsafe API or trait, raw pointer or FFI code, safety documentation, a soundness argument, or an invariant-bearing abstraction, also use the sibling unsafe-rust skill. Do not substitute a separate zerocopy-specific unsafe methodology.
  5. Add or update tests at the level that owns the behavior. For UI, compile-fail, or compiler-output changes, read UI and Output Tests before editing fixtures.
  6. Before submitting, follow Validation, including the applicable toolchain, feature, and pre-push checks.

Macro Development

Put shared macro logic in src/util/macro_util.rs when doing so avoids repeating generated code. Generated code often triggers lints because names and shapes come from user input; use targeted #[allow(...)] attributes where needed to prevent generated code from producing spurious lint failures.

Commit Messages

Use GitHub issue syntax when a commit resolves or advances an issue:

  • Closes #123 when the commit resolves the issue.
  • Makes progress on #123 when the commit advances but does not resolve it.

04 同仓库更多 Skills

google
google/zerocopy

zerocopy-review

Review proposed changes to google/zerocopy's zerocopy crate and derive crate. Use for pull-request, patch, or diff review where findings should account for zerocopy's correctness, compatibility, testing, maintainability, known merge-blocking placeholders and repository-style requirements.

★ 2.6k
google
google/zerocopy

unsafe-rust

Author, document, review, audit, or redesign unsafe Rust with proof-grade rigor. Use for unsafe blocks and functions, unsafe traits and impls, raw pointers, FFI, inline assembly, intrinsics, layout or validity reasoning, concurrency and atomics, SIMD and target features, allocators, invariant-bearing fields, safety comments or `# Safety` documentation, soundness reviews, TCB audits, generated unsafe code, changes to safety or behavioral contracts, and proof-oriented redesign of unsafe abstractions.

★ 2.6k
google
google/zerocopy

unsafe-rust

Author, document, review, audit, or redesign unsafe Rust with proof-grade rigor. Use for unsafe blocks and functions, unsafe traits and impls, raw pointers, FFI, inline assembly, intrinsics, layout or validity reasoning, concurrency and atomics, SIMD and target features, allocators, invariant-bearing fields, safety comments or `# Safety` documentation, soundness reviews, TCB audits, generated unsafe code, changes to safety or behavioral contracts, and proof-oriented redesign of unsafe abstractions.

★ 2.6k
google
google/zerocopy

unsafe-rust

Author, document, review, or audit unsafe Rust with proof-grade rigor. Use for unsafe blocks and functions, unsafe traits and impls, raw pointers, FFI, inline assembly, intrinsics, layout or validity reasoning, concurrency and atomics, SIMD and target features, allocators, invariant-bearing fields, safety comments or `# Safety` documentation, soundness reviews, TCB audits, generated unsafe code, and changes to safety or behavioral contracts.

★ 2.6k
google
google/zerocopy

unsafe-rust

Author, document, review, audit, or redesign unsafe Rust with proof-grade rigor. Use for unsafe blocks and functions, unsafe traits and impls, raw pointers, FFI, inline assembly, intrinsics, layout or validity reasoning, concurrency and atomics, SIMD and target features, allocators, invariant-bearing fields, safety comments or `# Safety` documentation, soundness reviews, TCB audits, generated unsafe code, changes to safety or behavioral contracts, and proof-oriented redesign of unsafe abstractions.

★ 2.6k
google
google/zerocopy

unsafe-rust

Author, document, review, audit, or redesign unsafe Rust with proof-grade rigor. Use for unsafe blocks and functions, unsafe traits and impls, raw pointers, FFI, inline assembly, intrinsics, layout or validity reasoning, concurrency and atomics, SIMD and target features, allocators, invariant-bearing fields, safety comments or `# Safety` documentation, soundness reviews, TCB audits, generated unsafe code, changes to safety or behavioral contracts, and proof-oriented redesign of unsafe abstractions.

★ 2.6k