Agent skill

Bazel Build Optimization

by wshobson in wshobson/agents

Production patterns for Bazel in large monorepos: workspace layout, targets and labels, remote caching and execution, custom rules and build-time tuning.

MITAuto-check passedDevelopment

Install Bazel Build Optimization

skills CLI
$ npx skills add wshobson/agents --skill bazel-build-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wshobson/agents bazel-build-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-essentials/skills/bazel-build-optimization .claude/skills/bazel-build-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bazel-build-optimization
GitHub stars
40k
Used in
9 other repos
Token cost
~502 tokens
SKILL.md length
155 words
Files
2 (incl. references)
Skills in repo
142
Repo updated
First seen
Licence
MIT

At a glance

Production patterns for Bazel in large monorepos: workspace layout, targets and labels, remote caching and execution, custom rules and build-time tuning.

  • Works in 2 steps: Bazel Architecture → Key Concepts
  • Setting up Bazel for a large monorepo
  • SKILL.md covers When to Use This Skill, Core Concepts, Templates and detailed worked… and Best Practices
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill gives an overview of Bazel for big monorepos: the workspace layout with `WORKSPACE.bazel` and `.bazelrc`, and the core concepts of targets, packages, labels, rules and aspects. It is aimed at setting up Bazel, configuring remote caching and execution, cutting build times, writing custom rules, debugging build problems and migrating to Bazel.

The best-practice list favors fine-grained targets for better caching, pinned dependencies for reproducible builds, remote caching, deliberate visibility to enforce architecture and one BUILD file per directory. It warns against globbing for dependencies, committing the `bazel-*` output directories, skipping workspace setup and ignoring warnings. Templates and worked examples are in `references/details.md`.

When your agent uses it

  • Setting up Bazel for a large monorepo
  • Configuring remote caching or remote execution
  • Cutting build times in a Bazel-based codebase
  • Writing custom Bazel rules or debugging build failures
  • Planning a migration to Bazel

Example prompts

  • “Set up remote caching for our Bazel monorepo and explain what to add to .bazelrc.”
  • “Split this coarse BUILD target into fine-grained targets so caching works better.”
  • “Why is our Bazel build slow, and which changes would cut the build time most?”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Bazel Architecture
  2. Key Concepts

What it can do on your machine

Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bazel Build Optimization loads about 502 tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 48 tokens; SKILL.md has 155 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~502
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 155 words, ~502 tokens.

Download SKILL.mdSave it as .claude/skills/bazel-build-optimization/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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.

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

© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/developer-essentials/skills/bazel-build-optimization of wshobson/agents.

  • SKILL.md
  • references/details.md

Open the folder on GitHubat commit 46891e7

Used in 9 other repositories

We found 19 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 9 other GitHub owners. This page covers the copy in wshobson/agents, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bazel Build Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bazel Build Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bazel Build Optimization this skillwshobson/agents40k9 repos~502Automated safety check: PassMIT
Typescript Expertcin12211/orca-q22412 repos~3.7kAutomated safety check: PassMIT
Ckeditor5 ReviewingTriliumNext/Trilium38k—~2.5kAutomated safety check: PassAGPL-3.0
Mecatl Perf MCP Interpretationstacklok/mecatl241—~2.3kAutomated safety check: PassApache-2.0
Pycrazyguitar/pysheeet8.2k—~886Automated safety check: PassMIT
Linea Dependency MaintenanceConsensys-Incorporated/linea-attestation-registry1771 repos~3.7kAutomated safety check: WarnMIT

