add-harness-package
БесплатноБез исполняемых скриптовНе проверенGuide for adding new AI SDK harness packages. Use when creating a new @ai-sdk/harness-<name> package that adapts a coding-agent runtime to HarnessV1.
от vercel★ 28 316 звёзд на GitHubОб этом скилле
Adding a New Harness Package
This guide covers creating a new @ai-sdk/harness-<name> package for an agent harness.
Before evaluating a runtime, read Harness Requirements for feasibility criteria and capability gaps to document. Follow the requirements while implementing the harness package.
A harness can be host-driven, where the runtime runs in the host process and uses the sandbox remotely, or bridge-backed, where a small bridge runs inside the sandbox because the runtime needs local access to the sandbox filesystem or process environment. Prefer host-driven when the runtime supports it.
First-Party vs Third-Party Harnesses
- Third-party packages: Any runtime can publish an external harness package.
- First-party
@ai-sdk/harness-<name>packages: Create an issue first to discuss whether the runtime belongs in this repo.
Reference Example
See https://github.com/vercel/ai/pull/16255/changes for a complete example of adding a new harness.
Harness Architecture
The AI SDK uses a layered harness architecture following the adapter pattern:
- Harness specification (
@ai-sdk/harness): Defines interfaces likeHarnessV1andHarnessV1Session - Utilities (
@ai-sdk/harness/utils): Shared code for implementing harnesses - Harness implementations (
@ai-sdk/harness-<name>): Concrete adapters for harnesses - Harness agent (
@ai-sdk/harness/agent): The high-level user-facingHarnessAgentAPI
Step-by-Step Guide
1. Create Package Structure
Create packages/harness-<name> with this baseline structure:
packages/harness-<name>/
├── src/
│ ├── index.ts
│ ├── <name>-harness.ts
│ ├── <name>-harness.test.ts
│ └── <name>-auth.ts # if the runtime needs auth resolution
├── package.json
├── tsconfig.json
├── tsdown.config.ts
├── turbo.json
├── vitest.node.config.js
└── README.md
If the runtime must execute inside the sandbox, add bridge files as well:
src/
├── <name>-bridge-protocol.ts
├── <name>-bridge-protocol.test.ts
└── bridge/
├── index.ts
├── package.json
└── pnpm-lock.yaml
Add a CHANGELOG.md containing just the package heading (# @ai-sdk/harness-<name>). Every package is required to have one.
2. Configure package.json
Use existing harness packages as the source of truth for scripts, exports, repository metadata, and publish settings.
Required package basics:
"name": "@ai-sdk/harness-<name>""type": "module""version": "0.0.0"(starting point for new packages)"license": "Apache-2.0""sideEffects": false- dependency on
@ai-sdk/harnessviaworkspace:* - dependency on
@ai-sdk/provider-utilsviaworkspace:*when using sandbox/auth/schema utilities - runtime SDK/CLI dependencies required by the harness
- dev dependencies matching existing harness packages
zodindevDependencies(and insrc/bridge/package.jsonwhen the bridge uses it) at exactly the version used inpackages/ai/package.json, never a Zod 3 version. See.agents/guidelines/zod-dependency-version.md"engines": { "node": ">=22" }
For bridge packages, ensure all bridge assets under src/bridge/ are copied into dist/bridge/ and can be read from there. Read .agents/guidelines/harness-bridge-assets.md for detailed requirements.
Bridge dependency rules (bridge-backed harnesses):
- The bridge's runtime deps live in
src/bridge/package.json(installed in-sandbox at bootstrap), not the main package.json. After changing them, regeneratesrc/bridge/pnpm-lock.yamlwithpnpm --dir packages/harness-<name>/src/bridge install --lockfile-only --ignore-workspace(runnable from the repo root). - For every third-party import in
src/bridge/, add the dependency tosrc/bridge/package.jsonso it is installed in the sandbox. tsdown automatically externalizes dependencies, peer dependencies, and optional dependencies declared by the main package; add bridge-only dependencies that are not declared there todeps.neverBundleintsdown.config.ts. A missing dependency or required exclusion may show up only at sandbox runtime as a module-resolution error. - Include packages the runtime lazily imports — e.g. provider SDKs (
@anthropic-ai/sdk,openai) resolved from the model id at runtime — insrc/bridge/package.jsoneven though nothing imports them directly. They do not need aneverBundleentry unless the bridge source imports them. These fail only when a model of that provider is actually used. - Match shared dependency versions (transport, schema, tooling, runtime SDKs) to what the other harness packages currently use — copy from a sibling package rather than choosing your own pins. Stale pins drift from security patches and can desync from the shared bridge runtime; check the current versions at creation time.
- ACP adapters built on
@ai-sdk/harness-acpwith annpm-lockedsource install theirsrc/bridge/package.jsonin place of the `harness-a
Установить add-harness-package в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл add-harness-package?
Guide for adding new AI SDK harness packages. Use when creating a new @ai-sdk/harness-<name> package that adapts a coding-agent runtime to HarnessV1.
Как установить скилл add-harness-package?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-harness-package запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic