add-harness-package

Guides creation of new @ai-sdk/harness packages adapting coding-agent runtimes to HarnessV1.

26.5k|5.1k|Updated May 23, 2023
One-click install
npx skills add https://github.com/vercel/ai --skill add-harness-package
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-harness-package
Source: https://github.com/vercel/ai/tree/main/skills/add-harness-package
Command: npx skills add https://github.com/vercel/ai --skill add-harness-package

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new agent harness adapter to the AI SDK monorepo involves many interlocking conventions—package structure, build configs, bridge protocols, auth resolution, tests, docs, and changesets—that are easy to get wrong without a canonical checklist.

Core Features & Use Cases

  • Step-by-step scaffolding guide: Covers package structure, package.json settings, TypeScript/tsup/vitest configs, and the HarnessV1 adapter contract.
  • Bridge-backed runtime guidance: Explains bridge dependency rules, lockfile regeneration, and asset copying for runtimes that must execute inside the sandbox.
  • Validation workflow: Prescribes konsistent checks, changesets, live sandbox testing, and documentation updates before release.
  • Use Case: When adding support for a new coding-agent runtime, follow this guide to produce a compliant @ai-sdk/harness-<name> package with tests, README, examples, and docs.

Quick Start

Use the add-harness-package skill to scaffold a new @ai-sdk/harness package for my coding-agent runtime.

Frequently Asked Questions about add-harness-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new harness package to the AI SDK?▼

Create a packages/harness-<name> directory with src, package.json, tsconfig files, tsup.config.ts, and vitest.node.config.js, then implement a factory returning a HarnessV1 object. Follow the step-by-step guide covering configs, adapter implementation, tests, README, examples, and docs.

What is the difference between host-driven and bridge-backed harnesses?▼

Host-driven harnesses run the runtime in the host process and use the sandbox remotely, while bridge-backed harnesses run a small bridge inside the sandbox when the runtime needs local filesystem or process access. Host-driven is preferred when the runtime supports it.

How do I manage bridge dependencies in a harness package?▼

Bridge runtime dependencies live in src/bridge/package.json, not the main package.json. Keep imports, the tsup external array, and bridge deps in sync, and regenerate src/bridge/pnpm-lock.yaml with pnpm --dir ... install --lockfile-only --ignore-workspace.

Does a new harness package need a changeset?▼

Yes, add a changeset with pnpm changeset. For a brand-new harness package's first release, use major rather than the usual patch, matching the convention of other harness packages.

Why does getBootstrap fail with ENOENT in unit tests?▼

getBootstrap reads compiled bridge assets like dist/bridge/index.mjs, which do not exist when tests run against src. Mock node:fs/promises readFile for the bridge asset paths, following the pattern in the Codex and OpenCode harness tests.