Configuration

Library and chains

The sections of library.yaml, the keys a library task takes for each kind, and how chains/*.yaml files compose them into chain templates.

Chain file keys defines every key a chain or a library component takes; this page maps the files.

library.yaml: reusable components

library.yaml has four sections. Each maps a name to a definition, which any chain takes with extends: <name>.

config/library.yaml
tasks:
  implementer:
    kind: agent
    harness: claude
    profile: strong
    prompt: Implement the approved plan.
  code_review:
    kind: agent
    harness: claude
    prompt: Review this work item's change for defects its passing tests do not catch.
    skill: kraft:code-review
    inputs: [review_package]
SectionHolds
tasksReusable tasks of any kind: agent, subprocess, builtin, forge.
stepsReusable ordered groups of tasks. A step may set read_only: true (read_only).
nodesReusable nodes, with their own steps, on_failure, fix_loop and escalation.
steeringNamed guidance (a steering profile), {instructions: "..."}, that an agent task selects with steering: [name] and a repository selects with its repos.yaml steering:.

The top-level remove: key

Added in 2.3

An add-on that builds on another may add a top-level remove: to its library.yaml, to drop entries it inherits from its parent. It isn't the chain-level remove, which drops nodes from one chain.

library.yaml
remove:
  chains: [hotfix]
  tasks: [security_scan]
  • Its sections are chains, tasks, steps, nodes, steering, skills and profiles, each a list of names.
  • validate, install and update refuse a name the parent doesn't have, and an entry something still in the library uses.
  • A root add-on, a repo library and your own library.yaml have no parent: Kraft refuses remove: there with "remove: is for an add-on that builds on another".

Keys of a library task

Every kind takes scope, steering, on_failure, policy, skippable and icon. Then each kind takes its own keys. A library step or node may set an icon too (Icons).

KindIts own keys
agentharness, prompt, skill, produces, profile, model, effort, fallback, inputs, outputs, reads Added in 2.6
subprocesscommand, outputs, reads Added in 2.6
builtinref, execution
forgetarget, wait

Chain file keys defines each key.

Extending a library step

A chain step extends a library step inside a node's steps:. The chain step names its own id. Its tasks come from the library step unless it sets tasks: of its own, which replace them. A component extends one parent of its own kind; the rest of the rule is in The library and extends.

config/library.yaml
steps:
  checks:
    tasks:
      - id: lint
        kind: subprocess
        command: just lint
config/chains/mine.yaml
nodes:
  - id: verify
    kind: exec
    steps:
      - id: checks
        extends: checks   # runs verify.checks.lint

Inspect and edit the library

  • kraft admin templates library lists every component as <section>.<name> (tasks.implementer) with the chains that use it.
  • kraft admin templates library ID shows one component with its definition and any lint issue that names it.
  • Templates › Library shows the same and edits the file. Kraft refuses a save that would break any chain that loads today, and writes nothing.

Qualified names

Added in 2.1

An installed Kraft add-on adds its own components and chains beside yours. Each is named <namespace>:<name>, where the namespace is the add-on's name or the alias it was installed under.

config/chains/mine.yaml
nodes:
  - id: implementation
    kind: exec
    tasks:
      - id: implement
        extends: release:implementer   # the add-on's task
  • extends, steering, skill and profile take a qualified name, including the extends of a node a chain revision or an item draft adds, as does a chain ID wherever one is named: --chain, default_chain in repos.yaml, a schedule's chain.
  • A bare name is always your own. A key of library.yaml and a chain's id never contain :, and Kraft refuses one that does.
  • An add-on's components and chains are read-only. Extend one, or copy it into your own library from the Templates screens.
  • A later update to the add-on doesn't change a copy.
  • A copy of a child add-on's chain or component runs what the child serves, overrides included. What it takes from a parent's entries is written into it, and a skill or profile keeps the name of the add-on that ships it, such as company:slow.
  • A repo library's components and chains are read-only in the Templates screens too. Edit them in that repository's .kraft/.
  • kraft admin templates library lists an add-on's component with its add-on, as tasks.release:implementer (release@acme 1.0.0), and kraft admin templates show release:ship heads the chain the same way.
  • kraft admin templates lint --dir PATH loads no add-on. It prints each reference to one as not checked (add-on) and doesn't count it as an error.

Names has the whole rule, including what a bare name means inside an add-on.

chains/*.yaml: chain templates

Each file in chains/ is one selectable chain, named by its id (or the file name), with an optional one-line description. The keys are in Chain file keys. Concepts walks through the shipped default and quick-task chains as worked examples.

  • kraft admin templates show ID --resolved prints a chain with its library components expanded.
  • Templates › Chains edits the file itself.

Kraft never overwrites these files on upgrade.

Extending a chain

Added in 2.2

A chain can build on another chain instead of listing its own nodes. It names one parent with extends and changes it with three edits. Everything the edits leave alone is the parent's, read live: a node the parent gains later appears in your chain at the next reload, with no change to your file.

config/chains/team-default.yaml
id: team-default
extends: default
description: The default chain, with a security scan and no external approval.

remove: [external_approval]

add:
  - after: verification
    node:
      id: security_scan
      kind: exec
      tasks:
        - id: scan
          extends: kraft-default:code_review
          prompt: Review the change for security problems only.

overrides:
  implementation.main.implement: { profile: deep }
  verification: { fix_loop: { max_attempts: 4 } }
  final_review: { message: The team lead signs off. }

Kraft applies the edits in this order:

  1. remove drops parent nodes by ID. Each must be one of the parent's nodes.
  2. overrides changes a component by its canonical path: a node (verification), a step (verification.review), a task (implementation.main.implement), a judge (verification.fix_loop.judge). A fix loop, on_failure or on_conflict is reached through its node, as verification does above. A node's override applies before its tasks' overrides.
  3. add puts a complete node, written as in any chain file, directly after the parent node after names. Several added after one node keep the order you wrote them in.

An override merges as extends does: a mapping merges key by key, and a list or a single value replaces what it inherited. Setting a task's profile drops an inherited model and effort, and setting tasks on a container written with steps replaces them, or the other way round.

Kraft refuses an extending chain, naming the edit, when:

  • it also writes nodes, or a chain without extends writes remove, add or overrides;
  • an edit names a node or path the parent doesn't have, or an added node takes an ID the parent has;
  • an override sets id, kind, extends or chain_finalized on a component the parent has, at any depth (fix_loop: { judge: { extends: ... } } on a node that has a judge too): remove the node and add a new one instead. A slot the parent leaves empty, such as the auto_review of a gate the parent gives no reviewer, takes a whole new component, as a list the override replaces does;
  • it removes the parent's final gate (chain_finalized), or adds a second one, written on the node or inherited through its extends;
  • a reject_to or restart_from is left naming a node it removed. Override that pointer to fix it;
  • its policy widens the parent's chain policy. It may only tighten it: deny_tools adds to the parent's list, allowed_tools narrows it, and a budget or time cap stays at or under the parent's. A null can't clear a key the parent sets. A policy inside an override follows the same rule against the node's or task's own policy.

There is no before:, and a parent node can't be moved. To change the order, copy the chain and own its structure.

The extending chain lives inIts extends may name
Your config/chains/One of your chains (default), or an installed add-on's (release:ship). Added in 2.2
An add-onOne of the add-on's own chains, never another add-on's. Added in 2.2

A chain that extends a chain that extends another is allowed, and each sees its parent with that parent's edits applied. kraft admin templates show ID --resolved prints the result, headed by where each node came from. An extending chain fails on its own: a bad edit, or a parent that doesn't resolve, is reported for that chain, and every other chain still loads.

Changing or ending the parent

  • Copying an extending chain copies its file, which still extends the same parent.
  • In Templates › Chains, Duplicate › Extend starts a chain under an ID starting <chain>_ext.
  • Change base… rewrites extends and keeps the edits the new parent can take. The rest are dropped, and the screen lists both first.
  • Detach… removes extends and writes the chain's nodes into the file, so it follows nothing. A node you overrode is written resolved; the others keep their library extends. Later changes to the parent no longer reach it. kraft admin templates show ID --resolved prints the whole chain expanded.
  • Ctrl/Cmd+Z undoes either.

Placing a step on a machine

Added in 2.4

runner: is a key of a chain, a node and a step: a machine or a group of machines from workers.yaml, any, or local (the default). The most specific wins: step, then node, then chain. A node written as a flat tasks: list is one step. A fix loop, a recovery plan, a judge and an escalation turn follow their node, and a gate's runner: places its automated review. Builtin and forge tasks always run on the server.

A group's name places the step on one of the group's machines that is free, the local worker included when it is a member. An item that no machine of the group could take is refused when it is filed.

An item can override it: the item's own --runner, or one node's --runner, wins over the library. A repo that needs a machine says so through its own .kraft/ library: a chain that sets runner:, made the repo's default chain.

Copyright © 2026