skills/copilotkit-contribute/references/contribution-guide.md
npm i -g pnpm@^9git clone https://github.com/<your-username>/CopilotKit.git
cd CopilotKit
git remote add upstream https://github.com/CopilotKit/CopilotKit.git
git fetch upstream
git rebase upstream/main
# Install all dependencies
pnpm install
# Build all packages (required before first dev session)
pnpm build
The build step is necessary because packages depend on each other. Nx handles the dependency graph — pnpm build runs nx run-many -t build --projects=packages/** with correct ordering.
Use a group prefix with the issue number:
| Type | Pattern | Example |
|---|---|---|
| Feature | feat/<ISSUE>-<name> | feat/1234-add-voice-hook |
| Bug fix | fix/<ISSUE>-<name> | fix/5678-runtime-cors |
| Documentation | docs/<ISSUE>-<name> | docs/9012-api-reference |
git checkout -b feat/1234-my-feature
Start all packages in watch/dev mode:
# All packages
pnpm dev
# V2 packages only
pnpm dev:next
# V1 packages only (if working on v1 wrappers)
pnpm dev:classic
# Single package
nx run @copilotkit/core:dev
CopilotKit enforces conventional commits via commitlint (runs as a commit-msg hook through lefthook). The format is:
<type>(<scope>): <subject>
Header max length: 120 characters.
| Type | Description |
|---|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation changes |
style | Formatting, whitespace (no code logic change) |
refactor | Code change that neither fixes a bug nor adds a feature |
perf | Performance improvement |
test | Adding or fixing tests |
chore | Build process, tooling, dependencies |
Use the package name without the namespace prefix:
fix(runtime): handle missing agent on init
feat(react): add useInterrupt hook
test(core): cover edge case in tool registry
CopilotKit uses lefthook for git hooks. On every commit, the following run in parallel:
pnpm i --lockfile-only if package.json changedpnpm run lint --fix && pnpm run formatpnpm run test && pnpm run check:packagesIf hooks fail, fix the issue and commit again. Do not skip hooks with --no-verify.
git push origin feat/1234-my-feature
main branch of CopilotKit/CopilotKit.