Bazel build optimization

From FridrichMethod/awesome-skills · View interactive version

Bazel build optimization is an AI agent skill from the GitHub repository FridrichMethod/awesome-skills. Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.

How to use this skill

Skill file

Bazel Build Optimization

Production patterns for Bazel in large-scale monorepos.

When to Use This Skill

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

Don'ts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.