Skip to content
Community

Contributing

Find where Kubb code lives, set up the core or plugins repository, pass the quality gates, and open a pull request.

Check the open issues and pull requests first. Open an issue before an opinion-driven change. Each repository's CONTRIBUTING.md has the full rules: kubb-labs/kubb and kubb-labs/plugins.

What lives where

RepositoryHolds
kubb-labs/kubbThe kubb and @kubb/* core packages, and these docs in docs/
kubb-labs/pluginsThe official @kubb/plugin-* packages, with a runnable example per plugin
kubb-labs/platformThe kubb.dev site, its blog, and Kubb Studio

Kubb core

PathHolds
packages/core/Plugin runtime, build loop, defineExtension, createKubb
packages/kit/Authoring toolkit behind kubb/kit
packages/ast/Universal AST and visitors
packages/adapter-oas/OpenAPI 2.0 and 3.x adapter
packages/parser-ts/, parser-md/AST to TypeScript, TSX, and Markdown source
packages/plugin-barrel/Barrel file plugin
packages/renderer-jsx/JSX renderer
packages/cli/The kubb CLI
packages/mcp/MCP server
packages/studio/The Studio connection behind kubb studio
packages/unplugin-kubb/Build tool integrations
packages/kubb/The main package: public APIs and defineConfig

Workflow

Both repositories need Node.js 22.22 or later, pnpm 11 or later, and Git. Run corepack enable to get the pnpm version the repository pins.

Fork and clone

gh repo fork kubb-labs/kubb --clone
cd kubb

Install dependencies

Terminal
pnpm install
pnpm build

pnpm build compiles every package so local packages resolve each other. Rerun it after you change package source.

Create a branch

Terminal
git checkout -b feat/your-feature-name

Iterate

Terminal
pnpm -F @kubb/core start                                          # rebuild one package on change
pnpm vitest run --config ./configs/vitest.config.ts packages/core # test one package

Put each test next to its source file. List a new test file in configs/test-registry.json, with one sentence on what it covers. In kubb-labs/plugins, test a folder such as packages/plugin-ts, and run pnpm generate after a plugin change.

Add a changeset

Run pnpm changeset when the change ships in a published package, including a package's docs/ folder, because kubb.dev reads it from the published version. Changes to docs/5.x, CI, and tests need none. Write Conventional Commits, such as feat: or fix:.

Open a pull request

Push to your fork and open a pull request against main. Fill in the template, link the issue, and re-request review after each round of changes.

Quality gates

Run these before you push. CI runs them on every pull request that changes code.

CommandChecksCI job
pnpm buildEvery package buildsBuild
pnpm typecheckTypes in every packageTypecheck
pnpm testThe Vitest suitesTests
pnpm lintoxlint rulesLinting
pnpm test:registryEvery test file has a registry entry, and no entry points at a deleted fileLinting
pnpm formatoxfmt formattingautofix.ci formats the pull request
pnpm typecheck:examplesPlugins only: the examples type-checkTypecheck
pnpm generatePlugins only: generates the examplesUpdate generated examples, which opens a pull request with the changes

Write a plugin

KindWhereHow
Community pluginYour own repository, on npm under a name you ownCreate a Kubb plugin, then Publish a plugin. Copy the layout of plugin-axios.
Official pluginpackages/plugin-<name>/ in kubb-labs/plugins, as @kubb/plugin-<name>Open an issue to agree on scope and name, then follow Adding a plugin.

Getting help

Open an issue or ask on Discord.