@autobest-ui/agent
v1.0.30
Published
Autobest Agent skills/plugins/mcp assets + sync cli
Readme
@autobest-ui/agent
Autobest 面向 Codex 等智能体发布的 Skills、Plugins 和 MCP 服务集合。
Skills
Common Skills 对当前用户全局生效,安装到 ~/.agents/skills:
npx --yes --package=@autobest-ui/[email protected] autobest-agent-sync commonReact Skills 只对单个项目生效。在项目根目录运行,安装到该项目的 .agents/skills:
npx --yes --package=@autobest-ui/[email protected] autobest-agent-sync react也可以把项目绝对路径作为最后一个参数。完整的分类、Skill 清单和更新行为见 Skills 使用说明。
MCP
安装 Node.js 20 或更高版本后,无需在业务项目中安装依赖。直接在终端验证 MCP 时,必须同时提供对应的环境变量。
先启动 PRD Knowledge HTTP API,再验证 RAG MCP:
RAG_API_BASE_URL="http://192.168.1.12:3000/api/knowledge" \
npx --yes \
--package=@autobest-ui/[email protected] \
autobest-rag-mcp验证 Azure PR MCP:
AZURE_DEVOPS_PAT="your-personal-access-token" \
npx --yes \
--package=@autobest-ui/[email protected] \
autobest-azurepr-mcp启动 Playwright Trace 人工录制 MCP:
npx --yes --package=@autobest-ui/[email protected] playwright install chromium
BACKEND_BASE_URL="http://127.0.0.1:3001" \
MAX_RECORD_DURATION="1800000" \
npx --yes \
--package=@autobest-ui/[email protected] \
autobest-trace-mcp-recorder启动成功后,MCP 会通过 stdio 持续等待客户端请求,终端没有输出属于正常状态,可按 Ctrl+C 停止。供 Codex 长期使用时,不要只执行上述临时命令,应将完整配置加入 ~/.codex/config.toml 后重启 Codex。
同一个 npm 包暴露多个独立命令:
| 命令 | 用途 | 必需配置 |
| ------------------------------- | ------------------------------ | ------------------ |
| autobest-rag-mcp | 连接 PRD Knowledge RAG API | RAG_API_BASE_URL |
| autobest-azurepr-mcp | 读取 Azure DevOps Pull Request | AZURE_DEVOPS_PAT |
| autobest-trace-mcp-recorder | 录制并上传 Playwright Trace | BACKEND_BASE_URL |
| figma-mcp-bridge | 连接本机 Figma Plugin | 无 |
Codex 配置示例分别位于:
安装示例固定使用当前版本 1.0.19,升级时应同步更新这里的版本号。
如果 @autobest-ui 发布在私有 npm registry,使用前需要在 npm 的 .npmrc 中配置该 scope 对应的 registry 和认证信息。
Figma Plugin
Figma Plugin 与 figma-mcp-bridge 分目录维护,并通过同一个 npm 包提供两个独立命令。安装或更新到稳定目录:
npx --yes --package=@autobest-ui/[email protected] figma-plugin命令会输出 manifest.json 的稳定路径。首次安装后,在 Figma 中通过 Plugins -> Development -> Import plugin from manifest 导入该文件。详细说明见 Figma Plugin 使用说明。
卸载本地文件:
npx --yes --package=@autobest-ui/[email protected] figma-plugin uninstallCodex Plugin
Autobest Delivery 将交付闭环 Skills 和隔离的 Playwright MCP 运行器作为一个 Codex Plugin 安装。需要 Node.js 20 或更高版本,以及支持 codex plugin 命令的 Codex CLI。
安装或更新:
npx --yes --package=@autobest-ui/[email protected] autobest-delivery-setup安装器会下载固定版本的运行依赖和 Chromium,将插件持久化到 ~/.autobest-agent/marketplaces/autobest-team,注册 autobest-team 本地市场并安装 autobest-delivery。如果同名市场仍指向旧的源码仓库,安装器会自动迁移。完成后重启 Codex,并在新会话中使用插件。
卸载:
npx --yes --package=@autobest-ui/[email protected] autobest-delivery-setup uninstall安装示例固定使用当前版本 1.0.19。插件能力、运行隔离和本地开发验证见 Autobest Delivery 使用说明。
发布前本地联调
尚未发布到 npm 时,建议先生成本地 tarball,再通过 npx --package=<tarball> 调用。该方式会使用 npm 最终发布的文件清单和 bin 配置,比直接运行源码更接近发布后的真实行为。
1. 生成本地 npm 包
进入本目录并生成 tarball:
cd /Users/autobest/repo-ui/AutobestFrontendCommon/packages/agents
AGENT_TARBALL="$(npm pack --silent)"
AGENT_TARBALL_PATH="$PWD/$AGENT_TARBALL"
printf '%s\n' "$AGENT_TARBALL_PATH"后续步骤都在同一个终端中执行,以便继续使用 AGENT_TARBALL_PATH。每次修改本包代码后,需要重新执行 npm pack --silent 并更新该变量。
2. 联调 Plugin
安装或更新 Autobest Delivery:
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-delivery-setup该命令会真实修改当前用户的 Codex Plugin 配置,并把插件安装到 ~/.autobest-agent/marketplaces/autobest-team。执行完成后重启 Codex,在新会话中验证插件。
联调结束后如需卸载:
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-delivery-setup uninstall3. 联调 Skills
安装全局 Common Skills:
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-agent-sync common在需要联调的项目根目录安装 React Skills:
cd /absolute/path/to/target-project
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-agent-sync reactCommon Skills 会写入 ~/.agents/skills,React Skills 会写入目标项目的 .agents/skills。
4. 直接启动 MCP
RAG MCP:
RAG_API_BASE_URL="http://192.168.1.12:3000/api/knowledge" \
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-rag-mcpAzure PR MCP:
AZURE_DEVOPS_PAT=your-token \
npx --yes \
--package="$AGENT_TARBALL_PATH" \
autobest-azurepr-mcpFigma MCP:
npx --yes \
--package="$AGENT_TARBALL_PATH" \
figma-mcp-bridgeFigma Plugin:
npx --yes \
--package="$AGENT_TARBALL_PATH" \
figma-pluginMCP 使用 stdio 协议,启动后持续等待客户端请求属于正常行为,可按 Ctrl+C 停止。
5. 在 Codex 中联调 MCP
Codex 的启动目录不固定,因此 config.toml 中必须填写 tarball 的绝对路径,不能使用 AGENT_TARBALL_PATH 变量或相对路径。将下面的 /absolute/path/to/autobest-ui-agent-x.y.z.tgz 替换为第 1 步输出的实际路径:
[mcp_servers.rag-mcp-bridge]
command = "npx"
args = [
"--yes",
"--package=/absolute/path/to/autobest-ui-agent-x.y.z.tgz",
"autobest-rag-mcp"
]
[mcp_servers.rag-mcp-bridge.env]
RAG_API_BASE_URL = "http://192.168.1.12:3000/api/knowledge"
[mcp_servers.azurepr-mcp-bridge]
command = "npx"
args = [
"--yes",
"--package=/absolute/path/to/autobest-ui-agent-x.y.z.tgz",
"autobest-azurepr-mcp"
]
env_vars = ["AZURE_DEVOPS_PAT"]
[mcp_servers.figma-mcp-bridge]
command = "npx"
args = [
"--yes",
"--package=/absolute/path/to/autobest-ui-agent-x.y.z.tgz",
"figma-mcp-bridge"
]
startup_timeout_sec = 30
tool_timeout_sec = 120
enabled = true配置 Azure PR MCP 前,还需要在启动 Codex 的环境中设置 AZURE_DEVOPS_PAT。修改 config.toml 后重启 Codex,再从新会话调用对应 MCP 工具。重新打包后如果 tarball 文件名或路径发生变化,需要同步更新 config.toml。
本地验证
在 packages/agents 目录安装依赖后运行:
npm test