
cline-sdk
Comprehensive Cline SDK skill for building AI agents. Covers the direct Agent runtime, ClineCore sessions, custom tools, plugins, events, LLM providers, scheduling, multi-agent teams, and production deployment. Use for any task involving @cline/sdk or its sub-packages.
- Installs
- 4.8K
- Last 24h
- +48
- Trending rank
- #3448
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/cline/sdk-skill --skill cline-sdk- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cline-sdk automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Cline SDK Skill
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.
Critical Rules
Follow these rules in all Cline SDK code:
- Install with
npm install @cline/sdk. The@cline/sdkpackage re-exports@cline/core, not every sub-package directly. Core re-exports the public SDK surface such asClineCore,Agent,createAgentRuntime,createTool, built-in tool helpers, provider helpers, and theLlmsnamespace. Import from@cline/agents,@cline/llms, or@cline/sharedonly when you need APIs that core does not re-export, such asAgentRuntime,createAgent, or some low-level types. - Requires Node.js 22 or later.
- Use
createTool()from@cline/sdk(or@cline/shared) to define tools. Tool names must besnake_case. - Prefer returning structured error data from tool
executefunctions when the agent can recover. DirectAgentconverts thrown tool errors into error tool results; ClineCore can also count repeated failed tool turns toward its mistake-limit handling. - Use
lifecycle: { completesRun: true }on tools that should end the agent loop (e.g. a "submit answer" tool). - When using
ClineCore, always calldispose()when done to clean up resources. - The direct
AgentandClineCorehave different event systems. ForAgent: useagent.subscribe()to getAgentRuntimeEventtypes, text streaming is"assistant-text-delta", and result text isresult.outputText. ForClineCore: usecline.subscribe()to getCoreSessionEventtypes. Render user-facing text, reasoning, and tool activity from"agent_event"payloads (content_start,content_update,content_end,done). Treat"chunk"events as raw transport chunks with{ stream, chunk, ts }, not as typed text deltas.ClineCoreresult text isresult.text. There is no top-levelonEventfield onAgentRuntimeConfig; useagent.subscribe()orhooks.onEventinstead. Do not use"content_update"or"content_start"withagent.subscribe(); those are host-facingAgentEventtypes carried inside ClineCoreagent_eventevents. - For direct
Agent,pluginsare simple runtime plugins withsetup(context)returning{ tools, hooks }. ForClineCore,extensionsareAgentPluginobjects withmanifest,setup(api, ctx), and optionalhooks. Do not use ClineCore plugin examples inside directAgent.plugins. - Plugin skills are file-based, not registered. There is no
registerSkill()and noapi.registerSkill. A plugin ships skills asSKILL.mdfiles under<package>/skills/<name>/SKILL.md(package shape required); the host discovers them and surfaces them as/slash-commandsautomatically -- do not callregisterCommandfor skills. Plugin MCP servers useapi.registerMcpServer()with the"mcp"capability. Configured agents (agent profiles) are YAML files in.cline/agents/loaded assubagent_<name>tools whenenableSpawnAgentis true.
How to Use This Skill
Reference File Structure
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.
Reading Order
- Start with
REFERENCE.mdfor your chosen API surface - Then read additional files relevant to your task:
- Writing agent code ->
api.md - Common patterns ->
patterns.md - Creating tools ->
tools/REFERENCE.md - Adding plugins/hooks ->
plugins/REFERENCE.md - Configuring LLM providers ->
providers/REFERENCE.md - Streaming events ->
events/REFERENCE.md - Deploying to production ->
production/REFERENCE.md - Scheduling agents ->
scheduling/REFERENCE.md - Multi-agent orchestration ->
multi-agent/REFERENCE.md - Debugging ->
gotchas.md
- Writing agent code ->
Example Paths
./references/agent/REFERENCE.md # Start here for lightweight agents
./references/clinecore/REFERENCE.md # Start here for full runtime
./references/agent/api.md # Agent class, config, methods
./references/tools/REFERENCE.md # Creating and using tools
./references/plugins/REFERENCE.md # Plugin system
./references/providers/REFERENCE.md # LLM provider configuration
Quick Decision Trees
"Which API surface should I use?"
Which API?
+-- I want a simple, in-memory agent with custom tools
| +-- agent/ (Agent class from @cline/agents, re-exported by @cline/sdk)
+-- I need session persistence, built-in tools, config discovery
| +-- clinecore/ (ClineCore from @cline/core)
+-- I want built-in file/shell/search/web tools
| +-- clinecore/ (has built-in tools; Agent does not)
+-- I want scheduled or recurring agents
| +-- clinecore/ (automation API)
+-- I need multi-process or multi-client session sharing
| +-- clinecore/ (hub-backed runtime)
+-- I'm building a browser-compatible agent
| +-- agent/ (no Node.js dependencies)
"I need to create tools"
Tools?
+-- Define a custom tool with schema -> tools/REFERENCE.md
+-- Use built-in tools (read_files, search_codebase, run_commands, etc.) -> tools/REFERENCE.md (built-in section)
+-- Control tool approval/policies -> tools/REFERENCE.md (policies section)
+-- Tool that ends the agent loop -> tools/REFERENCE.md (completion tools)
+-- Package tools as a reusable plugin -> plugins/REFERENCE.md
"I need to handle events"
Events?
+-- Stream text/reasoning in real time -> events/REFERENCE.md
+-- Track token usage and costs -> events/REFERENCE.md
+-- Watch tool calls -> events/REFERENCE.md
+-- Detect completion/errors -> events/REFERENCE.md
+-- Hook into lifecycle stages -> plugins/REFERENCE.md
"I need to configure a model provider"
Providers?
+-- Anthropic (Claude) -> providers/REFERENCE.md
+-- OpenAI (GPT) -> providers/REFERENCE.md
+-- Google (Gemini/Vertex) -> providers/REFERENCE.md
+-- AWS Bedrock -> providers/REFERENCE.md
+-- Mistral -> providers/REFERENCE.md
+-- OpenAI-compatible (vLLM, Together, etc.) -> providers/REFERENCE.md
+-- Custom/self-hosted provider -> providers/REFERENCE.md
"I need plugins or hooks"
Plugins?
+-- Package tools + hooks together -> plugins/REFERENCE.md
+-- Observe tool calls (logging, metrics) -> plugins/REFERENCE.md
+-- Intercept lifecycle events -> plugins/REFERENCE.md
+-- Add system prompt rules -> plugins/REFERENCE.md
+-- Expose an MCP server's tools -> plugins/REFERENCE.md (MCP servers)
+-- Bundle reusable skills (SKILL.md, auto slash commands) -> plugins/REFERENCE.md (bundled skills)
+-- Distribute via npm/git -> plugins/REFERENCE.md
"I need multi-agent coordination"
Multi-agent?
+-- Run one-off delegated sub-agents -> multi-agent/REFERENCE.md (sub-agents)
+-- Predefined named sub-agents from files -> multi-agent/REFERENCE.md (configured agents)
+-- Persistent cross-session teams -> multi-agent/REFERENCE.md (teams)
+-- Parent-child delegation -> multi-agent/REFERENCE.md (sub-agents)
+-- Peer-to-peer task board -> multi-agent/REFERENCE.md (teams)
"I need scheduling or automation"
Scheduling?
+-- Recurring cron jobs -> scheduling/REFERENCE.md
+-- One-off scheduled tasks -> scheduling/REFERENCE.md
+-- Event-driven triggers -> scheduling/REFERENCE.md
+-- CLI schedule management -> scheduling/REFERENCE.md
"I need to go to production"
Production?
+-- Error handling and status checks -> production/REFERENCE.md
+-- Cost control and token limits -> production/REFERENCE.md
+-- Observability (OpenTelemetry) -> production/REFERENCE.md
+-- Security and sandboxing -> production/REFERENCE.md
+-- Deployment patterns -> production/REFERENCE.md
Troubleshooting Index
- Agent loop not stopping ->
tools/REFERENCE.md(completion tools) - Tool errors crashing the agent ->
agent/gotchas.mdorclinecore/gotchas.md - Provider auth failures ->
providers/REFERENCE.md - Session not persisting ->
clinecore/gotchas.md - Token usage too high ->
production/REFERENCE.md(cost control) - Hub connection issues ->
clinecore/gotchas.md - Plugin not loading ->
plugins/REFERENCE.md - Events not firing ->
events/REFERENCE.md
Product Index
API Surfaces
| API | Entry File | Description |
|---|---|---|
| Agent | ./references/agent/REFERENCE.md | Lightweight in-memory agent loop |
| ClineCore | ./references/clinecore/REFERENCE.md | Full runtime with sessions, persistence, built-in tools |
Cross-Cutting Concepts
| Concept | Entry File | Description |
|---|---|---|
| Tools | ./references/tools/REFERENCE.md | Built-in and custom tool creation |
| Plugins | ./references/plugins/REFERENCE.md | Extension system with hooks, MCP servers, and bundled skills |
| Events | ./references/events/REFERENCE.md | Real-time streaming events |
| Providers | ./references/providers/REFERENCE.md | LLM provider configuration |
| Production | ./references/production/REFERENCE.md | Deployment, security, observability |
| Scheduling | ./references/scheduling/REFERENCE.md | Cron jobs and automation |
| Multi-Agent | ./references/multi-agent/REFERENCE.md | Teams, sub-agents, and configured agent profiles |
Package Map
| Package | Purpose |
|---|---|
@cline/sdk | User-facing alias for @cline/core; install this first |
@cline/core | Sessions, persistence, built-in tools, config, hub, and selected re-exports |
@cline/agents | Browser-compatible AgentRuntime class and lower-level factories |
@cline/llms | LLM provider gateway |
@cline/shared | Types, tool helpers, hook engine |
Resources
Repository: https://github.com/cline/cline SDK Source: https://github.com/cline/cline/tree/main/sdk Documentation: https://docs.cline.bot/sdk/overview Discord: https://discord.gg/cline
FAQ
What does the cline-sdk skill do?
Comprehensive Cline SDK skill for building AI agents. Covers the direct Agent runtime, ClineCore sessions, custom tools, plugins, events, LLM providers, scheduling, multi-agent teams, and production deployment. Use for any task involving @cline/sdk or its sub-packages.
How do I install cline-sdk?
Run npx skills add https://github.com/cline/sdk-skill --skill cline-sdk in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cline-sdk/ (personal) or .claude/skills/cline-sdk/ (project).
Which AI agents can use cline-sdk?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cline-sdk safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains cline-sdk?
It is published by cline in cline/sdk-skill. It has 4,765 recorded installs.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available