Skip to content
Skillpedia
Deploy & cloud (DevOps)41k Β· #6675

bazel-build-optimization

What it does

This skill helps optimize how Bazel, a build tool, works on large projects. It teaches production patterns so your projects build faster and more reliably.

When to use it

  • βœ“When setting up Bazel for the first time on a large project.
  • βœ“When trying to make Bazel use remote computers to speed up builds.
  • βœ“When trying to figure out why builds are taking too long.

Skill link

https://github.com/wshobson/agents/blob/main/plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHow can I configure Bazel to make my builds faster on our large project?”

5 new skills a week. 1 minute to read.

How it works

It provides examples and best practices for organizing your project files and configuring Bazel. This helps Bazel better understand how to build your code, making the process more efficient.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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
FAQ

What is Bazel?

Bazel is a tool that helps build (turn code into an executable program) software projects, especially large and complex ones.

What is a 'monorepo'?

A monorepo is a single code repository that holds many different projects.

What does 'optimize builds' mean?

It means making the software building process faster and use fewer computer resources.

Details

Original description by the author

Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.

repo: wshobson/agents

Popularity

GitHub stars
41k
Ranking position
#6675
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills