# Set up with a coding agent

> The agent-driven setup path: npx copilotkit@latest channels setup, the hosted channels-guide.md workflow, installing setup-slack-channel via the CLI instead of vendoring it, and how this repository's canonical .agents/skills layout and .claude symlink keep the build-channels-agent skill authoritative.

- Repository: CopilotKit/channels-sdk
- GitHub: https://github.com/CopilotKit/channels-sdk
- Human docs: https://grok-wiki.com/public/docs/copilotkit-channels-sdk-4c947e3e6161
- Complete Markdown: https://grok-wiki.com/public/docs/copilotkit-channels-sdk-4c947e3e6161/llms-full.txt

## Source Files

- `README.md`
- `AGENTS.md`
- `.agents/skills/build-channels-agent/SKILL.md`
- `.agents/skills/build-channels-agent/evals/evals.json`

---

---
title: "Set up with a coding agent"
description: "The agent-driven setup path: npx copilotkit@latest channels setup, the hosted channels-guide.md workflow, installing setup-slack-channel via the CLI instead of vendoring it, and how this repository's canonical .agents/skills layout and .claude symlink keep the build-channels-agent skill authoritative."
---

`npx copilotkit@latest channels setup` is the fastest path to a working Channel: it installs the `channels-setup` skill, prints a prompt, and copies that prompt to your clipboard for you to paste into your coding agent. The installed skill is a pointer, not a workflow — it fetches the actual steps from `https://copilotkit.ai/channels-guide.md` when the agent needs them, so the instructions stay current even if the skill on disk is months old. Building a Channels agent spans a project, an agent, a managed Channel, a provider app, and a long-running runtime; the hosted guide walks the agent through all of it.

## Run the guided setup

<Steps>
<Step title="Install the pointer skill">

```sh
npx copilotkit@latest channels setup
```

Keep the `@latest`. A bare `copilotkit` resolves to whatever is already on PATH or in the npx cache, and an older CLI fails with `Unknown option '--skill'` on related subcommands.

</Step>
<Step title="Paste the prompt into your coding agent">

The command copies the prompt to your clipboard. Its content is:

```text
Read https://copilotkit.ai/channels-guide.md and help the user build their first channel
```

</Step>
<Step title="Answer the guide's two questions">

The hosted guide asks which platform you want — Slack or Microsoft Teams — and which agent framework. It then covers the same setup as the manual quickstart, plus the provider-console and verification steps.

</Step>
<Step title="Let the agent drive the consoles">

Your agent operates the Slack and Intelligence consoles itself, in your own signed-in browser session. If the agent has no browser or computer-use tool yet, it asks you to add one first — that is the intended path, not a fallback. You type the secrets; the agent does the clicking.

</Step>
</Steps>

<Note>
Microsoft Teams setup, and any setup question the Slack skill does not cover, goes through this hosted guide. It is fetched on demand, so prefer it over a remembered sequence of steps.
</Note>

## Install the Slack setup skill on disk

To skip the hosted guide and put the Slack workflow directly into the coding agent you are already running in:

```sh
npx copilotkit@latest skills install --skill setup-slack-channel -y
```

<ParamField body="--skill setup-slack-channel" type="string">
Installs that one skill. `setup-slack-channel` covers the provider half of Slack setup: creating the Slack app, the managed Intelligence Channel, the local runtime, and diagnosing a Channel stuck at `setup_required` or a mention that gets no reply.
</ParamField>

<ParamField body="-y" type="flag">
Installs the named skill without opening an interactive picker.
</ParamField>

Omit `--skill` to install every CopilotKit skill:

```sh
npx copilotkit@latest skills install
```

The skill is scoped to Slack — for Microsoft Teams, use the hosted guide above.

### What the CLI covers versus the browser

The CLI handles the Intelligence side; the provider side stays in the browser, in your session.

| Surface | Operations |
| --- | --- |
| CLI | `copilotkit channels add --adapter slack` declares the Channel and attaches the adapter; `copilotkit channels status` compares your configuration, your code, and the server |
| Browser | Creating the Slack app, installing it into a workspace, issuing the project API key |

No CLI flag accepts a credential value, so the bot token and signing secret stay in your `.env` and with you.

## Why setup-slack-channel is installed, not vendored

`setup-slack-channel` lives in `CopilotKit/CopilotKit` and is delivered by the CLI. This repository does not carry a copy, and `AGENTS.md` instructs agents never to add one.

