{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://forge.summit-labs.me/schemas/manifest-v1.json",
  "title": "Summit Forge — Skills Manifest v1",
  "description": "Canonical schema for `skills/manifest.json` files in any Summit Forge workspace. Validates the list of skills + agent path mappings. Derived from the Zod schema in `cli/src/schema/manifest.schema.ts` of github.com/JERB78/summit-forge.\n\nEsquema canónico para archivos `skills/manifest.json`. Valida la lista de skills + mapping de paths por agente.",
  "type": "object",
  "additionalProperties": false,
  "required": ["version", "updated", "skills", "agents"],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "Optional URL of this JSON Schema (editor support)."
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$",
      "description": "SemVer (with optional pre-release tag) of the Summit Forge toolkit version this manifest belongs to."
    },
    "updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "ISO date YYYY-MM-DD when the manifest was last updated."
    },
    "skills": {
      "type": "object",
      "minProperties": 1,
      "description": "Map of skill key (kebab-case) to Skill metadata. Must declare at least one skill.",
      "patternProperties": {
        "^[a-z0-9]+(?:-[a-z0-9]+)*$": {
          "$ref": "#/$defs/Skill"
        }
      },
      "additionalProperties": false
    },
    "agents": {
      "type": "object",
      "minProperties": 1,
      "description": "Map of agent key (kebab-case) to Agent path config. Must declare at least one agent.",
      "patternProperties": {
        "^[a-z0-9]+(?:-[a-z0-9]+)*$": {
          "$ref": "#/$defs/Agent"
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "Skill": {
      "type": "object",
      "additionalProperties": false,
      "required": ["version", "displayName", "description", "source", "tier"],
      "properties": {
        "version": {
          "type": "string",
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$",
          "description": "Independent SemVer version of this skill."
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable display name."
        },
        "description": {
          "type": "string",
          "minLength": 20,
          "description": "One-paragraph description for trigger detection (min 20 chars so AI agents have enough signal)."
        },
        "source": {
          "type": "string",
          "pattern": "^skills/[a-z0-9]+(?:-[a-z0-9]+)*/SKILL\\.md$",
          "description": "Path to canonical SKILL.md relative to repo root. Must follow `skills/<kebab-case-name>/SKILL.md`."
        },
        "tier": {
          "type": "string",
          "enum": ["core", "extended", "experimental"],
          "description": "Tier classification — `core` skills get strongest stability guarantees; `extended` activate on trigger; `experimental` are unstable."
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "default": [],
          "description": "Tags for discoverability and filtering."
        }
      }
    },
    "Agent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "platform"],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Path pattern. Supports `{skill}` placeholder."
        },
        "platform": {
          "type": "string",
          "enum": ["all", "project", "global"],
          "description": "Where this agent operates: `all` = anywhere, `project` = per-project, `global` = user-global."
        },
        "comingSoon": {
          "type": "boolean",
          "description": "Marker for agents not yet released."
        }
      }
    }
  }
}
