Bazel Build Optimization skill for Claude

Optimize Bazel builds for large-scale monorepos.

When Claude uses it

Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.

Bazel Build Optimization SKILL.md

The full skill file from wshobson/agents (MIT).

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

How to install Bazel Build Optimization

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit wshobson/agents/plugins/developer-essentials/skills/bazel-build-optimization#main ~/.claude/skills/bazel-build-optimization

Codex

npx degit wshobson/agents/plugins/developer-essentials/skills/bazel-build-optimization#main ~/.codex/skills/bazel-build-optimization

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Bazel Build Optimization skill do?

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

+How do I install Bazel Build Optimization in Claude Code?

Copy the skill folder into ~/.claude/skills/bazel-build-optimization, for example with "npx degit wshobson/agents/plugins/developer-essentials/skills/bazel-build-optimization#main ~/.claude/skills/bazel-build-optimization". Claude Code loads it automatically and uses it when a task matches.

+Does Bazel Build Optimization work with ChatGPT or Codex?

Yes. Bazel Build Optimization uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/bazel-build-optimization. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Bazel Build Optimization free?

Bazel Build Optimization is published on GitHub by wshobson under the MIT license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Binary Analysis Patterns

    Master binary analysis patterns including disassembly, decompilation, control flow analysis, and code pattern recognition.

    wshobson/agents★ 43k
  5. Block No Verify Hook

    Configure a PreToolUse hook to prevent AI agents from skipping git pre-commit hooks with --no-verify and other bypass flags.

    wshobson/agents★ 43k
  6. Changelog Automation

    Automate changelog generation from commits, PRs, and releases following Keep a Changelog format.

    wshobson/agents★ 43k
  7. Connectivity Triage

    Use this skill when debugging active macOS connectivity failures, when an API or MCP service times out or disconnects, when DNS resolution…

    wshobson/agents★ 43k
  8. Context Driven Development

    Creates and maintains project context artifacts (product.md, tech-stack.md, workflow.md, tracks.md) in a `conductor/` directory.

    wshobson/agents★ 43k
  9. Cqrs Implementation

    Implement Command Query Responsibility Segregation for scalable architectures.

    wshobson/agents★ 43k

See all software development skills →

More skills from wshobson

  1. Before You Build

    Pre-build product and feature risk review for founders, product managers, and AI-assisted builders.

    wshobson/agents★ 43k
  2. Billing Automation

    Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management.

    wshobson/agents★ 43k

All skills by wshobson →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.