cline/cline/.agents/skills/cline-sdk/SKILL.md
cline-sdk
Comprehensive Cline SDK skill for building AI agents. Covers the 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.
- Source repository stars
- 65,609
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-04
- Source checked
- 2026-08-04
Decision brief
What it does—and where it fits
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.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/cline/cline --skill ".agents/skills/cline-sdk"Inspect the Agent Skill "cline-sdk" from https://github.com/cline/cline/blob/5ec2d47b21b3a09aa7a094bfbbe0c7e8f7ddd3fa/.agents/skills/cline-sdk/SKILL.md at commit 5ec2d47b21b3a09aa7a094bfbbe0c7e8f7ddd3fa. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
How to Use This Skill
The two main API surfaces (Agent and ClineCore) follow a 4-file pattern. Cross-cutting concepts are single-file guides.
Start with REFERENCE.md for your chosen API surfaceThen read additional files relevant to your task:Writing agent code - api.md - 02
Critical Rules
Follow these rules in all Cline SDK code:
Install with npm install @cline/sdk. The @cline/sdk package re-exports everything from @cline/core, @cline/agents, @cline/llms, and @cline/shared.Requires Node.js 22 or later.Use createTool() from @cline/sdk (or @cline/shared) to define tools. Tool names must be snakecase. - 03
Reference File Structure
The two main API surfaces (Agent and ClineCore) follow a 4-file pattern. Cross-cutting concepts are single-file guides.
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// contains:Cross-cutting concepts in ./references// have REFERENCE.md as the entry point. - 04
Reading Order
1. Start with REFERENCE.md for your chosen API surface 2. 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 provide…
Start with REFERENCE.md for your chosen API surfaceThen read additional files relevant to your task:Writing agent code - api.md - 05
Example Paths
Review the “Example Paths” section in the pinned source before continuing.
Review and apply the “Example Paths” source section.
Permission review
Static risk signals and limitations
Network access
The documentation includes network, browsing, or remote request actions.
-- I want built-in file/shell/search/web toolsEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 65,609 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- cline/cline
- Skill path
- .agents/skills/cline-sdk/SKILL.md
- Commit
- 5ec2d47b21b3a09aa7a094bfbbe0c7e8f7ddd3fa
- License
- Apache-2.0
- Collected
- 2026-08-04
- Default branch
- main
View the original SKILL.md
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 everything from@cline/core,@cline/agents,@cline/llms, and@cline/shared. - Requires Node.js 22 or later.
- Use
createTool()from@cline/sdk(or@cline/shared) to define tools. Tool names must besnake_case. - Return errors as structured data from tool
executefunctions. Throwing counts as a "mistake" against the agent's mistake limit. - 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 standalone
AgentandClineCorehave different event systems. ForAgent: useagent.subscribe()to getAgentRuntimeEventtypes (text streaming is"assistant-text-delta", result text isresult.outputText). ForClineCore: usecline.subscribe()to getCoreSessionEventtypes (text streaming is"chunk"withpayload.type === "text", result text isresult.text). There is no top-levelonEventfield onAgentRuntimeConfig-- useagent.subscribe()orhooks.onEventinstead. Do not use event types like"content_update"or"content_start"withagent.subscribe()-- those are internal legacy types from the ClineCore adapter layer.
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, stateless agent with custom tools
| +-- agent/ (Agent class from @cline/agents)
+-- 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 (bash, editor, read_files) -> 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
+-- Distribute via npm/git -> plugins/REFERENCE.md
"I need multi-agent coordination"
Multi-agent?
+-- Spawn one-off background agents -> multi-agent/REFERENCE.md (sub-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 stateless 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 |
| 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 and sub-agents |
Package Map
| Package | Purpose |
|---|---|
@cline/sdk | Everything you need, install this one |
@cline/core | Sessions, persistence, built-in tools, config, hub |
@cline/agents | Stateless agent loop, tool orchestration, streaming |
@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
Alternatives
Compare before choosing
teng-lin/notebooklm-py
notebooklm
Complete API for Google NotebookLM - full programmatic access including features not in the web UI. Create notebooks, add sources, generate all artifact types, download in multiple formats. Activates on explicit /notebooklm or intent like "create a podcast about X"
TencentCloudBase/CloudBase-AI-Toolkit
cloudbase-agent-python
Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming + OpenAI-compatible endpoints, add tools (bash, filesystem, MCP, code execution), memory (in-memory, TDAI, MySQL, MongoDB), observability (OpenTelemetry/Langfuse), and middleware (auth, logging). Use this skill when the user wants to create an AI agent server, build a chatbot backend, set up human-in-the-loop workflow
affaan-m/ECC
mle-workflow
Production machine-learning engineering workflow for data contracts, reproducible training, model evaluation, deployment, monitoring, and rollback. Use when building, reviewing, or hardening ML systems beyond one-off notebooks.
K-Dense-AI/scientific-agent-skills
simpy
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.