Bazel Build Optimization
Unverified●30/40Claude Code◐PartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
Cursor◐PartialPlain prose you can paste in — but no Cursor rules file
Codex◐PartialPlain prose you can paste in — but no AGENTS.md
Gemini CLI◐PartialPlain prose you can paste in
Copilot◐PartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add bazel-build-optimizationWho is stuck, and on what
Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
The whole source
Frontmatter — 2 properties
| name | bazel-build-optimization |
|---|---|
| description | Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases. |
| 1 | --- |
| 2 | name: bazel-build-optimization |
| 3 | description: Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases. |
| 4 | ---A5 — No allowed-tools declared — no way to tell what this skill may touch |
| 5 | |
| 6 | # Bazel Build Optimization |
| 7 | |
| 8 | Production patterns for Bazel in large-scale monorepos. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | - Setting up Bazel for monorepos |
| 13 | - Configuring remote caching/execution |
| 14 | - Optimizing build times |
| 15 | - Writing custom Bazel rules |
| 16 | - Debugging build issues |
| 17 | - Migrating to Bazel |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### 1. Bazel Architecture |
| 22 | |
| 23 | ``` |
| 24 | workspace/ |
| 25 | ├── WORKSPACE.bazel # External dependencies |
| 26 | ├── .bazelrc # Build configurations |
| 27 | ├── .bazelversion # Bazel version |
| 28 | ├── BUILD.bazel # Root build file |
| 29 | ├── apps/ |
| 30 | │ └── web/ |
| 31 | │ └── BUILD.bazel |
| 32 | ├── libs/ |
| 33 | │ └── utils/ |
| 34 | │ └── BUILD.bazel |
| 35 | └── tools/ |
| 36 | └── bazel/ |
| 37 | └── rules/ |
| 38 | ``` |
| 39 | |
| 40 | ### 2. Key Concepts |
| 41 | |
| 42 | | Concept | Description | |
| 43 | | ----------- | -------------------------------------- | |
| 44 | | **Target** | Buildable unit (library, binary, test) | |
| 45 | | **Package** | Directory with BUILD file | |
| 46 | | **Label** | Target identifier `//path/to:target` | |
| 47 | | **Rule** | Defines how to build a target | |
| 48 | | **Aspect** | Cross-cutting build behavior | |
| 49 | |
| 50 | ## Templates and detailed worked examples |
| 51 | |
| 52 | Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates. |
| 53 | |
| 54 | ## Best Practices |
| 55 | |
| 56 | ### Do's |
| 57 | |
| 58 | - **Use fine-grained targets** - Better caching |
| 59 | - **Pin dependencies** - Reproducible builds |
| 60 | - **Enable remote caching** - Share build artifacts |
| 61 | - **Use visibility wisely** - Enforce architecture |
| 62 | - **Write BUILD files per directory** - Standard convention |
| 63 | |
| 64 | ### Don'ts |
| 65 | |
| 66 | - **Don't use glob for deps** - Explicit is better |
| 67 | - **Don't commit bazel-\* dirs** - Add to .gitignore |
| 68 | - **Don't skip WORKSPACE setup** - Foundation of build |
| 69 | - **Don't ignore build warnings** - Technical debt |
| 70 |
Reviews
Installed this one?Write the first review and take the Trailblazer badge.
Alternatives
Subagent Driven DevelopmentUse when executing implementation plans with independent tasks in the current session◐◐◐◐◐●36/40Python Code Style & DocumentationPython code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.◐····●35/40Competitor Price Analysis 💲Competitor pricing strategy analysis and market positioning. Price mapping, pricing gaps identification, elasticity signals evaluation, and strategic pricing optimization. Use when the user asks about competitor pricing, price analysis, pricing strategy, or co◐····●34/40Competitor Price Tracker 📊Set up competitor price tracking and monitoring workflows. Track price changes, detect promotions, analyze pricing patterns, and get alerts for competitive price movements.◐····●34/40