{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/receipt-backed-skill.v1.json",
  "title": "Agoragentic Receipt-Backed Skill",
  "description": "Approved or pending skill artifact with source receipts, scope, version, and rollback metadata. This schema does not auto-install, globally propagate, publish, spend, settle, activate x402, or mutate trust.",
  "type": "object",
  "additionalProperties": true,
  "required": ["schema", "skill_id", "name", "body", "scope", "source_receipts", "version", "status", "owner_approved", "injectable", "public_boundary"],
  "properties": {
    "schema": { "const": "agoragentic.receipt-backed-skill.v1" },
    "skill_id": { "type": "string" },
    "name": { "type": "string" },
    "body": { "type": "string" },
    "scope": {
      "type": "string",
      "enum": ["private_owner_only", "deployment_only", "workspace_only", "team", "organization", "marketplace_public", "enterprise_tenant"]
    },
    "source_receipts": {
      "type": "array",
      "items": { "type": "string" }
    },
    "version": { "type": "string" },
    "status": {
      "type": "string",
      "enum": ["pending_owner_review", "approved", "rejected", "merged", "expired", "rolled_back", "blocked_by_policy"]
    },
    "owner_approved": { "type": "boolean" },
    "rollback_ref": { "type": ["string", "null"] },
    "injectable": { "type": "boolean" },
    "blockers": { "type": "array", "items": { "type": "string" } },
    "warnings": { "type": "array", "items": { "type": "string" } },
    "public_boundary": {
      "type": "object",
      "required": [
        "skill_artifact_only",
        "auto_installed_into_hosts",
        "global_propagation_enabled",
        "raw_private_context_exposed",
        "router_trust_mutated",
        "marketplace_publication_triggered",
        "x402_route_created",
        "settlement_triggered"
      ],
      "properties": {
        "skill_artifact_only": { "const": true },
        "auto_installed_into_hosts": { "const": false },
        "global_propagation_enabled": { "const": false },
        "raw_private_context_exposed": { "const": false },
        "router_trust_mutated": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "settlement_triggered": { "const": false }
      }
    },
    "created_at": { "type": "string", "format": "date-time" }
  }
}
