Add a rule to .claude/docs/git.md to fetch and branch off origin/main
(not stale local main) before starting work, with the worktree
equivalent and the rebase recovery command for an already-stale branch.
Prevents PRs from being based on an old commit.
Every meaningful unit of work gets its own pushed commit; a draft PR
opens on the first commit of a branch and flips to ready only on the
developer's say-so.
## What
Two unrelated cleanups:
### 1. Move internal-only skills out of the public repo
Three staff-only skills lived under `.claude/skills/` and
`.agents/skills/`, so `npx skills add CopilotKit/CopilotKit` swept them
into end-user installs. This PR deletes them here; they now live in the
internal-skills plugin (**CopilotKit/internal-skills#108**):
- `copilotkit-demo-parity`
- `git-hooks`
- `showcase-demo-debugging`
### 2. Recommend a cleaner skills install command
The **Build with agents** guide now recommends:
```bash
npx skills add CopilotKit/CopilotKit/skills -y
```
- `/skills` subpath installs only the published skills under `skills/`
(the repo root also picks up internal skills).
- `-y` skips the interactive prompts.
A Callout documents the interactive variant and `-g` for a global
install.
Removes the three internal-only skills (copilotkit-demo-parity, git-hooks,
showcase-demo-debugging) from .claude/skills/ and .agents/skills/. These are
staff-only and now live in the internal-skills plugin. Removing them at the
source means root skill discovery no longer sweeps internal skills into a
user's install.
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.
Add `metadata.internal: true` so the skill is hidden from
`npx skills add CopilotKit/CopilotKit` public installs.
Same pattern as PR #4937 for git-hooks and copilotkit-demo-parity.
Three regressions from the earlier CR Round 1 fix batch + a related
miss the same round didn't catch.
1. `components/ai/page-actions.tsx` is `"use client"`; importing
`getBaseUrl` from `@/lib/sitemap-helpers` pulled `fs` / `path` /
`gray-matter` into the client bundle and broke the build entirely
("Module not found: Can't resolve 'fs'"). The whole point of
`getBaseUrl` is the 2-line env-var read + trailing-slash strip — no
filesystem work — so inline a `getClientBaseUrl()` helper here with a
pointer to the canonical server-side version. `sitemap-helpers.ts`
stays untouched so other server-side callers keep their convenience.
2. The same file re-threw caught errors from `fetchMarkdown` /
`clipboard.writeText` on the assumption that Fumadocs's
`useCopyButton` would treat the rejection as "don't flip the
`checked` state". It doesn't — there's no `.catch()` on the
internal promise (verified in
`fumadocs-ui/dist/utils/use-copy-button.js`), so the throw produced
an unhandled rejection (browser console noise + Sentry spam) AND
gave the user no visible failure indicator either way. Log and
swallow at this layer; a follow-up PR can introduce an explicit
error UI if we want "Copy failed" to surface.
3. `.claude/launch.json` routed `shell` to port 3004 by passing
`-- --port 3004` to `npm --prefix showcase/shell run dev`. But
shell's `dev` script ends with `npx -y concurrently -k -n
bundle,next "tsx ... --watch" "next dev"` — the trailing
`--port 3004` was parsed by `concurrently`, not `next dev`, so
`next dev` still bound 3000 and the original collision with `docs`
persisted. Switch to `bash -c "PORT=3004 npm --prefix showcase/shell
run dev"` so the env var passes through `concurrently` into
`next dev` (which natively reads PORT).
Call-site enumeration:
- `getClientBaseUrl` (new) — only used inside the same file. No
external callers to update.
- `getBaseUrl` (untouched in `@/lib/sitemap-helpers`) — server-side
callers (sitemap routes, `llms-full.txt` route, `llms.txt` route)
unchanged; verified via grep that no `"use client"` file imports it.
- `MarkdownCopyButton` — error now logged once via `console.error`
and swallowed; the button stays in its idle state.
- `.claude/launch.json` `shell` entry — `runtimeExecutable` flipped
from `npm` to `bash`; harness reads these as opaque strings.
`.claude/launch.json` declared port 3000 for both \`docs\` (Next.js at
docs/) and \`shell\` (Next.js at showcase/shell/) — only one could
actually start at a time, and Next's auto-port-fallback would land
\`shell\` on whatever was free without the launch config knowing.
Reassign \`shell\` to port 3004 (next free slot after the existing
3001/2/3 cluster) and pass \`-- --port 3004\` through \`npm run dev\`
so the runtime port matches the declared port.
\`.claude/preview/shell-docs.sh\` had a blanket
\`|| { echo "(may have failed — expected)" }\` after \`pnpm install\` that
swallowed every install failure, not just the documented \`lefthook\`
prepare-hook one. A real failure (network down, lockfile drift) would
get silently absorbed and then explode much later at the \`npx tsx\`
generator step with a confusing \`Cannot find module\` error. Verify
\`$SCRIPTS_DIR/node_modules\` exists after the install attempt; bail
with a clear instruction if it doesn't.
\`showcase/shell-docs/next-env.d.ts\` is a Next.js-auto-generated file
whose contents differ between \`next dev\` (\`./.next/dev/types/...\`)
and \`next build\` (\`./.next/types/...\`). Per Next.js's own
recommendation it should never be checked in — the v16 path change
would otherwise produce dirty trees on every build/dev switch, and a
clean checkout's typecheck would fail because the imported
\`.next/dev/types/routes.d.ts\` is itself gitignored. Add the file to
\`.gitignore\` (matching the existing \`docs/next-env.d.ts\` entry) and
\`git rm --cached\` to untrack the committed copy. Next regenerates it
on first \`next dev\`/\`next build\`.
Call-site enumeration:
- \`.claude/launch.json\` — no callers within the repo; the
\`/run\` slash command reads it as data. Port change is non-breaking
for any other tooling that doesn't bind to 3000 for \`shell\`.
- \`.claude/preview/shell-docs.sh\` — the lefthook installer is the
only thing that runs it (besides interactive users); both flows
benefit from the loud failure.
- \`next-env.d.ts\` — no source file imports from it; the file is a
TypeScript \`/// <reference\` declaration consumed by tsc only,
regenerated on each build/dev.
Stack upgrade
- fumadocs-core/ui 15.8.5 → 16.8.12, next 15 → 16 (Turbopack), react 19 → 19.2
- Swap "next lint" → "oxlint ." to match the rest of the repo
- New deps for the page-actions component: @radix-ui/react-popover,
class-variance-authority, clsx, tailwind-merge
Layout & brand polish
- Sidebar floats as a rounded-2xl card with column-aligned padding;
framework picker pill, accent-purple section icons (16px), accent
active state, and a single divider line at the footer
- New custom <ThemeSwitch> — single 50×28 neutral switch replaces the
fumadocs sun/moon split (drops the vertical divider and purple tint)
- Sidebar folder collapse state persists across navigations via
SidebarFolderStatePreserver
- BrandNav: wider top bar, lowercase "Talk to an engineer", BookIcon
for Docs, GitHub/Discord icons rendered inline in our footer row
- Mobile: nav clipping + content padding fixes, content grid-span-full
- TOC-less pages: lift article max-width so content stretches into the
empty TOC column on wide viewports
New routes
- /llms.txt — page index per fumadocs LLMs integration
- /llms-full.txt — concatenated full text of every docs page
- /<path>.md and /<path>.mdx — per-page raw markdown with <Snippet>
regions inlined as fenced code blocks (resolver in lib/llm-text.ts
reuses the same demo-content.json the <Snippet> runtime reads)
- Page-actions bar: Copy Markdown + Open in Claude / Claude Code /
Windsurf / Codex (Codex links to https://chatgpt.com/codex for
universal coverage)
Content fixes
- Reasoning page (generative-ui/reasoning.mdx): rewrite to point at
the real reasoning-default / reasoning-custom cells instead of the
stale agentic-chat-reasoning / reasoning-default-render names
- Strip <FeatureIntegrations /> chip list ("SUPPORTED BY ...") from
16 docs MDX files (component definition kept in mdx-registry)
- Drop hideTOC: true from 11 pages so they pick up the lifted-cap rule
- Default home (/) to the built-in-agent authored sidebar; fix active
state matching on the home url
- Restore default fumadocs Callout (drop the bespoke docs-callout)
- OpsPlatformCTA redesign — light bordered card with accent stripe
- FrameworkOverview redesign — drop atmospheric chrome, smaller hero
- Homepage / docs-landing redesign
Integrations (LGP / LGT / ADK)
- Tag @region[default-reasoning-zero-config] in reasoning-default and
@region[reasoning-block-render] in reasoning-custom for all three
frameworks so the docs <Snippet> calls resolve
- Tag @region[use-agent-simple] + @region[message-list-simple] in
headless-simple and @region[use-rendered-messages-hook] +
@region[manual-tool-call-rendering] +
@region[manual-activity-message-rendering] + @region[custom-bubbles]
across headless-complete
Other
- docs/components/layout/mobile-sidebar.tsx: lowercase "engineer" to
match shell-docs
- .claude/launch.json + .claude/preview/ — dev launch configs for the
worktree so /preview brings up shell-docs on :3003
`.claude/skills/git-hooks` and `.claude/skills/copilotkit-demo-parity`
are contributor-only — they teach Claude Code about lefthook and the
parity tooling in `examples/integrations/`, not about using CopilotKit.
Without this, `npx skills add CopilotKit/CopilotKit` installs 11 skills
into end-user environments instead of the 9 intended public ones.
Mark them `metadata.internal: true` so they're excluded by default per
the vercel-labs/skills convention. Maintainers can still install them
with `INSTALL_INTERNAL_SKILLS=1`. Claude Code's project-local auto-load
of `.claude/skills/` is unaffected.
Two small changes to the parity tooling, surfaced while validating it on
the langgraph-fastapi port.
1. Drop the per-instance PROMPT.md file. The reference demo
(langgraph-python) does not load agent/PROMPT.md at runtime — it inlines
the prompt as a triple-string literal in agent/main.py. Syncing a
cosmetic PROMPT.md file to every instance created a contract the code
did not follow. Now:
- sync.ts no longer writes agent/PROMPT.md per instance.
- verify.ts greps the first non-blank line of _parity/canonical/PROMPT.md
against each instance's agent source. Inline the prompt string in
source; verifier passes.
- Deleted the now-orphaned PROMPT.md copy under langgraph-js/agent/.
2. Track Dockerfile, docker/Dockerfile.agent, and serve.py in the shared
verbatim-files list. These were previously silent "allowed divergence"
across all instances — any Docker or runtime-adapter drift shipped
unflagged. Now:
- Added to tracked.verbatimFiles in manifest.json.
- langgraph-js keeps them in allowedDivergence (Node-only stack, legit
difference from the Python-based reference).
- langgraph-fastapi drops them from allowedDivergence (same language
stack as the reference; Docker/serve.py should match).
README and the copilotkit-demo-parity skill updated to match the new
prompt contract. Verifier still supports `--target` and exits non-zero on
unexpected drift.
Introduce machinery for keeping examples/integrations/* demos aligned to a
single north-star (langgraph-python). Built first so the upcoming
langgraph-js and langgraph-fastapi alignment PRs have a mechanical baseline
to work against instead of manual copy-paste.
- examples/integrations/_parity/manifest.json declares verbatim files,
tracked package.json keys, and expected agent surface (tool names,
state keys) per instance plus allowed-divergence lists.
- _parity/sync.ts copies verbatim files + rewrites tracked package.json
keys from north-star to a target instance. Dry-run supported.
- _parity/verify.ts diffs each instance vs north-star and exits non-zero
on unexpected drift. Checks verbatim content, tracked keys, canonical
prompt equality, and agent-surface grep-level presence.
- Canonical prompt at _parity/canonical/PROMPT.md — synced into each
instance's agent/PROMPT.md on parity:sync.
- Root package.json: pnpm parity:sync, parity:verify, parity:check.
- CI: .github/workflows/integrations_parity.yml runs parity:check on PRs
touching examples/integrations/**.
- Skill: .claude/skills/copilotkit-demo-parity/SKILL.md teaches agents
how to drive sync/verify and handle manual-merge zones (agent code,
api route, Dockerfile).
Does NOT touch the existing instance demos yet. Those alignment commits
follow in the same PR.
Updated JSDoc and troubleshooting docs to accurately describe that
the client-side debug prop forwards config to the AG-UI transport
layer, not CopilotKit's own logging. Removed fabricated console.debug
output examples that don't exist.
- Fix clone() dropping debug config on ProxiedCopilotRuntimeAgent
- Pass raw DebugConfig to agents instead of collapsing to boolean
- Clamp verbose to false when enabled is false
- Fix pino-pretty log format in docs (parentheses, timestamps, levels)
- Add loggedEventCount to doc example
- Fix "Agent run started/finished" → actual log messages in arch docs
Flatten all packages from packages/v1/* and packages/v2/* into packages/* —
every package now lives directly under the @copilotkit/ scope with no v1/v2
subdirectories.
- Move all v1 packages (react-core, react-ui, runtime, shared, etc.) from
packages/v1/* to packages/*
- Absorb v2 react code into packages/react-core/src/v2/ (exported via /v2 subpath)
- Absorb v2 agent code into packages/runtime/src/agent/ (exported via /v2 subpath)
- Move v2 packages (core, angular, demo-agents, etc.) to packages/*
- Replace all @copilotkitnext/* imports with @copilotkit/* equivalents
- Keep @copilotkitnext/angular as the sole exception (angular remains on next)
- Update CI workflows, renovate config, release scripts for flat structure
- No public API surface changes — all exports fields are preserved
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
Agents and subagents sometimes skip pre-commit hooks by passing
bypass flags to git commit. This adds a PreToolUse hook that blocks
those attempts, ensuring lefthook always runs.