contributor-context
Contributor context for coding agents working in this repository. Human contributors should start with `README.md` and…
<!-- GENERATED from docs/playbooks/new-port.md by scripts/build-agent-skill.mjs. Do not edit. -->
$ npx -y skills add crossbind/crossbind --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
<!-- GENERATED from docs/playbooks/new-port.md by scripts/build-agent-skill.mjs. Do not edit. -->
<!-- GENERATED from docs/playbooks/new-port.md by scripts/build-agent-skill.mjs. Do not edit. -->
> **Port author** — Use this workflow when an upstream C or C++ library should be published as an `@crossbind/port-*` family.
Create a `ports/<name>/` family that:
For application-owned C++ that should stay inside one app, start from a Library Prebuilt project instead:
npm create crossbind@beta -- my-library Library Prebuilt
Use `pnpm run scaffold:port -- <name>` and compare the result with `ports/zlib/`:
ports/<name>/ ├── base/ # @crossbind/port-<name> │ ├── package.json # family metadata, nativeVersion, upstream license │ ├── build.mjs # shared source acquisition and build recipe │ ├── mergeConfig.mjs # merges the recipe into a platform config │ ├── README.md │ └── .npmignore ├── wasm/ # @crossbind/port-<name>-wasm │ ├── package.json │ ├── crossbind.config.js │ ├── crossbind.build.js │ ├── README.md │ ├── LICENSE │ └── .npmignore ├── android/ # same platform-variant shape ├── ios/ # same shape; add a podspec when the port needs one ├── darwin/ # same shape; macOS arm64 + x64 archives for Node.js addons ├── linux/ # same shape; Linux arm64 + x64 archives, built in the linux image ├── win32/ # same shape; Windows arm64 + x64 archives, built in the windows image ├── wasi/ # WASI library variant └── standalone-wasi/ # optional npm bin surface for an upstream CLI
The family recipe lives once in `base/build.mjs`. Each platform variant reuses it through `crossbind.build.js`; target-specific differences belong in that variant's config or build overlay.
These dependencies are load-bearing: pnpm's package graph determines native build order, and crossbind uses the same graph for link inputs.
Use the latest stable upstream release. Resolution order:
1. GitHub Releases API, excluding prereleases. 2. GitHub Tags API when the project does not publish releases. 3. The upstream project's release/download index as a last resort.
Run the repository checker after adding the family:
pnpm run check:native -- --update
Review the selected version and source digest instead of accepting an automated bump blindly.
1. Prefer CMake when upstream supports it. 2. Use autotools only when that is the maintained upstream path; see `ports/openssl/`. 3. Use a thin CMake adapter or an explicit custom build hook for other systems, and keep the exception documented.
Disable upstream tests, examples and documentation in distribution builds unless they are needed to produce the library.
# Create the current base + platform-variant structure. pnpm run scaffold:port -- <name> # Resolve/check upstream versions. pnpm run check:native -- --update # Build every package in the family. pnpm --filter '@crossbind/port-<name>*' run build # Iterate on one variant. pnpm --filter @crossbind/port-<name>-wasm run build # Check publish and artifact contracts. pnpm run check:dist node scripts/check-publish-hygiene.js
Add or update an `e2e/` fixture that consumes the port through the same public surface users will install. Do not turn an unrelated example into a private port test.
Import C++ and Rust like JavaScript modules (WebAssembly & React Native)
Contributor context for coding agents working in this repository. Human contributors should start with `README.md` and…
<!-- GENERATED from docs/api/app.md by scripts/build-agent-skill.mjs. Do not edit. -->
<!-- GENERATED from docs/api/build-state.md by scripts/build-agent-skill.mjs. Do not edit. -->
<!-- GENERATED from docs/api/conan.md by scripts/build-agent-skill.mjs. Do not edit. -->
<!-- GENERATED from docs/api/cpp-binding-rules.md by scripts/build-agent-skill.mjs. Do not edit. -->