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.
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 63 049
- Лиценз
- Не е посочен. Проверете в репозитория.
- Последна проверка на записа
- Няма посочена дата
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add cline/clineСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от 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.