diff --git a/.pi/skills/build-style b/.pi/skills/build-style new file mode 120000 index 0000000..d358654 --- /dev/null +++ b/.pi/skills/build-style @@ -0,0 +1 @@ +../../src/skills/style/build \ No newline at end of file diff --git a/src/skills/style/build/SKILL.md b/src/skills/style/build/SKILL.md new file mode 100644 index 0000000..05eee90 --- /dev/null +++ b/src/skills/style/build/SKILL.md @@ -0,0 +1,9 @@ +--- +name: build-style +description: Use when creating, editing, or reviewing build files, package manifests, build targets, or dependency metadata in this repository. +--- + +# build-style + +Use this skill as the source of truth for repository build conventions. +Follow the shared style skill instructions in `src/skills/style/STYLE.md`. diff --git a/src/skills/style/rust/rules/build.md b/src/skills/style/build/rules/rust.md similarity index 69% rename from src/skills/style/rust/rules/build.md rename to src/skills/style/build/rules/rust.md index 4ccf566..f66d2cb 100644 --- a/src/skills/style/rust/rules/build.md +++ b/src/skills/style/build/rules/rust.md @@ -1,4 +1,4 @@ -# Build rules +# Rust build rules ## Use workspace dependency versions @@ -14,6 +14,21 @@ Add package-local dependency features only when the feature set is specific to t The repository has one Cargo workspace and one `Cargo.lock`. Centralized dependency versions keep package manifests consistent with the workspace lockfile. +## Declare Rust dependencies in each build system + +### Rule + +Declare each direct crate dependency in each build system that builds the Rust target. +For Cargo, declare the crate in the package `Cargo.toml` file. +Use `workspace = true` for workspace-managed dependencies. +For Bazel, add the crate label to the `deps` of the target that uses it. +Apply this rule to `rust_library`, `rust_binary`, and `rust_test` targets. + +### Rationale + +Cargo and Bazel resolve Rust dependencies independently. +Complete declarations keep `cargo check`, Rust Analyzer, and Bazel builds consistent. + ## Declare Rust tests in Bazel ### Rule