跳到正文
cccskills
免费在 GitHub 公开

cline-sdk

Build AI agents with Cline SDK using guidance on choosing APIs, adding custom tools, saving sessions, and handling live events. References also cover model providers, scheduled runs, multi-agent coordination, and production deployment.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

集成工具DiscordOpenAI
查看安装方法

适用场景

  • Build an AI agent with custom tools
  • Choose an API for persistent sessions
  • Configure model providers and live event handling
  • Plan scheduled runs and multi-agent coordination
  • Review deployment, cost control, and operational guidance

包含的文件(16)

  • SKILL.md8.6 KB
  • references/agent/api.md5.1 KB
  • references/agent/gotchas.md4.3 KB
  • references/agent/patterns.md5.6 KB
  • references/agent/REFERENCE.md3.5 KB
  • references/clinecore/api.md6.9 KB
  • references/clinecore/gotchas.md4.9 KB
  • references/clinecore/patterns.md6.0 KB
  • references/clinecore/REFERENCE.md4.3 KB
  • references/events/REFERENCE.md7.6 KB
  • references/multi-agent/REFERENCE.md4.2 KB
  • references/plugins/REFERENCE.md22.8 KB
  • references/production/REFERENCE.md5.4 KB
  • references/providers/REFERENCE.md5.3 KB
  • references/scheduling/REFERENCE.md5.0 KB
  • references/tools/REFERENCE.md7.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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:

  1. Install with npm install @cline/sdk. The @cline/sdk package re-exports everything from @cline/core, @cline/agents, @cline/llms, and @cline/shared.
  2. Requires Node.js 22 or later.
  3. Use createTool() from @cline/sdk (or @cline/shared) to define tools. Tool names must be snake_case.
  4. Return errors as structured data from tool execute functions. Throwing counts as a "mistake" against the agent's mistake limit.
  5. Use lifecycle: { completesRun: true } on tools that should end the agent loop (e.g. a "submit answer" tool).
  6. When using ClineCore, always call dispose() when done to clean up resources.
  7. The standalone 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.

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:

FilePurposeWhen to Read
REFERENCE.mdOverview, when to use, quick startAlways read first
api.mdFull API: classes, methods, config, typesWriting code
patterns.mdCommon patterns, best practicesImplementation guidance
gotchas.mdPitfalls, limitations, debuggingTroubleshooting

Cross-cutting concepts in ./references/<concept>/ have REFERENCE.md as the entry point.

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 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

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.md or clinecore/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

APIEntry FileDescription
Agent./references/agent/REFERENCE.mdLightweight stateless agent loop
ClineCore./references/clinecore/REFERENCE.mdFull runtime with sessions, persistence, built-in tools

Cross-Cutting Concepts

ConceptEntry FileDescription
Tools./references/tools/REFERENCE.mdBuilt-in and custom tool creation
Plugins./references/plugins/REFERENCE.mdExtension system with hooks
Events./references/events/REFERENCE.mdReal-time streaming events
Providers./references/providers/REFERENCE.mdLLM provider configuration
Production./references/production/REFERENCE.mdDeployment, security, observability
Scheduling./references/scheduling/REFERENCE.mdCron jobs and automation
Multi-Agent./references/multi-agent/REFERENCE.mdTeams and sub-agents

Package Map

PackagePurpose
@cline/sdkEverything you need, install this one
@cline/coreSessions, persistence, built-in tools, config, hub
@cline/agentsStateless agent loop, tool orchestration, streaming
@cline/llmsLLM provider gateway
@cline/sharedTypes, 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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Create a GitHub pull request that follows the project's template. Review commits and changed files, gather issue and testing details, check branch readiness, and use the GitHub CLI to submit a regular or draft request.

中文简介正在准备中。当前显示英语简介。

  • Submitting completed changes for review
  • Writing a PR description from commits
  • Creating a draft pull request
cline/cline7.1万2026年10月18日 更新

Prepare a one-time What's new dialog for the desktop app when several meaningful features have accumulated. The skill selects changelog highlights, drafts concise copy, updates the content file, and guides testing and in-app previews.

中文简介正在准备中。当前显示英语简介。

  • Decide whether accumulated features warrant an announcement
  • Draft concise copy for three or four feature highlights
  • Add a new What's new content entry
cline/cline7.1万2026年10月18日 更新

opentui

免费

Build interactive terminal screens with OpenTUI using its core API, React, or Solid. Guides framework selection, components, layout, keyboard input, animations, and testing, with references for project setup and troubleshooting.

中文简介正在准备中。当前显示英语简介。

  • Starting an OpenTUI project with React or Solid
  • Building terminal forms and selection menus
  • Adapting layouts to terminal dimensions
cline/cline7.1万2026年10月18日 更新

Prepare Cline CLI releases for npm, the package registry, by reviewing SDK changes, drafting release notes, updating versions and changelogs, and creating release tags. Guides checks and publication through GitHub Actions or an authenticated local machine.

中文简介正在准备中。当前显示英语简介。

  • Drafting CLI release notes from relevant changes
  • Updating the CLI version and changelog
  • Publishing a tagged release through GitHub Actions
cline/cline7.1万2026年10月18日 更新

Prepare Cline desktop releases for stable, beta, or nightly testing. Coordinate release notes, matching version files, tags, and a GitHub Actions workflow that builds signed installers and manages automatic update feeds for release channels.

中文简介正在准备中。当前显示英语简介。

  • Preparing a stable desktop release
  • Publishing a beta alongside the stable app
  • Creating signed nightly test installers
cline/cline7.1万2026年10月18日 更新

Prepare and publish releases of the Cline VS Code extension. Follow separate paths for stable, nightly, and emergency legacy releases, covering version selection, release notes, approval steps, packaged builds, and checks after publication.

中文简介正在准备中。当前显示英语简介。

  • Preparing a stable extension release
  • Creating a manual nightly build
  • Publishing an emergency legacy hotfix
cline/cline7.1万2026年10月18日 更新

查看 cline 的全部技能

报告此技能的问题