Similar skills

  • Typescript Expert

    cin12211/orca-q

    TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.

    224 GitHub starsUsed in 12 repos~3.7k tokens
    DevelopmentAuto-check passed
  • Ckeditor5 Reviewing

    TriliumNext/Trilium

    Review or audit CKEditor 5 plugin code in the Trilium (TriliumNext Notes) monorepo, or a PR/diff touching packages/ckeditor5 (including its in-tree plugins under src/plugins/).

    38k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Guides reading mecatl's perf MCP data to find why a running harness is slow, leaking goroutines or growing in memory, using cheap reads before any CPU capture.

    241 GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Py

    crazyguitar/pysheeet

    Comprehensive Python programming reference covering syntax, concurrency, networking, databases, ML/LLM development, and HPC.

    8.2k GitHub stars~886 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Linea Dependency Maintenance

    Consensys-Incorporated/linea-attestation-registry

    Safely plan and execute dependency maintenance for JavaScript/TypeScript (npm, pnpm) and GitHub Actions, including npm lockfiles, pnpm workspaces, catalogs, overrides, SHA-pinned action versions…

    177 GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: warnings
  • Dotnet Debugging

    novotnyllc/dotnet-artisan

    Debugs Windows and Linux/macOS applications (native, .NET/CLR, mixed-mode) with WinDbg MCP (crash dumps, !analyze, !syncblk, !dlk, !runaway, !dumpheap, !gcroot, BSOD), dotnet-dump, lldb with SOS…

    233 GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed

More from wshobson/agents

All 142 skills in this repo
  • Billing Automation

    wshobson/agents

    Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.

    40k GitHub starsUsed in 14 repos~473 tokens
    Auto-check passed
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 14 repos~1.7k tokens
    Auto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 13 repos~814 tokens
    Auto-check passed
  • Portfolio Risk Metrics

    wshobson/agents

    Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.

    40k GitHub starsUsed in 13 repos~502 tokens
    Auto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 12 repos~1.3k tokens
    Auto-check passed
  • Plans memory headroom, works through out-of-memory failures and watches temperature and power during long ML training jobs on NVIDIA DGX Spark.

    40k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Questions about Bazel Build Optimization

What does Bazel Build Optimization do?

Production patterns for Bazel in large monorepos: workspace layout, targets and labels, remote caching and execution, custom rules and build-time tuning. bazelrc`, and the core concepts of targets, packages, labels, rules and aspects. It is aimed at setting up Bazel, configuring remote caching and execution, cutting build times, writing custom rules, debugging build problems and migrating to Bazel.

When should I use Bazel Build Optimization?

Bazel Build Optimization fits situations like: setting up Bazel for a large monorepo; configuring remote caching or remote execution; cutting build times in a Bazel-based codebase; writing custom Bazel rules or debugging build failures.

How do I install Bazel Build Optimization in Claude Code?

Run `npx skills add wshobson/agents --skill bazel-build-optimization -a claude-code`. Or copy the skill folder (plugins/developer-essentials/skills/bazel-build-optimization in wshobson/agents) into .claude/skills/bazel-build-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Bazel Build Optimization in Codex?

Run `npx skills add wshobson/agents --skill bazel-build-optimization -a codex`. Or copy the skill folder (plugins/developer-essentials/skills/bazel-build-optimization in wshobson/agents) into .agents/skills/bazel-build-optimization in your project. Codex loads it when a task matches its description.

Can I use Bazel Build Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill bazel-build-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bazel-build-optimization, .gemini/skills/bazel-build-optimization, .github/skills/bazel-build-optimization and .opencode/skills/bazel-build-optimization in your project.

What does Bazel Build Optimization need to run?

SKILL.md names no scripts, command-line tools or credentials: Bazel Build Optimization is instructions for the agent only.

Does Bazel Build Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bazel Build Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bazel Build Optimization use?

Bazel Build Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bazel Build Optimization use?

About 502 tokens (SKILL.md is roughly 2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Bazel Build Optimization?

Skills that share tags, products or a category with Bazel Build Optimization: Typescript Expert (cin12211/orca-q, 224 stars), Ckeditor5 Reviewing (TriliumNext/Trilium, 38k stars), Mecatl Perf MCP Interpretation (stacklok/mecatl, 241 stars) and Py (crazyguitar/pysheeet, 8.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bazel Build Optimization?

wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,287 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.

Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.