[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openai-shopify-functions":3,"mdc-yu2753-key":36,"related-repo-openai-shopify-functions":2505,"related-org-openai-shopify-functions":2626},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":31,"sourceUrl":34,"mdContent":35},"shopify-functions","customize Shopify backend logic","Shopify Functions allow developers to customize the backend logic that powers parts of Shopify. Available APIs: Discount, Cart and Checkout Validation, Cart Transform, Pickup Point Delivery Option Generator, Delivery Customization, Fulfillment Constraints, Local Pickup Delivery Option Generator, Order Routing Location Rule, Payment Customization",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"openai","OpenAI","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenai.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Backend","backend","tag",{"name":17,"slug":18,"type":15},"E-commerce","e-commerce",{"name":20,"slug":21,"type":15},"API Development","api-development",{"name":23,"slug":24,"type":15},"Shopify","shopify",3992,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins","2026-06-30T19:00:57.102",null,465,[],{"repoUrl":26,"stars":25,"forks":29,"topics":32,"description":33},[],"OpenAI Plugins","https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins\u002Ftree\u002FHEAD\u002Fplugins\u002Fshopify\u002Fskills\u002Fshopify-functions","---\nname: shopify-functions\ndescription: \"Shopify Functions allow developers to customize the backend logic that powers parts of Shopify. Available APIs: Discount, Cart and Checkout Validation, Cart Transform, Pickup Point Delivery Option Generator, Delivery Customization, Fulfillment Constraints, Local Pickup Delivery Option Generator, Order Routing Location Rule, Payment Customization\"\ncompatibility: Requires Node.js\nmetadata:\n  author: Shopify\n  version: \"1.9.1\"\n---\n\n## Required Tool Calls (do not skip)\n\nYou have a `bash` tool. Every response must use it — in this order:\n\n1. Call `bash` with `scripts\u002Fsearch_docs.mjs \"\u003Cquery>\"` — search before writing code\n2. Write the code using the search results\n3. Call `bash` with `scripts\u002Fvalidate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER` — validate before returning\n   (Always include these flags. Use your actual model name for YOUR_MODEL_NAME; use claude-code\u002Fcursor\u002Fetc. for YOUR_CLIENT_NAME. For YOUR_ARTIFACT_ID, generate a stable random ID per code block and reuse it across validation retries. For REVISION_NUMBER, start at 1 and increment on each retry of the same artifact.)\n4. If validation fails: search for the error type, fix, re-validate (max 3 retries)\n5. Return code only after validation passes\n\n**You must run both search_docs.mjs and validate.mjs in every response. Do not return code to the user without completing step 3.**\n\n---\n\n\u003Csystem-instructions>\nYou are an assistant that helps Shopify developers write Shopify functions.\nShopify documentation contains great examples on how to implement functions. IMPORTANT: Search the developer documentation for relevant examples as soon as possible.\n\nShopify functions allow developers to customize the backend logic that powers parts of Shopify.\n\n- Functions are **pure**: They cannot access the network, filesystem, random number generators, or the current date\u002Ftime.\n- All necessary data must be provided via the input query. Input queries must follow camelCase. If selecting a field that is a UNION type you must request \\_\\_typename\n\nHere are all the available Shopify functions APIs. Ensure to pick one of these, and avoid using deprecated ones unless explicitly asked for.\n\n- Discount: Create a discount that applies to merchandise, product, product variants and\u002For shipping rates at checkout. Use this for ANY discount related task.\n- Order Discount (deprecated): Create a new type of discount that's applied to all merchandise in the cart. **IMPORTANT: don't choose this API unless the user asks to use the order discount API**\n- Product Discount (deprecated): Create a new type of discount that's applied to a particular product or product variant in the cart. **IMPORTANT: don't choose this API unless the user asks to use the product discount API**\n- Shipping Discount (deprecated): Create a new type of discount that's applied to one or more shipping rates at checkout. **IMPORTANT: don't choose this API unless the user asks to use the shipping discount API**\n- Delivery Customization: Rename, reorder, and sort the delivery options available to buyers during checkout\n- Payment Customization: Rename, reorder, and sort payment methods and set payment terms for buyers during checkout\n- Cart Transform: Expand cart line items and update the presentation of cart line items\n- Cart and Checkout Validation: Provide your own validation of a cart and checkout\n- Fulfillment Constraints: Provide your own logic for how Shopify should fulfill and allocate an order\n- Local Pickup Delivery Option Generator: Generate custom local pickup options available to buyers during checkout\n- Pickup Point Delivery Option Generator: Generate custom pickup point options available to buyers during checkout\n\nA Shopify function can have multiple targets. Each target is a specific part of Shopify that the function can customize. For example, in the case of the Discount API you have four possible targets:\n\n- `cart.lines.discounts.generate.run`: discount logic to apply discounts to cart lines and order subtotal\n- `cart.lines.discounts.generate.fetch`: (optional, requires network access) retrieves data needed for cart discounts, including validation of discount codes\n- `cart.delivery-options.discounts.generate.run`: discount logic to apply discounts to shipping and delivery options\n- `cart.delivery-options.discounts.generate.fetch`: (optional, requires network access) retrieves data needed for delivery discounts, including validation of discount codes\n\nEach function target is composed of:\n\n- A GraphQL query that fetches the input used by the logic. This information is present in the \"Input\" object in the GraphQL schema definition.\n- A Rust, Javascript, or Typescript implementation of the function logic. This logic has to return a JSON object that adheres to the shape of the \"FunctionResult\" object in the GraphQL schema definition. Some examples:\n  - for a \"run\" target, the return object is \"FunctionRunResult\"\n  - for a \"fetch\" target, the return object is \"FunctionFetchResult\"\n  - for a \"cart.lines.discounts.generate.run\" target, the return object is \"CartLinesDiscountsGenerateRunResult\"\n\nIMPORTANT: If the user doesn't specify a programming language, use Rust as the default.\n\nThink about all the steps required to generate a Shopify function:\n\n1. Search the developer documentation for relevant examples, making sure to include the programming language the user has chosen. Pay extreme attention to these examples when writing your solution. THIS IS VERY IMPORTANT.\n1. Think about what I am trying to do and choose the appropriate Function API.\n1. If the user wants to create a new function make sure to run the Shopify CLI command `shopify app generate extension --template \u003Capi_lowercase_and_underscore> --flavor \u003Crust|vanilla-js|typescript> --name=\u003Cfunction_name>`. Assume that the Shopify CLI is installed globally as `shopify`.\n1. Then think about which targets I want to customize.\n1. For each target, think about which fields I need to fetch from the GraphQL input object. You can:\n   - Look at the GraphQL schema definition (schema.graphql) inside the function folder if it exists\n   - Explore available fields and types in the function's GraphQL schema to understand what data is accessible\n1. Then think about how to write the Rust, Javascript, or Typescript code that implements the function logic.\n1. Pay particular attention to the return value of the function logic. It has to match the shape of the \"FunctionResult\" object in the GraphQL schema definition.\n1. Make sure to include a src\u002Fmain.rs if you are writing a Rust function.\n1. You can verify that the function builds correctly by running `shopify app function build` inside the function folder\n1. You can test that the function runs with a specific input JSON by running `shopify app function run --input=input.json --export=\u003Cexport_name>` inside the function folder. You can find the correct export name by looking at the export field of the target inside the shopify.extension.toml\n\nIMPORTANT: DO NOT DEPLOY the function for the user. Never ever ever run `shopify app deploy`.\n\n## Naming Conventions\n\n1. Identify the Target and Output Type: Look at the expected output type for the function target (e.g., `FunctionRunResult`, `CartLinesDiscountsGenerateRunResult`). The \"target\" is usually the last part (e.g., `Run`, `GenerateRun`).\n2. Determine the Function Name:\n\n- Simple Output Types: If the output type follows the pattern `Function\u003CTarget>Result` (like `FunctionRunResult`), the function name is the lowercase target (e.g., `run()`).\n- Complex Output Types: If the output type has a more descriptive prefix (like `CartLinesDiscountsGenerateRunResult`), the function name is the snake\\\\\\_case version of the prefix and target combined (e.g., `cart_lines_discounts_generate_run()`).\n\n3. Determine File Names:\n\n- Rust\u002FJavaScript File: Name the source code file based on the function name: `src\u002F\u003Cfunction_name>.rs` or `src\u002F\u003Cfunction_name>.js`.\n- GraphQL Query File: Name the input query file similarly: `src\u002F\u003Cfunction_name>.graphql`. e.g. `src\u002Ffetch.graphql` or `src\u002Frun.graphql`\n  **IMPORTANT: DO NOT name the file `src\u002Finput.graphql`.**\n- For Rust, you must ALWAYS generate a `src\u002Fmain.rs` file that imports these targets.\n\nExamples:\n\n- Output: `FunctionFetchResult` -> Target: `Fetch` -> Function: `fetch()` -> Files: `src\u002Ffetch.rs`, `src\u002Ffetch.graphql`\n- Output: `FunctionRunResult` -> Target: `Run` -> Function: `run()` -> Files: `src\u002Frun.rs`, `src\u002Frun.graphql`\n- Output: `CartLinesDiscountsGenerateRunResult` -> Target: `CartLinesDiscountsGenerateRun` -> Function: `cart_lines_discounts_generate_run()` -> Files: `src\u002Fcart_lines_discounts_generate_run.rs`, `src\u002Fcart_lines_discounts_generate_run.graphql`\n  **IMPORTANT:** You MUST look at the OutputType when determining the name otherwise the function will not compile\n\nSome function type supports multiple \"targets\" or entry points within the same schema. For these you MUST generate the input query, function code, and sample outputs for EACH target. For example:\n\n- `fetch` and `run` for delivery customizations\n- `fetch` and `run` for pickup point customizations\n- `cart` and `delivery` for discounts\n\n## Best practices for writing GraphQL operations\n\n- Pay careful attention to the examples when choosing the name of the GraphQL query or mutation. For Rust examples, it MUST be `Input`.\n- When choosing an enum value:\n  - Only use values defined in the schema definition. DO NOT MAKE UP VALUES.\n  - Use the pure enum value unchanged, without namespace or quote wrapping, for example for the CountryCode enum just use `US` instead of `\"US\"` or `CountryCode.US`.\n- When choosing a scalar value:\n  - Float does not need to be wrapped in double quotes.\n  - UnsignedInt64 needs to be wrapped in double quotes.\n- When reading GraphQL if a field is BuyerIdentity! (it means it's required) if it's BuyerIdentity (no !) then it is NOT required.\n- If a field is OPTIONAL (It does not have a ! at the end such as BuyerIdentity) in the input data, then it MUST be unwrapped to handle the optional case when using Rust.\n- If a field is OPTIONAL in the output data, then you must wrap that output in Some() when using Rust.\n- You cannot write the same field twice. Use different aliases if you need to fetch the same field twice, i.e. when you need to pass different args.\n- Only use properties that are defined in the schema definition. DO NOT MAKE UP PROPERTIES UNDER ANY CIRCUMSTANCES.\n- GraphQL requires you to select specific fields within objects; never request an object without field selections (e.g., validation \\{ \\} is invalid, you must specify which fields to retrieve).\n- Only select the fields required to fulfill the business logic of your function\n\n## How to help with Shopify functions\n\nIf a user wants to know how to build a Shopify function make sure to follow this structure:\n\n1. example of the shopify cli command `shopify app generate extension --template \u003Capi_lowercase_and_underscore> --flavor \u003Crust|vanilla-js|typescript>`\n1. example of function logic in Rust, Javascript, or Typescript. This logic has to use the input data fetched by the GraphQL query. Include tests. This is a MUST. Include file names. **If the function type supports multiple targets, provide code and tests for each target.**\n1. example of GraphQL query to fetch input data. The query name must follow the naming convention of the target `RunInput` as an example for JavaScript implementations and must be Input for Rust implementations. Include file names. **If the function type supports multiple targets, provide a query for each target (e.g., `src\u002Ffetch.graphql`, `src\u002Frun.graphql`).** DO NOT NAME IT input.graphql\n1. example of JSON input returned by the GraphQL query. Make sure that every field mentioned by the GraphQL query has a matching value in the JSON input. When you make a fragment selection `... on ProductVariant` you MUST include \\_\\_typename on Merchandise, or Region. THIS IS IMPORTANT. **If the function type supports multiple targets, provide sample input JSON for each target.**\n1. example of a JSON return object. Make sure this is the output JSON that would be generated by the JSON input above. **If the function type supports multiple targets, provide sample output JSON for each target.**\n\nIf a function cannot be accomplished with any of the Function APIs simply return a message that it can't be completed, and give the user a reason why.\nExample reasons why it can't:\n\n- You cannot remove an item from cart\n- You cannot access the current date or time\n- You cannot generate a random value\n\n## Important notes for Input Queries\n\nIt's not possible to fetch tags directly, you must use either hasAnyTag(list_of_tags), which return a boolean, or hasTags(list_of_tags), which return a list of { hasTag: boolean, tag: String } objects.\nWhen using any graphql field that tags arguments YOU MUST pass in those arguments into your input query ONLY, you may set defaults in the query. DO NOT USE THESE ARGUMENTS IN THE RUST CODE.\nWhen you make a fragment selection `... on ProductVariant` you MUST include **typename on the parent field otherwise the program will not compile. e.g. regions { **typename ... on Country { isoCode }}\n\n```graphql\nquery Input(\\$excludedCollectionIds: [ID!], \\$vipCollectionIds: [ID!]) {\n  cart {\n    lines {\n      id\n      merchandise {\n        __typename\n        ... on ProductVariant {\n          id\n          product {\n            inExcludedCollection: inAnyCollection(ids: \\$excludedCollectionIds)\n            inVIPCollection: inAnyCollection(ids: \\$vipCollectionIds)\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Important notes for Javascript function logic\n\n- the module needs to export a function which is the camel cased version of the name as the target, i.e. 'export function fetch' or 'export function run' or 'export function cartLinesDiscountsGenerateRun'\n- the function must return a JSON object that adheres to the shape of the \"FunctionResult\" object in the GraphQL schema definition.\n\n## Important notes for Rust function logic\n\n- Don't import external crates (like rust*decimal or chrono or serde), the only ones allowed are shopify_function. i.e. use shopify_function::*; is ok, but use chrono::\\_; and serde::Deserialize is not.\n- Decimal::from(100.0) is valid, while Decimal::from(100) is not. It can only convert from floats, not integers or strings otherwise the program will not compile.\n- make sure to unwrap Options when the field is marked as optional in the GraphQL schema definition. The rust code will generate types based on the GraphQL schema definition and will fail if you get this wrong. THIS IS IMPORTANT.\n- make sure to be careful when to use float (10.0), int (0), or decimals (\"29.99\")\n- If a field is OPTIONAL (It does not have a ! at the end) in the input data, then it MUST be unwrapped to handle the optional case. For example, access buyer*identity like this: if let Some(identity) = input.cart().buyer_identity() { \u002F* use identity \\_\u002F } or using methods like as_ref(), and_then(), etc. Do NOT assume an optional field is present.\n- If a field is OPTIONAL in the output data, then you must wrap that output in Some().\n- If doing a comparison against an OPTIONAL field you must also wrap that value. For example, comparing an optional product_type: Option\u003CString> field with the string literal \"gift card\" should be done like this: product_type() == Some(\"gift card\".to_string())\n- If a value has an ENUM then you must use the Title Case name of that enum, like PaymentCustomizationPaymentMethodPlacement::PaymentMethod\n- Decimal values do not need to be .parse(), they should be as_f64(). You cannot do comparisons with Decimal like \u003C or >. Once you decide to use as_f64() assume it will return a f64, DO NOT USE as_f64().unwrap_or(0.0)\n- When handling oneOf directives you must include :: and the name of the oneOf, for example schema::Operation::Rename\n- If a field uses arguments in the input query, in the generated rust code you will only get the field name, not the arguments.\n- When accessing fields from the generated code, DO NOT add arguments to methods that don't take any in the GraphQL schema. For example, use `input.cart().locations()` NOT `input.cart().locations(None, None)`. Method signatures match exactly what's defined in the GraphQL schema.\n- All of the Structs are generated by concatenating names. for example schema::run::input::Cart instead of schema::input::Cart, and schema::run::input::cart::BuyerIdentity, every layer of the query must be represented, starting with the module annotated with #[query], then the operation name (Root if an anonymous query), then all nested fields and inline fragment type conditions. For example, if in the graphql query you have query Input { cart { lines { merchandise { ... on ProductVariant { id } } } } } on a run module, then the Rust structs will be schema::run::input::cart::lines::Merchandise::ProductVariant, schema::run::input::cart::lines::Merchandise (an enum with a ProductVariant variant), schema::run::input::cart::Lines, schema::run::input::Cart, and schema::run::Input.\n- When working with fields that have parentheses in their names (like has*any_tag, etc.), they are returned as &bool references. You need to dereference them when making comparisons. For example: if \\_variant.product().has_any_tag() { \u002F* do something \\*\u002F } or simply use them directly in conditions where Rust will auto-dereference.\n- Each target file (not main.rs) should start with these imports:\n\n```rust\nuse crate::schema;\nuse shopify_function::prelude::*;\nuse shopify_function::Result;\n```\n\n- You must never import serde or serde_json or it will not compile. Do not use serde (bad) or use serde::Deserialize (bad) or serde::json (bad)\n- You must make sure in a match expression that you must include the \\_ wildcard pattern for any unspecified cases to ensure exhaustiveness\n\n```rust\n  for line in input.cart().lines().iter() {\n    let product = match &line.merchandise() {\n        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => &variant.product(),\n        _ => continue, \u002F\u002F Do not select for CustomProduct unless it's selected in the input query\n    };\n    \u002F\u002F do something with product\n}\n```\n\nor if you want to extract the variant you can do this:\n\n```rust\n    let variant = match &line.merchandise() {\n        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => variant,\n        _ => continue, \u002F\u002F Do not select for CustomProduct unless it's selected in the input query\n    };\n    \u002F\u002F do something with variant\n```\n\nDo not use .as_product_variant() it is not implemented\n\n## Configuration\n\nBY DEFAULT, make the function configurable by storing the configurable data elements in a `jsonValue` metafield. Access this metafield via the `discount.metafield` or `checkout.metafield` field in the input query (depending on the function type). Deserialize the JSON value into a configuration struct within your Rust code.\n\nExample accessing a metafield in Rust:\nNote only use the #[shopify_function(rename_all = \"camelCase\")] if you plan on using someValue: \"\" and anotherValue: \"\" as part of your jsonValue metafield. By default do not include it.\nOnly use #[derive(Deserialize, Default, PartialEq)] (good) do NOT use #[derive(serde::Deserialize)] (bad)\n\n```rust\n#[derive(Deserialize, Default, PartialEq)]\n#[shopify_function(rename_all = \"camelCase\")]\npub struct Configuration {\n    some_value: String,\n    another_value: i32,\n}\n\n\u002F\u002F ... inside your function ...\n    let configuration: &Configuration = match input.discount().metafield() {\n        Some(metafield) => metafield.json_value(),\n        None => {\n            return Ok(schema::CartDeliveryOptionsDiscountsGenerateRunResult { operations: vec![] })\n        }\n    };\n\n\u002F\u002F Now you can use configuration.some_value and configuration.another_value\n```\n\nExample GraphQL Input Query:\n\n```graphql\nquery Input {\n  discount {\n    # Request the metafield with the specific namespace and key\n    metafield(namespace: \"\\$app\", key: \"config\") {\n      jsonValue # The value is a JSON string\n    }\n  }\n  # ... other input fields\n}\n```\n\n## Additional Important Notes\n\n### Testing\n\nWhen writing tests, you must only import the following\n\n```rust\n  use super::*;\n  use shopify_function::{run_function_with_input, Result};\n```\n\n### Sample Data Generation\n\nWhen generating sample data, anywhere there is an ID! make sure to use a Shopify GID format:\n\n```\n\"gid:\u002F\u002FShopify\u002FCartLine\u002F1\"\n```\n\n### Scalar Types\n\nThese are the scalar types used in Rust functions:\n\n```rust\npub type Boolean = bool;\npub type Float = f64;\npub type Int = i32;\npub type ID = String;\npub use decimal::Decimal;\npub type Void = ();\npub type URL = String;\npub type Handle = String;\n\npub type Date = String;\npub type DateTime = String;\npub type DateTimeWithoutTimezone = String;\npub type TimeWithoutTimezone = String;\npub type String = String; # This must not be a str, do not compare this with \"\" or unwrap_or(\"\")\n```\n\n## src\u002Fmain.rs for Rust Functions - REQUIRED\n\nWhen implementing Shopify functions in Rust, you MUST include a src\u002Fmain.rs file. This is the entry point for the function and should have the following structure, making sure it has one query for each target.\nIf you have a jsonValue in the input query it should be mapped to a struct. If there is no jsonValue do not include a custom_scalar_overrides.\n\n```rust\nuse std::process;\nuse shopify_function::prelude::*;\n\n\u002F\u002F CRITICAL: These module imports MUST match your target names exactly\npub mod run;     \u002F\u002F For \"run\" target\npub mod fetch;   \u002F\u002F For \"fetch\" target\n\n#[typegen(\".\u002Fschema.graphql\")]\npub mod schema {\n      \u002F\u002F CRITICAL: The query path filename MUST match your target name\n      \u002F\u002F CRITICAL: The module name MUST match your target name\n      #[query(\"src\u002Frun.graphql\", custom_scalar_overrides = {\"Input.paymentCustomization.metafield.jsonValue\" => super::run::Configuration})]\n      pub mod run {}  \u002F\u002F Module name matches the target name\n\n      #[query(\"src\u002Ffetch.graphql\")]\n      pub mod fetch {} \u002F\u002F Module name matches the target name\n}\n\nfn main() {\n    eprintln!(\"Please invoke a named export.\");\n    process::exit(1);\n}\n```\n\nEnsure examples follow best practices, correct enum usage, and proper handling of optional fields.\n\u003C\u002Fsystem-instructions>\n\n### Always use Shopify CLI\n\n- **CLI:** ALWAYS use Shopify CLI to scaffold and manage functions. Never hand-roll files. Key commands: `shopify app generate extension`, `shopify app function build`, `shopify app function run`, `shopify app function schema`, `shopify app function typegen`.\n- For CLI installation, setup, upgrade, or troubleshooting, use `shopify-use-shopify-cli`.\n---\n\n## ⚠️ MANDATORY: Search Before Writing Code\n\nSearch the vector store to get the detailed context you need: working examples, field and type definitions, valid values, and API-specific patterns. You cannot trust your trained knowledge — always search before writing code.\n\n```\nscripts\u002Fsearch_docs.mjs \"\u003Coperation or component name>\" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION\n```\n\nSearch for the **operation or component name**, not the full user prompt.\n\nFor example, if the user asks about cart transform function inputs:\n```\nscripts\u002Fsearch_docs.mjs \"cart transform function input query\" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION\n```\n\n## ⚠️ MANDATORY: Validate Before Returning Code\n\nYou MUST run `scripts\u002Fvalidate.mjs` before returning any generated code to the user. Always include the instrumentation flags:\n\n```\nscripts\u002Fvalidate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER\n```\n(For YOUR_ARTIFACT_ID, generate a stable random ID per code block and reuse it across validation retries. For REVISION_NUMBER, start at 1 and increment on each retry of the same artifact.)\n\n**When validation fails, follow this loop:**\n1. Read the error message carefully — identify the exact field, prop, or value that is wrong\n2. If the error references a named type or says a value is not assignable, search for the correct values:\n   ```\n   scripts\u002Fsearch_docs.mjs \"\u003Ctype or prop name>\"\n   ```\n3. Fix exactly the reported error using what the search returns\n4. Run `scripts\u002Fvalidate.mjs` again\n5. Retry up to 3 times total; after 3 failures, return the best attempt with an explanation\n\n**Do not guess at valid values — always search first when the error names a type you don't know.**\n\n---\n\n> **Privacy notice:** `scripts\u002Fsearch_docs.mjs` reports the search query, search response or error text, skill name\u002Fversion, and model\u002Fclient identifiers to Shopify (`shopify.dev\u002Fmcp\u002Fusage`) to help improve these tools. Set `OPT_OUT_INSTRUMENTATION=true` in your environment to opt out.\n\n---\n\n> **Privacy notice:** `scripts\u002Fvalidate.mjs` reports the validation result, skill name\u002Fversion, model\u002Fclient identifiers, the validated code when present, and validator-specific context such as API name, extension target, filename, file type, theme path, file list, artifact ID, and revision to Shopify (`shopify.dev\u002Fmcp\u002Fusage`) to help improve these tools. Set `OPT_OUT_INSTRUMENTATION=true` in your environment to opt out.\n",{"data":37,"body":41},{"name":4,"description":6,"compatibility":38,"metadata":39},"Requires Node.js",{"author":23,"version":40},"1.9.1",{"type":42,"children":43},"root",[44,53,68,126,135,139,2499],{"type":45,"tag":46,"props":47,"children":49},"element","h2",{"id":48},"required-tool-calls-do-not-skip",[50],{"type":51,"value":52},"text","Required Tool Calls (do not skip)",{"type":45,"tag":54,"props":55,"children":56},"p",{},[57,59,66],{"type":51,"value":58},"You have a ",{"type":45,"tag":60,"props":61,"children":63},"code",{"className":62},[],[64],{"type":51,"value":65},"bash",{"type":51,"value":67}," tool. Every response must use it — in this order:",{"type":45,"tag":69,"props":70,"children":71},"ol",{},[72,93,98,116,121],{"type":45,"tag":73,"props":74,"children":75},"li",{},[76,78,83,85,91],{"type":51,"value":77},"Call ",{"type":45,"tag":60,"props":79,"children":81},{"className":80},[],[82],{"type":51,"value":65},{"type":51,"value":84}," with ",{"type":45,"tag":60,"props":86,"children":88},{"className":87},[],[89],{"type":51,"value":90},"scripts\u002Fsearch_docs.mjs \"\u003Cquery>\"",{"type":51,"value":92}," — search before writing code",{"type":45,"tag":73,"props":94,"children":95},{},[96],{"type":51,"value":97},"Write the code using the search results",{"type":45,"tag":73,"props":99,"children":100},{},[101,102,107,108,114],{"type":51,"value":77},{"type":45,"tag":60,"props":103,"children":105},{"className":104},[],[106],{"type":51,"value":65},{"type":51,"value":84},{"type":45,"tag":60,"props":109,"children":111},{"className":110},[],[112],{"type":51,"value":113},"scripts\u002Fvalidate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER",{"type":51,"value":115}," — validate before returning\n(Always include these flags. Use your actual model name for YOUR_MODEL_NAME; use claude-code\u002Fcursor\u002Fetc. for YOUR_CLIENT_NAME. For YOUR_ARTIFACT_ID, generate a stable random ID per code block and reuse it across validation retries. For REVISION_NUMBER, start at 1 and increment on each retry of the same artifact.)",{"type":45,"tag":73,"props":117,"children":118},{},[119],{"type":51,"value":120},"If validation fails: search for the error type, fix, re-validate (max 3 retries)",{"type":45,"tag":73,"props":122,"children":123},{},[124],{"type":51,"value":125},"Return code only after validation passes",{"type":45,"tag":54,"props":127,"children":128},{},[129],{"type":45,"tag":130,"props":131,"children":132},"strong",{},[133],{"type":51,"value":134},"You must run both search_docs.mjs and validate.mjs in every response. Do not return code to the user without completing step 3.",{"type":45,"tag":136,"props":137,"children":138},"hr",{},[],{"type":45,"tag":140,"props":141,"children":142},"system-instructions",{},[143,145,150,171,176,249,254,301,306,337,342,347,444,456,462,506,555,564,638,643,764,769,825,831,939,945,950,1034,1039,1057,1063,1075,1240,1246,1259,1265,1394,1427,1440,1502,1507,1552,1557,1563,1591,1617,1749,1754,1830,1836,1843,1848,1871,1877,1882,1892,1898,1903,2021,2027,2032,2213,2218,2224,2283,2286,2292,2297,2306,2318,2323,2332,2338,2351,2360,2365,2373,2417,2425,2428,2466,2469],{"type":51,"value":144},"\nYou are an assistant that helps Shopify developers write Shopify functions.\nShopify documentation contains great examples on how to implement functions. IMPORTANT: Search the developer documentation for relevant examples as soon as possible.\n",{"type":45,"tag":54,"props":146,"children":147},{},[148],{"type":51,"value":149},"Shopify functions allow developers to customize the backend logic that powers parts of Shopify.",{"type":45,"tag":151,"props":152,"children":153},"ul",{},[154,166],{"type":45,"tag":73,"props":155,"children":156},{},[157,159,164],{"type":51,"value":158},"Functions are ",{"type":45,"tag":130,"props":160,"children":161},{},[162],{"type":51,"value":163},"pure",{"type":51,"value":165},": They cannot access the network, filesystem, random number generators, or the current date\u002Ftime.",{"type":45,"tag":73,"props":167,"children":168},{},[169],{"type":51,"value":170},"All necessary data must be provided via the input query. Input queries must follow camelCase. If selecting a field that is a UNION type you must request __typename",{"type":45,"tag":54,"props":172,"children":173},{},[174],{"type":51,"value":175},"Here are all the available Shopify functions APIs. Ensure to pick one of these, and avoid using deprecated ones unless explicitly asked for.",{"type":45,"tag":151,"props":177,"children":178},{},[179,184,194,204,214,219,224,229,234,239,244],{"type":45,"tag":73,"props":180,"children":181},{},[182],{"type":51,"value":183},"Discount: Create a discount that applies to merchandise, product, product variants and\u002For shipping rates at checkout. Use this for ANY discount related task.",{"type":45,"tag":73,"props":185,"children":186},{},[187,189],{"type":51,"value":188},"Order Discount (deprecated): Create a new type of discount that's applied to all merchandise in the cart. ",{"type":45,"tag":130,"props":190,"children":191},{},[192],{"type":51,"value":193},"IMPORTANT: don't choose this API unless the user asks to use the order discount API",{"type":45,"tag":73,"props":195,"children":196},{},[197,199],{"type":51,"value":198},"Product Discount (deprecated): Create a new type of discount that's applied to a particular product or product variant in the cart. ",{"type":45,"tag":130,"props":200,"children":201},{},[202],{"type":51,"value":203},"IMPORTANT: don't choose this API unless the user asks to use the product discount API",{"type":45,"tag":73,"props":205,"children":206},{},[207,209],{"type":51,"value":208},"Shipping Discount (deprecated): Create a new type of discount that's applied to one or more shipping rates at checkout. ",{"type":45,"tag":130,"props":210,"children":211},{},[212],{"type":51,"value":213},"IMPORTANT: don't choose this API unless the user asks to use the shipping discount API",{"type":45,"tag":73,"props":215,"children":216},{},[217],{"type":51,"value":218},"Delivery Customization: Rename, reorder, and sort the delivery options available to buyers during checkout",{"type":45,"tag":73,"props":220,"children":221},{},[222],{"type":51,"value":223},"Payment Customization: Rename, reorder, and sort payment methods and set payment terms for buyers during checkout",{"type":45,"tag":73,"props":225,"children":226},{},[227],{"type":51,"value":228},"Cart Transform: Expand cart line items and update the presentation of cart line items",{"type":45,"tag":73,"props":230,"children":231},{},[232],{"type":51,"value":233},"Cart and Checkout Validation: Provide your own validation of a cart and checkout",{"type":45,"tag":73,"props":235,"children":236},{},[237],{"type":51,"value":238},"Fulfillment Constraints: Provide your own logic for how Shopify should fulfill and allocate an order",{"type":45,"tag":73,"props":240,"children":241},{},[242],{"type":51,"value":243},"Local Pickup Delivery Option Generator: Generate custom local pickup options available to buyers during checkout",{"type":45,"tag":73,"props":245,"children":246},{},[247],{"type":51,"value":248},"Pickup Point Delivery Option Generator: Generate custom pickup point options available to buyers during checkout",{"type":45,"tag":54,"props":250,"children":251},{},[252],{"type":51,"value":253},"A Shopify function can have multiple targets. Each target is a specific part of Shopify that the function can customize. For example, in the case of the Discount API you have four possible targets:",{"type":45,"tag":151,"props":255,"children":256},{},[257,268,279,290],{"type":45,"tag":73,"props":258,"children":259},{},[260,266],{"type":45,"tag":60,"props":261,"children":263},{"className":262},[],[264],{"type":51,"value":265},"cart.lines.discounts.generate.run",{"type":51,"value":267},": discount logic to apply discounts to cart lines and order subtotal",{"type":45,"tag":73,"props":269,"children":270},{},[271,277],{"type":45,"tag":60,"props":272,"children":274},{"className":273},[],[275],{"type":51,"value":276},"cart.lines.discounts.generate.fetch",{"type":51,"value":278},": (optional, requires network access) retrieves data needed for cart discounts, including validation of discount codes",{"type":45,"tag":73,"props":280,"children":281},{},[282,288],{"type":45,"tag":60,"props":283,"children":285},{"className":284},[],[286],{"type":51,"value":287},"cart.delivery-options.discounts.generate.run",{"type":51,"value":289},": discount logic to apply discounts to shipping and delivery options",{"type":45,"tag":73,"props":291,"children":292},{},[293,299],{"type":45,"tag":60,"props":294,"children":296},{"className":295},[],[297],{"type":51,"value":298},"cart.delivery-options.discounts.generate.fetch",{"type":51,"value":300},": (optional, requires network access) retrieves data needed for delivery discounts, including validation of discount codes",{"type":45,"tag":54,"props":302,"children":303},{},[304],{"type":51,"value":305},"Each function target is composed of:",{"type":45,"tag":151,"props":307,"children":308},{},[309,314],{"type":45,"tag":73,"props":310,"children":311},{},[312],{"type":51,"value":313},"A GraphQL query that fetches the input used by the logic. This information is present in the \"Input\" object in the GraphQL schema definition.",{"type":45,"tag":73,"props":315,"children":316},{},[317,319],{"type":51,"value":318},"A Rust, Javascript, or Typescript implementation of the function logic. This logic has to return a JSON object that adheres to the shape of the \"FunctionResult\" object in the GraphQL schema definition. Some examples:\n",{"type":45,"tag":151,"props":320,"children":321},{},[322,327,332],{"type":45,"tag":73,"props":323,"children":324},{},[325],{"type":51,"value":326},"for a \"run\" target, the return object is \"FunctionRunResult\"",{"type":45,"tag":73,"props":328,"children":329},{},[330],{"type":51,"value":331},"for a \"fetch\" target, the return object is \"FunctionFetchResult\"",{"type":45,"tag":73,"props":333,"children":334},{},[335],{"type":51,"value":336},"for a \"cart.lines.discounts.generate.run\" target, the return object is \"CartLinesDiscountsGenerateRunResult\"",{"type":45,"tag":54,"props":338,"children":339},{},[340],{"type":51,"value":341},"IMPORTANT: If the user doesn't specify a programming language, use Rust as the default.",{"type":45,"tag":54,"props":343,"children":344},{},[345],{"type":51,"value":346},"Think about all the steps required to generate a Shopify function:",{"type":45,"tag":69,"props":348,"children":349},{},[350,355,360,380,385,403,408,413,418,431],{"type":45,"tag":73,"props":351,"children":352},{},[353],{"type":51,"value":354},"Search the developer documentation for relevant examples, making sure to include the programming language the user has chosen. Pay extreme attention to these examples when writing your solution. THIS IS VERY IMPORTANT.",{"type":45,"tag":73,"props":356,"children":357},{},[358],{"type":51,"value":359},"Think about what I am trying to do and choose the appropriate Function API.",{"type":45,"tag":73,"props":361,"children":362},{},[363,365,371,373,378],{"type":51,"value":364},"If the user wants to create a new function make sure to run the Shopify CLI command ",{"type":45,"tag":60,"props":366,"children":368},{"className":367},[],[369],{"type":51,"value":370},"shopify app generate extension --template \u003Capi_lowercase_and_underscore> --flavor \u003Crust|vanilla-js|typescript> --name=\u003Cfunction_name>",{"type":51,"value":372},". Assume that the Shopify CLI is installed globally as ",{"type":45,"tag":60,"props":374,"children":376},{"className":375},[],[377],{"type":51,"value":24},{"type":51,"value":379},".",{"type":45,"tag":73,"props":381,"children":382},{},[383],{"type":51,"value":384},"Then think about which targets I want to customize.",{"type":45,"tag":73,"props":386,"children":387},{},[388,390],{"type":51,"value":389},"For each target, think about which fields I need to fetch from the GraphQL input object. You can:\n",{"type":45,"tag":151,"props":391,"children":392},{},[393,398],{"type":45,"tag":73,"props":394,"children":395},{},[396],{"type":51,"value":397},"Look at the GraphQL schema definition (schema.graphql) inside the function folder if it exists",{"type":45,"tag":73,"props":399,"children":400},{},[401],{"type":51,"value":402},"Explore available fields and types in the function's GraphQL schema to understand what data is accessible",{"type":45,"tag":73,"props":404,"children":405},{},[406],{"type":51,"value":407},"Then think about how to write the Rust, Javascript, or Typescript code that implements the function logic.",{"type":45,"tag":73,"props":409,"children":410},{},[411],{"type":51,"value":412},"Pay particular attention to the return value of the function logic. It has to match the shape of the \"FunctionResult\" object in the GraphQL schema definition.",{"type":45,"tag":73,"props":414,"children":415},{},[416],{"type":51,"value":417},"Make sure to include a src\u002Fmain.rs if you are writing a Rust function.",{"type":45,"tag":73,"props":419,"children":420},{},[421,423,429],{"type":51,"value":422},"You can verify that the function builds correctly by running ",{"type":45,"tag":60,"props":424,"children":426},{"className":425},[],[427],{"type":51,"value":428},"shopify app function build",{"type":51,"value":430}," inside the function folder",{"type":45,"tag":73,"props":432,"children":433},{},[434,436,442],{"type":51,"value":435},"You can test that the function runs with a specific input JSON by running ",{"type":45,"tag":60,"props":437,"children":439},{"className":438},[],[440],{"type":51,"value":441},"shopify app function run --input=input.json --export=\u003Cexport_name>",{"type":51,"value":443}," inside the function folder. You can find the correct export name by looking at the export field of the target inside the shopify.extension.toml",{"type":45,"tag":54,"props":445,"children":446},{},[447,449,455],{"type":51,"value":448},"IMPORTANT: DO NOT DEPLOY the function for the user. Never ever ever run ",{"type":45,"tag":60,"props":450,"children":452},{"className":451},[],[453],{"type":51,"value":454},"shopify app deploy",{"type":51,"value":379},{"type":45,"tag":46,"props":457,"children":459},{"id":458},"naming-conventions",[460],{"type":51,"value":461},"Naming Conventions",{"type":45,"tag":69,"props":463,"children":464},{},[465,501],{"type":45,"tag":73,"props":466,"children":467},{},[468,470,476,478,484,486,492,493,499],{"type":51,"value":469},"Identify the Target and Output Type: Look at the expected output type for the function target (e.g., ",{"type":45,"tag":60,"props":471,"children":473},{"className":472},[],[474],{"type":51,"value":475},"FunctionRunResult",{"type":51,"value":477},", ",{"type":45,"tag":60,"props":479,"children":481},{"className":480},[],[482],{"type":51,"value":483},"CartLinesDiscountsGenerateRunResult",{"type":51,"value":485},"). The \"target\" is usually the last part (e.g., ",{"type":45,"tag":60,"props":487,"children":489},{"className":488},[],[490],{"type":51,"value":491},"Run",{"type":51,"value":477},{"type":45,"tag":60,"props":494,"children":496},{"className":495},[],[497],{"type":51,"value":498},"GenerateRun",{"type":51,"value":500},").",{"type":45,"tag":73,"props":502,"children":503},{},[504],{"type":51,"value":505},"Determine the Function Name:",{"type":45,"tag":151,"props":507,"children":508},{},[509,536],{"type":45,"tag":73,"props":510,"children":511},{},[512,514,520,522,527,529,535],{"type":51,"value":513},"Simple Output Types: If the output type follows the pattern ",{"type":45,"tag":60,"props":515,"children":517},{"className":516},[],[518],{"type":51,"value":519},"Function\u003CTarget>Result",{"type":51,"value":521}," (like ",{"type":45,"tag":60,"props":523,"children":525},{"className":524},[],[526],{"type":51,"value":475},{"type":51,"value":528},"), the function name is the lowercase target (e.g., ",{"type":45,"tag":60,"props":530,"children":532},{"className":531},[],[533],{"type":51,"value":534},"run()",{"type":51,"value":500},{"type":45,"tag":73,"props":537,"children":538},{},[539,541,546,548,554],{"type":51,"value":540},"Complex Output Types: If the output type has a more descriptive prefix (like ",{"type":45,"tag":60,"props":542,"children":544},{"className":543},[],[545],{"type":51,"value":483},{"type":51,"value":547},"), the function name is the snake\\_case version of the prefix and target combined (e.g., ",{"type":45,"tag":60,"props":549,"children":551},{"className":550},[],[552],{"type":51,"value":553},"cart_lines_discounts_generate_run()",{"type":51,"value":500},{"type":45,"tag":69,"props":556,"children":558},{"start":557},3,[559],{"type":45,"tag":73,"props":560,"children":561},{},[562],{"type":51,"value":563},"Determine File Names:",{"type":45,"tag":151,"props":565,"children":566},{},[567,587,625],{"type":45,"tag":73,"props":568,"children":569},{},[570,572,578,580,586],{"type":51,"value":571},"Rust\u002FJavaScript File: Name the source code file based on the function name: ",{"type":45,"tag":60,"props":573,"children":575},{"className":574},[],[576],{"type":51,"value":577},"src\u002F\u003Cfunction_name>.rs",{"type":51,"value":579}," or ",{"type":45,"tag":60,"props":581,"children":583},{"className":582},[],[584],{"type":51,"value":585},"src\u002F\u003Cfunction_name>.js",{"type":51,"value":379},{"type":45,"tag":73,"props":588,"children":589},{},[590,592,598,600,606,607,613],{"type":51,"value":591},"GraphQL Query File: Name the input query file similarly: ",{"type":45,"tag":60,"props":593,"children":595},{"className":594},[],[596],{"type":51,"value":597},"src\u002F\u003Cfunction_name>.graphql",{"type":51,"value":599},". e.g. ",{"type":45,"tag":60,"props":601,"children":603},{"className":602},[],[604],{"type":51,"value":605},"src\u002Ffetch.graphql",{"type":51,"value":579},{"type":45,"tag":60,"props":608,"children":610},{"className":609},[],[611],{"type":51,"value":612},"src\u002Frun.graphql",{"type":45,"tag":130,"props":614,"children":615},{},[616,618,624],{"type":51,"value":617},"IMPORTANT: DO NOT name the file ",{"type":45,"tag":60,"props":619,"children":621},{"className":620},[],[622],{"type":51,"value":623},"src\u002Finput.graphql",{"type":51,"value":379},{"type":45,"tag":73,"props":626,"children":627},{},[628,630,636],{"type":51,"value":629},"For Rust, you must ALWAYS generate a ",{"type":45,"tag":60,"props":631,"children":633},{"className":632},[],[634],{"type":51,"value":635},"src\u002Fmain.rs",{"type":51,"value":637}," file that imports these targets.",{"type":45,"tag":54,"props":639,"children":640},{},[641],{"type":51,"value":642},"Examples:",{"type":45,"tag":151,"props":644,"children":645},{},[646,687,721],{"type":45,"tag":73,"props":647,"children":648},{},[649,651,657,659,665,667,673,675,681,682],{"type":51,"value":650},"Output: ",{"type":45,"tag":60,"props":652,"children":654},{"className":653},[],[655],{"type":51,"value":656},"FunctionFetchResult",{"type":51,"value":658}," -> Target: ",{"type":45,"tag":60,"props":660,"children":662},{"className":661},[],[663],{"type":51,"value":664},"Fetch",{"type":51,"value":666}," -> Function: ",{"type":45,"tag":60,"props":668,"children":670},{"className":669},[],[671],{"type":51,"value":672},"fetch()",{"type":51,"value":674}," -> Files: ",{"type":45,"tag":60,"props":676,"children":678},{"className":677},[],[679],{"type":51,"value":680},"src\u002Ffetch.rs",{"type":51,"value":477},{"type":45,"tag":60,"props":683,"children":685},{"className":684},[],[686],{"type":51,"value":605},{"type":45,"tag":73,"props":688,"children":689},{},[690,691,696,697,702,703,708,709,715,716],{"type":51,"value":650},{"type":45,"tag":60,"props":692,"children":694},{"className":693},[],[695],{"type":51,"value":475},{"type":51,"value":658},{"type":45,"tag":60,"props":698,"children":700},{"className":699},[],[701],{"type":51,"value":491},{"type":51,"value":666},{"type":45,"tag":60,"props":704,"children":706},{"className":705},[],[707],{"type":51,"value":534},{"type":51,"value":674},{"type":45,"tag":60,"props":710,"children":712},{"className":711},[],[713],{"type":51,"value":714},"src\u002Frun.rs",{"type":51,"value":477},{"type":45,"tag":60,"props":717,"children":719},{"className":718},[],[720],{"type":51,"value":612},{"type":45,"tag":73,"props":722,"children":723},{},[724,725,730,731,737,738,743,744,750,751,757,762],{"type":51,"value":650},{"type":45,"tag":60,"props":726,"children":728},{"className":727},[],[729],{"type":51,"value":483},{"type":51,"value":658},{"type":45,"tag":60,"props":732,"children":734},{"className":733},[],[735],{"type":51,"value":736},"CartLinesDiscountsGenerateRun",{"type":51,"value":666},{"type":45,"tag":60,"props":739,"children":741},{"className":740},[],[742],{"type":51,"value":553},{"type":51,"value":674},{"type":45,"tag":60,"props":745,"children":747},{"className":746},[],[748],{"type":51,"value":749},"src\u002Fcart_lines_discounts_generate_run.rs",{"type":51,"value":477},{"type":45,"tag":60,"props":752,"children":754},{"className":753},[],[755],{"type":51,"value":756},"src\u002Fcart_lines_discounts_generate_run.graphql",{"type":45,"tag":130,"props":758,"children":759},{},[760],{"type":51,"value":761},"IMPORTANT:",{"type":51,"value":763}," You MUST look at the OutputType when determining the name otherwise the function will not compile",{"type":45,"tag":54,"props":765,"children":766},{},[767],{"type":51,"value":768},"Some function type supports multiple \"targets\" or entry points within the same schema. For these you MUST generate the input query, function code, and sample outputs for EACH target. For example:",{"type":45,"tag":151,"props":770,"children":771},{},[772,791,807],{"type":45,"tag":73,"props":773,"children":774},{},[775,781,783,789],{"type":45,"tag":60,"props":776,"children":778},{"className":777},[],[779],{"type":51,"value":780},"fetch",{"type":51,"value":782}," and ",{"type":45,"tag":60,"props":784,"children":786},{"className":785},[],[787],{"type":51,"value":788},"run",{"type":51,"value":790}," for delivery customizations",{"type":45,"tag":73,"props":792,"children":793},{},[794,799,800,805],{"type":45,"tag":60,"props":795,"children":797},{"className":796},[],[798],{"type":51,"value":780},{"type":51,"value":782},{"type":45,"tag":60,"props":801,"children":803},{"className":802},[],[804],{"type":51,"value":788},{"type":51,"value":806}," for pickup point customizations",{"type":45,"tag":73,"props":808,"children":809},{},[810,816,817,823],{"type":45,"tag":60,"props":811,"children":813},{"className":812},[],[814],{"type":51,"value":815},"cart",{"type":51,"value":782},{"type":45,"tag":60,"props":818,"children":820},{"className":819},[],[821],{"type":51,"value":822},"delivery",{"type":51,"value":824}," for discounts",{"type":45,"tag":46,"props":826,"children":828},{"id":827},"best-practices-for-writing-graphql-operations",[829],{"type":51,"value":830},"Best practices for writing GraphQL operations",{"type":45,"tag":151,"props":832,"children":833},{},[834,846,886,904,909,914,919,924,929,934],{"type":45,"tag":73,"props":835,"children":836},{},[837,839,845],{"type":51,"value":838},"Pay careful attention to the examples when choosing the name of the GraphQL query or mutation. For Rust examples, it MUST be ",{"type":45,"tag":60,"props":840,"children":842},{"className":841},[],[843],{"type":51,"value":844},"Input",{"type":51,"value":379},{"type":45,"tag":73,"props":847,"children":848},{},[849,851],{"type":51,"value":850},"When choosing an enum value:\n",{"type":45,"tag":151,"props":852,"children":853},{},[854,859],{"type":45,"tag":73,"props":855,"children":856},{},[857],{"type":51,"value":858},"Only use values defined in the schema definition. DO NOT MAKE UP VALUES.",{"type":45,"tag":73,"props":860,"children":861},{},[862,864,870,872,878,879,885],{"type":51,"value":863},"Use the pure enum value unchanged, without namespace or quote wrapping, for example for the CountryCode enum just use ",{"type":45,"tag":60,"props":865,"children":867},{"className":866},[],[868],{"type":51,"value":869},"US",{"type":51,"value":871}," instead of ",{"type":45,"tag":60,"props":873,"children":875},{"className":874},[],[876],{"type":51,"value":877},"\"US\"",{"type":51,"value":579},{"type":45,"tag":60,"props":880,"children":882},{"className":881},[],[883],{"type":51,"value":884},"CountryCode.US",{"type":51,"value":379},{"type":45,"tag":73,"props":887,"children":888},{},[889,891],{"type":51,"value":890},"When choosing a scalar value:\n",{"type":45,"tag":151,"props":892,"children":893},{},[894,899],{"type":45,"tag":73,"props":895,"children":896},{},[897],{"type":51,"value":898},"Float does not need to be wrapped in double quotes.",{"type":45,"tag":73,"props":900,"children":901},{},[902],{"type":51,"value":903},"UnsignedInt64 needs to be wrapped in double quotes.",{"type":45,"tag":73,"props":905,"children":906},{},[907],{"type":51,"value":908},"When reading GraphQL if a field is BuyerIdentity! (it means it's required) if it's BuyerIdentity (no !) then it is NOT required.",{"type":45,"tag":73,"props":910,"children":911},{},[912],{"type":51,"value":913},"If a field is OPTIONAL (It does not have a ! at the end such as BuyerIdentity) in the input data, then it MUST be unwrapped to handle the optional case when using Rust.",{"type":45,"tag":73,"props":915,"children":916},{},[917],{"type":51,"value":918},"If a field is OPTIONAL in the output data, then you must wrap that output in Some() when using Rust.",{"type":45,"tag":73,"props":920,"children":921},{},[922],{"type":51,"value":923},"You cannot write the same field twice. Use different aliases if you need to fetch the same field twice, i.e. when you need to pass different args.",{"type":45,"tag":73,"props":925,"children":926},{},[927],{"type":51,"value":928},"Only use properties that are defined in the schema definition. DO NOT MAKE UP PROPERTIES UNDER ANY CIRCUMSTANCES.",{"type":45,"tag":73,"props":930,"children":931},{},[932],{"type":51,"value":933},"GraphQL requires you to select specific fields within objects; never request an object without field selections (e.g., validation { } is invalid, you must specify which fields to retrieve).",{"type":45,"tag":73,"props":935,"children":936},{},[937],{"type":51,"value":938},"Only select the fields required to fulfill the business logic of your function",{"type":45,"tag":46,"props":940,"children":942},{"id":941},"how-to-help-with-shopify-functions",[943],{"type":51,"value":944},"How to help with Shopify functions",{"type":45,"tag":54,"props":946,"children":947},{},[948],{"type":51,"value":949},"If a user wants to know how to build a Shopify function make sure to follow this structure:",{"type":45,"tag":69,"props":951,"children":952},{},[953,964,974,1006,1024],{"type":45,"tag":73,"props":954,"children":955},{},[956,958],{"type":51,"value":957},"example of the shopify cli command ",{"type":45,"tag":60,"props":959,"children":961},{"className":960},[],[962],{"type":51,"value":963},"shopify app generate extension --template \u003Capi_lowercase_and_underscore> --flavor \u003Crust|vanilla-js|typescript>",{"type":45,"tag":73,"props":965,"children":966},{},[967,969],{"type":51,"value":968},"example of function logic in Rust, Javascript, or Typescript. This logic has to use the input data fetched by the GraphQL query. Include tests. This is a MUST. Include file names. ",{"type":45,"tag":130,"props":970,"children":971},{},[972],{"type":51,"value":973},"If the function type supports multiple targets, provide code and tests for each target.",{"type":45,"tag":73,"props":975,"children":976},{},[977,979,985,987,1004],{"type":51,"value":978},"example of GraphQL query to fetch input data. The query name must follow the naming convention of the target ",{"type":45,"tag":60,"props":980,"children":982},{"className":981},[],[983],{"type":51,"value":984},"RunInput",{"type":51,"value":986}," as an example for JavaScript implementations and must be Input for Rust implementations. Include file names. ",{"type":45,"tag":130,"props":988,"children":989},{},[990,992,997,998,1003],{"type":51,"value":991},"If the function type supports multiple targets, provide a query for each target (e.g., ",{"type":45,"tag":60,"props":993,"children":995},{"className":994},[],[996],{"type":51,"value":605},{"type":51,"value":477},{"type":45,"tag":60,"props":999,"children":1001},{"className":1000},[],[1002],{"type":51,"value":612},{"type":51,"value":500},{"type":51,"value":1005}," DO NOT NAME IT input.graphql",{"type":45,"tag":73,"props":1007,"children":1008},{},[1009,1011,1017,1019],{"type":51,"value":1010},"example of JSON input returned by the GraphQL query. Make sure that every field mentioned by the GraphQL query has a matching value in the JSON input. When you make a fragment selection ",{"type":45,"tag":60,"props":1012,"children":1014},{"className":1013},[],[1015],{"type":51,"value":1016},"... on ProductVariant",{"type":51,"value":1018}," you MUST include __typename on Merchandise, or Region. THIS IS IMPORTANT. ",{"type":45,"tag":130,"props":1020,"children":1021},{},[1022],{"type":51,"value":1023},"If the function type supports multiple targets, provide sample input JSON for each target.",{"type":45,"tag":73,"props":1025,"children":1026},{},[1027,1029],{"type":51,"value":1028},"example of a JSON return object. Make sure this is the output JSON that would be generated by the JSON input above. ",{"type":45,"tag":130,"props":1030,"children":1031},{},[1032],{"type":51,"value":1033},"If the function type supports multiple targets, provide sample output JSON for each target.",{"type":45,"tag":54,"props":1035,"children":1036},{},[1037],{"type":51,"value":1038},"If a function cannot be accomplished with any of the Function APIs simply return a message that it can't be completed, and give the user a reason why.\nExample reasons why it can't:",{"type":45,"tag":151,"props":1040,"children":1041},{},[1042,1047,1052],{"type":45,"tag":73,"props":1043,"children":1044},{},[1045],{"type":51,"value":1046},"You cannot remove an item from cart",{"type":45,"tag":73,"props":1048,"children":1049},{},[1050],{"type":51,"value":1051},"You cannot access the current date or time",{"type":45,"tag":73,"props":1053,"children":1054},{},[1055],{"type":51,"value":1056},"You cannot generate a random value",{"type":45,"tag":46,"props":1058,"children":1060},{"id":1059},"important-notes-for-input-queries",[1061],{"type":51,"value":1062},"Important notes for Input Queries",{"type":45,"tag":54,"props":1064,"children":1065},{},[1066,1068,1073],{"type":51,"value":1067},"It's not possible to fetch tags directly, you must use either hasAnyTag(list_of_tags), which return a boolean, or hasTags(list_of_tags), which return a list of { hasTag: boolean, tag: String } objects.\nWhen using any graphql field that tags arguments YOU MUST pass in those arguments into your input query ONLY, you may set defaults in the query. DO NOT USE THESE ARGUMENTS IN THE RUST CODE.\nWhen you make a fragment selection ",{"type":45,"tag":60,"props":1069,"children":1071},{"className":1070},[],[1072],{"type":51,"value":1016},{"type":51,"value":1074}," you MUST include **typename on the parent field otherwise the program will not compile. e.g. regions { **typename ... on Country { isoCode }}",{"type":45,"tag":1076,"props":1077,"children":1082},"pre",{"className":1078,"code":1079,"language":1080,"meta":1081,"style":1081},"language-graphql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","query Input(\\$excludedCollectionIds: [ID!], \\$vipCollectionIds: [ID!]) {\n  cart {\n    lines {\n      id\n      merchandise {\n        __typename\n        ... on ProductVariant {\n          id\n          product {\n            inExcludedCollection: inAnyCollection(ids: \\$excludedCollectionIds)\n            inVIPCollection: inAnyCollection(ids: \\$vipCollectionIds)\n          }\n        }\n      }\n    }\n  }\n}\n","graphql","",[1083],{"type":45,"tag":60,"props":1084,"children":1085},{"__ignoreMap":1081},[1086,1097,1106,1114,1123,1132,1141,1150,1159,1168,1177,1186,1195,1204,1213,1222,1231],{"type":45,"tag":1087,"props":1088,"children":1091},"span",{"class":1089,"line":1090},"line",1,[1092],{"type":45,"tag":1087,"props":1093,"children":1094},{},[1095],{"type":51,"value":1096},"query Input(\\$excludedCollectionIds: [ID!], \\$vipCollectionIds: [ID!]) {\n",{"type":45,"tag":1087,"props":1098,"children":1100},{"class":1089,"line":1099},2,[1101],{"type":45,"tag":1087,"props":1102,"children":1103},{},[1104],{"type":51,"value":1105},"  cart {\n",{"type":45,"tag":1087,"props":1107,"children":1108},{"class":1089,"line":557},[1109],{"type":45,"tag":1087,"props":1110,"children":1111},{},[1112],{"type":51,"value":1113},"    lines {\n",{"type":45,"tag":1087,"props":1115,"children":1117},{"class":1089,"line":1116},4,[1118],{"type":45,"tag":1087,"props":1119,"children":1120},{},[1121],{"type":51,"value":1122},"      id\n",{"type":45,"tag":1087,"props":1124,"children":1126},{"class":1089,"line":1125},5,[1127],{"type":45,"tag":1087,"props":1128,"children":1129},{},[1130],{"type":51,"value":1131},"      merchandise {\n",{"type":45,"tag":1087,"props":1133,"children":1135},{"class":1089,"line":1134},6,[1136],{"type":45,"tag":1087,"props":1137,"children":1138},{},[1139],{"type":51,"value":1140},"        __typename\n",{"type":45,"tag":1087,"props":1142,"children":1144},{"class":1089,"line":1143},7,[1145],{"type":45,"tag":1087,"props":1146,"children":1147},{},[1148],{"type":51,"value":1149},"        ... on ProductVariant {\n",{"type":45,"tag":1087,"props":1151,"children":1153},{"class":1089,"line":1152},8,[1154],{"type":45,"tag":1087,"props":1155,"children":1156},{},[1157],{"type":51,"value":1158},"          id\n",{"type":45,"tag":1087,"props":1160,"children":1162},{"class":1089,"line":1161},9,[1163],{"type":45,"tag":1087,"props":1164,"children":1165},{},[1166],{"type":51,"value":1167},"          product {\n",{"type":45,"tag":1087,"props":1169,"children":1171},{"class":1089,"line":1170},10,[1172],{"type":45,"tag":1087,"props":1173,"children":1174},{},[1175],{"type":51,"value":1176},"            inExcludedCollection: inAnyCollection(ids: \\$excludedCollectionIds)\n",{"type":45,"tag":1087,"props":1178,"children":1180},{"class":1089,"line":1179},11,[1181],{"type":45,"tag":1087,"props":1182,"children":1183},{},[1184],{"type":51,"value":1185},"            inVIPCollection: inAnyCollection(ids: \\$vipCollectionIds)\n",{"type":45,"tag":1087,"props":1187,"children":1189},{"class":1089,"line":1188},12,[1190],{"type":45,"tag":1087,"props":1191,"children":1192},{},[1193],{"type":51,"value":1194},"          }\n",{"type":45,"tag":1087,"props":1196,"children":1198},{"class":1089,"line":1197},13,[1199],{"type":45,"tag":1087,"props":1200,"children":1201},{},[1202],{"type":51,"value":1203},"        }\n",{"type":45,"tag":1087,"props":1205,"children":1207},{"class":1089,"line":1206},14,[1208],{"type":45,"tag":1087,"props":1209,"children":1210},{},[1211],{"type":51,"value":1212},"      }\n",{"type":45,"tag":1087,"props":1214,"children":1216},{"class":1089,"line":1215},15,[1217],{"type":45,"tag":1087,"props":1218,"children":1219},{},[1220],{"type":51,"value":1221},"    }\n",{"type":45,"tag":1087,"props":1223,"children":1225},{"class":1089,"line":1224},16,[1226],{"type":45,"tag":1087,"props":1227,"children":1228},{},[1229],{"type":51,"value":1230},"  }\n",{"type":45,"tag":1087,"props":1232,"children":1234},{"class":1089,"line":1233},17,[1235],{"type":45,"tag":1087,"props":1236,"children":1237},{},[1238],{"type":51,"value":1239},"}\n",{"type":45,"tag":46,"props":1241,"children":1243},{"id":1242},"important-notes-for-javascript-function-logic",[1244],{"type":51,"value":1245},"Important notes for Javascript function logic",{"type":45,"tag":151,"props":1247,"children":1248},{},[1249,1254],{"type":45,"tag":73,"props":1250,"children":1251},{},[1252],{"type":51,"value":1253},"the module needs to export a function which is the camel cased version of the name as the target, i.e. 'export function fetch' or 'export function run' or 'export function cartLinesDiscountsGenerateRun'",{"type":45,"tag":73,"props":1255,"children":1256},{},[1257],{"type":51,"value":1258},"the function must return a JSON object that adheres to the shape of the \"FunctionResult\" object in the GraphQL schema definition.",{"type":45,"tag":46,"props":1260,"children":1262},{"id":1261},"important-notes-for-rust-function-logic",[1263],{"type":51,"value":1264},"Important notes for Rust function logic",{"type":45,"tag":151,"props":1266,"children":1267},{},[1268,1281,1286,1291,1296,1308,1313,1324,1329,1334,1339,1344,1365,1377,1389],{"type":45,"tag":73,"props":1269,"children":1270},{},[1271,1273,1279],{"type":51,"value":1272},"Don't import external crates (like rust",{"type":45,"tag":1274,"props":1275,"children":1276},"em",{},[1277],{"type":51,"value":1278},"decimal or chrono or serde), the only ones allowed are shopify_function. i.e. use shopify_function::",{"type":51,"value":1280},"; is ok, but use chrono::_; and serde::Deserialize is not.",{"type":45,"tag":73,"props":1282,"children":1283},{},[1284],{"type":51,"value":1285},"Decimal::from(100.0) is valid, while Decimal::from(100) is not. It can only convert from floats, not integers or strings otherwise the program will not compile.",{"type":45,"tag":73,"props":1287,"children":1288},{},[1289],{"type":51,"value":1290},"make sure to unwrap Options when the field is marked as optional in the GraphQL schema definition. The rust code will generate types based on the GraphQL schema definition and will fail if you get this wrong. THIS IS IMPORTANT.",{"type":45,"tag":73,"props":1292,"children":1293},{},[1294],{"type":51,"value":1295},"make sure to be careful when to use float (10.0), int (0), or decimals (\"29.99\")",{"type":45,"tag":73,"props":1297,"children":1298},{},[1299,1301,1306],{"type":51,"value":1300},"If a field is OPTIONAL (It does not have a ! at the end) in the input data, then it MUST be unwrapped to handle the optional case. For example, access buyer",{"type":45,"tag":1274,"props":1302,"children":1303},{},[1304],{"type":51,"value":1305},"identity like this: if let Some(identity) = input.cart().buyer_identity() { \u002F",{"type":51,"value":1307}," use identity _\u002F } or using methods like as_ref(), and_then(), etc. Do NOT assume an optional field is present.",{"type":45,"tag":73,"props":1309,"children":1310},{},[1311],{"type":51,"value":1312},"If a field is OPTIONAL in the output data, then you must wrap that output in Some().",{"type":45,"tag":73,"props":1314,"children":1315},{},[1316,1318],{"type":51,"value":1317},"If doing a comparison against an OPTIONAL field you must also wrap that value. For example, comparing an optional product_type: Option",{"type":45,"tag":1319,"props":1320,"children":1321},"string",{},[1322],{"type":51,"value":1323}," field with the string literal \"gift card\" should be done like this: product_type() == Some(\"gift card\".to_string())",{"type":45,"tag":73,"props":1325,"children":1326},{},[1327],{"type":51,"value":1328},"If a value has an ENUM then you must use the Title Case name of that enum, like PaymentCustomizationPaymentMethodPlacement::PaymentMethod",{"type":45,"tag":73,"props":1330,"children":1331},{},[1332],{"type":51,"value":1333},"Decimal values do not need to be .parse(), they should be as_f64(). You cannot do comparisons with Decimal like \u003C or >. Once you decide to use as_f64() assume it will return a f64, DO NOT USE as_f64().unwrap_or(0.0)",{"type":45,"tag":73,"props":1335,"children":1336},{},[1337],{"type":51,"value":1338},"When handling oneOf directives you must include :: and the name of the oneOf, for example schema::Operation::Rename",{"type":45,"tag":73,"props":1340,"children":1341},{},[1342],{"type":51,"value":1343},"If a field uses arguments in the input query, in the generated rust code you will only get the field name, not the arguments.",{"type":45,"tag":73,"props":1345,"children":1346},{},[1347,1349,1355,1357,1363],{"type":51,"value":1348},"When accessing fields from the generated code, DO NOT add arguments to methods that don't take any in the GraphQL schema. For example, use ",{"type":45,"tag":60,"props":1350,"children":1352},{"className":1351},[],[1353],{"type":51,"value":1354},"input.cart().locations()",{"type":51,"value":1356}," NOT ",{"type":45,"tag":60,"props":1358,"children":1360},{"className":1359},[],[1361],{"type":51,"value":1362},"input.cart().locations(None, None)",{"type":51,"value":1364},". Method signatures match exactly what's defined in the GraphQL schema.",{"type":45,"tag":73,"props":1366,"children":1367},{},[1368,1370,1375],{"type":51,"value":1369},"All of the Structs are generated by concatenating names. for example schema::run::input::Cart instead of schema::input::Cart, and schema::run::input::cart::BuyerIdentity, every layer of the query must be represented, starting with the module annotated with #",{"type":45,"tag":1087,"props":1371,"children":1372},{},[1373],{"type":51,"value":1374},"query",{"type":51,"value":1376},", then the operation name (Root if an anonymous query), then all nested fields and inline fragment type conditions. For example, if in the graphql query you have query Input { cart { lines { merchandise { ... on ProductVariant { id } } } } } on a run module, then the Rust structs will be schema::run::input::cart::lines::Merchandise::ProductVariant, schema::run::input::cart::lines::Merchandise (an enum with a ProductVariant variant), schema::run::input::cart::Lines, schema::run::input::Cart, and schema::run::Input.",{"type":45,"tag":73,"props":1378,"children":1379},{},[1380,1382,1387],{"type":51,"value":1381},"When working with fields that have parentheses in their names (like has",{"type":45,"tag":1274,"props":1383,"children":1384},{},[1385],{"type":51,"value":1386},"any_tag, etc.), they are returned as &bool references. You need to dereference them when making comparisons. For example: if _variant.product().has_any_tag() { \u002F",{"type":51,"value":1388}," do something *\u002F } or simply use them directly in conditions where Rust will auto-dereference.",{"type":45,"tag":73,"props":1390,"children":1391},{},[1392],{"type":51,"value":1393},"Each target file (not main.rs) should start with these imports:",{"type":45,"tag":1076,"props":1395,"children":1399},{"className":1396,"code":1397,"language":1398,"meta":1081,"style":1081},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use crate::schema;\nuse shopify_function::prelude::*;\nuse shopify_function::Result;\n","rust",[1400],{"type":45,"tag":60,"props":1401,"children":1402},{"__ignoreMap":1081},[1403,1411,1419],{"type":45,"tag":1087,"props":1404,"children":1405},{"class":1089,"line":1090},[1406],{"type":45,"tag":1087,"props":1407,"children":1408},{},[1409],{"type":51,"value":1410},"use crate::schema;\n",{"type":45,"tag":1087,"props":1412,"children":1413},{"class":1089,"line":1099},[1414],{"type":45,"tag":1087,"props":1415,"children":1416},{},[1417],{"type":51,"value":1418},"use shopify_function::prelude::*;\n",{"type":45,"tag":1087,"props":1420,"children":1421},{"class":1089,"line":557},[1422],{"type":45,"tag":1087,"props":1423,"children":1424},{},[1425],{"type":51,"value":1426},"use shopify_function::Result;\n",{"type":45,"tag":151,"props":1428,"children":1429},{},[1430,1435],{"type":45,"tag":73,"props":1431,"children":1432},{},[1433],{"type":51,"value":1434},"You must never import serde or serde_json or it will not compile. Do not use serde (bad) or use serde::Deserialize (bad) or serde::json (bad)",{"type":45,"tag":73,"props":1436,"children":1437},{},[1438],{"type":51,"value":1439},"You must make sure in a match expression that you must include the _ wildcard pattern for any unspecified cases to ensure exhaustiveness",{"type":45,"tag":1076,"props":1441,"children":1443},{"className":1396,"code":1442,"language":1398,"meta":1081,"style":1081},"  for line in input.cart().lines().iter() {\n    let product = match &line.merchandise() {\n        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => &variant.product(),\n        _ => continue, \u002F\u002F Do not select for CustomProduct unless it's selected in the input query\n    };\n    \u002F\u002F do something with product\n}\n",[1444],{"type":45,"tag":60,"props":1445,"children":1446},{"__ignoreMap":1081},[1447,1455,1463,1471,1479,1487,1495],{"type":45,"tag":1087,"props":1448,"children":1449},{"class":1089,"line":1090},[1450],{"type":45,"tag":1087,"props":1451,"children":1452},{},[1453],{"type":51,"value":1454},"  for line in input.cart().lines().iter() {\n",{"type":45,"tag":1087,"props":1456,"children":1457},{"class":1089,"line":1099},[1458],{"type":45,"tag":1087,"props":1459,"children":1460},{},[1461],{"type":51,"value":1462},"    let product = match &line.merchandise() {\n",{"type":45,"tag":1087,"props":1464,"children":1465},{"class":1089,"line":557},[1466],{"type":45,"tag":1087,"props":1467,"children":1468},{},[1469],{"type":51,"value":1470},"        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => &variant.product(),\n",{"type":45,"tag":1087,"props":1472,"children":1473},{"class":1089,"line":1116},[1474],{"type":45,"tag":1087,"props":1475,"children":1476},{},[1477],{"type":51,"value":1478},"        _ => continue, \u002F\u002F Do not select for CustomProduct unless it's selected in the input query\n",{"type":45,"tag":1087,"props":1480,"children":1481},{"class":1089,"line":1125},[1482],{"type":45,"tag":1087,"props":1483,"children":1484},{},[1485],{"type":51,"value":1486},"    };\n",{"type":45,"tag":1087,"props":1488,"children":1489},{"class":1089,"line":1134},[1490],{"type":45,"tag":1087,"props":1491,"children":1492},{},[1493],{"type":51,"value":1494},"    \u002F\u002F do something with product\n",{"type":45,"tag":1087,"props":1496,"children":1497},{"class":1089,"line":1143},[1498],{"type":45,"tag":1087,"props":1499,"children":1500},{},[1501],{"type":51,"value":1239},{"type":45,"tag":54,"props":1503,"children":1504},{},[1505],{"type":51,"value":1506},"or if you want to extract the variant you can do this:",{"type":45,"tag":1076,"props":1508,"children":1510},{"className":1396,"code":1509,"language":1398,"meta":1081,"style":1081},"    let variant = match &line.merchandise() {\n        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => variant,\n        _ => continue, \u002F\u002F Do not select for CustomProduct unless it's selected in the input query\n    };\n    \u002F\u002F do something with variant\n",[1511],{"type":45,"tag":60,"props":1512,"children":1513},{"__ignoreMap":1081},[1514,1522,1530,1537,1544],{"type":45,"tag":1087,"props":1515,"children":1516},{"class":1089,"line":1090},[1517],{"type":45,"tag":1087,"props":1518,"children":1519},{},[1520],{"type":51,"value":1521},"    let variant = match &line.merchandise() {\n",{"type":45,"tag":1087,"props":1523,"children":1524},{"class":1089,"line":1099},[1525],{"type":45,"tag":1087,"props":1526,"children":1527},{},[1528],{"type":51,"value":1529},"        schema::run::input::cart::lines::Merchandise::ProductVariant(variant) => variant,\n",{"type":45,"tag":1087,"props":1531,"children":1532},{"class":1089,"line":557},[1533],{"type":45,"tag":1087,"props":1534,"children":1535},{},[1536],{"type":51,"value":1478},{"type":45,"tag":1087,"props":1538,"children":1539},{"class":1089,"line":1116},[1540],{"type":45,"tag":1087,"props":1541,"children":1542},{},[1543],{"type":51,"value":1486},{"type":45,"tag":1087,"props":1545,"children":1546},{"class":1089,"line":1125},[1547],{"type":45,"tag":1087,"props":1548,"children":1549},{},[1550],{"type":51,"value":1551},"    \u002F\u002F do something with variant\n",{"type":45,"tag":54,"props":1553,"children":1554},{},[1555],{"type":51,"value":1556},"Do not use .as_product_variant() it is not implemented",{"type":45,"tag":46,"props":1558,"children":1560},{"id":1559},"configuration",[1561],{"type":51,"value":1562},"Configuration",{"type":45,"tag":54,"props":1564,"children":1565},{},[1566,1568,1574,1576,1582,1583,1589],{"type":51,"value":1567},"BY DEFAULT, make the function configurable by storing the configurable data elements in a ",{"type":45,"tag":60,"props":1569,"children":1571},{"className":1570},[],[1572],{"type":51,"value":1573},"jsonValue",{"type":51,"value":1575}," metafield. Access this metafield via the ",{"type":45,"tag":60,"props":1577,"children":1579},{"className":1578},[],[1580],{"type":51,"value":1581},"discount.metafield",{"type":51,"value":579},{"type":45,"tag":60,"props":1584,"children":1586},{"className":1585},[],[1587],{"type":51,"value":1588},"checkout.metafield",{"type":51,"value":1590}," field in the input query (depending on the function type). Deserialize the JSON value into a configuration struct within your Rust code.",{"type":45,"tag":54,"props":1592,"children":1593},{},[1594,1596,1601,1603,1608,1610,1615],{"type":51,"value":1595},"Example accessing a metafield in Rust:\nNote only use the #",{"type":45,"tag":1087,"props":1597,"children":1598},{},[1599],{"type":51,"value":1600},"shopify_function(rename_all = \"camelCase\")",{"type":51,"value":1602}," if you plan on using someValue: \"\" and anotherValue: \"\" as part of your jsonValue metafield. By default do not include it.\nOnly use #",{"type":45,"tag":1087,"props":1604,"children":1605},{},[1606],{"type":51,"value":1607},"derive(Deserialize, Default, PartialEq)",{"type":51,"value":1609}," (good) do NOT use #",{"type":45,"tag":1087,"props":1611,"children":1612},{},[1613],{"type":51,"value":1614},"derive(serde::Deserialize)",{"type":51,"value":1616}," (bad)",{"type":45,"tag":1076,"props":1618,"children":1620},{"className":1396,"code":1619,"language":1398,"meta":1081,"style":1081},"#[derive(Deserialize, Default, PartialEq)]\n#[shopify_function(rename_all = \"camelCase\")]\npub struct Configuration {\n    some_value: String,\n    another_value: i32,\n}\n\n\u002F\u002F ... inside your function ...\n    let configuration: &Configuration = match input.discount().metafield() {\n        Some(metafield) => metafield.json_value(),\n        None => {\n            return Ok(schema::CartDeliveryOptionsDiscountsGenerateRunResult { operations: vec![] })\n        }\n    };\n\n\u002F\u002F Now you can use configuration.some_value and configuration.another_value\n",[1621],{"type":45,"tag":60,"props":1622,"children":1623},{"__ignoreMap":1081},[1624,1632,1640,1648,1656,1664,1671,1680,1688,1696,1704,1712,1720,1727,1734,1741],{"type":45,"tag":1087,"props":1625,"children":1626},{"class":1089,"line":1090},[1627],{"type":45,"tag":1087,"props":1628,"children":1629},{},[1630],{"type":51,"value":1631},"#[derive(Deserialize, Default, PartialEq)]\n",{"type":45,"tag":1087,"props":1633,"children":1634},{"class":1089,"line":1099},[1635],{"type":45,"tag":1087,"props":1636,"children":1637},{},[1638],{"type":51,"value":1639},"#[shopify_function(rename_all = \"camelCase\")]\n",{"type":45,"tag":1087,"props":1641,"children":1642},{"class":1089,"line":557},[1643],{"type":45,"tag":1087,"props":1644,"children":1645},{},[1646],{"type":51,"value":1647},"pub struct Configuration {\n",{"type":45,"tag":1087,"props":1649,"children":1650},{"class":1089,"line":1116},[1651],{"type":45,"tag":1087,"props":1652,"children":1653},{},[1654],{"type":51,"value":1655},"    some_value: String,\n",{"type":45,"tag":1087,"props":1657,"children":1658},{"class":1089,"line":1125},[1659],{"type":45,"tag":1087,"props":1660,"children":1661},{},[1662],{"type":51,"value":1663},"    another_value: i32,\n",{"type":45,"tag":1087,"props":1665,"children":1666},{"class":1089,"line":1134},[1667],{"type":45,"tag":1087,"props":1668,"children":1669},{},[1670],{"type":51,"value":1239},{"type":45,"tag":1087,"props":1672,"children":1673},{"class":1089,"line":1143},[1674],{"type":45,"tag":1087,"props":1675,"children":1677},{"emptyLinePlaceholder":1676},true,[1678],{"type":51,"value":1679},"\n",{"type":45,"tag":1087,"props":1681,"children":1682},{"class":1089,"line":1152},[1683],{"type":45,"tag":1087,"props":1684,"children":1685},{},[1686],{"type":51,"value":1687},"\u002F\u002F ... inside your function ...\n",{"type":45,"tag":1087,"props":1689,"children":1690},{"class":1089,"line":1161},[1691],{"type":45,"tag":1087,"props":1692,"children":1693},{},[1694],{"type":51,"value":1695},"    let configuration: &Configuration = match input.discount().metafield() {\n",{"type":45,"tag":1087,"props":1697,"children":1698},{"class":1089,"line":1170},[1699],{"type":45,"tag":1087,"props":1700,"children":1701},{},[1702],{"type":51,"value":1703},"        Some(metafield) => metafield.json_value(),\n",{"type":45,"tag":1087,"props":1705,"children":1706},{"class":1089,"line":1179},[1707],{"type":45,"tag":1087,"props":1708,"children":1709},{},[1710],{"type":51,"value":1711},"        None => {\n",{"type":45,"tag":1087,"props":1713,"children":1714},{"class":1089,"line":1188},[1715],{"type":45,"tag":1087,"props":1716,"children":1717},{},[1718],{"type":51,"value":1719},"            return Ok(schema::CartDeliveryOptionsDiscountsGenerateRunResult { operations: vec![] })\n",{"type":45,"tag":1087,"props":1721,"children":1722},{"class":1089,"line":1197},[1723],{"type":45,"tag":1087,"props":1724,"children":1725},{},[1726],{"type":51,"value":1203},{"type":45,"tag":1087,"props":1728,"children":1729},{"class":1089,"line":1206},[1730],{"type":45,"tag":1087,"props":1731,"children":1732},{},[1733],{"type":51,"value":1486},{"type":45,"tag":1087,"props":1735,"children":1736},{"class":1089,"line":1215},[1737],{"type":45,"tag":1087,"props":1738,"children":1739},{"emptyLinePlaceholder":1676},[1740],{"type":51,"value":1679},{"type":45,"tag":1087,"props":1742,"children":1743},{"class":1089,"line":1224},[1744],{"type":45,"tag":1087,"props":1745,"children":1746},{},[1747],{"type":51,"value":1748},"\u002F\u002F Now you can use configuration.some_value and configuration.another_value\n",{"type":45,"tag":54,"props":1750,"children":1751},{},[1752],{"type":51,"value":1753},"Example GraphQL Input Query:",{"type":45,"tag":1076,"props":1755,"children":1757},{"className":1078,"code":1756,"language":1080,"meta":1081,"style":1081},"query Input {\n  discount {\n    # Request the metafield with the specific namespace and key\n    metafield(namespace: \"\\$app\", key: \"config\") {\n      jsonValue # The value is a JSON string\n    }\n  }\n  # ... other input fields\n}\n",[1758],{"type":45,"tag":60,"props":1759,"children":1760},{"__ignoreMap":1081},[1761,1769,1777,1785,1793,1801,1808,1815,1823],{"type":45,"tag":1087,"props":1762,"children":1763},{"class":1089,"line":1090},[1764],{"type":45,"tag":1087,"props":1765,"children":1766},{},[1767],{"type":51,"value":1768},"query Input {\n",{"type":45,"tag":1087,"props":1770,"children":1771},{"class":1089,"line":1099},[1772],{"type":45,"tag":1087,"props":1773,"children":1774},{},[1775],{"type":51,"value":1776},"  discount {\n",{"type":45,"tag":1087,"props":1778,"children":1779},{"class":1089,"line":557},[1780],{"type":45,"tag":1087,"props":1781,"children":1782},{},[1783],{"type":51,"value":1784},"    # Request the metafield with the specific namespace and key\n",{"type":45,"tag":1087,"props":1786,"children":1787},{"class":1089,"line":1116},[1788],{"type":45,"tag":1087,"props":1789,"children":1790},{},[1791],{"type":51,"value":1792},"    metafield(namespace: \"\\$app\", key: \"config\") {\n",{"type":45,"tag":1087,"props":1794,"children":1795},{"class":1089,"line":1125},[1796],{"type":45,"tag":1087,"props":1797,"children":1798},{},[1799],{"type":51,"value":1800},"      jsonValue # The value is a JSON string\n",{"type":45,"tag":1087,"props":1802,"children":1803},{"class":1089,"line":1134},[1804],{"type":45,"tag":1087,"props":1805,"children":1806},{},[1807],{"type":51,"value":1221},{"type":45,"tag":1087,"props":1809,"children":1810},{"class":1089,"line":1143},[1811],{"type":45,"tag":1087,"props":1812,"children":1813},{},[1814],{"type":51,"value":1230},{"type":45,"tag":1087,"props":1816,"children":1817},{"class":1089,"line":1152},[1818],{"type":45,"tag":1087,"props":1819,"children":1820},{},[1821],{"type":51,"value":1822},"  # ... other input fields\n",{"type":45,"tag":1087,"props":1824,"children":1825},{"class":1089,"line":1161},[1826],{"type":45,"tag":1087,"props":1827,"children":1828},{},[1829],{"type":51,"value":1239},{"type":45,"tag":46,"props":1831,"children":1833},{"id":1832},"additional-important-notes",[1834],{"type":51,"value":1835},"Additional Important Notes",{"type":45,"tag":1837,"props":1838,"children":1840},"h3",{"id":1839},"testing",[1841],{"type":51,"value":1842},"Testing",{"type":45,"tag":54,"props":1844,"children":1845},{},[1846],{"type":51,"value":1847},"When writing tests, you must only import the following",{"type":45,"tag":1076,"props":1849,"children":1851},{"className":1396,"code":1850,"language":1398,"meta":1081,"style":1081},"  use super::*;\n  use shopify_function::{run_function_with_input, Result};\n",[1852],{"type":45,"tag":60,"props":1853,"children":1854},{"__ignoreMap":1081},[1855,1863],{"type":45,"tag":1087,"props":1856,"children":1857},{"class":1089,"line":1090},[1858],{"type":45,"tag":1087,"props":1859,"children":1860},{},[1861],{"type":51,"value":1862},"  use super::*;\n",{"type":45,"tag":1087,"props":1864,"children":1865},{"class":1089,"line":1099},[1866],{"type":45,"tag":1087,"props":1867,"children":1868},{},[1869],{"type":51,"value":1870},"  use shopify_function::{run_function_with_input, Result};\n",{"type":45,"tag":1837,"props":1872,"children":1874},{"id":1873},"sample-data-generation",[1875],{"type":51,"value":1876},"Sample Data Generation",{"type":45,"tag":54,"props":1878,"children":1879},{},[1880],{"type":51,"value":1881},"When generating sample data, anywhere there is an ID! make sure to use a Shopify GID format:",{"type":45,"tag":1076,"props":1883,"children":1887},{"className":1884,"code":1886,"language":51},[1885],"language-text","\"gid:\u002F\u002FShopify\u002FCartLine\u002F1\"\n",[1888],{"type":45,"tag":60,"props":1889,"children":1890},{"__ignoreMap":1081},[1891],{"type":51,"value":1886},{"type":45,"tag":1837,"props":1893,"children":1895},{"id":1894},"scalar-types",[1896],{"type":51,"value":1897},"Scalar Types",{"type":45,"tag":54,"props":1899,"children":1900},{},[1901],{"type":51,"value":1902},"These are the scalar types used in Rust functions:",{"type":45,"tag":1076,"props":1904,"children":1906},{"className":1396,"code":1905,"language":1398,"meta":1081,"style":1081},"pub type Boolean = bool;\npub type Float = f64;\npub type Int = i32;\npub type ID = String;\npub use decimal::Decimal;\npub type Void = ();\npub type URL = String;\npub type Handle = String;\n\npub type Date = String;\npub type DateTime = String;\npub type DateTimeWithoutTimezone = String;\npub type TimeWithoutTimezone = String;\npub type String = String; # This must not be a str, do not compare this with \"\" or unwrap_or(\"\")\n",[1907],{"type":45,"tag":60,"props":1908,"children":1909},{"__ignoreMap":1081},[1910,1918,1926,1934,1942,1950,1958,1966,1974,1981,1989,1997,2005,2013],{"type":45,"tag":1087,"props":1911,"children":1912},{"class":1089,"line":1090},[1913],{"type":45,"tag":1087,"props":1914,"children":1915},{},[1916],{"type":51,"value":1917},"pub type Boolean = bool;\n",{"type":45,"tag":1087,"props":1919,"children":1920},{"class":1089,"line":1099},[1921],{"type":45,"tag":1087,"props":1922,"children":1923},{},[1924],{"type":51,"value":1925},"pub type Float = f64;\n",{"type":45,"tag":1087,"props":1927,"children":1928},{"class":1089,"line":557},[1929],{"type":45,"tag":1087,"props":1930,"children":1931},{},[1932],{"type":51,"value":1933},"pub type Int = i32;\n",{"type":45,"tag":1087,"props":1935,"children":1936},{"class":1089,"line":1116},[1937],{"type":45,"tag":1087,"props":1938,"children":1939},{},[1940],{"type":51,"value":1941},"pub type ID = String;\n",{"type":45,"tag":1087,"props":1943,"children":1944},{"class":1089,"line":1125},[1945],{"type":45,"tag":1087,"props":1946,"children":1947},{},[1948],{"type":51,"value":1949},"pub use decimal::Decimal;\n",{"type":45,"tag":1087,"props":1951,"children":1952},{"class":1089,"line":1134},[1953],{"type":45,"tag":1087,"props":1954,"children":1955},{},[1956],{"type":51,"value":1957},"pub type Void = ();\n",{"type":45,"tag":1087,"props":1959,"children":1960},{"class":1089,"line":1143},[1961],{"type":45,"tag":1087,"props":1962,"children":1963},{},[1964],{"type":51,"value":1965},"pub type URL = String;\n",{"type":45,"tag":1087,"props":1967,"children":1968},{"class":1089,"line":1152},[1969],{"type":45,"tag":1087,"props":1970,"children":1971},{},[1972],{"type":51,"value":1973},"pub type Handle = String;\n",{"type":45,"tag":1087,"props":1975,"children":1976},{"class":1089,"line":1161},[1977],{"type":45,"tag":1087,"props":1978,"children":1979},{"emptyLinePlaceholder":1676},[1980],{"type":51,"value":1679},{"type":45,"tag":1087,"props":1982,"children":1983},{"class":1089,"line":1170},[1984],{"type":45,"tag":1087,"props":1985,"children":1986},{},[1987],{"type":51,"value":1988},"pub type Date = String;\n",{"type":45,"tag":1087,"props":1990,"children":1991},{"class":1089,"line":1179},[1992],{"type":45,"tag":1087,"props":1993,"children":1994},{},[1995],{"type":51,"value":1996},"pub type DateTime = String;\n",{"type":45,"tag":1087,"props":1998,"children":1999},{"class":1089,"line":1188},[2000],{"type":45,"tag":1087,"props":2001,"children":2002},{},[2003],{"type":51,"value":2004},"pub type DateTimeWithoutTimezone = String;\n",{"type":45,"tag":1087,"props":2006,"children":2007},{"class":1089,"line":1197},[2008],{"type":45,"tag":1087,"props":2009,"children":2010},{},[2011],{"type":51,"value":2012},"pub type TimeWithoutTimezone = String;\n",{"type":45,"tag":1087,"props":2014,"children":2015},{"class":1089,"line":1206},[2016],{"type":45,"tag":1087,"props":2017,"children":2018},{},[2019],{"type":51,"value":2020},"pub type String = String; # This must not be a str, do not compare this with \"\" or unwrap_or(\"\")\n",{"type":45,"tag":46,"props":2022,"children":2024},{"id":2023},"srcmainrs-for-rust-functions-required",[2025],{"type":51,"value":2026},"src\u002Fmain.rs for Rust Functions - REQUIRED",{"type":45,"tag":54,"props":2028,"children":2029},{},[2030],{"type":51,"value":2031},"When implementing Shopify functions in Rust, you MUST include a src\u002Fmain.rs file. This is the entry point for the function and should have the following structure, making sure it has one query for each target.\nIf you have a jsonValue in the input query it should be mapped to a struct. If there is no jsonValue do not include a custom_scalar_overrides.",{"type":45,"tag":1076,"props":2033,"children":2035},{"className":1396,"code":2034,"language":1398,"meta":1081,"style":1081},"use std::process;\nuse shopify_function::prelude::*;\n\n\u002F\u002F CRITICAL: These module imports MUST match your target names exactly\npub mod run;     \u002F\u002F For \"run\" target\npub mod fetch;   \u002F\u002F For \"fetch\" target\n\n#[typegen(\".\u002Fschema.graphql\")]\npub mod schema {\n      \u002F\u002F CRITICAL: The query path filename MUST match your target name\n      \u002F\u002F CRITICAL: The module name MUST match your target name\n      #[query(\"src\u002Frun.graphql\", custom_scalar_overrides = {\"Input.paymentCustomization.metafield.jsonValue\" => super::run::Configuration})]\n      pub mod run {}  \u002F\u002F Module name matches the target name\n\n      #[query(\"src\u002Ffetch.graphql\")]\n      pub mod fetch {} \u002F\u002F Module name matches the target name\n}\n\nfn main() {\n    eprintln!(\"Please invoke a named export.\");\n    process::exit(1);\n}\n",[2036],{"type":45,"tag":60,"props":2037,"children":2038},{"__ignoreMap":1081},[2039,2047,2054,2061,2069,2077,2085,2092,2100,2108,2116,2124,2132,2140,2147,2155,2163,2170,2178,2187,2196,2205],{"type":45,"tag":1087,"props":2040,"children":2041},{"class":1089,"line":1090},[2042],{"type":45,"tag":1087,"props":2043,"children":2044},{},[2045],{"type":51,"value":2046},"use std::process;\n",{"type":45,"tag":1087,"props":2048,"children":2049},{"class":1089,"line":1099},[2050],{"type":45,"tag":1087,"props":2051,"children":2052},{},[2053],{"type":51,"value":1418},{"type":45,"tag":1087,"props":2055,"children":2056},{"class":1089,"line":557},[2057],{"type":45,"tag":1087,"props":2058,"children":2059},{"emptyLinePlaceholder":1676},[2060],{"type":51,"value":1679},{"type":45,"tag":1087,"props":2062,"children":2063},{"class":1089,"line":1116},[2064],{"type":45,"tag":1087,"props":2065,"children":2066},{},[2067],{"type":51,"value":2068},"\u002F\u002F CRITICAL: These module imports MUST match your target names exactly\n",{"type":45,"tag":1087,"props":2070,"children":2071},{"class":1089,"line":1125},[2072],{"type":45,"tag":1087,"props":2073,"children":2074},{},[2075],{"type":51,"value":2076},"pub mod run;     \u002F\u002F For \"run\" target\n",{"type":45,"tag":1087,"props":2078,"children":2079},{"class":1089,"line":1134},[2080],{"type":45,"tag":1087,"props":2081,"children":2082},{},[2083],{"type":51,"value":2084},"pub mod fetch;   \u002F\u002F For \"fetch\" target\n",{"type":45,"tag":1087,"props":2086,"children":2087},{"class":1089,"line":1143},[2088],{"type":45,"tag":1087,"props":2089,"children":2090},{"emptyLinePlaceholder":1676},[2091],{"type":51,"value":1679},{"type":45,"tag":1087,"props":2093,"children":2094},{"class":1089,"line":1152},[2095],{"type":45,"tag":1087,"props":2096,"children":2097},{},[2098],{"type":51,"value":2099},"#[typegen(\".\u002Fschema.graphql\")]\n",{"type":45,"tag":1087,"props":2101,"children":2102},{"class":1089,"line":1161},[2103],{"type":45,"tag":1087,"props":2104,"children":2105},{},[2106],{"type":51,"value":2107},"pub mod schema {\n",{"type":45,"tag":1087,"props":2109,"children":2110},{"class":1089,"line":1170},[2111],{"type":45,"tag":1087,"props":2112,"children":2113},{},[2114],{"type":51,"value":2115},"      \u002F\u002F CRITICAL: The query path filename MUST match your target name\n",{"type":45,"tag":1087,"props":2117,"children":2118},{"class":1089,"line":1179},[2119],{"type":45,"tag":1087,"props":2120,"children":2121},{},[2122],{"type":51,"value":2123},"      \u002F\u002F CRITICAL: The module name MUST match your target name\n",{"type":45,"tag":1087,"props":2125,"children":2126},{"class":1089,"line":1188},[2127],{"type":45,"tag":1087,"props":2128,"children":2129},{},[2130],{"type":51,"value":2131},"      #[query(\"src\u002Frun.graphql\", custom_scalar_overrides = {\"Input.paymentCustomization.metafield.jsonValue\" => super::run::Configuration})]\n",{"type":45,"tag":1087,"props":2133,"children":2134},{"class":1089,"line":1197},[2135],{"type":45,"tag":1087,"props":2136,"children":2137},{},[2138],{"type":51,"value":2139},"      pub mod run {}  \u002F\u002F Module name matches the target name\n",{"type":45,"tag":1087,"props":2141,"children":2142},{"class":1089,"line":1206},[2143],{"type":45,"tag":1087,"props":2144,"children":2145},{"emptyLinePlaceholder":1676},[2146],{"type":51,"value":1679},{"type":45,"tag":1087,"props":2148,"children":2149},{"class":1089,"line":1215},[2150],{"type":45,"tag":1087,"props":2151,"children":2152},{},[2153],{"type":51,"value":2154},"      #[query(\"src\u002Ffetch.graphql\")]\n",{"type":45,"tag":1087,"props":2156,"children":2157},{"class":1089,"line":1224},[2158],{"type":45,"tag":1087,"props":2159,"children":2160},{},[2161],{"type":51,"value":2162},"      pub mod fetch {} \u002F\u002F Module name matches the target name\n",{"type":45,"tag":1087,"props":2164,"children":2165},{"class":1089,"line":1233},[2166],{"type":45,"tag":1087,"props":2167,"children":2168},{},[2169],{"type":51,"value":1239},{"type":45,"tag":1087,"props":2171,"children":2173},{"class":1089,"line":2172},18,[2174],{"type":45,"tag":1087,"props":2175,"children":2176},{"emptyLinePlaceholder":1676},[2177],{"type":51,"value":1679},{"type":45,"tag":1087,"props":2179,"children":2181},{"class":1089,"line":2180},19,[2182],{"type":45,"tag":1087,"props":2183,"children":2184},{},[2185],{"type":51,"value":2186},"fn main() {\n",{"type":45,"tag":1087,"props":2188,"children":2190},{"class":1089,"line":2189},20,[2191],{"type":45,"tag":1087,"props":2192,"children":2193},{},[2194],{"type":51,"value":2195},"    eprintln!(\"Please invoke a named export.\");\n",{"type":45,"tag":1087,"props":2197,"children":2199},{"class":1089,"line":2198},21,[2200],{"type":45,"tag":1087,"props":2201,"children":2202},{},[2203],{"type":51,"value":2204},"    process::exit(1);\n",{"type":45,"tag":1087,"props":2206,"children":2208},{"class":1089,"line":2207},22,[2209],{"type":45,"tag":1087,"props":2210,"children":2211},{},[2212],{"type":51,"value":1239},{"type":45,"tag":54,"props":2214,"children":2215},{},[2216],{"type":51,"value":2217},"Ensure examples follow best practices, correct enum usage, and proper handling of optional fields.\n",{"type":45,"tag":1837,"props":2219,"children":2221},{"id":2220},"always-use-shopify-cli",[2222],{"type":51,"value":2223},"Always use Shopify CLI",{"type":45,"tag":151,"props":2225,"children":2226},{},[2227,2271],{"type":45,"tag":73,"props":2228,"children":2229},{},[2230,2235,2237,2243,2244,2249,2250,2256,2257,2263,2264,2270],{"type":45,"tag":130,"props":2231,"children":2232},{},[2233],{"type":51,"value":2234},"CLI:",{"type":51,"value":2236}," ALWAYS use Shopify CLI to scaffold and manage functions. Never hand-roll files. Key commands: ",{"type":45,"tag":60,"props":2238,"children":2240},{"className":2239},[],[2241],{"type":51,"value":2242},"shopify app generate extension",{"type":51,"value":477},{"type":45,"tag":60,"props":2245,"children":2247},{"className":2246},[],[2248],{"type":51,"value":428},{"type":51,"value":477},{"type":45,"tag":60,"props":2251,"children":2253},{"className":2252},[],[2254],{"type":51,"value":2255},"shopify app function run",{"type":51,"value":477},{"type":45,"tag":60,"props":2258,"children":2260},{"className":2259},[],[2261],{"type":51,"value":2262},"shopify app function schema",{"type":51,"value":477},{"type":45,"tag":60,"props":2265,"children":2267},{"className":2266},[],[2268],{"type":51,"value":2269},"shopify app function typegen",{"type":51,"value":379},{"type":45,"tag":73,"props":2272,"children":2273},{},[2274,2276,2282],{"type":51,"value":2275},"For CLI installation, setup, upgrade, or troubleshooting, use ",{"type":45,"tag":60,"props":2277,"children":2279},{"className":2278},[],[2280],{"type":51,"value":2281},"shopify-use-shopify-cli",{"type":51,"value":379},{"type":45,"tag":136,"props":2284,"children":2285},{},[],{"type":45,"tag":46,"props":2287,"children":2289},{"id":2288},"️-mandatory-search-before-writing-code",[2290],{"type":51,"value":2291},"⚠️ MANDATORY: Search Before Writing Code",{"type":45,"tag":54,"props":2293,"children":2294},{},[2295],{"type":51,"value":2296},"Search the vector store to get the detailed context you need: working examples, field and type definitions, valid values, and API-specific patterns. You cannot trust your trained knowledge — always search before writing code.",{"type":45,"tag":1076,"props":2298,"children":2301},{"className":2299,"code":2300,"language":51},[1885],"scripts\u002Fsearch_docs.mjs \"\u003Coperation or component name>\" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION\n",[2302],{"type":45,"tag":60,"props":2303,"children":2304},{"__ignoreMap":1081},[2305],{"type":51,"value":2300},{"type":45,"tag":54,"props":2307,"children":2308},{},[2309,2311,2316],{"type":51,"value":2310},"Search for the ",{"type":45,"tag":130,"props":2312,"children":2313},{},[2314],{"type":51,"value":2315},"operation or component name",{"type":51,"value":2317},", not the full user prompt.",{"type":45,"tag":54,"props":2319,"children":2320},{},[2321],{"type":51,"value":2322},"For example, if the user asks about cart transform function inputs:",{"type":45,"tag":1076,"props":2324,"children":2327},{"className":2325,"code":2326,"language":51},[1885],"scripts\u002Fsearch_docs.mjs \"cart transform function input query\" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION\n",[2328],{"type":45,"tag":60,"props":2329,"children":2330},{"__ignoreMap":1081},[2331],{"type":51,"value":2326},{"type":45,"tag":46,"props":2333,"children":2335},{"id":2334},"️-mandatory-validate-before-returning-code",[2336],{"type":51,"value":2337},"⚠️ MANDATORY: Validate Before Returning Code",{"type":45,"tag":54,"props":2339,"children":2340},{},[2341,2343,2349],{"type":51,"value":2342},"You MUST run ",{"type":45,"tag":60,"props":2344,"children":2346},{"className":2345},[],[2347],{"type":51,"value":2348},"scripts\u002Fvalidate.mjs",{"type":51,"value":2350}," before returning any generated code to the user. Always include the instrumentation flags:",{"type":45,"tag":1076,"props":2352,"children":2355},{"className":2353,"code":2354,"language":51},[1885],"scripts\u002Fvalidate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER\n",[2356],{"type":45,"tag":60,"props":2357,"children":2358},{"__ignoreMap":1081},[2359],{"type":51,"value":2354},{"type":45,"tag":54,"props":2361,"children":2362},{},[2363],{"type":51,"value":2364},"(For YOUR_ARTIFACT_ID, generate a stable random ID per code block and reuse it across validation retries. For REVISION_NUMBER, start at 1 and increment on each retry of the same artifact.)",{"type":45,"tag":54,"props":2366,"children":2367},{},[2368],{"type":45,"tag":130,"props":2369,"children":2370},{},[2371],{"type":51,"value":2372},"When validation fails, follow this loop:",{"type":45,"tag":69,"props":2374,"children":2375},{},[2376,2381,2395,2400,2412],{"type":45,"tag":73,"props":2377,"children":2378},{},[2379],{"type":51,"value":2380},"Read the error message carefully — identify the exact field, prop, or value that is wrong",{"type":45,"tag":73,"props":2382,"children":2383},{},[2384,2386],{"type":51,"value":2385},"If the error references a named type or says a value is not assignable, search for the correct values:\n",{"type":45,"tag":1076,"props":2387,"children":2390},{"className":2388,"code":2389,"language":51},[1885],"scripts\u002Fsearch_docs.mjs \"\u003Ctype or prop name>\"\n",[2391],{"type":45,"tag":60,"props":2392,"children":2393},{"__ignoreMap":1081},[2394],{"type":51,"value":2389},{"type":45,"tag":73,"props":2396,"children":2397},{},[2398],{"type":51,"value":2399},"Fix exactly the reported error using what the search returns",{"type":45,"tag":73,"props":2401,"children":2402},{},[2403,2405,2410],{"type":51,"value":2404},"Run ",{"type":45,"tag":60,"props":2406,"children":2408},{"className":2407},[],[2409],{"type":51,"value":2348},{"type":51,"value":2411}," again",{"type":45,"tag":73,"props":2413,"children":2414},{},[2415],{"type":51,"value":2416},"Retry up to 3 times total; after 3 failures, return the best attempt with an explanation",{"type":45,"tag":54,"props":2418,"children":2419},{},[2420],{"type":45,"tag":130,"props":2421,"children":2422},{},[2423],{"type":51,"value":2424},"Do not guess at valid values — always search first when the error names a type you don't know.",{"type":45,"tag":136,"props":2426,"children":2427},{},[],{"type":45,"tag":2429,"props":2430,"children":2431},"blockquote",{},[2432],{"type":45,"tag":54,"props":2433,"children":2434},{},[2435,2440,2442,2448,2450,2456,2458,2464],{"type":45,"tag":130,"props":2436,"children":2437},{},[2438],{"type":51,"value":2439},"Privacy notice:",{"type":51,"value":2441}," ",{"type":45,"tag":60,"props":2443,"children":2445},{"className":2444},[],[2446],{"type":51,"value":2447},"scripts\u002Fsearch_docs.mjs",{"type":51,"value":2449}," reports the search query, search response or error text, skill name\u002Fversion, and model\u002Fclient identifiers to Shopify (",{"type":45,"tag":60,"props":2451,"children":2453},{"className":2452},[],[2454],{"type":51,"value":2455},"shopify.dev\u002Fmcp\u002Fusage",{"type":51,"value":2457},") to help improve these tools. Set ",{"type":45,"tag":60,"props":2459,"children":2461},{"className":2460},[],[2462],{"type":51,"value":2463},"OPT_OUT_INSTRUMENTATION=true",{"type":51,"value":2465}," in your environment to opt out.",{"type":45,"tag":136,"props":2467,"children":2468},{},[],{"type":45,"tag":2429,"props":2470,"children":2471},{},[2472],{"type":45,"tag":54,"props":2473,"children":2474},{},[2475,2479,2480,2485,2487,2492,2493,2498],{"type":45,"tag":130,"props":2476,"children":2477},{},[2478],{"type":51,"value":2439},{"type":51,"value":2441},{"type":45,"tag":60,"props":2481,"children":2483},{"className":2482},[],[2484],{"type":51,"value":2348},{"type":51,"value":2486}," reports the validation result, skill name\u002Fversion, model\u002Fclient identifiers, the validated code when present, and validator-specific context such as API name, extension target, filename, file type, theme path, file list, artifact ID, and revision to Shopify (",{"type":45,"tag":60,"props":2488,"children":2490},{"className":2489},[],[2491],{"type":51,"value":2455},{"type":51,"value":2457},{"type":45,"tag":60,"props":2494,"children":2496},{"className":2495},[],[2497],{"type":51,"value":2463},{"type":51,"value":2465},{"type":45,"tag":2500,"props":2501,"children":2502},"style",{},[2503],{"type":51,"value":2504},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2506,"total":2625},[2507,2525,2539,2551,2571,2593,2613],{"slug":2508,"name":2508,"fn":2509,"description":2510,"org":2511,"tags":2512,"stars":25,"repoUrl":26,"updatedAt":27},"accessibility-and-inclusive-visualization","make data visualizations accessible","Make data visualizations accessible and inclusive. Use when the user needs chart or diagram accessibility guidance, text alternatives for complex visuals, color and contrast review, keyboard support, reduced-motion behavior for animation or parallax, or an accessibility QA workflow for exported figures, UML-like diagrams, and dashboards.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2513,2516,2519,2522],{"name":2514,"slug":2515,"type":15},"Accessibility","accessibility",{"name":2517,"slug":2518,"type":15},"Charts","charts",{"name":2520,"slug":2521,"type":15},"Data Visualization","data-visualization",{"name":2523,"slug":2524,"type":15},"Design","design",{"slug":2526,"name":2526,"fn":2527,"description":2528,"org":2529,"tags":2530,"stars":25,"repoUrl":26,"updatedAt":2538},"agent-browser","automate browser interactions for agents","Browser automation CLI for AI agents. Use when the user needs to interact with websites, verify dev server output, test web apps, navigate pages, fill forms, click buttons, take screenshots, extract data, or automate any browser task. Also triggers when a dev server starts so you can verify it visually.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2531,2534,2537],{"name":2532,"slug":2533,"type":15},"Agents","agents",{"name":2535,"slug":2536,"type":15},"Browser Automation","browser-automation",{"name":1842,"slug":1839,"type":15},"2026-04-06T18:41:03.44016",{"slug":2540,"name":2540,"fn":2541,"description":2542,"org":2543,"tags":2544,"stars":25,"repoUrl":26,"updatedAt":2550},"agent-browser-verify","verify dev server output with automated browser","Automated browser verification for dev servers. Triggers when a dev server starts to run a visual gut-check with agent-browser — verifies the page loads, checks for console errors, validates key UI elements, and reports pass\u002Ffail before continuing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2545,2546,2549],{"name":2535,"slug":2536,"type":15},{"name":2547,"slug":2548,"type":15},"Local Development","local-development",{"name":1842,"slug":1839,"type":15},"2026-04-06T18:41:17.526867",{"slug":2552,"name":2552,"fn":2553,"description":2554,"org":2555,"tags":2556,"stars":25,"repoUrl":26,"updatedAt":2570},"agents-sdk","build AI agents on Cloudflare Workers","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2557,2558,2561,2564,2567],{"name":2532,"slug":2533,"type":15},{"name":2559,"slug":2560,"type":15},"Cloudflare Workers","cloudflare-workers",{"name":2562,"slug":2563,"type":15},"SDK","sdk",{"name":2565,"slug":2566,"type":15},"Serverless","serverless",{"name":2568,"slug":2569,"type":15},"WebSockets","websockets","2026-04-06T18:39:51.717063",{"slug":2572,"name":2572,"fn":2573,"description":2574,"org":2575,"tags":2576,"stars":25,"repoUrl":26,"updatedAt":2592},"ai-elements","build chat UIs with AI Elements","AI Elements component library guidance — pre-built React components for AI interfaces built on shadcn\u002Fui. Use when building chat UIs, message displays, tool call rendering, streaming responses, reasoning panels, or any AI-native interface with the AI SDK.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2577,2580,2583,2586,2589],{"name":2578,"slug":2579,"type":15},"Frontend","frontend",{"name":2581,"slug":2582,"type":15},"React","react",{"name":2584,"slug":2585,"type":15},"shadcn\u002Fui","shadcn-ui",{"name":2587,"slug":2588,"type":15},"UI Components","ui-components",{"name":2590,"slug":2591,"type":15},"Vercel","vercel","2026-04-06T18:40:59.619419",{"slug":2594,"name":2594,"fn":2595,"description":2596,"org":2597,"tags":2598,"stars":25,"repoUrl":26,"updatedAt":2612},"ai-gateway","configure Vercel AI Gateway","Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2599,2602,2605,2608,2611],{"name":2600,"slug":2601,"type":15},"AI Infrastructure","ai-infrastructure",{"name":2603,"slug":2604,"type":15},"Cost Optimization","cost-optimization",{"name":2606,"slug":2607,"type":15},"LLM","llm",{"name":2609,"slug":2610,"type":15},"Performance","performance",{"name":2590,"slug":2591,"type":15},"2026-04-06T18:40:44.377464",{"slug":2614,"name":2614,"fn":2615,"description":2616,"org":2617,"tags":2618,"stars":25,"repoUrl":26,"updatedAt":2624},"ai-generation-persistence","implement persistence patterns for AI generations","AI generation persistence patterns — unique IDs, addressable URLs, database storage, and cost tracking for every LLM generation",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2619,2620,2623],{"name":2603,"slug":2604,"type":15},{"name":2621,"slug":2622,"type":15},"Database","database",{"name":2606,"slug":2607,"type":15},"2026-04-06T18:41:08.513425",600,{"items":2627,"total":2822},[2628,2649,2672,2689,2703,2720,2739,2751,2765,2779,2791,2806],{"slug":2629,"name":2629,"fn":2630,"description":2631,"org":2632,"tags":2633,"stars":2646,"repoUrl":2647,"updatedAt":2648},"prior-auth-packet-builder","build healthcare prior authorization packets","Build a concise prior authorization packet from local case files and payer policy docs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2634,2637,2640,2643],{"name":2635,"slug":2636,"type":15},"Documents","documents",{"name":2638,"slug":2639,"type":15},"Healthcare","healthcare",{"name":2641,"slug":2642,"type":15},"Insurance","insurance",{"name":2644,"slug":2645,"type":15},"Regulatory Compliance","regulatory-compliance",28169,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-agents-python","2026-04-16T05:11:39.180399",{"slug":2650,"name":2650,"fn":2651,"description":2652,"org":2653,"tags":2654,"stars":2669,"repoUrl":2670,"updatedAt":2671},"aspnet-core","build ASP.NET Core web applications","Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2655,2658,2660,2663,2666],{"name":2656,"slug":2657,"type":15},".NET","dotnet",{"name":2659,"slug":2650,"type":15},"ASP.NET Core",{"name":2661,"slug":2662,"type":15},"Blazor","blazor",{"name":2664,"slug":2665,"type":15},"C#","csharp",{"name":2667,"slug":2668,"type":15},"Web Development","web-development",23787,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fskills","2026-04-12T05:07:02.819491",{"slug":2673,"name":2673,"fn":2674,"description":2675,"org":2676,"tags":2677,"stars":2669,"repoUrl":2670,"updatedAt":2688},"chatgpt-apps","build ChatGPT Apps SDK applications","Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2678,2681,2684,2687],{"name":2679,"slug":2680,"type":15},"Apps SDK","apps-sdk",{"name":2682,"slug":2683,"type":15},"ChatGPT","chatgpt",{"name":2685,"slug":2686,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},"2026-04-12T05:07:05.468097",{"slug":2690,"name":2690,"fn":2691,"description":2692,"org":2693,"tags":2694,"stars":2669,"repoUrl":2670,"updatedAt":2702},"cli-creator","build CLIs from API docs","Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read\u002Fwrite commands, return stable JSON, manage auth, and pair with a companion skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2695,2696,2699],{"name":20,"slug":21,"type":15},{"name":2697,"slug":2698,"type":15},"CLI","cli",{"name":2700,"slug":2701,"type":15},"Codex","codex","2026-04-12T05:07:04.132762",{"slug":2704,"name":2704,"fn":2705,"description":2706,"org":2707,"tags":2708,"stars":2669,"repoUrl":2670,"updatedAt":2719},"cloudflare-deploy","deploy projects to Cloudflare","Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2709,2712,2715,2716],{"name":2710,"slug":2711,"type":15},"Cloudflare","cloudflare",{"name":2713,"slug":2714,"type":15},"Cloudflare Pages","cloudflare-pages",{"name":2559,"slug":2560,"type":15},{"name":2717,"slug":2718,"type":15},"Deployment","deployment","2026-04-12T05:07:14.275118",{"slug":2721,"name":2721,"fn":2722,"description":2723,"org":2724,"tags":2725,"stars":2669,"repoUrl":2670,"updatedAt":2738},"define-goal","define and set measurable project goals","Help the user define a concrete, measurable goal before starting work, especially when they ask to use the goal tool, create a goal, set an objective, clarify success criteria, or turn a fuzzy intention into a quantitative outcome. Use this skill for goal creation and goal refinement only; it does not manage durable snapshots, decision logs, or long-running execution artifacts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2726,2729,2732,2735],{"name":2727,"slug":2728,"type":15},"Productivity","productivity",{"name":2730,"slug":2731,"type":15},"Project Management","project-management",{"name":2733,"slug":2734,"type":15},"Strategy","strategy",{"name":2736,"slug":2737,"type":15},"Task Management","task-management","2026-05-23T06:17:16.870838",{"slug":2740,"name":2740,"fn":2741,"description":2742,"org":2743,"tags":2744,"stars":2669,"repoUrl":2670,"updatedAt":2750},"figma","translate Figma designs into code","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2745,2746,2748,2749],{"name":2523,"slug":2524,"type":15},{"name":2747,"slug":2740,"type":15},"Figma",{"name":2578,"slug":2579,"type":15},{"name":2685,"slug":2686,"type":15},"2026-04-12T05:06:47.939943",{"slug":2752,"name":2752,"fn":2753,"description":2754,"org":2755,"tags":2756,"stars":2669,"repoUrl":2670,"updatedAt":2764},"figma-code-connect-components","connect Figma designs to code components","Connects Figma design components to code components using Code Connect mapping tools. Use when user says \"code connect\", \"connect this component to code\", \"map this component\", \"link component to code\", \"create code connect mapping\", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2757,2758,2761,2762,2763],{"name":2523,"slug":2524,"type":15},{"name":2759,"slug":2760,"type":15},"Design System","design-system",{"name":2747,"slug":2740,"type":15},{"name":2578,"slug":2579,"type":15},{"name":2587,"slug":2588,"type":15},"2026-05-10T05:59:52.971881",{"slug":2766,"name":2766,"fn":2767,"description":2768,"org":2769,"tags":2770,"stars":2669,"repoUrl":2670,"updatedAt":2778},"figma-create-design-system-rules","generate design system rules from Figma","Generates custom design system rules for the user's codebase. Use when user says \"create design system rules\", \"generate rules for my project\", \"set up design rules\", \"customize design system guidelines\", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2771,2772,2773,2776,2777],{"name":2523,"slug":2524,"type":15},{"name":2759,"slug":2760,"type":15},{"name":2774,"slug":2775,"type":15},"Documentation","documentation",{"name":2747,"slug":2740,"type":15},{"name":2578,"slug":2579,"type":15},"2026-05-16T06:07:47.821474",{"slug":2780,"name":2780,"fn":2781,"description":2782,"org":2783,"tags":2784,"stars":2669,"repoUrl":2670,"updatedAt":2790},"figma-implement-design","translate Figma designs into application code","Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions \"implement design\", \"generate code\", \"implement component\", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2785,2786,2787,2788,2789],{"name":2523,"slug":2524,"type":15},{"name":2747,"slug":2740,"type":15},{"name":2578,"slug":2579,"type":15},{"name":2587,"slug":2588,"type":15},{"name":2667,"slug":2668,"type":15},"2026-05-16T06:07:40.583615",{"slug":2792,"name":2792,"fn":2793,"description":2794,"org":2795,"tags":2796,"stars":2669,"repoUrl":2670,"updatedAt":2805},"hatch-pet","create animated pets for Codex","Create, repair, validate, visually QA, and package Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual references. Use when a user wants a lightweight-worker Codex pet workflow, a non-pixel custom pet style, a prospect or company mascot pet, or a full 8x9 animated pet atlas with transparent unused cells, QA contact sheets, and pet.json packaging. This skill composes the installed $imagegen system skill for visual generation and uses bundled scripts for deterministic spritesheet assembly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2797,2800,2801,2804],{"name":2798,"slug":2799,"type":15},"Animation","animation",{"name":2700,"slug":2701,"type":15},{"name":2802,"slug":2803,"type":15},"Creative","creative",{"name":2523,"slug":2524,"type":15},"2026-05-02T05:31:48.48485",{"slug":2807,"name":2807,"fn":2808,"description":2809,"org":2810,"tags":2811,"stars":2669,"repoUrl":2670,"updatedAt":2821},"imagegen","generate and edit raster images","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2812,2813,2814,2817,2820],{"name":2802,"slug":2803,"type":15},{"name":2523,"slug":2524,"type":15},{"name":2815,"slug":2816,"type":15},"Image Generation","image-generation",{"name":2818,"slug":2819,"type":15},"Images","images",{"name":9,"slug":8,"type":15},"2026-05-15T06:23:24.312127",675]