mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
69673f2ea7
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.
1.2 KiB
1.2 KiB
Hook Development
When creating a new hook, always complete all of the following:
- Implementation: Create the hook in
@copilotkit/react-core. If backward compatibility shims are needed, add them in the package'sv1/directory. - JSDoc: Add JSDoc on top of the hook implementation, including usage examples.
- Tests: Write extensive tests covering behavior, edge cases, and lifecycle (mount/unmount/re-render).
- API reference: Add a reference page at
showcase/shell-docs/src/content/reference/hooks/<hookName>.mdxwithtitleanddescriptionfrontmatter. The v2 reference navigation is generated automatically by walking thereference/tree and reading frontmatter (seeshowcase/shell-docs/src/lib/reference-items.ts) — there is nometa.jsonto edit for v2 reference; the file and its frontmatter are the metadata. (Only the legacyreference/v1/tree usesmeta.json.) - 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'smeta.jsonso it appears in navigation.
Never author docs in the retired top-level docs/ folder. See Documentation.