v2.0.0next
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.

library.yaml defines reusable components, and each chains/*.yaml file composes them into a chain template. 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:.

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
subprocesscommand
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.

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.

Copyright © 2026