Dive

Reference

Plan file

One plan, in `./.dive/plans/` or `~/.config/dive/plans/`, run with `dive plan run` and called by agents and other plans as `plan__<identifier>`.

File typeLocation
YAML./.dive/plans/<identifier>.yaml (project)
~/.config/dive/plans/<identifier>.yaml (global)

Unknown keys are a load error. For completion in your editor, start the file with # yaml-language-server: $schema=https://raw.githubusercontent.com/loon-rocks/dive/main/docs/schemas/plan.schema.json.

Fields

versioninteger

The file version the document is written in. Omitted means 1; dive plan migrate brings a file to the current version.

identifierstringrequired

Letters, digits, _ and -. The plan is called as plan__<identifier>, and a plan with a built-in plan's identifier replaces it.

namestringrequired

Display name.

descriptionstringrequired

What the plan does. Agents read it when choosing tools.

exemplarsstring[]

Example requests the plan handles, added to its tool description.

MCP servers the steps use. While any of them isn't configured, the plan can't run here: it's still listed, with the server it's missing.

JSON Schema for the plan's inputs, validated before any step runs. Steps reference inputs as {{input.<field>}}.

stepsobject[]required

The steps, run in order.

steps.[].idstringrequired

Unique across the plan, including steps inside bodies. Later steps read the result as {{<id>.<field>}}. Can't be input, item, index, accumulator or length.

steps.[].tool_namestringrequired

A catalog tool (<server>__*, user__*, builtin__*, plan__*, agent__*) or a control step (exit, route, filter, map, reduce, agent, ask).

steps.[].inputobjectrequired

The tool's input. String values are templates over input and earlier results; a control step's input is described on its page.

Why the step exists, for people reading the plan.

Files the step's tool writes to disk, by name. Dive makes a directory for each call; pass {{files.<name>.path}}, or {{files.<name>.dir}} for a pattern, to the tool's own output option. After the call each file is stored and listed under the result's files with its name: {{<id>.files.<name>.ref}}, or a list for a pattern.

The file name with its extension, such as snapshot.json, or a pattern with * or ?, such as page-*.png, for several files.

When true, a missing file, or a pattern with no match, isn't an error.

JSON Schema for the result of an output plan. Its properties must match the keys of finish.output.

finish"silent" | objectrequired

How the plan ends, and what it returns: silent, output or solver.

Returns this map as JSON, each template filled from step results. No model call.

A model call writes the answer as prose, returned as {answer}.

What the answer should say, as a template.

Extra system prompt for the solver call.

What the solver sees, as a map of templates over step results.

version: 2
identifier: weekly_changes
name: Weekly changes
description: Summarizes the commits merged since a git ref.
input_schema:
  type: object
  required:
  - base
  properties:
    base:
      type: string
      description: The ref to start after, such as the last release tag
steps:
- id: commits
  tool_name: github__tool__git_log
  input:
    base: '{{input.base}}'
    head: HEAD
- id: nothing_shipped
  tool_name: exit
  input:
    when:
      value: '{{commits.count}}'
      op: eq
      to: 0
    status: success
    message: Nothing merged since {{input.base}}
finish:
  solver:
    query_to_answer: Summarize what changed, grouped by theme.
    data:
      commits: '{{commits.commits}}'