agentbundler

package module
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 0 Imported by: 0

README

Agent Bundler

CI Release Go 1.26 License

One source → target-specific coding-agent layouts

Claude Code · Codex · Pi · Copilot · Grok Build · Cursor · Antigravity CLI

Define coding-agent assets once. Build the target-specific trees each agent expects.

Why this exists

SKILL.md is useful common ground, but it does not define a shared metadata format, plugin/package layout, or a common way to ship agents, hooks, and scripts. Each coding agent adds its own conventions. The same instructions also do not work equally well across models: wording that helps an OpenAI model may need a different version for an Anthropic model, and vice versa.

Maintaining copied skills and plugin files for every target is tedious. Copies drift. Small target or model differences become manual release work.

Agent Bundler keeps one source of truth, then lets you customize the parts that actually need to differ: frontmatter, Markdown sections, support files, and short target-wide preambles. It renders the result into the directory layout expected by Claude Code, Codex, Pi, GitHub Copilot, Grok Build, Cursor, and Antigravity CLI.

canonical source + manifest
          │
          ▼
   import → customize → render
          │
          ├── Claude Code   .claude-plugin/ + hooks/ + skills/ + agents/
          ├── Codex         .codex-plugin/ + hooks/ + skills/
          ├── Pi            package.json + hook runtime + declared TS extensions
          ├── Copilot CLI   plugin.json + hooks.json + skills/ + agents/
          ├── Grok Build    Claude-compatible plugin + Grok hook roots
          ├── Cursor        .cursor-plugin/ + hooks/ + skills/ + agents/
          └── Antigravity   plugin.json + skills/ + agents/ + explicit native resources

Current scope

Package profiles produce skills, agents, portable resources, command hooks, payload files, and deterministic catalogs in each vendor's native layout. Claude, Codex, Copilot CLI, Cursor, Grok, and Antigravity CLI use separate plugin roots. Antigravity requires package profile and separate mode, emits no catalog, supports only agents with name and description, and rejects portable hooks. Explicit Antigravity-native rules, MCP configuration, hooks, and scripts can be copied as opaque native resources. Pi can merge several logical packages into one explicit aggregate package with its typed hook runtime and explicitly declared native TypeScript extensions. Project profiles remain available for their narrower target layouts.

Hook portability is semantic, not name-based. An unsupported event, matcher, decision, timeout, async mode, or failure policy fails with an exact diagnostic; Agent Bundler never silently weakens a security hook or drops an asset.

Agent Bundler is a compiler, not an agent runtime, installer, marketplace, or publisher. It creates target-ready files; your project or release workflow decides where to install or publish them. Run repository-owned vendor smoke tests before publishing; see Targets and CLI.

Idempotence

Idempotence is a required product quality, separate from deterministic output. With unchanged source bytes, manifest, selectors, and compiler version, a successful build must leave a current output tree untouched: no replacement, mtime change, or filesystem watcher churn. check must remain write-free, and package must preserve an existing archive when its deterministic bytes match. Real drift may still trigger the complete atomic replacement needed to remove stale output safely.

The current writer and archive implementation produce identical bytes but still replace unchanged filesystem objects. This is a known product gap, not the intended steady-state contract. Until content-aware no-op writes land, run check first and invoke build only when it reports drift. See Idempotence quality contract.

Install

Homebrew is the default install:

brew install alexei-led/tap/agentbundler

Or install with Go 1.26+:

go install github.com/alexei-led/agentbundler/cmd/agbun@latest

Start with an existing bundle

Discover the installed CLI, then build from a directory containing agentbundle.json:

agbun --version
agbun --help
agbun check
agbun build

Use agbun help build, agbun help check, and agbun help targets for the full command, safety, and target-ID reference.

build replaces the configured output directory. Use a dedicated generated directory, not a working project root. check is read-only; add --native to run only declared safe validators for Claude, Grok, and Antigravity after drift passes. Opt-in root vendor discovery can route repository installs into the generated target trees without symlinks; see repository-root compatibility. For a complete first bundle, see the quick start. For a tested Antigravity CLI plugin, see the Conductor-shaped example. For a multi-package hook example that builds all seven targets, see testdata/cc-thingz-hooks.

What can be customized

