Files
copilotkit__copilotkit/.claude/docs/hooks.md
Sam Julien 69673f2ea7 docs: route all documentation authoring to shell-docs
The top-level docs/ app is retired but nothing said so, and two
instruction surfaces still pointed contributors there. Establish a
single canonical rule and reduce the other surfaces to pointers.

- Add .claude/docs/documentation.md as the source of truth: CopilotKit
  docs are authored in showcase/shell-docs/src/content/; the top-level
  docs/ folder is retired; AG-UI protocol docs are authored upstream in
  ag-ui-protocol/ag-ui and mirrored here.
- CLAUDE.md: add an Essentials rule and a Reference link.
- docs/README.md: replace boilerplate with a retired/STOP banner.
- .claude/docs/hooks.md: fix the stale /docs pointer; document that a
  hook's API reference page lives in reference/hooks/ and that v2
  reference nav is generated from frontmatter (no meta.json).
- CONTRIBUTING.md: add a two-domain documentation section.
2026-06-03 10:04:56 -07:00

1.2 KiB

Hook Development

When creating a new hook, always complete all of the following:

  1. Implementation: Create the hook in @copilotkit/react-core. If backward compatibility shims are needed, add them in the package's v1/ directory.
  2. JSDoc: Add JSDoc on top of the hook implementation, including usage examples.
  3. Tests: Write extensive tests covering behavior, edge cases, and lifecycle (mount/unmount/re-render).
  4. API reference: Add a reference page at showcase/shell-docs/src/content/reference/hooks/<hookName>.mdx with title and description frontmatter. The v2 reference navigation is generated automatically by walking the reference/ tree and reading frontmatter (see showcase/shell-docs/src/lib/reference-items.ts) — there is no meta.json to edit for v2 reference; the file and its frontmatter are the metadata. (Only the legacy reference/v1/ tree uses meta.json.)
  5. Conceptual docs (if needed): If the hook needs usage/how-to documentation beyond the API reference, add a guide page under showcase/shell-docs/src/content/docs/ and update that section's meta.json so it appears in navigation.

Never author docs in the retired top-level docs/ folder. See Documentation.