Agent Skillsfanfan-de/anybox › anybox-plugin-development

anybox-plugin-development

GitHub

用于创建、审查和验证 Anybox 第三方插件包。涵盖编写 plugin.json 清单、配置 MCP 服务与 Connector、定义 Skill,以及调试插件安装与目录发现问题。

plugins/Anybox-Plugins/anybox-plugin-development/skills/anybox-plugin-development/SKILL.md fanfan-de/anybox

Trigger Scenarios

用户要求创建或转换 Anybox 插件 需要编写或校验 plugin.json 配置文件 调试插件安装失败或目录识别异常

Install

npx skills add fanfan-de/anybox --skill anybox-plugin-development -g -y
More Options

Non-standard path

npx skills add https://github.com/fanfan-de/anybox/tree/master/plugins/Anybox-Plugins/anybox-plugin-development/skills/anybox-plugin-development -g -y

Use without installing

npx skills use fanfan-de/anybox@anybox-plugin-development

指定 Agent (Claude Code)

npx skills add fanfan-de/anybox --skill anybox-plugin-development -a claude-code -g -y

安装 repo 全部 skill

npx skills add fanfan-de/anybox --all -g -y

预览 repo 内 skill

npx skills add fanfan-de/anybox --list

SKILL.md

Frontmatter
{
    "name": "anybox-plugin-development",
    "description": "创建、审查或验证 Anybox 第三方插件包。Use when the user asks to make a plugin, convert an API\/SaaS\/local tool into an installable plugin, write plugin.json, add plugin MCP servers, add bundled plugin skills, define plugin-owned connectors with API key or OAuth credentials, package plugin metadata, or debug plugin catalog\/install\/diagnostic failures."
}

Anybox 插件开发

使用这个 skill 来为当前仓库的插件运行时创建插件包。遇到文档和代码不一致时,以运行代码为准。

参考来源:

  • 随包完整指南:../../docs/anybox-third-party-plugin-development.md
  • 在源码仓库内调试时,以 packages/anyboxagent/src/plugin/plugin.ts 为运行时事实来源。
  • 在源码仓库内修改插件系统代码后,参考 packages/anyboxagent/Test/plugin.test.ts

工作流

  1. 明确插件能力:MCP 工具、随包 skill、插件自带 connector,或平台 connector requirement。
  2. 选择插件包结构。默认使用 Codex-like 展开目录。
  3. 编写 .anybox-plugin/plugin.json,必须是严格 JSON,只使用运行时支持的顶层字段。
  4. 在插件根目录添加运行文件,例如 skills/connectors/scripts/docs/assets/
  5. 使用 Plugin.listCatalog() 验证 catalog 能发现插件。
  6. 更新内置仓库时运行 pnpm plugins:index,不要手改或把它当成正式生产目录。
  7. 如果修改了插件系统或分发代码,运行 pnpm plugins:release:testbun test Test/plugin.test.ts

插件包结构

新插件默认使用这个结构:

<install-root>/
  <plugin-id>/
    .anybox-plugin/
      plugin.json
    skills/
      <skill-name>/
        SKILL.md
    connectors/
    scripts/
    docs/
    assets/

注意:

  • <install-root> 是包含一个或多个插件包目录的父目录;开发新插件时优先把它作为 ANYBOX_PLUGIN_LOCAL_DIR
  • 当前运行时用 ANYBOX_PLUGIN_LOCAL_DIR 发现固定本地插件仓库,未设置时默认是 Agent data 目录下的 plugins/local。这个目录逻辑上等价于 GitHub 插件仓库,只提供可安装候选项,不受卸载流程删除。
  • ANYBOX_PLUGIN_INSTALL_DIR 是受管理安装根目录,用于网络下载或从本地仓库安装时复制出来的插件包。这里的插件逻辑上属于已安装插件,运行时使用这里的副本,卸载时可能删除对应插件包。
  • 新包和正式 Release 只使用 .anybox-plugin/plugin.json;根目录 plugin.json.codex-plugin/plugin.json 仅作为手动导入兼容入口。
  • skillsconnectorsscriptsdocsassets 应放在插件根目录。
  • 插件 ID 使用稳定的小写名称。目录名和 manifest name 尽量保持一致。
  • 如果确实需要多个版本并存,也可以使用 <plugin-id>/<version>/.anybox-plugin/plugin.json,运行时会选择最高版本。

