{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://get-design-done.example/schemas/intel.schema.json",
  "title": ".design/intel/*.json",
  "description": "Shape of intel-store slice files per reference/intel-schema.md. Each slice has a generated timestamp and one array-valued payload key matching the slice name.",
  "type": "object",
  "additionalProperties": true,
  "required": ["generated"],
  "properties": {
    "generated": { "type": "string" },
    "git_hash": { "type": "string" },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["path", "type"],
        "properties": {
          "path": { "type": "string" },
          "type": {
            "type": "string",
            "enum": ["skill", "agent", "reference", "connection", "script", "hook", "config", "test", "other"]
          },
          "mtime": { "type": "string" },
          "size_bytes": { "type": "integer", "minimum": 0 },
          "git_hash": { "type": "string" }
        }
      }
    },
    "exports": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["file", "kind", "name"],
        "properties": {
          "file": { "type": "string" },
          "kind": {
            "type": "string",
            "enum": ["skill", "agent", "reference", "other"]
          },
          "name": { "type": "string" },
          "command": { "type": "string" }
        }
      }
    },
    "symbols": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["file", "heading"],
        "properties": {
          "file": { "type": "string" },
          "heading": { "type": "string" },
          "level": { "type": "integer", "minimum": 1, "maximum": 6 },
          "anchor": { "type": "string" },
          "line": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "tokens": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["file", "token"],
        "properties": {
          "file": { "type": "string" },
          "token": { "type": "string" },
          "category": {
            "type": "string",
            "enum": ["color", "spacing", "typography", "radius", "shadow", "motion", "other"]
          },
          "line": { "type": "integer", "minimum": 1 },
          "context": { "type": "string" }
        }
      }
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["file", "component"],
        "properties": {
          "file": { "type": "string" },
          "component": { "type": "string" },
          "role": {
            "type": "string",
            "enum": ["definition", "reference", "example"]
          },
          "line": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "patterns": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["name"],
        "properties": {
          "name": { "type": "string" },
          "category": {
            "type": "string",
            "enum": ["color-system", "spacing-system", "typography-system", "component-styling", "layout", "interaction", "other"]
          },
          "source_file": { "type": "string" },
          "description": { "type": "string" }
        }
      }
    },
    "dependencies": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["from", "to"],
        "properties": {
          "from": { "type": "string" },
          "to": { "type": "string" },
          "kind": {
            "type": "string",
            "enum": ["at-reference", "reads-from", "skill-calls-agent", "agent-calls-agent"]
          },
          "line": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["id", "summary"],
        "properties": {
          "id": { "type": "string" },
          "summary": { "type": "string" },
          "source_file": { "type": "string" },
          "line": { "type": "integer", "minimum": 1 },
          "date": { "type": "string" }
        }
      }
    },
    "debt": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["id", "summary"],
        "properties": {
          "id": { "type": "string" },
          "summary": { "type": "string" },
          "severity": {
            "type": "string",
            "enum": ["high", "medium", "low"]
          },
          "source_file": { "type": "string" },
          "line": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["id"],
        "properties": {
          "id": { "type": "string" },
          "type": { "type": "string" },
          "name": { "type": "string" }
        }
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["from", "to"],
        "properties": {
          "from": { "type": "string" },
          "to": { "type": "string" },
          "kind": { "type": "string" }
        }
      }
    }
  }
}
