@defrex/autobuild

中文文档
1.6.0发布于 2026/11/12Apache-2.0TypeScriptES Module近 30 天下载 7456

Agent-driven software delivery from groomed ticket to merged PR

原始使用文档
文档目录9 节
  1. Quickstart
  2. How it works
  3. Work tickets run the pipeline
  4. A dispatcher spawns builds
  5. All local, all remote, or anywhere between
  6. Built for throughput, not latency
  7. Let the queue fill itself
  8. Learn more
  9. License

Autobuild

Tickets in, Product out.

Autobuild runs coding agents through a fixed pipeline that plans, implements, reviews, and verifies every ticket before it merges. You groom tickets in and review pull requests out; agents do the work, and deterministic code keeps them honest.

The autobuild dispatch dashboard with four builds in flight, each partway through the pipeline

Quickstart

You need Bun, git, and the local prerequisites for the agent runtime you select: Claude Code, Codex CLI, or Pi. The GitHub forge also needs an authenticated gh CLI or an exported GITHUB_TOKEN/GH_TOKEN; the local-git forge needs no account or remote.

From the repository you want built, install Autobuild as a development dependency:

bun add -d --exact @defrex/[email protected]

Without a package.json, installation creates package.json and bun.lock, which should be committed, with node_modules/ ignored.

Run the repository-installed CLI:

bun ab init

This vendors the editable ab-* skills, writes a stack-neutral config, and hands repository-aware setup to a coding agent. The configuration reference covers every field. Then start the dispatcher and its live dashboard:

bun ab dispatch

Then groom your first ticket in your coding agent:

/ab-spec add a retry budget

The agent asks the questions needed to produce a buildable ticket and files it in your tracker. From then on, that skill is how work goes in.

How it works

Finite integration trees collect related work before merging it under your chosen policy.

Work tickets run the pipeline

spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → finalize
      epilogue: (pr.conflicted → reconcile → verify:*)* → merged or closed

Each work ticket moves through deterministic phases inside its own build-runner. Every phase is a fresh agent session, with artifacts knitting them together.

  1. spec — the dispatcher claims a ready ticket, establishes the final spec, and cuts a branch. The spec is the contract for everything after.
  2. plan ⇄ plan-review — a planner writes an implementation plan; an independent reviewer approves it or sends it back with findings.
  3. implement ⇄ code-review — the same shape over commits: implement, review, revise. A finding that survives round after round escalates to you instead of looping forever.
  4. verify:* — your verification steps, in the order you declare them: shell commands judged by exit code, or agent verifiers that return a verdict and can attach evidence such as screenshots.
  5. finalize — the PR opens with an agent-written description and the attached evidence, then any post-PR steps you've configured (changelogs, release notes) run.
  6. epilogue — the dispatcher watches the open PR. Conflicts route back through reconcile and re-verify; the build ends merged or closed.

A dispatcher spawns builds

The dispatcher claims ready tickets and starts a build-runner for each. Runners are isolated, and all state is logged. Agents never decide what phase comes next, and outcomes are never inferred from what a model printed: every phase reports through a typed CLI into the event log, and tested code decides the transition. That log is the build. Kill the process at any point and the dispatcher resumes from durable state.

The pipeline grammar is fixed on purpose; verify:* and finalize:* are the extension points, declared per repository in autobuild.toml. For the seams and the reasoning behind them, see docs/architecture.md and SPEC.md.

All local, all remote, or anywhere between

Every seam is an adapter you can customize for your project. The build pipeline stays the same.

SeamDecidesAdapters
ticketswhere work comes fromlocal files, Linear, hosted, plugin
dispatcherwhat starts buildslocal process
workspacewhere a build runsgit worktree, Vercel Sandbox, plugin
runtimewho does the thinkingClaude Code, Codex, Pi, plugin
forgewhere code mergeslocal git, GitHub, plugin
storewhere state livesSQLite, remote HTTP store
operatorshow you watchterminal, stdio MCP, Operator API

Plugins are trusted Bun modules declared in autobuild.toml against the versioned @defrex/autobuild/plugin-sdk.

Built for throughput, not latency

One build may take longer than a chat with an agent. The trade is far more changes merging every day, with much greater reliability.

  • File it and walk away. Nothing in the pipeline waits on you. You don't approve tool calls, paste errors back, or watch a terminal. A build escalates to you only when it is truly blocked.
  • As many builds as you can groom. Builds run side by side, each in its own workspace, up to the limit you set. Your attention stops being the ceiling; how fast you can write good tickets becomes the limit.

Headless is safe because the pipeline is deterministic code, not model judgment. State lives in a typed, append-only event log, phase transitions are owned by tested code, and every build leaves a queryable paper trail. Your merge gates are never bypassed: a PR merges when your required checks and your consent say it merges.

Let the queue fill itself

Once tickets are the interface, anything that can write a ticket can put work in front of you.

Builds feed the queue themselves. An implementer that spots a latent bug, a worthwhile refactor, or a missing follow-up outside its spec records an observation (ab observe) and moves on: the insight is kept, and scope creep stays out of the PR. Once enough pile up, the dispatcher distills them into proposed tickets, deduplicated against work already filed, and by default files them into triage. You groom them like any ticket you wrote yourself. Agents propose; humans dispatch.

Support threads, meeting notes, and error telemetry can feed it the same way. An agent with the ab CLI or the MCP server can file tickets and answer routine escalations, leaving you only the real product calls.

Learn more

License

Apache License 2.0.

版本与发布记录

@defrex/autobuild 共发布 23 个版本,首次发布于 2026/09/17;过去 12 个月发布了 23 个版本。

版本发布日期距今
1.6.0latest2026/11/12今天
1.5.02026/11/092 天前
1.4.22026/11/048 天前
1.4.12026/11/038 天前
1.4.02026/11/039 天前
1.3.02026/10/2913 天前

其他发布通道:beta → 1.0.0-beta.4。

关于 @defrex/autobuild 的常见问题

@defrex/autobuild 是什么?

Agent-driven software delivery from groomed ticket to merged PR

如何安装 @defrex/autobuild?

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

@defrex/autobuild 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@defrex/autobuild 支持 ESM 还是 CommonJS?

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

@defrex/autobuild 可以商用吗?

@defrex/autobuild 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@defrex/autobuild 的下载量有多少?

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

@defrex/autobuild 还在维护吗?

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