bazel-build-optimization
大規模なモノリポのためのBazelビルドの最適化
大規模なBazelビルドは遅くなり、保守が困難になることがあります。このスキルは、エンタープライズ向けコードベース全体で速度と信頼性を向上させるための実証済みのテンプレートとワークフローを提供します。
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "bazel-build-optimization". Help me speed up Bazel builds in a large monorepo
Résultat attendu:
- Enable disk and repository caching in .bazelrc to reuse build artifacts across runs
- Add remote cache flags for CI environments and set remote_upload_local_results=true
- Use bazel analyze-profile on profile.json to identify action bottlenecks
Utilisation de "bazel-build-optimization". Set up remote execution for our Bazel builds
Résultat attendu:
- Configure .bazelrc with remote_cache and remote_executor endpoints for your execution service
- Define platform constraints in platforms/BUILD.bazel for worker selection
- Add toolchain definitions in toolchains/BUILD.bazel for language-specific toolchains
Utilisation de "bazel-build-optimization". Create BUILD files for a new Python library
Résultat attendu:
- Use py_library rule with glob for source files and requirement() for pip dependencies
- Add py_test rule with pytest dependency and appropriate size/timeout attributes
- Consider py_binary for entrypoint scripts with data dependencies for assets
Audit de sécurité
SûrThis is a pure documentation skill containing only instructional markdown content. No executable code, scripts, or functions exist. Static findings are false positives triggered by documentation patterns: 'sha256' in http_archive() calls are integrity checksums for dependency downloads (security best practice), backticks are Markdown code fences, and URL references are documentation links. No file system access, network calls, or command execution capabilities exist.
Facteurs de risque
🌐 Accès réseau (7)
⚙️ Commandes externes (20)
📁 Accès au système de fichiers (4)
Score de qualité
Ce que vous pouvez construire
モノリポビルドの標準化
チーム間で一貫したBazel構成テンプレートとキャッシュ戦略を採用し、より高速で再現可能なビルドを実現します。
リモート実行セットアップの設計
リモート実行クラスターへの接続のためのプラットフォーム定義とツールチェーン構成を起草します。
ビルド時間の短縮
キャッシュの改善とプロファイリング手順を特定し、大規模なコードベースでのパイプライン実行時間を削減します。
Essayez ces prompts
TypeScriptとPythonモノリポ用の最小限のWORKSPACE.bazelと.bazelrcを作成します。ルールのバージョンとチェックサムのプレースホルダーを含めます。
ローカルディスクキャッシュとリモートキャッシュの.bazelrc設定をお勧めします。リモートへのローカル結果のアップロードを有効にするタイミングを説明します。
TypeScriptライブラリとテストターゲットを含むPythonライブラリのBUILD.bazel例を起草します。
モノリポ内の遅いターゲットと高ファンアウトの依存関係を一意するために、Bazelクエリとプロファイリングコマンドをリストアップします。
Bonnes pratiques
- きめ細かなターゲットを使用して、コードベース全体でインクリメンタルビルドのキャッシュヒットを最大化します
- WORKSPACEでBazelルールとツールのバージョンをピン留めして、再現可能で決定論的なビルドを実現します
- bazel build --profileでビルドを定期的にプロファイリングし、遅いアクションに対処して問題を蓄積させないようにします
Éviter
- BUILDルールで広範なglobパターンをソースファイルに使用すると、キャッシュの効率が低下します
- WORKSPACEのセットアップをスキップしたり、ルールバージョンをピン留めしたりしないと、再現不可能なビルドになります
- ビルド警告と分析キャッシュの問題を無視すると、ビルド構成に技術的負債が発生します