bazel-build-optimization – skill Lập trình cho agent AI
Tối ưu build Bazel cho monorepo quy mô lớn. Dùng khi cấu hình Bazel, triển khai remote execution, hoặc tối ưu hiệu năng build cho codebase doanh nghiệp.
Cài skill bazel-build-optimization bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /bazel-build-optimization – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $bazel-build-optimization – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /bazel-build-optimization – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/bazel-build-optimization-c07e0.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /bazel-build-optimization – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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
Skill liên quan
- andreessen – Kỹ năng ra quyết định và năng suất theo phong cách Marc Andreessen. Một operator thẳng…
- baoyu-electron-extract – Trích xuất tài nguyên và JavaScript từ bất kỳ ứng dụng Electron đã cài nào (bundle…
- agy-delegate – Ủy thác tác vụ lập trình cho Google Antigravity CLI (`agy`) chỉ khi người dùng yêu cầu…
- agy-powerline – Cài đặt, kiểm tra và đổi giao diện statusline agy-powerline cho Antigravity CLI (agy)…
- api-design-reviewer – Rà soát thiết kế REST API toàn diện với lint tự động, phát hiện breaking change và…
- api-test-suite-builder – Dùng khi người dùng yêu cầu tạo API test, xây dựng bộ integration test, kiểm thử REST…
- ast-grep – Tìm kiếm và viết lại code có nhận biết AST qua ast-grep.
- ai-code-generation-guardrails – Dùng khi review code do AI tạo trước khi merge hoặc thực thi: lên kế hoạch kiểm tra AST…