Manifest 规则

最小 manifest:

{
  "name": "my-plugin",
  "version": "0.1.0",
  "description": "My first Anybox plugin."
}

支持的顶层字段包括:

  • nameversiondescription
  • authorhomepagerepositorylicensekeywords
  • interface
  • mcpServers
  • skills
  • connectorRequirements
  • connectors
  • apps,仅用于旧兼容
  • commandsagents,当前是保留字段
  • skillPreviews 可用于仓库 manifest 的市场预览;源 manifest 不提交 package,正式 ZIP 元数据由 Release 打包器生成。
  • 内置仓库的 index.json 是自动生成的开发清单,不是桌面生产目录。正式桌面从同版本 GitHub Release 动态拉取 v2 目录,且只允许该 Release 的 ZIP。

未知顶层字段会被拒绝。

使用 interface 配置 catalog 展示信息:

{
  "interface": {
    "displayName": "Hello Anybox",
    "shortDescription": "A minimal plugin for learning plugin development.",
    "longDescription": "This plugin demonstrates a local stdio MCP server and a bundled Agent skill.",
    "developerName": "Your Name",
    "category": "Automation",
    "capabilities": ["demo", "mcp"],
    "logo": "HA",
    "brandColor": "#2563EB"
  }
}

优先使用已知 catalog 分类:CodeBrowserGitDatabaseDocsAutomationDesign

能力模式

不需要独立连接状态或凭据生命周期的工具,使用 mcpServers

{
  "mcpServers": [
    {
      "id": "hello",
      "name": "Hello Anybox",
      "risk": "low",
      "permissions": ["Starts a local Node.js MCP server bundled with this plugin."],
      "tools": [
        {
          "name": "hello_echo",
          "title": "Echo Text",
          "description": "Echo text back to the user.",
          "readOnly": true
        }
      ],
      "runtime": {
        "transport": "stdio",
        "command": "node",
        "args": ["${PLUGIN_ROOT}/scripts/server.js"],
        "cwd": "${PLUGIN_ROOT}",
        "timeoutMs": 10000
      }
    }
  ]
}

插件需要给 Agent 提供说明时,使用 skills

{
  "skills": "skills"
}

声明的 skill root 下,每个直接子目录都必须包含 SKILL.md。例如 skills/review/SKILL.md 会生成 plugin:<plugin-id>:review

插件需要自带 API key 或 OAuth 状态时,使用 connectors

{
  "connectors": [
    {
      "id": "weather",
      "name": "Weather",
      "risk": "medium",
      "permissions": ["Sends requests to api.weather.example."],
      "credential": {
        "kind": "api_key",
        "key": "WEATHER_API_KEY",
        "label": "Weather API key",
        "type": "password",
        "required": true,
        "secret": true
      },
      "runtime": {
        "transport": "stdio",
        "command": "node",
        "args": ["${PLUGIN_ROOT}/connectors/weather/server.js"],
        "cwd": "${PLUGIN_ROOT}",
        "env": {
          "WEATHER_API_KEY": "${WEATHER_API_KEY}"
        }
      },
      "tools": [
        {
          "name": "weather_current",
          "title": "Current Weather",
          "description": "Read current weather for a city.",
          "readOnly": true
        }
      ]
    }
  ]
}

插件要复用平台已有能力时,使用 connectorRequirements,例如 browser、GitHub 或 workspace files。

Runtime 规则

  • 所有 ${PLUGIN_ROOT} 路径都必须留在插件包内部。
  • stdio MCP server 的普通日志写 stderr。stdout 只能输出 JSON-RPC 消息。
  • 本地 MCP server 必须响应 initializetools/listtools/call
  • 只读工具标记 readOnly: true,破坏性操作标记 destructive: true
  • risk 使用 lowmediumhigh;不要使用 critical,除非插件安装应该被阻止。
  • 不要提交 API key、OAuth client secret、access token、refresh token、本地 auth store、数据库或缓存目录。

验证

对候选插件来源根目录运行:

