Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Builds AI agents with the Cline SDK (@cline/sdk), covering agent runtime, sessions, custom tools, plugins, events, and LLM providers.
23% 100%+77 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 5 of 22 without it.
Our server infrastructure is currently running on Node.js v18 LTS. Will `@cline/sdk` work out-of-the-box on Node 18, or what minimum Node runtime version is required?
States that Node.js 22 or later is required.
3 of 3 safety checks passed
Consolidated skill for building AI agents with the Cline SDK. Use the decision trees below to find the right entry point and API surface, then load detailed references.
Follow these rules in all Cline SDK code:
npm install @cline/sdk. The @cline/sdk package re-exports everything from @cline/core, @cline/agents, @cline/llms, and @cline/shared.createTool() from @cline/sdk (or @cline/shared) to define tools. Tool names must be snake_case.execute functions. Throwing counts as a "mistake" against the agent's mistake limit.lifecycle: { completesRun: true } on tools that should end the agent loop (e.g. a "submit answer" tool).ClineCore, always call dispose() when done to clean up resources.Agent and ClineCore have different event systems. For Agent: use agent.subscribe() to get AgentRuntimeEvent types (text streaming is "assistant-text-delta", result text is result.outputText). For ClineCore: use cline.subscribe() to get CoreSessionEvent types (text streaming is "chunk" with payload.type === "text", result text is result.text). There is no top-level onEvent field on AgentRuntimeConfig -- use agent.subscribe() or hooks.onEvent instead. Do not use event types like "content_update" or "content_start" with agent.subscribe() -- those are internal legacy types from the ClineCore adapter layer.The two main API surfaces (Agent and ClineCore) follow a 4-file pattern. Cross-cutting concepts are single-file guides.
Each main API surface in ./references/<api>/ contains:
| File | Purpose | When to Read |
|---|---|---|
REFERENCE.md | Overview, when to use, quick start | Always read first |
api.md | Full API: classes, methods, config, types | Writing code |
patterns.md | Common patterns, best practices | Implementation guidance |
gotchas.md | Pitfalls, limitations, debugging | Troubleshooting |
Cross-cutting concepts in ./references/<concept>/ have REFERENCE.md as the entry point.
REFERENCE.md for your chosen API surfaceapi.mdpatterns.mdtools/REFERENCE.mdNext to this one in the catalogue, plus more from the same author.