{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gateway.gethouston.ai/v1/agentstore/schema/agent",
  "title": "AgentIR",
  "description": "Houston Agent Store's framework-agnostic agent representation (v2.0.0). Build one from your agent's CLAUDE.md, its SKILL.md files, learnings and integrations, then POST it to /v1/agentstore/agents to publish (you get back a claimCode and a claimUrl to claim it).",
  "type": "object",
  "additionalProperties": false,
  "required": ["irVersion", "identity", "instructions", "provenance"],
  "properties": {
    "irVersion": { "const": "2.0.0" },
    "identity": {
      "type": "object",
      "additionalProperties": false,
      "required": ["slug", "name", "description", "category", "creator"],
      "properties": {
        "slug": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
          "description": "kebab-case, starts alphanumeric, 1..64 chars."
        },
        "name": { "type": "string", "minLength": 1, "maxLength": 120 },
        "tagline": { "type": "string", "maxLength": 160 },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 20000,
          "description": "Markdown \"what it does\"."
        },
        "icon": {
          "description": "An emoji OR an https image URL.",
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["kind", "value"],
              "properties": {
                "kind": { "const": "emoji" },
                "value": { "type": "string", "minLength": 1, "maxLength": 80 }
              }
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["kind", "url"],
              "properties": {
                "kind": { "const": "url" },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://",
                  "maxLength": 2048
                }
              }
            }
          ]
        },
        "color": { "type": "string", "maxLength": 32 },
        "category": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" },
        "tags": {
          "type": "array",
          "maxItems": 6,
          "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" },
          "description": "Up to 6 lowercase slug tags."
        },
        "creator": {
          "type": "object",
          "additionalProperties": false,
          "required": ["displayName"],
          "properties": {
            "displayName": { "type": "string", "minLength": 1, "maxLength": 80 },
            "url": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://",
              "maxLength": 2048
            }
          },
          "description": "MAY be sent with only a placeholder — it is rewritten to you when you claim the upload."
        }
      }
    },
    "instructions": {
      "type": "string",
      "maxLength": 200000,
      "description": "The agent's CLAUDE.md. May be an empty string."
    },
    "skills": {
      "type": "array",
      "maxItems": 64,
      "description": "Discrete skills; each `body` is a full SKILL.md file. Omit or send [].",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["slug", "body"],
        "properties": {
          "slug": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200000,
            "description": "The full SKILL.md text (YAML frontmatter + markdown), verbatim."
          }
        }
      }
    },
    "learnings": {
      "type": "array",
      "maxItems": 500,
      "description": "Captured learnings. Omit or send [].",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "text"],
        "properties": {
          "id": { "type": "string", "minLength": 1, "maxLength": 64 },
          "text": { "type": "string", "minLength": 1, "maxLength": 4000 },
          "createdAt": { "type": "string", "format": "date-time" }
        }
      }
    },
    "integrations": {
      "type": "array",
      "maxItems": 64,
      "description": "Composio toolkit slugs the agent expects. Omit or send [].",
      "items": { "type": "string", "pattern": "^[A-Z0-9_]{1,64}$" }
    },
    "provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": ["createdVia"],
      "properties": {
        "createdVia": { "enum": ["houston", "agent-post"] },
        "exporter": { "type": "string", "maxLength": 80 },
        "houstonVersion": { "type": "string", "maxLength": 40 },
        "anonymized": { "type": "boolean" }
      }
    }
  }
}