A target overlay can:

  • merge or remove JSON frontmatter keys, including target-defined metadata such as tools;
  • replace the whole Markdown body;
  • replace the body under an exact heading path;
  • add, replace, or delete support files;
  • prepend a short target-wide policy through composition.

See customization for the exact sidecar format and examples.

Documentation

License

MIT

Documentation

Overview

Package agentbundler is the target-neutral Agent Bundler compiler product.

The executable entry point is cmd/agbun. Internal packages own source import, composition, target rendering, and generated-output effects.

Directories

Path Synopsis
cmd
agbun command
internal
artifact
Package artifact validates and applies complete generated-output plans.
Package artifact validates and applies complete generated-output plans.
artifact/archive
Package archive writes deterministic target-root release archives.
Package archive writes deterministic target-root release archives.
artifact/compare
Package compare detects exact drift between a build plan and generated output.
Package compare detects exact drift between a build plan and generated output.
artifact/nativeverify
Package nativeverify runs declared native verification commands.
Package nativeverify runs declared native verification commands.
artifact/provenance
Package provenance adds deterministic build evidence to compiler plans.
Package provenance adds deterministic build evidence to compiler plans.
artifact/write
Package write materializes validated build plans as complete output trees.
Package write materializes validated build plans as complete output trees.
buildinfo
Package buildinfo reports the Agent Bundler build version.
Package buildinfo reports the Agent Bundler build version.
compatibility
Package compatibility derives and maintains opt-in repository-root vendor discovery files.
Package compatibility derives and maintains opt-in repository-root vendor discovery files.
compiler
Package compiler coordinates source import, composition, target rendering, and artifacts.
Package compiler coordinates source import, composition, target rendering, and artifacts.
compiler/composition
Package composition resolves source inventories for one target.
Package composition resolves source inventories for one target.
compiler/model
Package model defines the target-neutral data exchanged by compiler subsystems.
Package model defines the target-neutral data exchanged by compiler subsystems.
compiler/source
Package source routes explicit source manifests to their topology importers.
Package source routes explicit source manifests to their topology importers.
compiler/source/bundle
Package bundle imports Agent Bundler's canonical bundle source layout.
Package bundle imports Agent Bundler's canonical bundle source layout.
compiler/source/frontmatter
Package frontmatter parses the YAML frontmatter used by Agent Skills files.
Package frontmatter parses the YAML frontmatter used by Agent Skills files.
compiler/source/skillrepo
Package skillrepo imports explicit roots from a generic skills repository.
Package skillrepo imports explicit roots from a generic skills repository.
target
Package target resolves and dispatches built-in target adapters.
Package target resolves and dispatches built-in target adapters.
target/antigravity
Package antigravity renders normalized packages as Antigravity CLI plugins.
Package antigravity renders normalized packages as Antigravity CLI plugins.
target/claude
Package claude renders normalized packages for Claude Code.
Package claude renders normalized packages for Claude Code.
target/codex
Package codex renders normalized packages as Codex plugins.
Package codex renders normalized packages as Codex plugins.
target/copilot
Package copilot renders normalized packages for GitHub Copilot.
Package copilot renders normalized packages for GitHub Copilot.
target/cursor
Package cursor renders normalized packages as Cursor plugins.
Package cursor renders normalized packages as Cursor plugins.
target/grok
Package grok renders normalized packages for Grok Build.
Package grok renders normalized packages for Grok Build.
target/hookdecision
Package hookdecision renders a canonical decision-hook process wrapper into vendor protocols.
Package hookdecision renders a canonical decision-hook process wrapper into vendor protocols.
target/marketplace
Package marketplace builds target-neutral marketplace catalog entries.
Package marketplace builds target-neutral marketplace catalog entries.
target/packageoutput
Package packageoutput renders installable target package roots.
Package packageoutput renders installable target package roots.
target/pi
Package pi renders normalized packages for Pi.
Package pi renders normalized packages for Pi.
target/plugin
Package plugin renders the common single-package native plugin skill subset.
Package plugin renders the common single-package native plugin skill subset.
target/skills
Package skills renders the common native skill subset for target adapters.
Package skills renders the common native skill subset for target adapters.
testutil/vendorsmoke
Package vendorsmoke provides bounded, isolated helpers for opt-in vendor CLI tests.
Package vendorsmoke provides bounded, isolated helpers for opt-in vendor CLI tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL