Skip to main content
The JSON Schema for skill.spec.yml is embedded in the CLI binary and covers every v0 construct. It enforces typed fields, required properties, and additionalProperties: false on every typed object — unknown fields are not warned about, they are invalid. The schema is the machine-readable companion to the Grammar Reference.

Getting the Schema

Print the embedded schema to a file with:
You can then use it with any JSON Schema validator, wire it into your editor for YAML completion, or reference it in CI:
The schema $id is https://skillspec.dev/schemas/skill.spec.v0.json and targets JSON Schema draft 2020-12.

Strict Validation

Every typed object in the schema sets "additionalProperties": false. This means:
  • A field spelled prefr instead of prefer fails validation immediately.
  • A field spelled forbit instead of forbid fails validation immediately.
  • A field spelled elicitations at a route level (where it does not belong) fails validation immediately.
Without this strictness, misspelled behavior silently disappears: skillspec validate passes, the rule evaluates, but the misspelled effect never fires. Strict schema rejection turns silent data loss into an auditable error.
Explicit extension surfaces — metadata, allow values, choice sets, artifact schema, command success_when, and closures — use additionalProperties: true because they are intentionally open mappings.

Type Overview

Safety Classes

The safety_class enum appears on commands, elicitation choices, and dependency permission and provision fields. It is a declaration for the harness — not an execution permission.

Dependency Kinds

The reference CLI can directly check cli, file, and env dependencies via skillspec deps check. package, service, adapter, and browser dependencies are harness-specific and are reported as requiring harness-level checks.

Import Roles

Resource Roles

Code Kinds

Artifact Kinds

Cross-Reference Rules

skillspec validate enforces reference closure across the entire document. The most important rules:
  • Every Rule.prefer must reference an existing Route.id
  • Every Rule.route_order item must reference an existing Route.id
  • Every Rule.elicit item must reference an existing elicitation id
  • Every Rule.after_success item must reference an existing command or closure id
  • Every Test.expect.route must reference an existing Route.id
  • Every Elicitation.default must reference one of its own choices
  • Every Elicitation.required_when.route must reference an existing route
  • Every ElicitationChoice.route must reference an existing route
  • Every ElicitationChoice.next must reference an existing state
  • Every Import.requires.imports item must reference an existing import id
  • The import dependency graph must be acyclic
  • Every on_demand import must be connected via used_by, requires.imports, a code block, a recipe, or a load_import step
  • Every resource must be referenced by code or recipe, or declare used_by
  • Code.provenance must declare exactly one of resource or import
  • Every Code.requires.* item must reference an existing id of the appropriate kind
  • Every Code.inputs and Code.outputs item must reference an existing artifact
  • Every produced_by and consumed_by reference must use kind command, code, or recipe
  • Every recipe step reference must point at an existing id
  • Every scenario test must declare at least one concrete expectation
skillspec grammar sensemake --view porting teaches the grammar progressively before import — use it to understand which constructs to promote from prose before running skillspec validate on a generated draft.