Index of every page on this site: llms.txt
All skills
wshobson avatar

/bazel-build-optimization

@4220308
by Seth Hobsonwshobson/agents43k stars
4,518
Run it yourself

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

Use this Skill: https://skilld.dev/gh/wshobson/agents/bazel-build-optimization

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈48 tokens for metadata: the name and description. ≈468 when used: this file. ≈1.9k more on demand in 1 file.

Description uses 2.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈192 characters, or 2.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides templates and best practices for optimizing Bazel build systems, including remote caching, custom rules, and multi-language support. No malicious patterns were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    1 file scanned · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4220308. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 6 months ago
  • bazel
  • monorepo
  • build-optimization
  • remote-caching
  • remote-execution
  • bazel-rules
  • build-performance
  • enterprise

README badge

README badge for wshobson/agents/bazel-build-optimization

Configures Bazel for large-scale monorepos with patterns for remote caching, custom rules, and build optimization. Covers workspace setup, dependency pinning, fine-grained targets, and debugging strategies for enterprise codebases.

Generated from the current SKILL.md.

Does this skill cover remote caching and execution setup?
Yes. The skill includes patterns for configuring remote caching and execution, which are core to optimizing build times in large monorepos.
What size codebase is this skill designed for?
Large-scale monorepos. The skill assumes enterprise-level codebases where build performance and reproducibility are critical concerns.
Does this skill include custom rule examples?
Yes. Writing custom Bazel rules is listed as a core use case, with detailed templates and worked examples referenced in the skill documentation.
Can I use this skill to migrate an existing project to Bazel?
Yes. Migration to Bazel is explicitly listed as a use case the skill addresses.

Generated from the current SKILL.md. These answers refresh after source changes.