@tank/bundle-creator
1.0.0Description
Author multi-atom Tank bundles that combine instruction, hook, agent, rule, tool, resource, and prompt atoms. Covers atoms array schema, atom kind selection, handler wiring, agent definition, rule policies, extension bags, permission scoping, and bundle directory layout.
Triggered by
tank install @tank/bundle-creatorBundle Creator
Compose multiple atom primitives into a single deployable package that extends agent behavior beyond what instructions alone can achieve.
Core Philosophy
-
Atoms are the unit of composition. Each atom does one thing: inject context, intercept lifecycle events, define a sub-agent, enforce a rule, register a tool, expose a resource, or template a prompt. A bundle wires atoms together into a cohesive capability.
-
Start with the lightest atom. If pure instructions solve the problem, use an instruction-only skill. Add atoms only when you need machine enforcement (hooks, rules), delegation (agents), or external integration (tools, resources). Every atom adds complexity.
-
Permission budget is real. Each atom widens the package's attack surface. Scope permissions to the minimum each atom actually needs. A readonly reviewer agent does not need
writeorbash. -
Hooks and rules are different tools. Hooks run arbitrary code at lifecycle events. Rules declare static policies the runtime enforces. Prefer rules for simple allow/block decisions; use hooks when you need conditional logic, delegation, or side effects.
-
Name the bundle for the capability, not the atoms.
@tank/quality-gatenames the outcome.@tank/hook-agent-rule-combonames the plumbing. Users install capabilities, not implementation details.
Quick-Start: Common Problems
"I need a bundle that reviews code before the agent stops"
- Create
bundles/{name}/tank.jsonwith atoms array - Add a
hookatom onpre-stoppointing to./hooks/{name}.ts - Add an
agentatom for the reviewer withreadonly: true - Add an
instructionatom referencing./SKILL.mdfor context - Write the hook handler that delegates to the agent
-> See
references/worked-examples.md(quality-gate walkthrough)
"I need to enforce a rule without writing code"
- Add a
ruleatom withevent,policy, andreason - Pair with an
instructionatom explaining the rationale - No hook handler needed — the runtime enforces declaratively
-> See
references/bundle-composition.md(rule patterns)
"I need to register an MCP tool or expose data"
- Add a
toolatom withnameand connection config - Or add a
resourceatom withurifor readable data - Add an
instructionatom so the agent knows when to use them -> Seereferences/tank-json-anatomy.md(tool and resource atoms)
"I am not sure if I need a bundle or a skill"
- Check the decision tree below
- If every atom would be
instruction, use a skill instead -> Seereferences/bundle-composition.md(skill vs bundle)
Decision Trees
Skill vs Bundle
| Signal | Format |
|---|---|
| Pure instructions/knowledge | Instruction-only |
| Need lifecycle hooks (pre-stop, etc.) | Bundle |
| Need a sub-agent with specific tools | Bundle |
| Need machine-enforced rules | Bundle |
| Need MCP tool or resource registration | Bundle |
| Need prompt templates or slash commands | Bundle |
Which Atom Kind
| Need | Atom Kind | Required Fields |
|---|---|---|
| Behavioral context for the agent | instruction | content (file path) |
| Code at lifecycle events | hook | event, handler |
| Delegatable sub-agent | agent | name, role |
| Declarative policy enforcement | rule | event, policy |
| MCP server registration | tool | name |
| Readable data/context source | resource | uri |
| Reusable invocable template | prompt | name, template |
Hook Handler Type
| Signal | Handler Type |
|---|---|
| Simple block/allow/rewrite on match | DSL |
| Conditional logic, delegation, side fx | JS |
| Needs access to git diff, file content | JS |
| Portable across all runtimes | DSL |
Agent Model Tier
| Workload | Model Tier |
|---|---|
| Fast classification, triage | fast |
| Code review, analysis | balanced |
| Architecture decisions, complex | powerful |
Bundle Directory Layout
bundles/{kebab-name}/
tank.json # Required — metadata + permissions + atoms array
SKILL.md # Optional — instruction content (referenced by atom)
hooks/ # Optional — JS/TS hook handlers
references/ # Optional — deep docs (250-450 lines each)
scripts/ # Optional — executable code
assets/ # Optional — templates, images
Atom Wiring Checklist
- Every
hookatom references an existing file inhooks/ - Every
instructionatom references an existing.mdfile - Every
agentatom hasname,role, and atoolsarray - Every
ruleatom hasevent,policy, andreason - Permissions in
tank.jsoncover what all atoms need combined repositorypoints tohttps://github.com/tankpkg/packages
Reference Index
| File | Contents |
|---|---|
references/tank-json-anatomy.md | Full tank.json schema: fields, atoms array, each atom kind |
references/bundle-composition.md | When to compose which atoms, sizing signals, permission scoping |
references/worked-examples.md | Three real bundle walkthroughs showing atom interplay |