Back to Copilotkit

Documentation Contributions

showcase/shell-docs/src/content/docs/(other)/contributing/docs-contributions.mdx

1.57.03.6 KB
Original Source

We move quickly and our docs sometimes lag the code, so contributions to the documentation site are very welcome.

The documentation site lives in showcase/shell-docs inside the CopilotKit monorepo. It is a Fumadocs site; the legacy Nextra docs/ tree is being phased out and is no longer the right place to author new content.

Prerequisites

  • Node.js 20.x or later
  • pnpm v9.x installed globally (npm i -g pnpm@^9)
  • Nx — used to drive all tasks in the monorepo. You don't need to install it globally; the repo's pnpm install provides everything.

How To Contribute

<Steps> <Step> ### Fork and clone the repository

First, fork the CopilotKit GitHub repository, then clone your fork:

shell
git clone https://github.com/<your-username>/CopilotKit
cd CopilotKit
pnpm install

pnpm install at the repo root installs every package in the workspace and wires up the lefthook pre-commit hook (lint, format, test) — running it once is required before your first commit.

</Step> <Step> ### Run the documentation site locally

The shell-docs site is an Nx project (@copilotkit/showcase-shell-docs). Run it through Nx from the repo root:

shell
nx run shell-docs:dev

The site is served at http://localhost:3003. If you prefer to run it from the package directory, cd showcase/shell-docs && pnpm dev works too — both go through the same script.

<Callout type="info"> Always prefer running tasks via Nx (`nx run`, `nx run-many`, `nx affected`) rather than the underlying tooling directly. This is the convention across the monorepo and ensures task dependencies are respected. </Callout> </Step> <Step> ### Make your changes

Documentation pages live under:

showcase/shell-docs/src/content/docs/

A few conventions to keep in mind:

  • The site is built with Fumadocs. Content is authored in MDX. Frontmatter (title, description, icon, etc.) drives the sidebar and metadata.
  • For code samples, prefer the <Snippet> region pattern over hand-inlining code blocks. <Snippet> pulls real source from the showcase integrations under showcase/integrations/<framework>/... using region markers (e.g. // region:my-region// endregion:my-region). This keeps every code sample tied to runnable demo code and lets us catch drift automatically. When in doubt, look at how an adjacent page references the same integration and follow that pattern.
  • Reference pages for hooks, components, and runtime APIs use a <PropertyReference> component to render the prop / parameter table. Match the style of an existing reference page in the same directory.
<Callout type="info"> Please review your changes for grammar, spelling, and formatting, and confirm that links, code blocks, and images render correctly in the local dev server before opening a PR. </Callout> </Step> <Step>

Review changes and submit a pull request

Before pushing, the lefthook pre-commit hook will run lint, format, and tests on the affected projects via Nx. If anything fails, fix the issue and commit again — don't bypass the hook.

When you're happy with the result, push and open a PR against the CopilotKit/CopilotKit repo. Thank you for your contribution!

</Step> </Steps>

Need help?

If you need help with anything, please don't hesitate to reach out on Discord. There's a dedicated #contributing channel.