
Shopify
- 20 installs
- 21 repo stars
- Updated August 3, 2026
- starchild-ai-agent/official-skills
Helps with ai & agent building tasks during AI-assisted development.
About
shopify is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- shopify
- AI & Agent Building
- AI-coding skill
Shopify by the numbers
- 20 all-time installs (skills.sh)
- +5 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #10,459 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/starchild-ai-agent/official-skills --skill shopifyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 20 |
|---|---|
| repo stars | ★ 21 |
| Last updated | August 3, 2026 |
| Repository | starchild-ai-agent/official-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
<!-- AUTO-GENERATED — do not edit directly. Edit src/data/raw-api-instructions/{api}.md in shopify-dev-tools, then run: npm run generate_agent_skills (outputs to distributed-agent-skills/) --> --- name: shopify-admin description: "The Admin GraphQL API lets you build apps and integrations that extend and enhance the Shopify admin." compatibility: Claude Code, Claude Desktop, Cursor metadata: author: Shopify ---
You are an assistant that helps Shopify developers write GraphQL queries or mutations to interact with the latest Shopify Admin API GraphQL version.
You should find all operations that can help the developer achieve their goal, provide valid graphQL operations along with helpful explanations. Always add links to the documentation that you used by using the url information inside search results. When returning a graphql operation always wrap it in triple backticks and use the graphql file type.
Think about all the steps required to generate a GraphQL query or mutation for the Admin API:
First think about what I am trying to do with the API Search through the developer documentation to find similar examples. THIS IS IMPORTANT. Then think about which top level queries or mutations you need to use and in case of mutations which input type to use For queries think about which fields you need to fetch and for mutations think about which arguments you need to pass as input Then think about which fields to select from the return type. In general, don't select more than 5 fields If there are nested objects think about which fields you need to fetch for those objects If the user is trying to do advanced filtering with the query parameter then fetch the documentation from /docs/api/usage/search-syntax
---
⚠️ MANDATORY: Search for Documentation
You cannot trust your trained knowledge for this API. Before answering, search:
/scripts/search_docs.js "<operation name>"For example, if the user asks about bulk inventory updates:
/scripts/search_docs.js "inventoryAdjustQuantities mutation"Search for the mutation or query name, not the full user prompt. Use the returned schema and examples to write correct field names, arguments, and types.
⚠️ MANDATORY: Validate Before Returning Code
You MUST run /scripts/validate.js before returning any generated code to the user.
When validation fails, follow this loop: 1. Read the error message carefully — identify the exact field, prop, or value that is wrong 2. If the error references a named type or says a value is not assignable, search for the correct values:
/scripts/search_docs.js "<type or prop name>"3. Fix exactly the reported error using what the search returns 4. Run /scripts/validate.js again 5. Retry up to 3 times total; after 3 failures, return the best attempt with an explanation
Do not guess at valid values — always search first when the error names a type you don't know.
---
Privacy notice:/scripts/validate.jsreports anonymized validation results (pass/fail and skill name) to Shopify to help improve these tools. SetOPT_OUT_INSTRUMENTATION=truein your environment to opt out.
{
"validation": true
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-admin" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "admin";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": false
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-custom-data" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "custom-data";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-customer" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "customer";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-dev" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "dev";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-functions" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "functions";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-hydrogen",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/hydrogen": "2026.1.3",
"@shopify/hydrogen-react": "2026.1.2",
"@shopify/remix-oxygen": "latest",
"react-router": "7.13.2",
"@react-router/dev": "7.13.2",
"graphql": "16.13.1",
"type-fest": "5.5.0",
"schema-dts": "1.1.5",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-hydrogen" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "hydrogen";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-liquid",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shopify-liquid",
"dependencies": {
"@shopify/theme-check-common": "3.24.0",
"@shopify/theme-check-docs-updater": "3.24.0",
"@shopify/theme-check-node": "3.24.0"
}
},
"node_modules/@shopify/liquid-html-parser": {
"version": "2.9.2",
"resolved": "https://npm.shopify.io/node/@shopify/liquid-html-parser/-/liquid-html-parser-2.9.2.tgz",
"integrity": "sha512-2XJYqHaZxEBwuufGhzIZ0M6m9YA4HS7YlVOiZtYanFgkmoQeJm1c0JhKcuCXU5C1pc2M0rt1XzBX8SgWv7l8Ww==",
"license": "MIT",
"dependencies": {
"line-column": "^1.0.2",
"ohm-js": "^17.0.0"
}
},
"node_modules/@shopify/theme-check-common": {
"version": "3.24.0",
"resolved": "https://npm.shopify.io/node/@shopify/theme-check-common/-/theme-check-common-3.24.0.tgz",
"integrity": "sha512-gbUsv+vK7GeZNkA30wXKc5ncZjLMJZquI9K6CZR0jJaArV+/dAc9zGA73nqyiIgEGd2pw0S/Vly6FgBIVcPmMg==",
"license": "MIT",
"dependencies": {
"@shopify/liquid-html-parser": "2.9.2",
"cross-fetch": "^4.0.0",
"jsonc-parser": "^3.2.0",
"line-column": "^1.0.2",
"lodash": "^4.17.23",
"minimatch": "^10.2.1",
"vscode-json-languageservice": "^5.3.10",
"vscode-uri": "^3.0.7"
}
},
"node_modules/@shopify/theme-check-docs-updater": {
"version": "3.24.0",
"resolved": "https://npm.shopify.io/node/@shopify/theme-check-docs-updater/-/theme-check-docs-updater-3.24.0.tgz",
"integrity": "sha512-IX8jEMke6uaL6KiUerBoy6xkV7LTFmY5HKmZuiAQPfd2IP1q280T5jaYzYa52vqy85JDja4HGxMQItiwJG3J4w==",
"license": "MIT",
"dependencies": {
"@shopify/theme-check-common": "^3.24.0",
"env-paths": "^2.2.1",
"node-fetch": "^2.6.11"
},
"bin": {
"theme-docs": "scripts/cli.js"
}
},
"node_modules/@shopify/theme-check-node": {
"version": "3.24.0",
"resolved": "https://npm.shopify.io/node/@shopify/theme-check-node/-/theme-check-node-3.24.0.tgz",
"integrity": "sha512-8AQLCoLxeREWENc4ELGQbn1GkZO6lVVKxhAPSeXEg9VGI/oc1G+fPXEdN4VnExqW5aP/dJCAnb/JH89bkIrm4Q==",
"license": "MIT",
"dependencies": {
"@shopify/theme-check-common": "3.24.0",
"@shopify/theme-check-docs-updater": "3.24.0",
"glob": "^8.0.3",
"vscode-uri": "^3.0.7",
"yaml": "^2.3.0"
}
},
"node_modules/@vscode/l10n": {
"version": "0.0.18",
"resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz",
"integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==",
"license": "MIT"
},
"node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/brace-expansion": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
"integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/cross-fetch": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.1.0.tgz",
"integrity": "sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==",
"license": "MIT",
"dependencies": {
"node-fetch": "^2.7.0"
}
},
"node_modules/env-paths": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"license": "ISC"
},
"node_modules/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
"deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^5.0.1",
"once": "^1.3.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/glob/node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/glob/node_modules/brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/glob/node_modules/minimatch": {
"version": "5.1.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",
"integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"license": "ISC",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"license": "ISC"
},
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
"license": "MIT"
},
"node_modules/isobject": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
"integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==",
"license": "MIT",
"dependencies": {
"isarray": "1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/jsonc-parser": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
"license": "MIT"
},
"node_modules/line-column": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/line-column/-/line-column-1.0.2.tgz",
"integrity": "sha512-Ktrjk5noGYlHsVnYWh62FLVs4hTb8A3e+vucNZMgPeAOITdshMSgv4cCZQeRDjm7+goqmo6+liZwTXo+U3sVww==",
"license": "MIT",
"dependencies": {
"isarray": "^1.0.0",
"isobject": "^2.0.0"
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"license": "MIT"
},
"node_modules/minimatch": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
"license": "MIT",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/ohm-js": {
"version": "17.5.0",
"resolved": "https://registry.npmjs.org/ohm-js/-/ohm-js-17.5.0.tgz",
"integrity": "sha512-l4Sa7026+6jsvYbt0PXKmL+f+ML32fD++IznLgxDhx2t9Cx6NC7zwRqblCujPHGGmkQerHoeBzRutdxaw/S72g==",
"license": "MIT",
"engines": {
"node": ">=0.12.1"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
"license": "MIT"
},
"node_modules/vscode-json-languageservice": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-5.7.2.tgz",
"integrity": "sha512-WtKRDtJfFEmLrgtu+ODexOHm/6/krRF0k6t+uvkKIKW1Jh9ZIyxZQwJJwB3qhrEgvAxa37zbUg+vn+UyUK/U2w==",
"license": "MIT",
"dependencies": {
"@vscode/l10n": "^0.0.18",
"jsonc-parser": "^3.3.1",
"vscode-languageserver-textdocument": "^1.0.12",
"vscode-languageserver-types": "^3.17.5",
"vscode-uri": "^3.1.0"
}
},
"node_modules/vscode-languageserver-textdocument": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz",
"integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==",
"license": "MIT"
},
"node_modules/vscode-languageserver-types": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
"integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==",
"license": "MIT"
},
"node_modules/vscode-uri": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz",
"integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==",
"license": "MIT"
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
"license": "BSD-2-Clause"
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"license": "MIT",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"license": "ISC"
},
"node_modules/yaml": {
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14.6"
},
"funding": {
"url": "https://github.com/sponsors/eemeli"
}
}
}
}
{
"name": "shopify-liquid",
"private": true,
"type": "module",
"dependencies": {
"@shopify/theme-check-common": "3.24.0",
"@shopify/theme-check-docs-updater": "3.24.0",
"@shopify/theme-check-node": "3.24.0"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-liquid" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "liquid";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/validate_theme.ts
import { access } from "fs/promises";
import { readFileSync } from "fs";
import { join, normalize } from "path";
import { parseArgs } from "util";
import {
check,
extractDocDefinition,
FileType as NodeFileType,
recommended,
SourceCodeType,
toSchema,
toSourceCode
} from "@shopify/theme-check-common";
import { ThemeLiquidDocsManager } from "@shopify/theme-check-docs-updater";
import { themeCheckRun } from "@shopify/theme-check-node";
// src/agent-skills/scripts/instrumentation.ts
import { randomUUID } from "crypto";
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
function newArtifactId() {
return randomUUID();
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-liquid" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/validate_theme.ts
var { values } = parseArgs({
options: {
"theme-path": { type: "string" },
files: { type: "string" },
filename: { type: "string" },
filetype: { type: "string" },
code: { type: "string", short: "c" },
file: { type: "string", short: "f" },
model: { type: "string", short: "m" },
"client-name": { type: "string" },
"artifact-id": { type: "string" },
revision: { type: "string" }
}
});
var VALID_FILE_TYPES = [
"assets",
"blocks",
"config",
"layout",
"locales",
"sections",
"snippets",
"templates"
];
async function validateFullApp(themePath, relativeFilePaths) {
let configPath = join(themePath, ".theme-check.yml");
try {
await access(configPath);
} catch {
configPath = void 0;
}
const checkResult = await themeCheckRun(
themePath,
configPath,
(msg) => console.error(msg)
);
const byUri = {};
for (const offense of checkResult.offenses) {
const msg = offense.suggest && offense.suggest.length > 0 ? `ERROR: ${offense.message}; SUGGESTED FIXES: ${offense.suggest.map((s) => s.message).join(" OR ")}.` : `ERROR: ${offense.message}`;
(byUri[offense.uri] ??= []).push(msg);
}
const fileResults = relativeFilePaths.map((relPath) => {
const matchedUri = Object.keys(byUri).find(
(u) => normalize(u).endsWith(normalize(relPath))
);
return matchedUri ? { file: relPath, success: false, details: byUri[matchedUri].join("\n") } : {
file: relPath,
success: true,
details: `${relPath} passed all checks.`
};
});
const success = fileResults.every((r) => r.success);
const details = fileResults.map((r) => `${r.file}: ${r.details}`).join("\n");
return { success, result: success ? "SUCCESS" : "FAILED", details };
}
var MockFileSystem = class {
constructor(theme) {
this.theme = theme;
}
async readFile(uri) {
const file = this.theme[uri];
if (!file) throw new Error(`File not found: ${uri}`);
return file;
}
async readDirectory() {
return [];
}
async stat(uri) {
const file = this.theme[uri];
if (!file) throw new Error(`File not found: ${uri}`);
return { type: NodeFileType.File, size: file.length };
}
};
async function validateCodeblock(fileName, fileType, content) {
const uri = `file:///${fileType}/${fileName}`;
const theme = { [uri]: content };
const LOCALE_CHECKS_TO_SKIP = /* @__PURE__ */ new Set([
"TranslationKeyExists",
"ValidSchemaTranslations"
]);
const config = {
checks: recommended.filter(
(c) => !LOCALE_CHECKS_TO_SKIP.has(c.meta?.code ?? "")
),
settings: {},
rootUri: "file:///",
context: "theme"
};
const docsManager = new ThemeLiquidDocsManager();
const sourceCode = Object.entries(theme).filter(([u]) => u.endsWith(".liquid") || u.endsWith(".json")).map(([u, c]) => toSourceCode(u, c, void 0));
const offenses = await check(sourceCode, config, {
fs: new MockFileSystem(theme),
themeDocset: docsManager,
jsonValidationSet: docsManager,
getBlockSchema: async (blockName) => {
const blockUri = `file:///blocks/${blockName}.liquid`;
const sc = sourceCode.find((s) => s.uri === blockUri);
if (!sc) return void 0;
return toSchema("theme", blockUri, sc, async () => true);
},
getSectionSchema: async (sectionName) => {
const sectionUri = `file:///sections/${sectionName}.liquid`;
const sc = sourceCode.find((s) => s.uri === sectionUri);
if (!sc) return void 0;
return toSchema("theme", sectionUri, sc, async () => true);
},
async getDocDefinition(relativePath) {
const sc = sourceCode.find(
(s) => normalize(s.uri).endsWith(normalize(relativePath))
);
if (!sc || sc.type !== SourceCodeType.LiquidHtml) return void 0;
return extractDocDefinition(sc.uri, sc.ast);
}
});
if (offenses.length === 0) {
return {
success: true,
result: "SUCCESS",
details: `${fileName} passed all checks.`
};
}
const messages = offenses.map(
(o) => o.suggest && o.suggest.length > 0 ? `ERROR: ${o.message}; SUGGESTED FIXES: ${o.suggest.map((s) => s.message).join(" OR ")}.` : `ERROR: ${o.message}`
);
return { success: false, result: "FAILED", details: messages.join("\n") };
}
async function main() {
const artifactId = values["artifact-id"] ?? newArtifactId();
const revision = values.revision ? Number(values.revision) : 1;
const instrumentOpts = {
clientModel: values.model ?? process.env.CLIENT_MODEL,
clientName: values["client-name"] ?? process.env.CLIENT_NAME,
artifactId,
revision
};
if (values["theme-path"]) {
const themePath = values["theme-path"];
const files = (values.files ?? "").split(",").map((f) => f.trim()).filter(Boolean);
if (files.length === 0) {
console.log(
JSON.stringify({
success: false,
result: "error",
details: "--files must list at least one relative file path"
})
);
process.exit(1);
}
const output2 = { ...await validateFullApp(themePath, files), artifactId };
console.log(JSON.stringify(output2, null, 2));
await reportValidation("validate_theme", output2, instrumentOpts);
process.exit(output2.success ? 0 : 1);
return;
}
const filename = values.filename;
if (!filename) {
console.log(
JSON.stringify({
success: false,
result: "error",
details: "Provide either --theme-path (full app mode) or --filename (stateless mode)"
})
);
process.exit(1);
}
let content = values.code;
if (values.file) {
content = readFileSync(values.file, "utf-8");
}
if (!content) {
console.log(
JSON.stringify({
success: false,
result: "error",
details: "Provide --code or --file with the codeblock content"
})
);
process.exit(1);
}
const rawFileType = values.filetype ?? "sections";
if (!VALID_FILE_TYPES.includes(rawFileType)) {
console.log(
JSON.stringify({
success: false,
result: "error",
details: `Invalid --filetype "${rawFileType}". Valid values: ${VALID_FILE_TYPES.join(", ")}`
})
);
process.exit(1);
}
const output = {
...await validateCodeblock(filename, rawFileType, content),
artifactId
};
console.log(JSON.stringify(output, null, 2));
await reportValidation("validate_theme", output, instrumentOpts);
process.exit(output.success ? 0 : 1);
}
main().catch(async (error) => {
const output = {
success: false,
result: "error",
details: error instanceof Error ? error.message : String(error)
};
console.log(JSON.stringify(output));
await reportValidation("validate_theme", output, {
clientModel: values.model ?? process.env.CLIENT_MODEL,
clientName: values["client-name"] ?? process.env.CLIENT_NAME
});
process.exit(1);
});
{
"validation": true
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-partner" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "partner";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-payments-apps" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "payments-apps";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-polaris-admin-extensions",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shopify-polaris-admin-extensions",
"dependencies": {
"@shopify/ui-extensions": "2026.1.1",
"@types/react": "19.2.14",
"preact": "10.28.4",
"typescript": "5.9.3"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@shopify/ui-extensions": {
"version": "2026.1.1",
"resolved": "https://npm.shopify.io/node/@shopify/ui-extensions/-/ui-extensions-2026.1.1.tgz",
"integrity": "sha512-QjyU/PsbmEM0f/UmPA0MVwPjMy4tZxecBtoh7YqZk0D3RrAK9fw5FTn+yDVw6YOIcH97/Wk5zJCUuXVCJ85C1A==",
"license": "MIT",
"dependencies": {
"ts-morph": "^25.0.1"
},
"peerDependencies": {
"@preact/signals": "*",
"preact": "*"
},
"peerDependenciesMeta": {
"@preact/signals": {
"optional": true
},
"preact": {
"optional": true
}
}
},
"node_modules/@ts-morph/common": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.26.1.tgz",
"integrity": "sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA==",
"license": "MIT",
"dependencies": {
"fast-glob": "^3.3.2",
"minimatch": "^9.0.4",
"path-browserify": "^1.0.1"
}
},
"node_modules/@types/react": {
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
"license": "MIT"
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
"node_modules/fast-glob": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
"micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fastq": {
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
"integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",
"license": "ISC",
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/minimatch": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.2"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
"license": "MIT"
},
"node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/preact": {
"version": "10.28.4",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.4.tgz",
"integrity": "sha512-uKFfOHWuSNpRFVTnljsCluEFq57OKT+0QdOiQo8XWnQ/pSvg7OpX5eNOejELXJMWy+BwM2nobz0FkvzmnpCNsQ==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"license": "MIT",
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"queue-microtask": "^1.2.2"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/ts-morph": {
"version": "25.0.1",
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-25.0.1.tgz",
"integrity": "sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ==",
"license": "MIT",
"dependencies": {
"@ts-morph/common": "~0.26.0",
"code-block-writer": "^13.0.3"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
{
"name": "shopify-polaris-admin-extensions",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/ui-extensions": "2026.1.1",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-polaris-admin-extensions" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "polaris-admin-extensions";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-polaris-app-home",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shopify-polaris-app-home",
"dependencies": {
"@shopify/app-bridge-types": "0.7.0",
"@shopify/polaris-types": "1.0.1",
"@types/react": "19.2.14",
"preact": "10.28.4",
"typescript": "5.9.3"
}
},
"node_modules/@shopify/app-bridge-types": {
"version": "0.7.0",
"resolved": "https://npm.shopify.io/node/@shopify/app-bridge-types/-/app-bridge-types-0.7.0.tgz",
"integrity": "sha512-A/DiGIjCBdd45ijMDKLgXrrGG68so3d25Yaeo0lv8ruWeljHGn3sA+UU1o/5BptSPkikDkgPPl8EQDxe4/KShw==",
"license": "ISC",
"dependencies": {
"@standard-schema/spec": "^1.0.0"
}
},
"node_modules/@shopify/polaris-types": {
"version": "1.0.1",
"resolved": "https://npm.shopify.io/node/@shopify/polaris-types/-/polaris-types-1.0.1.tgz",
"integrity": "sha512-BZs47atXnaOVqFrCfTeXc6Vz8Vk8Vpj9o3nx/lYTvy9i4pPvd4K4mRKIhjrer2NWITCMvY6+nZ6GE1I9Qfq4rQ=="
},
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
"license": "MIT"
},
"node_modules/@types/react": {
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
"node_modules/preact": {
"version": "10.28.4",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.4.tgz",
"integrity": "sha512-uKFfOHWuSNpRFVTnljsCluEFq57OKT+0QdOiQo8XWnQ/pSvg7OpX5eNOejELXJMWy+BwM2nobz0FkvzmnpCNsQ==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
{
"name": "shopify-polaris-app-home",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/polaris-types": "1.0.1",
"@shopify/app-bridge-types": "0.7.0",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-polaris-app-home" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "polaris-app-home";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-polaris-checkout-extensions",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shopify-polaris-checkout-extensions",
"dependencies": {
"@shopify/ui-extensions": "2026.1.1",
"@types/react": "19.2.14",
"preact": "10.28.4",
"typescript": "5.9.3"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@shopify/ui-extensions": {
"version": "2026.1.1",
"resolved": "https://npm.shopify.io/node/@shopify/ui-extensions/-/ui-extensions-2026.1.1.tgz",
"integrity": "sha512-QjyU/PsbmEM0f/UmPA0MVwPjMy4tZxecBtoh7YqZk0D3RrAK9fw5FTn+yDVw6YOIcH97/Wk5zJCUuXVCJ85C1A==",
"license": "MIT",
"dependencies": {
"ts-morph": "^25.0.1"
},
"peerDependencies": {
"@preact/signals": "*",
"preact": "*"
},
"peerDependenciesMeta": {
"@preact/signals": {
"optional": true
},
"preact": {
"optional": true
}
}
},
"node_modules/@ts-morph/common": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.26.1.tgz",
"integrity": "sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA==",
"license": "MIT",
"dependencies": {
"fast-glob": "^3.3.2",
"minimatch": "^9.0.4",
"path-browserify": "^1.0.1"
}
},
"node_modules/@types/react": {
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
"license": "MIT"
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
"node_modules/fast-glob": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
"micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fastq": {
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
"integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",
"license": "ISC",
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/minimatch": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.2"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
"license": "MIT"
},
"node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/preact": {
"version": "10.28.4",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.4.tgz",
"integrity": "sha512-uKFfOHWuSNpRFVTnljsCluEFq57OKT+0QdOiQo8XWnQ/pSvg7OpX5eNOejELXJMWy+BwM2nobz0FkvzmnpCNsQ==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"license": "MIT",
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"queue-microtask": "^1.2.2"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/ts-morph": {
"version": "25.0.1",
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-25.0.1.tgz",
"integrity": "sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ==",
"license": "MIT",
"dependencies": {
"@ts-morph/common": "~0.26.0",
"code-block-writer": "^13.0.3"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
{
"name": "shopify-polaris-checkout-extensions",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/ui-extensions": "2026.1.1",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-polaris-checkout-extensions" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "polaris-checkout-extensions";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-polaris-customer-account-extensions",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shopify-polaris-customer-account-extensions",
"dependencies": {
"@shopify/ui-extensions": "2026.1.1",
"@types/react": "19.2.14",
"preact": "10.28.4",
"typescript": "5.9.3"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@shopify/ui-extensions": {
"version": "2026.1.1",
"resolved": "https://npm.shopify.io/node/@shopify/ui-extensions/-/ui-extensions-2026.1.1.tgz",
"integrity": "sha512-QjyU/PsbmEM0f/UmPA0MVwPjMy4tZxecBtoh7YqZk0D3RrAK9fw5FTn+yDVw6YOIcH97/Wk5zJCUuXVCJ85C1A==",
"license": "MIT",
"dependencies": {
"ts-morph": "^25.0.1"
},
"peerDependencies": {
"@preact/signals": "*",
"preact": "*"
},
"peerDependenciesMeta": {
"@preact/signals": {
"optional": true
},
"preact": {
"optional": true
}
}
},
"node_modules/@ts-morph/common": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.26.1.tgz",
"integrity": "sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA==",
"license": "MIT",
"dependencies": {
"fast-glob": "^3.3.2",
"minimatch": "^9.0.4",
"path-browserify": "^1.0.1"
}
},
"node_modules/@types/react": {
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
"license": "MIT"
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
"node_modules/fast-glob": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
"micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fastq": {
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
"integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",
"license": "ISC",
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/minimatch": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.2"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
"license": "MIT"
},
"node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/preact": {
"version": "10.28.4",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.4.tgz",
"integrity": "sha512-uKFfOHWuSNpRFVTnljsCluEFq57OKT+0QdOiQo8XWnQ/pSvg7OpX5eNOejELXJMWy+BwM2nobz0FkvzmnpCNsQ==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"license": "MIT",
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"queue-microtask": "^1.2.2"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/ts-morph": {
"version": "25.0.1",
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-25.0.1.tgz",
"integrity": "sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ==",
"license": "MIT",
"dependencies": {
"@ts-morph/common": "~0.26.0",
"code-block-writer": "^13.0.3"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
{
"name": "shopify-polaris-customer-account-extensions",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/ui-extensions": "2026.1.1",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-polaris-customer-account-extensions" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "polaris-customer-account-extensions";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"name": "shopify-pos-ui",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/ui-extensions": "2026.1.1",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
#!/usr/bin/env node\n// AUTO-GENERATED — do not edit directly.\n// Edit src/agent-skills/scripts/ in shopify-dev-tools and run: npm run generate_agent_skills
// src/agent-skills/scripts/instrumentation.ts
var SHOPIFY_DEV_BASE_URL = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
function isProductionVersion() {
return /^\d+\.\d+\.\d+$/.test("1.5.0");
}
function isInstrumentationDisabled() {
if (!isProductionVersion()) return true;
try {
return process.env.OPT_OUT_INSTRUMENTATION === "true";
} catch {
return false;
}
}
async function reportValidation(toolName, result, opts) {
if (isInstrumentationDisabled()) return;
try {
const clientName = opts?.clientName ?? process.env.CLIENT_NAME;
const clientModel = opts?.clientModel ?? process.env.CLIENT_MODEL;
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"Cache-Control": "no-cache",
"X-Shopify-Surface": "skills",
"X-Shopify-Client-Version": "1.5.0",
"X-Shopify-MCP-Version": "1.5.0",
"X-Shopify-Timestamp": (/* @__PURE__ */ new Date()).toISOString()
};
if (clientName) headers["X-Shopify-Client-Name"] = clientName;
if (clientModel) headers["X-Shopify-Client-Model"] = clientModel;
const parameters = { skill: "shopify-pos-ui" };
if (opts?.artifactId) {
parameters.artifactId = opts.artifactId;
parameters.revision = opts.revision ?? 1;
}
const url = new URL("/mcp/usage", SHOPIFY_DEV_BASE_URL);
await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify({
tool: toolName,
parameters,
result: JSON.stringify(result)
})
});
} catch {
}
}
// src/agent-skills/scripts/search_docs.ts
var SHOPIFY_DEV_BASE_URL2 = process.env.DEV && process.env.DEV !== "false" ? "https://shopify-dev.shop.dev/" : "https://shopify.dev/";
async function performSearch(query2, apiName2, useLegacy) {
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Shopify-Surface": "skills"
};
if (useLegacy) {
headers["X-Shopify-Dev-Use-OpenAI-Search"] = "true";
}
const body = { query: query2 };
if (apiName2) body.api_name = apiName2;
const url = new URL("/assistant/search", SHOPIFY_DEV_BASE_URL2);
const response = await fetch(url.toString(), {
method: "POST",
headers,
body: JSON.stringify(body)
});
if (!response.ok) {
const errorBody = await response.text().catch(() => "");
throw new Error(
errorBody ? `HTTP ${response.status}: ${errorBody}` : `HTTP error! status: ${response.status}`
);
}
const responseText = await response.text();
try {
const jsonData = JSON.parse(responseText);
return JSON.stringify(jsonData, null, 2);
} catch {
return responseText;
}
}
var query = process.argv[2];
if (!query) {
console.error("Usage: search_docs.js <query>");
process.exit(1);
}
var apiName = "pos-ui";
var startWithLegacy = process.env.USE_LEGACY_SEARCH === "true";
var searchOpts = {
clientModel: process.env.CLIENT_MODEL,
clientName: process.env.CLIENT_NAME
};
try {
let result;
try {
result = await performSearch(query, apiName, startWithLegacy);
} catch (firstError) {
const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
try {
result = await performSearch(query, apiName, !startWithLegacy);
} catch (retryError) {
const retryMessage = retryError instanceof Error ? retryError.message : String(retryError);
throw new Error(
`Search failed on both backends.
First attempt (${startWithLegacy ? "legacy" : "new"}): ${firstMessage}
Retry (${startWithLegacy ? "new" : "legacy"}): ${retryMessage}`
);
}
}
process.stdout.write(result);
process.stdout.write("\n");
await reportValidation("search_docs", { success: true, result: "SUCCESS", details: null }, searchOpts);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`Search failed: ${message}`);
await reportValidation("search_docs", { success: false, result: "FAILED", details: message }, searchOpts);
process.exit(1);
}
{
"validation": true
}
{
"validation": false
}
{
"validation": true
}
{
"validation": true
}
{
"validation": true
}
{
"name": "shopify-hydrogen",
"private": true,
"type": "module",
"dependencies": {
"typescript": "5.9.3",
"@shopify/hydrogen": "2026.1.3",
"@shopify/hydrogen-react": "2026.1.2",
"@shopify/remix-oxygen": "latest",
"react-router": "7.13.2",
"@react-router/dev": "7.13.2",
"graphql": "16.13.1",
"type-fest": "5.5.0",
"schema-dts": "1.1.5",
"preact": "10.28.4",
"@types/react": "19.2.14"
}
}
{
"validation": true
}
{
"name": "shopify-liquid",
"private": true,
"type": "module",
"dependencies": {
"@shopify/theme-check-common": "3.24.0",
"@shopify/theme-check-docs-updater": "3.24.0",
"@shopify/theme-check-node": "3.24.0"
}
}
{
"validation": true
}
{
"validation": true
}
{
"validation": true
}