cd C:\Projects\anybox\packages\anyboxagent
$env:ANYBOX_PLUGIN_LOCAL_DIR = "C:\path\to\plugin-source-root"
$env:ANYBOX_PLUGIN_REGISTRY_INDEX_URL = "off"
bun -e "import * as Plugin from './src/plugin/plugin.ts'; console.log(JSON.stringify(await Plugin.listCatalog(), null, 2))"

确认输出里包含插件 ID、生成的 MCP server ID、connector-backed MCP server ID 和随包 skill ID。

修改插件系统运行时代码后运行:

cd C:\Projects\anybox
pnpm plugins:index:check
pnpm plugins:release:test

cd C:\Projects\anybox\packages\anyboxagent
bun test Test/plugin.test.ts

常见失败

  • 插件没有出现在 catalog:检查 ANYBOX_PLUGIN_LOCAL_DIR、目录结构、JSON 合法性、支持的顶层字段,以及必填的 nameversiondescription。只有验证下载/安装根目录时才检查 ANYBOX_PLUGIN_INSTALL_DIR
  • PLUGIN_CONFIG_INVALID:检查必填 configFields 或 OAuth client 设置。
  • 诊断没有发现工具:检查命令是否可执行、runtime 路径、cwd、JSON-RPC 方法处理,以及 stdout 是否混入普通日志。
  • Connector 未连接:API key connector 需要保存 key;OAuth connector 需要完成浏览器授权。
  • 卸载时源码被删:开发时使用 ANYBOX_PLUGIN_LOCAL_DIR。不要直接把 Git 源码根目录当成 ANYBOX_PLUGIN_INSTALL_DIR;如果必须验证受管理安装根,复制或构建到 dev-install 目录。

Version History

  • 0dc79c3 Current 2026-07-31 12:08

    重构应用架构并移除过时代码;新增pnpm plugins:index命令用于更新内置仓库索引,禁止手动修改;简化工作流测试步骤,移除对pnpm plugins:release:test的强制要求;明确仅读取.plugin/plugin.json作为manifest入口。

  • 08dc189 2026-07-05 18:54

Same Skill Collection

.agents/skills/anybox-frontend-guidelines/SKILL.md
.agents/skills/anybox-mobile-release/SKILL.md
.agents/skills/anybox-plugin/SKILL.md
.agents/skills/deploy-anybox-tencent-docker-windows/SKILL.md
.agents/skills/deploy-anybox-tencent-server/SKILL.md
.agents/skills/fanfande-frontend-style/SKILL.md
.agents/skills/fanfande-plugin-structure/SKILL.md
.agents/skills/frontend-ui-style-kit/SKILL.md
.agents/skills/obsidian-like/SKILL.md
.agents/skills/pdf/SKILL.md
.agents/skills/transcribe/SKILL.md
.agents/skills/zhihu-md-publisher/SKILL.md
.anybox/skills/anybox-plugin-development/SKILL.md
.anybox/skills/anybox-start-dev/SKILL.md
packages/chrome-plugin/runtime/skills/chrome/SKILL.md
plugins/Anybox-Plugins/atlassian-rovo/skills/capture-tasks-from-meeting-notes/SKILL.md
plugins/Anybox-Plugins/atlassian-rovo/skills/generate-status-report/SKILL.md
plugins/Anybox-Plugins/box/skills/box/SKILL.md
plugins/Anybox-Plugins/browser/skills/browser/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-app-intents/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-debugger-agent/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-ettrace-performance/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-memgraph-leaks/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-simulator-browser/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-liquid-glass/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-performance-audit/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-ui-patterns/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-view-refactor/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/appkit-interop/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/build-run-debug/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/liquid-glass/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/packaging-notarization/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/signing-entitlements/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/swiftpm-macos/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/swiftui-patterns/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/telemetry/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/test-triage/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/view-refactor/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/window-management/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/frontend-app-builder/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/frontend-testing-debugging/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/react-best-practices/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/shadcn-best-practices/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/supabase-best-practices/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-branded-presentation/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-resize-for-all-social-media/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-translate-design/SKILL.md
plugins/Anybox-Plugins/chrome/skills/chrome/SKILL.md
plugins/Anybox-Plugins/cinema/skills/initialize-cinema-project/SKILL.md

Metadata

Files
0
Version
b621dd3
Hash
4089d30b
Indexed
2026-07-05 18:54

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 05:04
浙ICP备14020137号-1 $방문자$