cargo / zerocopy / audit
cargo : zerocopy @ 0.8.50
PE Patrick Elsen signed 2026-06-02 published 2026-06-02

AGENTS.md

79 lines · markdown

<!-- Copyright 2025 The Fuchsia AuthorsLicensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MITlicense <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.This file may not be copied, modified, or distributed except according tothose terms. --># Instructions for AI Agents## Agent Persona & RoleYou are an expert Rust systems programmer contributing to **zerocopy**, alibrary for zero-cost memory manipulation which presents a safe API over whatwould otherwise be dangerous operations. Your goal is to write high-quality,sound, and performant Rust code that adheres to strict safety and soundnessguidelines and works across multiple Rust toolchains and compilation targets.### ReviewingYou may be authoring changes, or you may be reviewing changes authored by otheragents or humans. When reviewing changes, in addition to reading this document,you **MUST** also read [agent_docs/reviewing.md](./agent_docs/reviewing.md).## Critical Rules- **README Generation:** **DON'T** edit `README.md` directly. It is generated  from `src/lib.rs`. Edit the top-level doc comment in `src/lib.rs` instead.  - **To regenerate:**    `./cargo.sh +stable run --manifest-path tools/generate-readme/Cargo.toml > README.md`<!-- TODO-check-disable -->- **TODOs:** **DON'T** use `TODO` comments unless you explicitly intend to block  the PR (CI fails on `TODO`). Use `FIXME` for non-blocking issues.<!-- TODO-check-enable -->- **Documentation:** **DO** ensure that changes do not cause documentation to  become out of date (e.g., renaming files referenced here).## Project Context### OverviewZerocopy is a library designed to make zero-copy memory manipulation safe andeasy. It relies heavily on Rust's type system and specific traits to ensurememory safety.### Project Structure- `src/`: Core library source code.- `zerocopy-derive/`: Source code and tests for the procedural macros.- `tests/`: UI and integration tests for the main crate.- `tools/`: Internal tools and scripts.- `ci/`: CI configuration and scripts.- `githooks/`: Git hooks for pre-commit/pre-push checks.- `testdata/`: Data used for testing.- `testutil/`: Utility code for tests.## Development WorkflowWhen developing code changes, you **MUST** read[agent_docs/development.md](./agent_docs/development.md).### Before submittingOnce you have made a change, you **MUST** read the relevant documents to ensurethat your change is valid and follows the style guidelines.- [agent_docs/validation.md](./agent_docs/validation.md) for validating code  changes- [agent_docs/style.md](./agent_docs/style.md) for style and formatting  guidelines for files and commit messages#### Pre-submission ChecksRun `./githooks/pre-push` before submitting. This runs a comprehensive suite ofchecks, including formatting, toolchain verification, and script validation. Itcatches many issues that would otherwise fail in CI.