Port a Claude Code plugin to every harness
Convert a Claude Code layout into one portable plugin for Claude Code, Codex, Gemini CLI, Copilot, Cursor, Windsurf, Pi, and OpenCode.
The detector recognizes this source when it finds .claude-plugin/plugin.json, CLAUDE.md, skills/**/SKILL.md, commands/*.md, agents/*.md, and hooks/hooks.json.
npx ap-sdk port ./my-plugin
npx ap-sdk port ./my-plugin --dry-runMapping
| Claude Code source | ap-sdk output |
|---|---|
.claude-plugin/plugin.json | plugin id, description, version, author |
CLAUDE.md | instructions |
skills/**/SKILL.md | defineSkill |
commands/*.md | defineCommand |
agents/*.md | defineSubagent |
hooks/hooks.json | defineHook |
What does not carry over
The generator only claims what src/port.ts can read: manifests, instruction files, SKILL.md skills, markdown commands, markdown agents, Claude-style hook JSON, hook script folders, and non-structural companion directories. Native hook events without a portable mapping are emitted as stop with a TODO comment so you can choose the right event. Harness-specific settings outside those files remain in your source tree but are not modeled unless you add them to the generated plugin.ts.
Next steps
npx ap-sdk check plugin.ts
npx ap-sdk build plugin.tsThen review the support matrix and install the plugin into the harnesses you use.
On this page