Skip to content
Back to skills

Bazel Build Optimization Wshobson

ASecurity

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

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
ai-agentsgodebugginggitperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add thedixitjain/the-mega-skill-library --skill bazel-build-optimization--wshobson --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bazel Build Optimization Wshobson?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bazel Build Optimization  Wshobson
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thedixitjain-bazel-build-optimization-wshobson/badge)](https://www.skillsdirectory.com/skills/thedixitjain-bazel-build-optimization-wshobson)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: bazel-build-optimization
description: "Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases."
category: engineering-core
source_repo: wshobson/agents
source_path: "plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md"
source_url: https://github.com/wshobson/agents/blob/HEAD/plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md
---


# 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

---

**Source:** [`wshobson/agents`](https://github.com/wshobson/agents) → `plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md`

Files in this skill

  • SKILL.md2.5 KB
  • references/details.md7.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.