bazel-build-optimization

bazel-build-optimization is a skill for Claude Code, Codex from wshobson/agents. It costs 36 tokens per session (480 once invoked), scanned A, original, MIT.

A guide to improving Bazel, a build system, for large monorepos. A monorepo keeps multiple applications and libraries in one repository.

In plain words
What is it for?
Use it to set up or migrate to Bazel, configure build caching and remote execution, write build rules, and troubleshoot large repository builds.
Why use it?
It helps reduce slow builds and CI runs while keeping dependencies, build rules, and shared code manageable across many projects.

Skill for Claude CodeCodex

Part of the developer-essentials plugin — 11 skills, 1 agent shipped together

About the project

Agentic Plugin Marketplace is a collection of reusable plugins, agents, skills, commands, and rules for coding-agent tools including Claude Code, Codex CLI, Cursor, OpenCode, Antigravity CLI, and GitHub Copilot. It is for developers assembling agentic workflows across multiple harnesses from shared Markdown sources, and the catalogue entries are examples or subsets of those workflow components.

wshobson/agents · 39,424 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wshobson/agents/bazel-build-optimization
Any agent
npx skills add wshobson/agents --skill bazel-build-optimization
Clone the repo
git clone --depth 1 https://github.com/wshobson/agents

Made for: Claude Code, Codex.

Or install developer-essentials, the plugin that ships this one along with the rest of its 11 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bazel-build-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/wshobson/agents/bazel-build-optimization.svg)](https://agentmods.dev/skills/wshobson/agents/bazel-build-optimization)
Your own site
<a href="https://agentmods.dev/skills/wshobson/agents/bazel-build-optimization"><img src="https://agentmods.dev/badge/skills/wshobson/agents/bazel-build-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 480 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.00480
Opus 5 $0.00018 $0.00240
Sonnet 5 $0.00007 $0.00096
Haiku 4.5 $0.00004 $0.00048

Measured yesterday against content hash 7d9b2a350ed7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bazel-build-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/developer-essentials/skills/bazel-build-optimization/SKILL.md · 70 lines

What it actually says

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
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 70 lines · 36 tokens per session scan A 7d9b2a350ed7

Subscribe to this mod's changes

bazel-build-optimization is a skill published in the GitHub repository wshobson/agents (39,424 stars, last pushed 3d ago), licensed MIT. It adds 36 tokens to every session and 480 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

pre-push

Runs the local equivalent of the CI merge gate before you push. Detects which areas (Python, TypeScript, docs) your changes touch, auto-fixes what it can, then runs only those checks. Use when the user asks to run pre-push checks, get push-ready, verify changes before pushing or opening a PR, "make sure CI will pass"…

strands-agents/harness-sdk · 85 tokens

babysit

Same-session monitoring loop for PRs, CI runs, tickets, and deployments using the monitorstart / monitorupdate / autonudgestop MCP tools. The loop re-injects your check instructions into THIS session on an idle interval — same context, same tools — and works from dashboard chat, Slack threads, and Discord DMs. Use…

kirodotdev/KiroCrew · 137 tokens

deploying-to-staging-environment

Use when deploying changes to staging across relay, relay-dashboard, and relay-cloud repos - coordinates multi-repo branch syncing using git worktrees, automatically triggers staging deployments via GitHub Actions.

AgentWorkforce/relay · 44 tokens

maas-nightly-qe-impact

Assess whether a Models-as-a-Service autofix change requires follow-up in opendatahub-tests or ods-ci nightly QE pipelines. Runs as a Jira autofix postreview extension for the Model as a Service component. Appends a Nightly QE Impact section to the PR description and writes informational findings. Use when autofix…

opendatahub-io/ai-helpers · 81 tokens

github-actions-debugger

Debug and monitor GitHub Actions workflow runs. Check run status, view failed job logs, and troubleshoot CI failures. Use this when the user needs to investigate GitHub Actions failures, inspect job output, or identify the root cause of a broken workflow run.

opendatahub-io/ai-helpers · 56 tokens

gitlab-pipeline-debugger

Debug and monitor GitLab CI/CD pipelines for merge requests. Check pipeline status, view job logs, and troubleshoot CI failures. Use this when the user needs to investigate GitLab CI pipeline issues, check job statuses, or view specific job logs.

opendatahub-io/ai-helpers · 56 tokens