@a2f0/agent-tool

中文文档
0.1.53发布于 2026/11/07UNLICENSEDES Module构建来源已验证近 30 天下载 1.3万

Portable cross-agent review, PR workflows, and shared skills

原始使用文档
文档目录4 节
  1. Quick start
  2. Normal usage
  3. Development
  4. Documentation

agent-tool

agent-tool is a command-line tool and a set of portable skills for repositories where Claude Code, Codex, OpenCode, or Hermes make the changes. It provides shared Git, GitHub, review, validation, and release workflows: independent agent reviews of a committed branch, guarded pushes and squash merges of the exact reviewed commit, package versioning, brand image rendering, screenshot staging with a framework-free gallery, and compact output for noisy commands. Repository policy stays in agent-tool.json; the portable skills coordinate independently reviewed changes.

Quick start

Install Bun 1.3.11 or newer and Git, then in the project that will use agent-tool:

bun add --dev --exact @a2f0/agent-tool
bun run agent-tool init
bun run agent-tool skills install --apply
bun run agent-tool doctor

Restart the agent harness after installing skills if its discovery cache needs refreshing.

The npm package ships source and embedded skills with no install script. Bun runs the executable, so npm projects also need Bun on PATH:

npm install --save-dev --save-exact @a2f0/agent-tool

Version preparation needs Bun 1.4 or newer. GitHub operations require an authenticated gh supporting pr checks --json, and independent reviews require an authenticated Claude Code, Codex, or OpenCode CLI. A compiled standalone executable needs no Bun or Node at runtime.

Add "agent-tool": "agent-tool" to package scripts, or invoke node_modules/.bin/agent-tool directly. Use the direct executable for an empty positional argument. Global --repo <directory> and --config <file> select a checkout and explicit policy file.

Normal usage

agent-tool branch create chore/maintenance --base main --remote origin
agent-tool repo context
agent-tool bun test --log
agent-tool review claude
agent-tool branch push <reviewed-head> --remote origin
agent-tool pr open 'chore: maintain repository' --body-file /tmp/pr-body.txt
agent-tool pr checks --wait --head <reviewed-head>
agent-tool pr preflight <reviewed-head> <base-branch> <reviewed-base>
agent-tool pr merge 'chore: maintain repository' <reviewed-head> <base-branch>

The bundled ship-pr skill runs the full validation, versioning, independent review, feedback, merge, cleanup, and deployment workflow from your agent harness. The CLI reference explains what a review result means, and shared workflows describes each repository command's contract.

Development

To work on agent-tool itself, install mise, then run from a clone:

mise install
bun install --frozen-lockfile
bun src/index.ts --help
bun test --parallel=2

Development covers the source layout, the full validation suite, and release procedures.

Documentation

  • Shared workflows: branches, commit trust, copied hooks, PR checks/threads, cleanup, CI aggregate gates, release verification, durable validation receipts, and toolchain/protection diagnostics.
  • CLI reference: existing review, version, skill installation, command capture, import-graph checks, configuration, and distribution contracts.
  • Development: setup, source layout, validation, and release procedures for this package.
  • Images: declarative brand sources and generated outputs.
  • Screenshots: staging captured screenshots into a website, and the gallery and carousel web components that show them.
  • Permissions: which commands run without approval in Claude Code and Codex, and the dependency commands that enforce it.
  • Dependency maintenance: active compatibility constraints and the dependency-update workflow.
  • Design and extraction history: component boundaries, origins, and explicit implementation limits.

The tool does not execute repository JavaScript as policy, bypass Git hooks for shipping mutations, discard local edits, or silently weaken required CI checks. Project builds, tests, deployment previews, health checks, and specialized checks remain repository commands.

版本与发布记录

@a2f0/agent-tool 共发布 53 个版本,首次发布于 2026/10/05;过去 12 个月发布了 53 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.53latest2026/11/07今天
0.1.522026/11/07今天
0.1.512026/11/071 天前
0.1.502026/11/061 天前
0.1.492026/11/061 天前
0.1.482026/11/061 天前

关于 @a2f0/agent-tool 的常见问题

@a2f0/agent-tool 是什么?

Portable cross-agent review, PR workflows, and shared skills

如何安装 @a2f0/agent-tool?

在项目目录运行 npm install @a2f0/agent-tool,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 agent-tool,可以用 npx agent-tool 直接运行。

@a2f0/agent-tool 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/a2f0__agent-tool 是否存在。

@a2f0/agent-tool 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@a2f0/agent-tool 可以商用吗?

@a2f0/agent-tool 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@a2f0/agent-tool 的下载量有多少?

根据 npm 官方下载统计,@a2f0/agent-tool 在 2026/10/05 – 2026/11/03 这 30 天内被下载 12,525 次,日均约 418 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@a2f0/agent-tool 还在维护吗?

最新版本 0.1.53 发布于 2026/11/07(今天);至今共发布 53 个版本,其中过去 12 个月发布了 53 个;首次发布于 2026/10/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。