Skip to content

Repository files navigation

any2bazel

Generate and maintain Bazel build files for a project so they remain in sync with another build system (CMake, Maven, and more) — whether as part of a migration, or to keep parallel builds consistent.

license claude-code bazel

Table of contents

Get started

Install as a Claude Code skill:

npx skills add -g engflow/any2bazel

Then invoke it from your agent's CLI:

/any2bazel

Developed for Claude Code using Opus 4.8.

Introduction

any2bazel extracts what each build system actually compiles and links into a canonical action model, then iterates until Bazel's build actions match. A deterministic diff drives the loop — an LLM does only the creative work (generating and fixing BUILD.bazel files).

  • Diffs the actions each build performs.
  • One action-based IR shared across frontends; the differ is language- and mnemonic-aware.
  • Asymmetric flag comparison — textually different but semantically equivalent builds converge to zero errors.
  • Grouping-agnostic for libraries and Java source sets — library renames and object-library fold-ins converge with no mapping.
  • Reviewer-auditable suppressions in a checked-in cmake2bazel.json.
  • MVP scope — no codegen, custom commands, or packaging yet.

Note

This project is in its early stages, we welcome feedback and contributions as we continue to evolve this tool.

Source build support

Frontend Reference source Status
CMake File API codemodel-v2 Mature — the validated path
Maven forked javac argfiles Early — argv-floor only
VSCode / npm esbuild/tsc/child_process instrumentation Experimental — standalone TS emit check

Case studies

Project Frontend Notes
Ladybird CMake Full case study — performance & flag canonicalization
VSCode npm/esbuild 7710/7710 .js byte parity
BoringSSL, Abseil, RE2, fmt, spdlog, TinyXML2, zlib CMake See EXPERIMENTS.md
Guava Maven See EXPERIMENTS.md

Contributing

Contributions are welcome. Please send any feedback and changes to the main repo at https://github.com/EngFlow/any2bazel.

About

Migration tools for any build system to bazel

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages