docs(skills): add build style skill

This commit is contained in:
2026-09-17 12:33:12 -04:00
parent 498d0dd467
commit e571966884
3 changed files with 26 additions and 1 deletions

1
.pi/skills/build-style Symbolic link
View File

@@ -0,0 +1 @@
../../src/skills/style/build

View File

@@ -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`.

View File

@@ -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