{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:agentic-awesome-skills:schema:selection-input:v1",
  "title": "AAS agent-owned selection input v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["profile", "skillIds"],
  "properties": {
    "name": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._ -]*$" },
    "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["host", "scope"],
        "properties": {
          "host": { "enum": ["codex", "claude"] },
          "scope": { "enum": ["project", "user"] }
        }
      }
    },
    "profile": {
      "type": "object",
      "additionalProperties": false,
      "required": ["goals"],
      "properties": {
        "goals": { "$ref": "#/$defs/textArray" },
        "projectType": { "type": "string", "minLength": 1, "maxLength": 256 },
        "languages": { "$ref": "#/$defs/optionalTextArray" },
        "frameworks": { "$ref": "#/$defs/optionalTextArray" },
        "constraints": { "$ref": "#/$defs/optionalTextArray" }
      }
    },
    "skillIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 128,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/id" }
    }
  },
  "$defs": {
    "id": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[a-z0-9][a-z0-9._-]*(/[a-z0-9][a-z0-9._-]*)*$" },
    "textArray": { "type": "array", "minItems": 1, "maxItems": 32, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
    "optionalTextArray": { "type": "array", "maxItems": 32, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 256 } }
  }
}
