schema.yaml

Schema authoring reference — artifacts, phases, and pipelines.

A schema lives at <schema-dir>/schema.yaml and is validated against SchemaYamlSchema in packages/protocol/src/types/schema.ts (re-exported from @soel/contractor-protocol so the web dashboard can validate the same content the CLI consumes). Bundled schemas live under packages/cli/schemas/<name>/schema.yaml; user forks live under ~/.contractor/schemas/<name>/schema.yaml.

This page is the field-by-field reference. For the conceptual overview (what a schema is, when to fork) see Schemas.

Top-level shape

A schema must declare at least one artifact. phases and pipeline are optional — a schema with only artifacts produces nothing executable, but still passes validation.

artifacts

Each artifact is a node in the dependency graph.

requires is the edge set: contractor's artifact graph (buildArtifactGraph) walks these to compute topological order, dependencies, and dependents. validateArtifactGraph flags cycles, unresolved requires (an id that names no artifact), and unresolved phases[].tracks.

phases

Phases are the executable units a pipeline references.

The strategy chooses how the phase is built into a slash command at install time and how it fans out at run time. See Strategies for what each one does.

  • tracks points at an artifact id whose state drives the phase (e.g. tasks for task-group-implement). validateArtifactGraph reports a unresolved-tracks problem when the named id does not exist.
  • namespace: contractor marks the phase as a static, repo-agnostic helper (e.g. propose); everything else namespaces under blueprint. See Slash commands.
  • agents is required when the strategy is parallel-agents and ignored otherwise.

pipeline

The default pipeline contractor run executes for blueprints on this schema. Steps are one of three kinds — phase reference, shell, or gate.

Phase-reference step

Resolves to an agent step that calls the named phase's slash command. Inherits the phase's instruction and strategy.

kind: shell step

Runs an arbitrary shell command in the worktree. The {{scope}} placeholder is replaced with the blueprint's scope at run time (or empty when unscoped — pair with when: scope to skip the step entirely).

kind: gate step

Pauses the pipeline and waits for a user decision. The description is shown in the dashboard's gate prompt. See Gates.

needs_prepared_worktree

Any phase-reference or shell step may set needs_prepared_worktree: true. When the pipeline runner reaches a flagged step, it consults the per-worktree prepare marker and, if missing or invalidated by a HEAD change, injects a synthetic prepare step before the scheduled one. Both shipped schemas set this flag on implement. See Worktrees for the full mechanics.

Example

implement (legacy)

The top-level implement: block is an older shape used by some schemas to declare what the implement phase tracks. New schemas should declare an id: implement entry under phases: instead — both shipped schemas use the modern phase form. The block is preserved for compatibility:

See also

  • Schemas — what schemas are and when to fork one.
  • Strategies — what each phases[].strategy value does.
  • Pipelines — step kinds and resolution precedence.
  • Worktreesneeds_prepared_worktree semantics.