{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/llm-wiki/schemas/v0.1.0/skill.json",
  "title": "Skill type",
  "description": "Agent skill with workflow instructions. Uses name/description instead of title/summary.",
  "x-index-aliases": {
    "name": "title",
    "description": "summary",
    "when_to_use": "read_when"
  },
  "type": "object",
  "required": ["name", "description", "type"],
  "properties": {
    "name": {
      "type": "string",
      "description": "Skill identifier (lowercase, hyphenated, max 64 chars)",
      "maxLength": 64
    },
    "description": {
      "type": "string",
      "description": "What the skill does and when to use it"
    },
    "type": {
      "type": "string",
      "description": "Must be skill",
      "const": "skill"
    },
    "when_to_use": {
      "type": "string",
      "description": "Additional activation context"
    },
    "argument-hint": {
      "type": "string",
      "description": "Hint shown during autocomplete"
    },
    "paths": {
      "oneOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" } }
      ],
      "description": "Glob patterns for file-based activation"
    },
    "disable-model-invocation": {
      "type": "boolean",
      "description": "Prevent auto-invocation"
    },
    "user-invocable": {
      "type": "boolean",
      "description": "Show in slash-command menu"
    },
    "allowed-tools": {
      "oneOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" } }
      ],
      "description": "Tools pre-approved for this skill"
    },
    "context": {
      "type": "string",
      "description": "fork to run in a subagent"
    },
    "agent": {
      "type": "string",
      "description": "Subagent type when context is fork"
    },
    "model": {
      "type": "string",
      "description": "Model override for this skill"
    },
    "effort": {
      "type": "string",
      "description": "Effort level",
      "enum": ["low", "medium", "high", "xhigh", "max"]
    },
    "shell": {
      "type": "string",
      "description": "Shell for inline commands",
      "enum": ["bash", "powershell"]
    },
    "hooks": {
      "type": "object",
      "description": "Hooks scoped to this skill's lifecycle"
    },
    "status": {
      "type": "string",
      "description": "Lifecycle state",
      "enum": ["active", "draft", "stub", "generated"]
    },
    "last_updated": {
      "type": "string",
      "description": "ISO 8601 date"
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Search terms"
    },
    "owner": {
      "type": "string",
      "description": "Who is responsible"
    },
    "superseded_by": {
      "type": "string",
      "description": "Slug of replacement"
    },
    "document_refs": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Slugs of doc pages that describe this skill"
    },
    "compatibility": {
      "type": "string",
      "description": "Human-readable environment requirements"
    },
    "license": {
      "type": "string",
      "description": "License identifier"
    },
    "metadata": {
      "type": "object",
      "description": "Publishing metadata (author, version, homepage)"
    }
  },
  "x-wiki-types": {
    "skill": "Agent skill with workflow instructions"
  },
  "x-graph-edges": {
    "document_refs": {
      "relation": "documented-by",
      "direction": "outgoing",
      "target_types": ["doc"]
    },
    "superseded_by": {
      "relation": "superseded-by",
      "direction": "outgoing"
    }
  },
  "additionalProperties": true
}
