bazel-build-optimization – Coding skill for AI agents
Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
Install the bazel-build-optimization skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /bazel-build-optimization – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $bazel-build-optimization – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /bazel-build-optimization – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /bazel-build-optimization – then describe the task you want done.
SKILL.md content
Bazel Build Optimization
Production patterns for Bazel in large-scale monorepos.
When to Use This Skill
- Setting up Bazel for monorepos
- Configuring remote caching/execution
- Optimizing build times
- Writing custom Bazel rules
- Debugging build issues
- Migrating to Bazel
Core Concepts
1. Bazel Architecture
workspace/
├── WORKSPACE.bazel # External dependencies
├── .bazelrc # Build configurations
├── .bazelversion # Bazel version
├── BUILD.bazel # Root build file
├── apps/
│ └── web/
│ └── BUILD.bazel
├── libs/
│ └── utils/
│ └── BUILD.bazel
└── tools/
└── bazel/
└── rules/2. Key Concepts
| Concept | Description |
| ----------- | -------------------------------------- |
| Target | Buildable unit (library, binary, test) |
| Package | Directory with BUILD file |
| Label | Target identifier //path/to:target |
| Rule | Defines how to build a target |
| Aspect | Cross-cutting build behavior |
Templates and detailed worked examples
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Best Practices
Do's
- Use fine-grained targets - Better caching
- Pin dependencies - Reproducible builds
- Enable remote caching - Share build artifacts
- Use visibility wisely - Enforce architecture
- Write BUILD files per directory - Standard convention
Don'ts
- Don't use glob for deps - Explicit is better
- **Don't commit bazel-\* dirs** - Add to .gitignore
- Don't skip WORKSPACE setup - Foundation of build
- Don't ignore build warnings - Technical debt
Related skills
- andreessen – Marc Andreessen-mode decision and productivity skill. A blunt, market-first operator…
- baoyu-electron-extract – Extracts resources and JavaScript from any installed Electron app (`.asar` bundle)…
- agy-delegate – Delegate coding tasks to the Google Antigravity CLI (`agy`) only when the user…
- agy-powerline – Install, check and restyle the agy-powerline statusline for Antigravity CLI (agy)…
- api-design-reviewer – Comprehensive REST API design review with automated linting, breaking-change detection…
- api-test-suite-builder – Use when the user asks to generate API tests, create integration test suites, test REST…
- ast-grep – AST-aware structural code search and rewrite via ast-grep.
- ai-code-generation-guardrails – Use when reviewing AI-generated code before merge or execution: plan AST/security…