{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aisa.ablera.com/contracts/drafts/skill-manifest.schema.json",
  "title": "Skill manifest — DRAFT (the runtime row of a skill: SKILLS.MANIFEST)",
  "x-status": "draft",
  "description": "Agent Framework § 6.6 and Agent Skills: a skill is a domain procedure with typed inputs, tool/connector bindings, judgement points and assertions. Source and/or binary packages are pinned in tool_bindings; the owned procedure, manifest and package dependencies form its release. A skill that writes retains dry-run and teardown. Required core only (D139).",
  "type": "object", "additionalProperties": true,
  "required": ["skill_key", "version", "module", "inputs", "operations", "assertions", "writes"],
  "properties": {
    "skill_key": { "type": "string", "pattern": "^[a-z][a-z0-9_.\\-]+$" },
    "version": { "type": "integer", "minimum": 1 },
    "module": { "type": "string", "enum": ["configuration", "support", "source", "platform"] },
    "name": { "type": "string" },
    "source_node": { "type": "string", "description": "memory tree path of the Markdown source" },
    "inputs": { "type": "object", "description": "JSON Schema of the skill's inputs" },
    "operations": { "type": "array", "minItems": 0, "items": { "type": "object", "required": ["operation_id", "connector", "mode"], "properties": { "operation_id": { "type": "string" }, "connector": { "type": "string" }, "mode": { "type": "string", "enum": ["read", "dry_run", "write", "send", "ddl"] }, "shape_key": { "type": "string", "description": "the approved write shape a write step instantiates" } } } },
    "tool_bindings": { "type": "array", "items": { "$ref": "https://aisa.ablera.com/contracts/tool-package.schema.json" }, "description": "Pinned executable packages; source and/or binary. Shared packages retain the canonical owner and digest." },
    "entry_tool": { "type": "object", "additionalProperties": false, "required": ["tool_key", "version"], "properties": { "tool_key": { "type": "string" }, "version": { "type": "integer", "minimum": 1 } }, "description": "Optional fully automated entry. It orchestrates the declared operations; the runner does not also replay operations as a second path." },
    "assertions": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["name", "expect"], "properties": { "name": { "type": "string" }, "query_or_call": { "type": "string" }, "expect": { "type": "string" } } } },
    "writes": { "type": "boolean" },
    "dry_run_default": { "type": "boolean" },
    "teardown": { "type": "object", "properties": { "operations": { "type": "array", "items": { "type": "string" } } } },
    "coverage_map": { "type": "array", "items": { "type": "object", "required": ["object", "path", "why"], "properties": { "object": { "type": "string" }, "path": { "type": "string", "enum": ["endpoint", "statement", "gateway", "ui_action"] }, "why": { "type": "string" } } }, "description": "D74/D136: per configuration object, which write path and why — the fallback is visible, never silent" },
    "proof_level_reached": { "type": "string", "enum": ["structural", "priced", "reachable", "quoted", "issued", "verified"] },
    "eval_set_key": { "type": "string" }
  },
  "allOf": [ { "if": { "properties": { "writes": { "const": true } } }, "then": { "required": ["dry_run_default", "teardown"], "properties": { "dry_run_default": { "const": true } } } } ]
}
