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

bazel-build-optimization

Makes your agent optimize the building of large code projects. It improves speed and efficiency when code is compiled.

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.

Example of what to ask your AI

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

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

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

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.
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.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add wshobson/agents --skill bazel-build-optimization

Or download just the file:

curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md -o SKILL.md
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
#4842
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills