Command Palette

Search for a command to run...

Назад к скиллам
скилл № 99098

bazel-diagnose

Symptom-routed diagnosis procedure for a Bazel build that is already wrong, covering slow builds and slow analysis, unexpected cache misses, cache or BES…

БесплатноБез исполняемых скриптов
ocx-shот ocx-sh★ 20 звёзд на GitHub

Установить bazel-diagnose в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

bazel-diagnose

A Bazel build is already wrong: too slow, missing the cache, rebuilding for no reason, failing on one machine, or green when it should be red. This skill routes the symptom to the one measurement that names the cause.

Every command below was checked against Bazel 8.7.0 and 9.2.0 on Linux; where the two differ, the step says which, and where a result could differ off a Linux host (macOS, Windows, a container without user namespaces) it says so rather than generalising. This skill carries the procedure only: it never restates a standard, it cites the bazel-quality rule by ID.

Contents: Stop condition · Never edit the check · Step 0: ground truth · Route by symptom · A. Slow build or slow analysis · B. Unexpected cache miss · C. Cache or BES outage · D. Nondeterministic or non-hermetic action · E. Flaky test · F. Repository-rule or module-extension refetch · G. Target-selection miss · H. A flag that "does not exist" · The receipt · What agents get wrong · References

Stop condition

Stop when all four hold. Not before, and do not keep measuring after.

  1. The root cause is named as a mechanism, not a category. "The action key changed because the .bazelrc passes --action_env=WS=$PWD and this action reads WS" is a cause. "Cache instability" is a category.
  2. The measurement that proved it is pasted into the report — the command and its real output, verbatim. Narrating a measurement is not making one.
  3. Either the fix was watched to make the symptom go away (re-run the same measurement after the change and paste both readings), or the cause is a named documented gap with the version and the surface that would settle it.
  4. Nothing outside the cause was changed to reach step 3.

A diagnosis that ends at "probably X" is not finished; it is a hypothesis that needs one more measurement or an explicit gap.

Never edit the check

Making the symptom disappear by weakening the thing that detected it is the failure this skill exists to prevent. Each of these is a violation, not a fix:

Edit Why it is a violation Rule
Adding --noincompatible_strict_action_env to stop "environment flakiness" On 8.x it looks like a no-op and silently pins permissive behaviour across a 9.x bump; on 9.x it reintroduces the cache-key-invisible class BZL-CACHE-19
Tagging an action no-cache / local so the miss stops being visible The action now re-executes every build forever; the key instability is untouched BZL-CACHE-15, BZL-TEST-08
Adding --sandbox_debug to a committed rc file An unbounded disk leak by design; it is a one-shot investigation flag BZL-HERM-03
Dropping to --spawn_strategy=local or no-sandbox to make a sandbox failure go away local has no namespace to revoke, so every isolation guarantee the build had is gone BZL-HERM-26
Tagging a failing diff_test / write_source_files target manual Deletes the regeneration guard instead of regenerating the file BZL-HERM-21
Setting flaky = True or --flaky_test_attempts on a red test Both retry paths stop at the first success — they manufacture a green, they do not measure BZL-TEST-05, BZL-TEST-06
Widening a glob() until the missing file reappears The pattern was never the mechanism; a BUILD file appearing beneath it was BZL-HERM-19, BZL-ARCH-02
Inventing a knob (salt=, --remote_symlink_absolute_path_strategy) Neither exists in any client control surface BZL-CACHE-22, BZL-CACHE-31

If the only available fix is one of these, it is a documented gap under stop condition 3 — recorded with its reason, never applied silently.

Step 0: ground truth

Run these three before the first hypothesis. They cost seconds and they are what keeps the rest of the procedure from being fiction.

  1. Name the version. bazel --version, and read .bazelversion and any USE_BAZEL_VERSION in CI. A matrix spanning 8.x and 9.x is two diagnoses, not one: --incompatible_strict_action_env flips its default at 9.0.0 (BZL-FLAG-21 owns the per-version default, BZL-HERM-01 the rc pin), so an action-key measurement on one leg says nothing about the other; measure once per major (BZL-CI-28).
  2. Read the flag surface you are about to cite, on that binary: bazel help <command> --long and bazel help startup_options. A flag can live in only one. bazel help all --long is not a command — it prints ERROR: 'all' is not a known command, and reading that error as "the flag is absent" inverts the answ
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/cache-miss.md
  • references/fetch-and-selection.md
  • references/flaky-test.md
  • references/nondeterminism.md
  • references/outage-and-eviction.md
  • references/slow-build.md

FAQ

Что делает скилл bazel-diagnose?

Symptom-routed diagnosis procedure for a Bazel build that is already wrong, covering slow builds and slow analysis, unexpected cache misses, cache or BES outages, non-hermetic and nondeterministic actions, flaky tests, repository-rule and module-extension refetches, target-selection misses, and flags that appear not to exist. Use when someone says the build got slow, analysis takes forever, CI never hits the cache, this rebuilt for no reason, why did this action re-run, the remote cache is down, exit code 39, lost inputs, this test passes locally and fails in CI, the sandbox is not hermetic, Bazel keeps refetching an external repo, the diff tool skipped a target, or unrecognized option after a version bump. Not for deciding whether to adopt Bazel or for standing a workspace up, which is bazel-adopt, and not for the standards themselves, which the bazel-quality rules carry.

Как установить скилл bazel-diagnose?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bazel-diagnose запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить bazel-diagnose с