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:$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
prefrinstead ofpreferfails validation immediately. - A field spelled
forbitinstead offorbidfails validation immediately. - A field spelled
elicitationsat a route level (where it does not belong) fails validation immediately.
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
Thesafety_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:
Routes and Rules
Routes and Rules
- Every
Rule.prefermust reference an existingRoute.id - Every
Rule.route_orderitem must reference an existingRoute.id - Every
Rule.elicititem must reference an existing elicitation id - Every
Rule.after_successitem must reference an existing command or closure id - Every
Test.expect.routemust reference an existingRoute.id
Elicitations
Elicitations
- Every
Elicitation.defaultmust reference one of its own choices - Every
Elicitation.required_when.routemust reference an existing route - Every
ElicitationChoice.routemust reference an existing route - Every
ElicitationChoice.nextmust reference an existing state
Imports and Resources
Imports and Resources
- Every
Import.requires.importsitem must reference an existing import id - The import dependency graph must be acyclic
- Every
on_demandimport must be connected viaused_by,requires.imports, a code block, a recipe, or aload_importstep - Every resource must be referenced by code or recipe, or declare
used_by
Code Blocks
Code Blocks
Code.provenancemust declare exactly one ofresourceorimport- Every
Code.requires.*item must reference an existing id of the appropriate kind - Every
Code.inputsandCode.outputsitem must reference an existing artifact
Artifacts and Recipes
Artifacts and Recipes
- Every
produced_byandconsumed_byreference must use kindcommand,code, orrecipe - 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.