specs-ndk

Scaffolds SpecsNDK CoreJs ABI native modules with C++ and TypeScript controllers for Lens Studio projects.

16|2|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-ndk-lens-studio-devs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: specs-ndk
Source: https://github.com/lens-studio-devs/ls-extensions/tree/main/plugins/ls-clad/skills/specs-ndk
Command: npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-ndk-lens-studio-devs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Adding a native C++ module to an existing Lens Studio project requires coordinating SpecsNDK toolchain setup, CMake builds, CoreJs ABI host functions, and TypeScript controller wiring, which is error-prone when done manually. ## Core Features & Use Cases - Native Module Scaffolding: Generates a complete SpecsNDK module (CMakeLists.txt, C++ sources, build.sh) plus TypeScript decorator and controller scripts via tools/scaffold.py. - Optional RGBA Frame Preview: The --with-rgba-frame flag adds a getFrameRGBA() export, copies the FlippedImage.lspkg prefab into Assets/Prefabs, and wires a runtime camera preview path. - SDK Provisioning: Downloads and extracts SpecsNDK to ~/Dev/SpecsNDK using tools/download_specsndk.py, with CMake verification and Google Cloud auth gating for 401/403 responses. - Use Case: A developer with an existing Lens Studio project asks to add an AudioPitchShiftModule; the skill scaffolds the C++ module, writes AudioPitchShiftNativeModule.ts and AudioPitchShiftController.ts, attaches the controller to the scene via ExecuteEditorCode, and builds libAudioPitchShiftModule.so into Assets/NativeModules. ## Quick Start Add a SpecsNDK native module named MyFeatureModule to my current Lens Studio project and build it.

Frequently Asked Questions about specs-ndk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a native C++ module to an existing Lens Studio project?

Run tools/scaffold.py with --name set to a PascalCase module name and --out pointing at the Lens Studio project root containing Assets/. It generates the C++ module folder, CMakeLists.txt, build.sh, and TypeScript decorator and controller scripts under Assets/Scripts.

How do I install SpecsNDK on macOS or Windows?

Verify cmake --version first, then use tools/download_specsndk.py to probe and download the platform archive from Google Cloud Storage into ~/Dev/SpecsNDK. If the probe returns 401 or 403, install Google Cloud SDK and run gcloud auth login before the authenticated download.

What is the difference between ping() and getFrameRGBA() exports?

By default the scaffolded module exports only ping(). Passing --with-rgba-frame to scaffold.py also adds getFrameRGBA(), which returns { buffer, width, height }, copies FlippedImage.lspkg into Assets/Prefabs, and wires a runtime camera preview in the controller.

Does the scaffolded module work without the SpecsNDK SDK installed?

No. The skill verifies that ~/Dev/SpecsNDK exists with the expected toolchain layout before scaffolding or building. If missing, it runs the setup reference to download the SDK, and builds fail until CMake and the SDK are present.

Why does the native module build fail after scaffolding?

Builds fail when CMake is missing, SPECSNDK_ROOT points to a wrong or empty SDK path, or OUTPUT_SO_DIR in build.sh does not match the project's Assets/NativeModules directory. Confirm cmake --version passes and edit OUTPUT_SO_DIR to the real path.