{
  "$schema": "https://agentskills.io/schema/v0.2.0",
  "skills": [
    {
      "name": "search-products",
      "type": "http",
      "method": "GET",
      "description": "Search for vinyl records by artist, album, or genre",
      "url": "https://shopify-app.vinyl.com/api/agent/search",
      "sha256": "TBD",
      "parameters": {
        "query": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Search keyword — can be artist name, album title, or genre (e.g. 'The Beatles', 'Abbey Road', 'jazz')"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "default": 15,
            "maximum": 20,
            "description": "Number of results to return. Max 20, default 15."
          }
        ]
      },
      "response": {
        "200": {
          "description": "Search results",
          "schema": {
            "results": {
              "type": "array",
              "items": {
                "id": "string — numeric Shopify product ID",
                "title": "string — album title",
                "artist": "string | null",
                "description": "string | null",
                "price": "number | null — amount in store currency",
                "currency": "string | null — ISO 4217 code (e.g. 'USD')",
                "in_stock": "boolean",
                "url": "string | null — storefront product URL",
                "is_gift_card": "boolean",
                "product_type": "string | null",
                "featured_image": "string | null — image URL"
              }
            }
          }
        },
        "400": { "description": "Missing required parameter q" },
        "500": { "description": "Internal error" }
      }
    },
    {
      "name": "get-product",
      "type": "http",
      "method": "GET",
      "description": "Retrieve detailed information about a vinyl record",
      "url": "https://shopify-app.vinyl.com/api/agent/product/{id}",
      "sha256": "TBD",
      "parameters": {
        "path": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Numeric Shopify product ID (e.g. '123456789'). Obtain from search-products results."
          }
        ]
      },
      "response": {
        "200": {
          "description": "Product detail",
          "schema": {
            "id": "string — numeric Shopify product ID",
            "title": "string — album title",
            "artist": "string | null",
            "description": "string | null",
            "price": "number | null",
            "currency": "string | null",
            "in_stock": "boolean",
            "genres": "string[] — list of genre tags",
            "release_year": "number | null",
            "url": "string | null",
            "feature_image": "string | null",
            "is_gift_card": "boolean"
          }
        },
        "400": { "description": "Missing product id" },
        "404": { "description": "Product not found" },
        "500": { "description": "Internal error" }
      }
    },
    {
      "name": "create-checkout-link",
      "type": "http",
      "method": "POST",
      "description": "Generate a checkout link for a product",
      "url": "https://shopify-app.vinyl.com/api/agent/checkout-link",
      "sha256": "TBD",
      "parameters": {
        "body": {
          "contentType": "application/json",
          "fields": [
            {
              "name": "product_id",
              "required": true,
              "type": "string",
              "description": "Numeric Shopify product ID. Obtain from search-products or get-product."
            },
            {
              "name": "quantity",
              "required": false,
              "type": "integer",
              "default": 1,
              "description": "Number of units to add to the checkout cart."
            }
          ]
        }
      },
      "response": {
        "200": {
          "description": "Checkout link created",
          "schema": {
            "checkout_url": "string — Shopify checkout URL to redirect the user"
          }
        },
        "400": { "description": "Missing required field product_id" },
        "404": { "description": "Product or variant not found" },
        "500": { "description": "Internal error" }
      }
    }
  ]
}
