Kit: the plugin authoring toolkit
kubb/kit is the layer you build on. Everything a developer writes to extend Kubb starts from this one import: your own plugin, the generators it runs, the resolver that names its files, and any adapter, parser, renderer, or storage backend you add. See the Kit API reference for the full surface, Architecture for where kit sits in the pipeline, and Plugins for what a plugin does once it is built.
What you build with it
A plugin is the usual starting point. definePlugin gives you the lifecycle hooks, and defineGenerator gives you the handlers that walk the AST and emit files. Kit covers the rest of the surface a real plugin reaches for:
createResolvernames your files and places them, so other plugins import your output instead of guessing paths.createAdapterteaches Kubb a new input format.defineParserturns the emitted nodes into a source string.createRendererwalks a templating format other than JSX intoFileNodes.createStoragesends the result somewhere other than the filesystem.
AST helpers
Most generator handlers end by building a node, so the ast namespace sits in the same import. It ships the factory builders, the type guards, the macros, the printers a parser drives, and the transform and collect visitors. Pull ast from kubb/kit whether you are inside a plugin or writing a standalone script that reads a spec.
Core helpers
The same import carries the helpers that belong to no single plugin. Diagnostics builds and narrows the structured errors Kubb collects during a build, and kubb/kit/testing gives you Vitest-backed helpers for exercising a plugin, generator, or adapter without running a full build.
Why a separate surface from the engine
The Kubb engine also runs the build: the plugin driver, the file manager, the CLI reporters. None of that is part of authoring a plugin. You call definePlugin and return an object. The engine discovers that object, walks the AST against it, and writes the result to disk. Folding the two into one import would hand every plugin author driver internals they never call.
Kit keeps them apart the same way the AST layer and the JSX renderer stay separate from the engine that drives them. You call kubb/kit to build things. The engine, reached through the kubb package and its CLI, runs them.