Share chains with add-ons
Added in 2.1
Each instance pins a Kraft add-on from a collection to a commit and changes it only through an update you review.
This guide installs the add-on release from the collection acme, uses what it ships and keeps it current. To write and publish an add-on, see Publish an add-on.
| To | Run |
|---|---|
| Add a collection | kraft admin addon collection add SOURCE |
| Install an add-on from it | kraft admin addon install ADDON@COLLECTION |
| See what is installed | kraft admin addon list |
| Take a new version | kraft admin addon update |
| Remove an add-on | kraft admin addon uninstall ADDON@COLLECTION |
Before you start
- A running Kraft server, and
git. - The instance defines every harness and
agent profile the add-on requires. The
example needs the shipped
claudeharness andstrongprofile. - The address of the collection, from whoever published it.
Install an add-on
Bound what an add-on's agents may do
An add-on's prompts, steering and skills are instructions an agent follows with whatever tools your instance allows it. An add-on can't widen what a run may do, but with nothing set on the instance an agent may already run any command. Before you install an add-on from people you don't fully trust, set these on the instance:
maxima:inpolicy.yaml, so no add-on sets a time, attempt or budget limit above yours;allowed_tools, so the permission gate answers from your list;- a sandbox on each repo the add-on's chains run in.
Security explains why an add-on carries limits and never permissions.
1. Add the collection
Kraft keeps no directory of collections, so ask whoever published the add-on for its address. Then add it:
kraft admin addon collection add acme/kraft-addons
added collection acme
owner/repo is a GitHub repository. An https URL, an ssh:// URL, a
user@host:path address or a file:/// URL works too, and --ref picks a
branch, tag or commit. This installs nothing.
kraft admin addon collection list shows what the collection publishes.
2. Install the add-on
kraft admin addon install release@acme
Kraft fetches the add-on, checks it against your instance, and prints a review. Reach lists what decides how far a run goes: gates, merge steps, harnesses, models and limits. Content lists the rest, with every prompt and skill in full. On a first install everything is new:
release@acme new, 1.0.0
Reach:
- release:ship.nodes[implementation].tasks[implement]: harness set to 'claude'
- release:ship.nodes[implementation].tasks[implement].policy: limit time_cap_minutes set, set to 90
...
Content:
- release:ship.nodes[implementation].tasks[implement]: prompt new:
Implement the approved plan, then write the release notes.
...
Apply release@acme? [y/N]
Read it, then answer y. Nothing is installed until you do. -y accepts without
asking. A running server loads the add-on at once.
Add-on problems
covers a refused or declined install.
If another add-on or a repository already uses the name release, install it
under another namespace with --as:
kraft admin addon install release@acme --as acme-release
3. Check it worked
kraft admin addon list
release@acme release 1.0.0 f4a11422cc83
The columns are the add-on ID, its namespace, its version and the commit it is pinned to. Then read a chain it ships:
kraft admin templates show release:ship
The output starts with # release:ship (release@acme 1.0.0).
kraft admin doctor shows 1 add-on(s) load on its add-ons row.
Install an add-on that builds on another
Added in 2.3
An add-on can build on another, its parent and accept a range of the parent's versions. Install the child and Kraft fetches the parents it lacks from their collections, so you name only the add-on you want:
kraft admin addon install team-payments@payments
The install is one review and one answer for the whole tree. It starts with a line for each parent Kraft pulls in, then the review of each add-on, parent first:
pulls in platform-dept@platform 2.0.0 from collection platform: team-payments@payments builds on it
Answer n and nothing is installed, the parents included. A parent that is
already installed is used as it is.
- The parent's collection must be added. If it isn't, the install is
refused with
its parent platform-dept@platform comes from collection platform, which this instance has not added; add it first: kraft admin addon collection add <its git URL or directory>. Add the collection, then install again. Ask whoever published the child for its address. --asnames only the add-on you install.--asand--auto-updateapply to the child alone; a pulled-in parent installs under its own name. If that name is taken, the refusal saysinstall it first with its own --asand gives the command: install the parent with an alias, then the child.- A parent outside the child's range is refused, with both ways out, in An update is held by a range.
The review of a child's install or update lists its chain changes as they resolve with its parent.
To see which of a child's chains and components it inherits, overrides or adds,
run kraft admin templates show --resolved ID or kraft admin templates library: each is marked, and the web UI
shows the same marks.
While an enabled child builds on it, uninstall and disable refuse to remove
the parent, and name each child:
cannot uninstall platform-dept@platform: something installed builds on it
team-payments@payments builds on it (requires.addons)
Disable or uninstall the child first; that is always allowed. enable on a child
is refused while its parent isn't installed, not enabled or outside its range.
When a parent is left out at load, its children are left out with it, each
saying its parent <id> is not loaded: and the parent's reason.
Install Kraft's own add-ons
Added in 2.5
Kraft's own chains and library need no install. They are the built-in add-on
kraft-default, which comes with the installed Kraft and is always loaded: file
work on kraft-default:default or kraft-default:quick-task, or extend them
from your own chain. A new home's default and quick-task already do. See The
built-in kraft-default.
Kraft's repository is also a collection, kraft-sdlc, for add-ons that build on
the built-in:
| Add-on | What its chains use | Needs |
|---|---|---|
kraft-superpowers | Kraft's chains, with superpowers' methods on the tasks below. | The superpowers plugin wherever the agent runs. |
kraft admin addon collection add itsOmidKarami/kraft
kraft admin addon install kraft-superpowers@kraft-sdlc
kraft-superpowers builds on kraft-default@kraft, which needs no install.
File work on one of its chains with
kraft item create "title" --chain kraft-superpowers:default. Its chains use:
- Spec: the written design of superpowers'
brainstorming: intent, goals and non-goals, constraints and the choices the agent made marked as its own. - Plan: the bite-sized, test-first steps of
writing-plans. - Implementation:
test-driven-development, thenverification-before-completion. - Review feedback:
receiving-code-review, wherever a review sends work back. The implementer acts on the threads you leave at the local or final review, and pushes back with reasons only where a change would break something. The repairs check each finding from Kraft's code review, the merge request's bots or CI against the code, act on it when it holds and answer it with reasons when it doesn't. The repairs also usesystematic-debuggingfor failures. - Tests: the implementer and the repairs run the tests for what changed, not the whole suite, whatever a skill says. Kraft's verification and CI run the suite.
The spec and plan keep Kraft's own format and gates, and a person approves them
at those gates. Methods that need a person in the session are left out:
brainstorming's conversation, worktrees and finishing a branch. The steering
tells an agent whose plugin lacks a skill the chain names to stop with
needs_context and name the skill, and never to post on the merge request
itself.
Kraft's own collection
lists each task's steering.
If you installed kraft-default from GitHub
Added in 2.6
On Kraft 2.5 the way to get kraft-default was to install it from kraft-sdlc,
and kraft-superpowers 1.x installed it as its parent. Kraft now ships it, and
the built-in takes the name. The GitHub copy is left out when the home loads,
and kraft-superpowers 1.x stops loading until you update it.
kraft admin doctor's kraft-default row names the old copy and the two
commands, and its add-ons row fails on kraft-superpowers until you run
them. Run them in this order:
kraft admin addon update kraft-superpowers@kraft-sdlc
kraft admin addon uninstall kraft-default@kraft-sdlc
A local chain that says extends: kraft-default:default keeps working, and doesn't
stop the uninstall, because the built-in answers it now. Work items already
running keep the copy they were filed with. install kraft-default@kraft-sdlc
is refused, naming the built-in.
Use what an add-on ships
Everything an add-on declares is named <namespace>:<name> from outside it.
- Run its chain. Name it when you file an item, or make it a repo's
default_chaininrepos.yaml:kraft item create "Cut the 4.2 release" --chain release:ship - Extend a component. A chain or library component of your own takes an
add-on's with
extends:and changes what it needs. An update to the add-on reaches your chain too, and its review shows the change:config/chains/mine.yamlid: mine nodes: - id: implementation kind: exec tasks: - id: implement extends: release:implementer policy: time_cap_minutes: 60 - Select its skill, steering profile or agent profile. Set
skill: release:release-notes,steering: [release:house-style]orprofile: release:carefulon a task in your own chain or library. The add-on must ship the one you name. The example add-on ships only the skill. An add-on declares a steering profile in thesteering:section of itslibrary.yaml, and an agent profile in itsprofiles.yaml. Names lists every qualified reference. - Copy it. An add-on's chains and components are read-only. In the web UI, open the chain under Templates › Chains, or the component under Templates › Library, and select Copy to my library. Kraft asks for a name and opens a draft that is yours to edit. A copy no longer follows the add-on's updates. A child add-on's copy has its overrides folded in. The phone layout has no copy button.
Build on a shared chain
Added in 2.2
Copying an add-on's chain gives you a snapshot that misses its later fixes. To
change a few things and keep the rest current, write a chain that extends it.
This one adds a sign-off gate to release:ship and gives its implementer less
time:
id: team
extends: release:ship
description: acme's release chain, with our own sign-off.
add:
- after: verify
node:
id: sign_off
kind: gate
chain_finalized: true
message: The team lead signs off.
reject_to: implementation
overrides:
implementation.main.implement: { policy: { time_cap_minutes: 60 } }
Check what it resolves to:
kraft admin templates show team --resolved
The output starts with where each node came from, then the whole chain:
# extends release:ship
# implementation: overridden (implementation.main.implement)
# verify: inherited
# sign_off: added
id: team
Run it like any chain of your own: kraft item create "..." --chain team. When
the add-on updates, your chain gets the new version, and the update's review
lists what team runs differently. An update that drops or renames a node
your edits name is refused, so your chain never breaks silently; see
Add-on problems.
While team extends it, uninstall and disable refuse to remove the add-on.
You can start one on the Templates screen too: open the add-on's chain, press Add to my library and keep Extend, then edit it on the canvas. Each change you make there is written as one of these edits, never as a copy of what the chain inherits; see An extending chain.
A repository can do the same in its own .kraft/chains/: list the add-on under
addons: in .kraft/library.yaml, and name it by its own name. See
Building on an add-on's chain.
Extending a chain has every edit and rule.
Keep it current
Update by hand
kraft admin addon update --check
release@acme 1.0.0 -> 1.1.0
Reach:
- release:ship.nodes[implementation].tasks[implement].policy: limit time_cap_minutes raised, 90 -> 120
Content:
- component tasks.implementer changed
release@acme: update waiting
--check prints each review and changes nothing. It exits 0 when every add-on
is current, 1 when an update is waiting or held by a range, 2 when one would be refused and 3
when a collection couldn't be checked, so a scheduled job can watch for one. kraft admin addon update shows the same reviews and asks once
for each tree of add-ons that build on each other.
An item that is already running keeps the add-on version it started with. It keeps the versions of the add-on's whole tree, its parent and theirs. A revision that would bring in a child built on another version of a parent is refused.
When an update is held
Added in 2.3
Add-ons that build on each other move as a set. Kraft drops every move that would leave an installed add-on outside its parent's range, offers the dropped ones again, and applies what is then consistent. A dropped move is held: the add-on keeps its version and the rest of the update goes ahead.
company@corp: held: company@corp 2.0.0 is outside team@payments's range 1 (needs 1.x)
- One review and one answer per tree. The add-ons that move together are shown in one review, parent first and you accept or decline them whole. Add-ons in other trees are asked separately.
- A named add-on takes its relatives.
kraft admin addon update ADDONalso takes the waiting moves of its installed parents and children. If a relative's move would break a chain and the add-ons you named don't need it, that relative is held and the rest apply. If the named moves themselves break a chain, every member is refused. --checkexits 1 for a held move, like a waiting update, and 2 for one that would be refused, which includes a relative held because its own move breaks a chain.- Auto-update moves a tree as one set, across collections, taking only
add-ons whose auto-update is on. A member held for a person, or one whose
ref, URL or alias was changed by hand, holds the tree as it is locked. - A member that names a new parent or range is held for a person by itself.
- A relative whose auto-update is off is never moved, and its collection isn't
fetched for it. A move that needs it is held:
kraft admin doctorshows it on itsadd-on updatesrow. Runkraft admin addon updateto move the tree.
To get a held move out of the way, see An update is held by a range.
Let an add-on update itself
kraft admin addon auto-update release@acme on
After each server start, and once a day while the server runs, Kraft checks
the add-on and applies an update whose
review has no Reach line: a new version that changes only content, such as
a prompt or a skill. It holds every other update for you and keeps the
installed version running. kraft admin doctor shows a held or failed update
on its add-on updates row.
kraft admin addon collection auto-update acme on does the same for every
add-on installed from the collection.
Auto-update lists what is held.
Move a collection to another source
Added in 2.5
To take a collection from a fork, a mirror or a local checkout, move it in place instead of uninstalling its add-ons:
kraft admin addon collection add ../kraft-addons-fork --replace
kraft admin addon update
The add-ons keep running what they locked until the update shows the move,
collection URL changed, with what changes, and you accept it. Another
branch of the same repository needs no move: collection add SOURCE --ref REF.
Put the same add-ons on another machine
Copy addons.yaml and addons.lock from config/ to the other machine's
config/, then start Kraft or run kraft admin reload. Kraft fetches each
add-on at its locked commit in the background, so both machines run the same
files. The other machine needs git access to the collection's URL.
Remove an add-on
kraft admin addon uninstall release@acme
Kraft refuses while one of your own files still names the add-on's namespace,
and lists each reference. Change those first. It also refuses while another
add-on builds on it.
kraft admin addon disable release@acme keeps the add-on installed and stops
loading it, under the same rule. Items that are running finish on the version
they started with.
Next steps
- Add-ons and collections: every manifest field,
addons.yaml, the lock, and when an add-on loads. - Add-on verbs: every
kraft admin addonverb and flag. - Security: what an add-on can and can't change.
- Add-on problems: the message
validateor akraft admin addoncommand printed when you add a collection, install, update or remove an add-on, and its fix. - Publish an add-on: write a collection, validate it, publish it and share one repository's chains without a collection.
- Write your own chain: the chain and library keys an add-on's files use.