BA

bazel-build-optimization

A specialized toolkit for configuring, optimizing, and debugging Bazel builds within large-scale monorepos.

Install

mkdir -p .claude/skills/bazel-build-optimization && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1968" && unzip -o skill.zip -d .claude/skills/bazel-build-optimization && rm skill.zip

Installs to .claude/skills/bazel-build-optimization

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
165 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Configure remote execution for distributed builds
  • Pin dependencies for reproducible environments
  • Define fine-grained build targets for caching
  • Write cross-platform build rules
  • Audit workspace dependency graphs

How it works

Analyzes the dependency graph across packages to perform incremental builds and distribute compilation across a remote cluster.

Inputs & outputs

You give it
Workspace configuration and source code
You get back
Optimized build graph and cached artifacts

When to use bazel-build-optimization

  • Optimize Bazel build times in a monorepo
  • Configure remote caching for CI/CD
  • Write custom Bazel rules
  • Migrate an existing project to Bazel

About this skill

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

ConceptDescription
TargetBuildable unit (library, binary, test)
PackageDirectory with BUILD file
LabelTarget identifier //path/to:target
RuleDefines how to build a target
AspectCross-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

When not to use it

  • Managing small single-file projects
  • Fast-prototyping without long-term build requirements

Prerequisites

Bazel installedMonorepo structureRemote build cluster

Limitations

  • High initial configuration complexity
  • Requires discipline to maintain clean build files

How it compares

It forces architectural discipline through strict dependency tracking rather than relying on global system state.

Compared to similar skills

bazel-build-optimization side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
bazel-build-optimization (this skill)142moNo flagsAdvanced
senior-devops77moReviewAdvanced
deployment-engineer44moNo flagsAdvanced
devops-engineer13moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by wshobson

View all by wshobson

You might also like

senior-devops

davila7

Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.

720

deployment-engineer

sickn33

Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.

418

devops-engineer

Jeffallan

Use when setting up CI/CD pipelines, containerizing applications, or managing infrastructure as code. Invoke for pipelines, Docker, Kubernetes, cloud platforms, GitOps.

12

terraform-specialist

sickn33

Expert Terraform/OpenTofu specialist mastering advanced IaC automation, state management, and enterprise infrastructure patterns. Handles complex module design, multi-cloud deployments, GitOps workflows, policy as code, and CI/CD integration. Covers migration strategies, security best practices, and modern IaC ecosystems. Use PROACTIVELY for advanced IaC, state management, or infrastructure automation.

12

devops-engineer

I-Synergy

DevOps and CI/CD specialist. Use for building pipelines, containerization, infrastructure as code, or deployment automation. User-invocable only for production deployments.

00

DevOps / CI-CD Engineer

dr-pabs

Automate build, validation, deployment, and release operations for the project.

00

Search skills

Search the agent skills registry