{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.kiket.dev/board.json",
  "title": "Kiket Board Definition",
  "description": "Defines a Kanban/Scrum board layout with columns, swimlanes, and card templates.",
  "type": "object",
  "properties": {
    "model_version": {
      "type": "string"
    },
    "board": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9_-]+$"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "kanban",
            "scrum",
            "sprint",
            "roadmap"
          ],
          "default": "kanban"
        },
        "description": {
          "type": "string"
        },
        "workflow": {
          "type": "string"
        },
        "default": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "columns": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "states": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          },
          "wip_limit": {
            "type": "integer",
            "minimum": 0
          },
          "color": {
            "type": "string"
          }
        }
      }
    },
    "swimlanes": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false
        },
        "group_by": {
          "type": "string",
          "default": "assignee"
        },
        "show_empty": {
          "type": "boolean",
          "default": true
        },
        "order": {
          "type": "string",
          "enum": [
            "alphabetical",
            "custom"
          ],
          "default": "alphabetical"
        }
      },
      "additionalProperties": false
    },
    "card_template": {
      "type": "object",
      "properties": {
        "size": {
          "type": "string",
          "enum": [
            "compact",
            "standard",
            "detailed"
          ],
          "default": "compact"
        },
        "fields": {
          "type": "object",
          "properties": {
            "primary": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "secondary": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "show_avatar": {
          "type": "boolean"
        },
        "show_priority": {
          "type": "boolean"
        },
        "show_labels": {
          "type": "boolean"
        },
        "show_due_date": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "filters": {
      "type": "object"
    }
  },
  "required": [
    "columns"
  ],
  "additionalProperties": false
}
