{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/agent-skill-candidate.v1.json",
  "title": "Agoragentic Agent Skill Candidate",
  "description": "Receipt-backed skill candidate extracted from Agent OS runs or Harness Core sessions. This schema does not install skills, propagate globally, publish listings, mutate trust, activate x402, or bypass owner review.",
  "type": "object",
  "additionalProperties": true,
  "required": ["schema", "skill_candidate_id", "name", "action", "body", "source_receipts", "proposed_scope", "provenance", "status", "public_boundary"],
  "properties": {
    "schema": { "const": "agoragentic.agent-skill-candidate.v1" },
    "skill_candidate_id": { "type": "string" },
    "name": { "type": "string" },
    "action": {
      "type": "string",
      "enum": ["KEEP", "MERGE", "SKIP", "NEEDS_OWNER_REVIEW", "BLOCKED_BY_POLICY"]
    },
    "body": { "type": "string" },
    "source_receipts": {
      "type": "array",
      "items": { "type": "string" }
    },
    "proposed_scope": {
      "type": "string",
      "enum": [
        "private_owner_only",
        "deployment_only",
        "workspace_only",
        "team",
        "organization",
        "marketplace_public",
        "enterprise_tenant"
      ]
    },
    "provenance": {
      "type": "object",
      "required": ["created_from", "created_by", "created_at"],
      "additionalProperties": true
    },
    "status": {
      "type": "string",
      "enum": [
        "extracted",
        "pending_policy_review",
        "pending_owner_review",
        "approved",
        "rejected",
        "merged",
        "expired",
        "rolled_back",
        "blocked_by_policy"
      ]
    },
    "owner_approved": { "type": "boolean" },
    "source_receipt_backed": { "type": "boolean" },
    "blockers": { "type": "array", "items": { "type": "string" } },
    "warnings": { "type": "array", "items": { "type": "string" } },
    "approved_by": { "type": ["string", "null"] },
    "approval_id": { "type": ["string", "null"] },
    "rejection_reason": { "type": ["string", "null"] },
    "rollback_ref": { "type": ["string", "null"] },
    "rollback_reason": { "type": ["string", "null"] },
    "reviewed_by": { "type": ["string", "null"] },
    "reviewed_at": { "type": "string" },
    "public_boundary": {
      "type": "object",
      "properties": {
        "memory_artifact_only": { "const": true },
        "global_memory_enabled": { "const": false },
        "router_trust_mutated": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "settlement_triggered": { "const": false },
        "wallet_spend_triggered": { "const": false }
      },
      "additionalProperties": true
    }
  }
}
