kingwill101/native_prebuilt/native-prebuilt

Claude Code and agent skill by kingwill101/native_prebuilt

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install kingwill101/native_prebuilt/native-prebuilt

SKILL.md

The same SKILL.md was published earlier as kingwill101/native_prebuilt/native-prebuilt.

native_prebuilt

Use this skill when you need to work with native libraries in Dart packages - whether generating manifests, building from source, or setting up prebuilt resolution.

Three API Paths

1. Hooks Builder integration (simple packages)

For packages with single-stage builds using existing hooks builders like CBuilder:

dart
import 'package:hooks/hooks.dart';
import 'package:native_prebuilt/native_prebuilt.dart';
import 'package:native_toolchain_c/native_toolchain_c.dart';
void main(List<String> args) async {
await build(args, (input, output) async {
await PrebuiltCodeAssetBuilder(
assetName: 'src/my_package.dart',
libraryStem: 'my_package',
manifest: myPackagePrebuilts,
linkModeResolver: (_) => DynamicLoadingBundled(),
sourceFallback: SourceFallback(
sources: [LocalSource(paths: ['.'])],
builder: HookBuilderSourceBuilder.factory(
(input) => CBuilder.library(
name: 'my_package',
packageName: input.packageName,
assetName: 'src/my_package.dart',
sources: const ['src/native/my_package.c'],
),
),
),
).run(input: input, output: output, logger: Logger.root);
});
}
2. Managed build recipes (complex packages)

For multi-stage builds with caching and cross-compilation, you can write the NativeProject in Dart by hand:

dart
final project = NativeProject(
name: 'tdlib',
asset: const NativeAssetSpec(
assetName: 'src/client/platform/io/tdjson_native.dart',
libraryStem: 'tdjson',
linkMode: DynamicLoadingBundled(),
),
build: NativeBuildDefinition(
recipes: {
OS.linux: StepBuildRecipe(steps: [
CmakeConfigureStep(buildDirectory: 'build'),
CmakeBuildStep(buildDirectory: 'build', targets: ['tdjson']),
ExportArtifactStep(artifactPath: 'build/td/libtdjson.so'),
]),
},
),
);
// hook/build.dart
await runNativeProjectCli(args, project: project);
3. Declarative manifest (recommended for release builds)

You can define the complete project in native_prebuilt.yaml instead of writing NativeProject code manually. The CLI loads that manifest, validates it, and generates the build graph from it. native_prebuilt build runs declarative recipes and falls back to hook/build.dart when no recipe is declared; when the manifest has a matching target artifact, its payload definition standardizes the staged output.

CLI Commands

Manifest Management
  • dart run native_prebuilt init - Scaffold an initial native_prebuilt.yaml from the package's pubspec.yaml
  • dart run native_prebuilt manifest update [--strict] - Generate/refresh manifest or lock file; --strict rejects flat built-library/<name>
  • dart run native_prebuilt manifest verify - Verify manifest hashes match built artifacts
  • dart run native_prebuilt manifest verify-release [--manifest] [--built-library-dir] [--release-assets-dir] [--strict] - Hash + triple check vs lock/g.dart
  • dart run native_prebuilt doctor [--manifest] [--built-library-dir] [--release-assets-dir] [--target] [--strict] - Drift/hash/triple check, exit 2 on drift
  • dart run native_prebuilt schema export - Write schema/native_prebuilt.schema.json for editor validation
Build Pipeline
  • dart run native_prebuilt plan --target <platform> - Show build plan for a target
  • dart run native_prebuilt build --target <platform> --output <dir> - Build native library
  • dart run native_prebuilt cache-key --target <platform> - Show cache key for a build
  • dart run native_prebuilt explain-cache --target <platform> - Explain cache state
  • dart run native_prebuilt verify --target <platform> - Verify built artifact (legacy); also verify --ref <tag> [--release-assets-dir] [--ephemeral] [--target] for isolated download + triple check
Workflow Generation
  • dart run native_prebuilt workflow init - Generate GitHub workflow files (now merge+doctor+verify-consumer→update-manifest→release, Node24)
  • dart run native_prebuilt workflow init --gitlab - Generate GitLab CI files
  • dart run native_prebuilt workflow init --gitlab --platform linux,windows - Filter GitLab outputs by platform

Build Steps

Common YAML keys:

  • type (required)
  • id (required)
  • needs (optional)
  • execution (host|target, default target)
typePurpose
cmake_configureRun CMake configure/generate
cmake_buildRun CMake build with targets
commandRun arbitrary commands
download_archiveDownload and extract archives
git_checkoutClone or update git repositories
git_apply_patchApply patch files
copyCopy files or directories
stripStrip debug symbols
export_artifactExport the final artifact

Recipe values use Liquid templates with source.*, work, output, cache, directories.*, env.*, target.*, library.*, hook.*, project.*, and custom build.options.* values. Common target helpers include target.rust_target, target.zig_target, target.sdk, and OS booleans. Manifest-level variables.* values can refer to these values and to other shared variables. YAML anchors can share complete step lists. Dynamic artifact payloads are the default; declare static_library only for static targets.

Use schema/native_prebuilt.schema.json for editor validation.

Platform Toolchains

Auto-detected from environment:

  • Android NDK — ANDROID_NDK_HOME or SDK
  • Apple SDK — Xcode paths
  • MSVC — Visual Studio installation
  • vcpkg — VCPKG_ROOT

Caching

Build steps are cached using content-based fingerprints:

  • Same inputs → cache hit (skip build)
  • Changed source/toolchain → cache miss (rebuild)
  • Cache stored in .dart_tool/native_prebuilt/build-cache/

Test Fixtures

Located in test/fixtures/native_projects/:

  • simple_shared/ - Basic shared library
  • static_library/ - Static library
  • generated_source/ - Multi-stage with code generation
  • dependency_graph/ - Library with dependencies
  • patchable_source/ - Patchable source
  • failing_build/ - Intentionally broken

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kingwill101/native_prebuilt/native-prebuilt/badge)](https://verified-skill.com/skills/kingwill101/native_prebuilt/native-prebuilt)

Something wrong with this skill or its page? Tell us.