@teakit/napi
Preserve the public identity boundaries: the product and repository are @teakit/napi, Zig users import napi, and command-line users install or run napikit.
Workflow
- Read
AGENTS.md,skills/llms.md, and the relevant accepted spec. - Identify the affected surface: runtime, build integration, CLI, docs, or release tooling.
- Load only the matching reference pages below. Start with a maintainer reference for repository work, then open detailed guides only when needed.
- Add or update tests before changing behavior.
- Keep public docs, scripts, and CI aligned with the implementation.
- Run the narrowest checks while iterating, then the canonical checks before handoff.
Reference routing
Treat every references/*.md label below as a local path relative to this file. Its link points to the corresponding stable public documentation route.
Maintainer references
- Read
references/runtime.mdfor Zig exports, conversions, callbacks, async work, classes, and namespaces. - Read
references/build-and-packaging.mdforbuild.zig, native targets, declarations, generated npm packages, and publishing boundaries. - Read
references/cli-and-docs.mdfor CLI commands, Bun scripts, Rspress routing, and repository tooling.
Getting started
- Use
references/quick-start.mdfor the scaffolded addon path. - Use
references/manual-setup.mdfor hand-written project setup. - Use
references/project-layout.mdfor the consumer repository and generated package tree.
Authoring addons
- Use
references/functions.mdfor exported functions and registration. - Use
references/namespaces.mdandreferences/classes.mdfor nested exports and stateful instances. - Use
references/type-conversion.mdandreferences/memory.mdfor Zig/JavaScript values, allocation, and lifetimes. - Use
references/errors.mdandreferences/callbacks.mdfor failures and JavaScript callbacks.
Async work
- Use
references/workers.mdfor one-result background work. - Use
references/threadsafe.mdfor cross-thread, multi-call callbacks. - Use
references/promises.mdfor manually settled promises.
Build and release
- Use
references/typescript.mdfor declaration generation. - Use
references/cross-compiling.mdfor release targets and partial builds. - Use
references/publishing.mdfor npm package layout, trusted publishing, and release CI.
API reference
- Use
references/cli.mdfornapikitcommands andreferences/build.mdfor the consumerbuild.zigAPI. - Use
references/env.md,references/val.md, andreferences/error.mdfor the core runtime environment, JavaScript values, and N-API errors. - Use
references/callback.md,references/threadsafe-fn.md,references/ref.md, andreferences/deferred.mdfor callback and lifetime primitives. - Use
references/call-info.mdandreferences/class.mdfor low-level calls and class definitions. - Use
references/dts.mdfor declaration generator APIs.
Guardrails
- Use
@teakit/napifor product and repository branding; reservenapikitfor the CLI package, executable, and commands. - Do not rename the Zig package from
napior the npm CLI fromnapikit. - Do not change public Zig APIs, CLI commands, generated package layouts, supported targets, registry, or access level without explicit approval.
- Keep bunup and public npmjs publishing unless a proposal explicitly replaces them.
- Keep public Rspress entry files at
skills/and detailed package guidance inskills/teakit-napi/references/; internal documents underdocs/are not site pages. - Keep the public documentation origin
https://napi.teakit.orgsynchronized across Rspress, README,skills/llms.md, and npm package metadata. - Keep the canonical source repository
https://github.com/teakit/napisynchronized across Rspress, README,skills/llms.md, CLI scaffolding, and npm package metadata. - Preserve the public documentation routes declared in
rspress.config.tswhen reorganizing reference files. - Use Biome for supported files and
zig fmtfor Zig. Do not introduce another formatter, linter, package manager, or test runner.