docs(skills): add build style skill

This commit was merged in pull request #67.
This commit is contained in:
alexion committed 2026-09-17 12:45:29 -04:00
1 parent 498d0dd467
commit 87916a8e17
6 files changed
+68 -42

No files matched your search

@@ -0,0 +1,30 @@
# Dependency rules
## Use workspace dependency versions
### Rule
Declare Rust dependency versions in the repository root `Cargo.toml` under `[workspace.dependencies]`.
Reference workspace dependencies from package `Cargo.toml` files with `workspace = true`.
Do not declare dependency versions in package `Cargo.toml` files unless the operator explicitly requests a package-local version.
Add package-local dependency features only when the feature set is specific to that package.
### Rationale
The repository has one Cargo workspace and one `Cargo.lock`.
Centralized 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, Rust Analyzer, and Bazel builds consistent.