rust-change
Implement or review a change to the core or the bindings crate with the layering, tests and documentation evidence the invariants require.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- rust-change
- description
- Implement or review a change to the core or the bindings crate with the layering, tests and documentation evidence the invariants require.
03 SKILL.md 正文
Change a crate
- Read
AGENTS.mdanddocs/explanation/architecture.md. Identify the crate:crates/alliumpy-coreholds conversions and constants without an interpreter;crates/alliumpyis the thin bindings crate. Cargo enforces the directionalliumpy→alliumpy-core→allium-parser, never the reverse; pyo3 appears only incrates/alliumpy. A public core item exposed to Python is part of that API's shape. - Find upstream's behaviour at the pin. For a conversion, read how
allium-clicomputes the same value and assert it in a test. Ticket-scoped scaffolding without parser or command behaviour may cite the ticket instead; behaviour still follows invariant 1. - Keep the lint boundary: the core inherits the workspace table; the bindings crate
has its own
[lints]table, includingunsafe_code = "forbid". A lint pyo3's macro output trips may be allowed there with a comment naming the macro, never in the workspace table. Keep pedantic enabled and unsafe code forbidden in both crates. - Derive the test from upstream's result before implementing, and confirm it fails
first. Unit tests live in the core module they test under
#[cfg(test)]; public items carry doctests that assert. The bindings crate has no Rust tests. An item the binding exposes needs a pytest case undercrates/alliumpy/tests/, with the stub and Rust binding changed together. Usepython-changefor that evidence. - Public core types are
Send + Sync + 'static,CloneandDebug; public enums and structs are#[non_exhaustive]. Errors have stableDisplaytext: it becomes the Python exception's message (invariant 3). - Silence an item lint only with
#[expect(lint, reason = "...")]on the item it names; the macro-output exception belongs in the bindings table as step 3 describes. - Run
just fmt-check,just clippy,just test,just coverageand, for public documentation,just doc, thenjust checkbefore handoff. These test and coverage recipes exclude the bindings crate. Snapshot checks validate locks first and run offline because cargo-insta cannot forward--locked; cargo shear has no such flag either (the invariant 7 wording gap is recorded in T05). - Report by
file:line: what changed, which upstream behaviour it reproduces, and which test proves it.
04 同仓库更多 Skills
rust-change
Implement or review a change to the core or the bindings crate with the layering, tests and documentation evidence the invariants require.
review-docs
Add or revise a handbook page so it satisfies the documentation contract and stays reachable.
review-change
Review a change in this repository against its invariants, specifications, tests, and documentation contract.
python-change
Implement or review a change to the Python package, its stub, its tests or the console script with the stubtest, pytest and wheel-smoke evidence the invariants require.
project-check
Bring a workspace to a state where the full gate runs, and interpret what it reports.
plan-change
Plan a change when the scope, affected specifications, risks, or validation need evidence before any code is written.