{
  "$id": "https://loadout.jnw-it.com/api/schema.json",
  "title": "Agent Loadout listing.yaml",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "type": {
      "type": "string",
      "const": "loadout"
    },
    "title": {
      "type": "string",
      "minLength": 3,
      "maxLength": 60
    },
    "summary": {
      "type": "string",
      "minLength": 20,
      "maxLength": 200
    },
    "description": {
      "type": "string",
      "minLength": 20
    },
    "highlights": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "license": {
      "type": "string",
      "minLength": 2
    },
    "author": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "github": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "source": {
      "type": "object",
      "properties": {
        "repo": {
          "type": "string",
          "format": "uri"
        },
        "path": {
          "type": "string"
        },
        "commit": {
          "type": "string"
        }
      },
      "required": [
        "repo"
      ],
      "additionalProperties": false
    },
    "categories": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "web-app",
          "gamedev",
          "security",
          "bots",
          "browser-extension",
          "data",
          "workflow",
          "ai-agents"
        ]
      }
    },
    "stacks": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "files": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "type": "string",
            "enum": [
              "instructions",
              "adapter",
              "rules",
              "skill",
              "reference",
              "mcp",
              "subagent"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "agent": {
            "description": "adapter files only: the single agent this file is for",
            "type": "string",
            "enum": [
              "claude-code",
              "codex",
              "cursor",
              "gemini-cli",
              "copilot"
            ]
          },
          "skill": {
            "description": "skill and reference files: the skill folder name",
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "install_to": {
            "description": "override the default target path per agent; null = not installed",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "claude-code",
                "codex",
                "cursor",
                "gemini-cli",
                "copilot"
              ]
            },
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "required": [
          "path",
          "role",
          "description"
        ],
        "additionalProperties": false
      }
    },
    "compatibility": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": [
          "claude-code",
          "codex",
          "cursor",
          "gemini-cli",
          "copilot"
        ]
      },
      "additionalProperties": {
        "type": "string",
        "enum": [
          "native",
          "adapter",
          "unsupported"
        ]
      }
    },
    "requires": {
      "default": {
        "tools": [],
        "env": [],
        "mcp": []
      },
      "type": "object",
      "properties": {
        "tools": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "env": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mcp": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "tested": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "passing",
            "failing",
            "partial",
            "untested"
          ]
        },
        "last_run": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {}
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "per_agent": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "enum": [
              "claude-code",
              "codex",
              "cursor",
              "gemini-cli",
              "copilot"
            ]
          },
          "additionalProperties": {
            "type": "string",
            "enum": [
              "pass",
              "fail",
              "untested"
            ]
          }
        },
        "fixture": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "status",
        "last_run",
        "fixture"
      ],
      "additionalProperties": false
    },
    "security": {
      "type": "object",
      "properties": {
        "scanned": {
          "type": "boolean"
        },
        "scanner": {
          "type": "string"
        },
        "verdict": {
          "type": "string",
          "enum": [
            "clean",
            "flagged"
          ]
        },
        "network": {
          "type": "boolean"
        },
        "scripts": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "scanned",
        "network"
      ],
      "additionalProperties": false
    },
    "featured": {
      "default": false,
      "type": "boolean"
    },
    "deprecated": {
      "default": false,
      "type": "boolean"
    },
    "last_checked": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {}
      ]
    },
    "published": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {}
      ]
    },
    "updated": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {}
      ]
    }
  },
  "required": [
    "id",
    "type",
    "title",
    "summary",
    "description",
    "highlights",
    "version",
    "license",
    "author",
    "categories",
    "stacks",
    "files",
    "tested",
    "security",
    "last_checked"
  ],
  "additionalProperties": false
}