skills/bindings_synchronization/SKILL.md
When making changes to public Filament C++ APIs, AI agents must ensure the changes are mirrored in the Java and JavaScript/TypeScript binding layers.
You must check and update the language bindings if your changes touch any public headers under filament/include/filament/, specifically:
View, Engine, Camera, LightManager, RenderableManager).AmbientOcclusionOptions, BloomOptions, FogOptions).
[!IMPORTANT] If you modify options structs defined in
filament/include/filament/Options.h, you must run the beamsplitter tool. The tool parsesOptions.hand automatically updates Java bindings, JavaScript/TypeScript bindings, and C++ JSON serialization files.Run it via:
bashcd tools/beamsplitter && go run .
BlendMode, QualityLevel, AntiAliasing under filament/include/filament/ or nested inside classes).All JNI JNI-exported functions use automatic symbol resolution (dynamic mapping), meaning they are mapped by signature rather than a static registration table.
android/filament-android/src/main/java/com/google/android/filament/<ClassName>.javaandroid/filament-android/src/main/cpp/<ClassName>.cpppublic (unless the API is strictly internal to the Java package). Follow Java naming conventions (camelCase).setFoo), always add the corresponding Getter (e.g., isFoo or getFoo).private static native.extern "C" JNIEXPORT <ReturnType> JNICALL Java_com_google_android_filament_<ClassName>_<NativeMethodName>.jboolean using (jboolean) or static_cast<jboolean>().Filament uses Emscripten's Embind to export C++ APIs to JS.
web/filament-js/jsbindings.cppweb/filament-js/jsenums.cppweb/filament-js/filament.d.tsweb/filament-js/extensions.jsjsbindings.cpp within the corresponding class_<ClassName>("<JSClassName>") block using .function("methodName", &ClassName::methodName).filament.d.ts to match any changes. Every bound C++ method should have a corresponding declaration inside export class <ClassName> to avoid IDE type errors.BloomOptions), make sure to:
jsbindings.cpp using .field("fieldName", &ClassName::Options::fieldName).filament.d.ts to include the new properties.extensions.js contains a prototype-overrides wrapper for merging the options (e.g., Filament.View.prototype.setBloomOptions). Update the default options object if needed.Before concluding a task:
filament.d.ts are 100% synchronized.