docs(skills): add build style skill
This commit is contained in:
1
.pi/skills/build-style
Symbolic link
1
.pi/skills/build-style
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../src/skills/style/build
|
||||||
9
src/skills/style/build/SKILL.md
Normal file
9
src/skills/style/build/SKILL.md
Normal 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`.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Build rules
|
# Rust build rules
|
||||||
|
|
||||||
## Use workspace dependency versions
|
## 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`.
|
The repository has one Cargo workspace and one `Cargo.lock`.
|
||||||
Centralized dependency versions keep package manifests consistent with the workspace lockfile.
|
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
|
## Declare Rust tests in Bazel
|
||||||
|
|
||||||
### Rule
|
### Rule
|
||||||
Reference in New Issue
Block a user