{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://claude-context.dev/schemas/manifest.schema.json",
  "title": "Claude Context Manifest",
  "description": "Root manifest for Claude context engineering installation",
  "type": "object",
  "required": ["name", "version"],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON Schema reference"
    },
    "name": {
      "type": "string",
      "pattern": "^[a-z0-9-]+$",
      "minLength": 1,
      "maxLength": 100,
      "description": "Project context name (lowercase, hyphens allowed)"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "Semantic version of this context installation"
    },
    "claude_context_version": {
      "type": "string",
      "description": "Compatible claude-context template version (semver range)"
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "description": "Brief description of the project context"
    },
    "repository": {
      "type": "string",
      "format": "uri",
      "description": "Repository URL"
    },
    "author": {
      "oneOf": [
        { "type": "string" },
        {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "email": { "type": "string", "format": "email" },
            "url": { "type": "string", "format": "uri" }
          },
          "required": ["name"]
        }
      ],
      "description": "Author information"
    },
    "license": {
      "type": "string",
      "description": "SPDX license identifier"
    },
    "keywords": {
      "type": "array",
      "items": { "type": "string" },
      "maxItems": 20,
      "description": "Keywords for discovery"
    },
    "agents": {
      "type": "array",
      "items": { "type": "string" },
      "description": "List of agent names included"
    },
    "commands": {
      "type": "array",
      "items": { "type": "string" },
      "description": "List of command names included"
    },
    "workflows": {
      "type": "array",
      "items": { "type": "string" },
      "description": "List of workflow names documented"
    },
    "extensions": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Installed extension identifiers"
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": { "type": "string" },
      "description": "Extension dependencies with version ranges"
    },
    "config": {
      "type": "object",
      "description": "Default configuration overrides",
      "properties": {
        "context_budget": {
          "type": "object",
          "properties": {
            "max_tokens": { "type": "integer" },
            "target_utilization": { "type": "number" },
            "compact_trigger": { "type": "number" }
          }
        },
        "rpi": {
          "type": "object",
          "properties": {
            "require_human_approval": { "type": "boolean" },
            "auto_doc_update": { "type": "boolean" }
          }
        }
      }
    },
    "scripts": {
      "type": "object",
      "additionalProperties": { "type": "string" },
      "description": "Custom scripts (init, validate, etc.)"
    }
  },
  "additionalProperties": false
}
