{
  "$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",
      "parameters": [
        {
          "name": "q",
          "in": "query",
          "required": true,
          "description": "Search keyword — can be artist name, album title, or genre (e.g. 'The Beatles', 'Abbey Road', 'jazz')",
          "schema": { "type": "string" }
        },
        {
          "name": "limit",
          "in": "query",
          "required": false,
          "description": "Number of results to return. Max 20, default 15.",
          "schema": {
            "type": "integer",
            "default": 15,
            "maximum": 20
          }
        }
      ],
      "responses": {
        "200": {
          "description": "Search results",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "results": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Numeric Shopify product ID"
                        },
                        "title": {
                          "type": "string",
                          "description": "Album title"
                        },
                        "artist": { "type": "string", "nullable": true },
                        "description": { "type": "string", "nullable": true },
                        "price": {
                          "type": "number",
                          "nullable": true,
                          "description": "Amount in store currency"
                        },
                        "currency": {
                          "type": "string",
                          "nullable": true,
                          "description": "ISO 4217 code (e.g. 'USD')"
                        },
                        "in_stock": { "type": "boolean" },
                        "url": {
                          "type": "string",
                          "nullable": true,
                          "description": "Storefront product URL"
                        },
                        "is_gift_card": { "type": "boolean" },
                        "product_type": { "type": "string", "nullable": true },
                        "featured_image": {
                          "type": "string",
                          "nullable": true,
                          "description": "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}",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Numeric Shopify product ID (e.g. '123456789'). Obtain from search-products results.",
          "schema": { "type": "string" }
        }
      ],
      "responses": {
        "200": {
          "description": "Product detail",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Numeric Shopify product ID"
                  },
                  "title": {
                    "type": "string",
                    "description": "Album title"
                  },
                  "artist": { "type": "string", "nullable": true },
                  "description": { "type": "string", "nullable": true },
                  "price": { "type": "number", "nullable": true },
                  "currency": { "type": "string", "nullable": true },
                  "in_stock": { "type": "boolean" },
                  "genres": {
                    "type": "array",
                    "items": { "type": "string" },
                    "description": "List of genre tags"
                  },
                  "release_year": { "type": "integer", "nullable": true },
                  "url": { "type": "string", "nullable": true },
                  "featured_image": { "type": "string", "nullable": true },
                  "is_gift_card": { "type": "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",
      "requestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": ["product_id"],
              "properties": {
                "product_id": {
                  "type": "string",
                  "description": "Numeric Shopify product ID. Obtain from search-products or get-product."
                },
                "quantity": {
                  "type": "integer",
                  "default": 1,
                  "description": "Number of units to add to the checkout cart."
                }
              }
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Checkout link created",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "checkout_url": {
                    "type": "string",
                    "description": "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" }
      }
    }
  ]
}