The rule comes from a concrete failure. This repository previously vendored the skill under `.agents/skills/setup-slack-channel/`. That copy fell roughly 16 KB behind its upstream across all eight files and ended up asserting the opposite of the truth about Slack interactivity — that enabling it does not make buttons work, when disabling it is what breaks human-in-the-loop. Nothing enforced the match, and `skills install` writes into that same path, so following the README overwrote eight tracked files. One home, fetched on demand, is why that cannot recur.

`.gitignore` now enforces the boundary — paths that `skills install` writes are untracked:

```gitignore
# Skills fetched from the CopilotKit registry, not owned here (see AGENTS.md).
/.agents/skills/setup-slack-channel/
/agent/
/skills-lock.json
```

## The canonical skill layout

The repository ships exactly one skill it owns: `build-channels-agent`. `AGENTS.md` designates it the authority on the Channels SDK API — the API is recent and easy to get wrong from memory, so agents are told to ground code in the skill rather than in recalled patterns.

:::files
repo/
├── AGENTS.md                          # skill ownership rules for agents
├── .agents/
│   └── skills/
│       └── build-channels-agent/      # canonical home — edit here
│           ├── SKILL.md               # the API authority
│           ├── references/
│           │   ├── adapter-authoring.md
│           │   ├── hitl-patterns.md
│           │   └── ui-components.md
│           └── evals/
│               └── evals.json         # 8 evals guarding the API surface
└── .claude/
    └── skills/
        └── build-channels-agent -> ../../.agents/skills/build-channels-agent
:::

`.claude/skills/` mirrors the canonical layout for Claude Code, which discovers skills there. `.claude/skills/build-channels-agent` is a symlink to the canonical copy under `.agents/skills/` — edit the canonical file, never the link, so the two cannot drift apart.

### What the skill guarantees

`build-channels-agent/SKILL.md` states that every code sample in it compiles: the samples were transcribed into one project and typechecked under `strict` against both `@copilotkit/channels@0.7.1` + `@copilotkit/runtime@1.66.1` and the `0.6.1` + `1.65.0` pair, with zero errors on both. The `evals/evals.json` file defines eight scenario evals that pin the correct API surface — for example, that generated code uses `createChannel`/`defineChannelTool` rather than the `Bot`-prefixed names that exist nowhere in the shipped packages, defaults to the managed path when the developer does not hold Slack tokens, and gates startup on `status().overall === "online"` instead of trusting `ready()` alone.

### Division of labor between the two skills

| Skill | Home | Covers |
| --- | --- | --- |
| `build-channels-agent` | This repository, `.agents/skills/` | Writing the code: `createChannel`, handlers, tools, slash commands, JSX message UI, modals, human-in-the-loop, the runtime wiring that starts a Channel |
| `setup-slack-channel` | `CopilotKit/CopilotKit`, installed via CLI | The provider half: Slack app creation, the managed Intelligence Channel, the local runtime, and diagnosing `setup_required`, Waiting for runtime, or a silent mention |

## Troubleshooting

<AccordionGroup>
<Accordion title="Unknown option '--skill'">

An older `copilotkit` — globally installed or left in the npx cache — is shadowing the current CLI. Keep the `@latest` in the command; that is what forces npx to fetch the current version instead of reusing what it already has.

</Accordion>
<Accordion title="The agent has no browser tool">

The hosted guide expects the agent to drive the Slack and Intelligence consoles in your signed-in session. An agent without a browser or computer-use tool will ask you to add one before continuing — add the tool rather than falling back to copying steps by hand.

</Accordion>
</AccordionGroup>

## Related pages

<CardGroup>
<Card title="Quickstart" href="/quickstart">
The same setup done by hand: create the Channel, write the listener, set the environment variables, and verify `status().overall === "online"`.
</Card>
<Card title="Installation" href="/installation">
The package pair, ESM requirement, `@ag-ui/client` overrides pin, and tsconfig the generated code depends on.
</Card>
<Card title="Managed Channels vs direct adapters" href="/managed-vs-direct">
Why the setup path defaults to a managed Channel, and why switching to a direct adapter to escape `setup_required` is a known failure mode.
</Card>
<Card title="Troubleshooting" href="/troubleshooting">
The stale-CLI error, `setup_required`, Waiting for runtime, and the other documented failure modes with fixes.
</Card>
</CardGroup>
