agents/skills/shopify-baseline/SKILL.md
Install or upgrade a quality baseline for Shopify theme repos. Use this whenever the user asks to add Shopify theme linting, Biome, Theme Check, Playwright accessibility checks, Vitest, Vite build tooling, lefthook hooks, GitHub Actions CI, Shopify Lighthouse CI, Claude Code PR review workflows, or a context-efficient run_silent.sh setup across Shopify sites.
npx skillsauth add carterdea/dots shopify-baselineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Set up a reusable quality floor for Shopify Online Store 2.0 theme repos: Theme Check for Liquid/theme rules, Biome for JS/TS/JSON/CSS-adjacent checks, Vite for frontend source builds, Playwright + axe for rendered accessibility smoke tests, optional Vitest for complex JS, lefthook for local gates, GitHub Actions for CI, Shopify Lighthouse CI when shop secrets exist, Claude Code PR review automation, and scripts/run_silent.sh for context-efficient agent output.
assets/ with emptyOutDir: false.BASE_URL, SHOPIFY_PREVIEW_URL, or Shopify Lighthouse CI benchmark store.Resolve resource paths relative to the directory containing this SKILL.md. In Codex, expand the skill path from the loaded skill metadata. In shell helpers, use an explicit variable:
SKILL_DIR="/absolute/path/to/agents/skills/shopify-baseline"
Then copy resources from $SKILL_DIR/resources/... and $SKILL_DIR/scripts/.... Do not assume the current working directory is the skill directory.
Treat the target as a Shopify theme if any of these exist:
layout/theme.liquidconfig/settings_schema.jsonsections/*.liquidtemplates/*.jsonshopify.theme.tomlDetect package manager:
pnpm-lock.yaml -> pnpmpackage-lock.json or yarn.lock and remove only when the user explicitly asks for package-manager cleanup.Detect existing tooling:
.theme-check.yml, .theme-check.yaml, or package/scripts calling shopify theme checkbiome.json or biome.jsoncvite.config.* or vite dependencyplaywright.config.* or @playwright/testvitest.config.*, vitest dependency, or test scriptslefthook.yml, lefthook.yaml, or .lefthook.yml.github/workflows/* containing anthropics/claude-code-action.github/workflows/* containing shopify/lighthouse-ci-actionIf the theme is not at the repository root, stop after detection and propose a root strategy before writing files. Current default is one Shopify theme per repo; future monorepos should put hooks/workflows at repo root and theme configs/scripts under the theme directory.
Check current versions first, then install only missing packages.
Default dev dependencies:
@shopify/cli for reproducible shopify theme check@biomejs/biomevite when source JS/CSS build tooling exists or should be convertedtypescript only when TS source or tsconfig.json existslefthook@playwright/test@axe-core/playwrightvitest only when the theme has meaningful source modules or existing testsCommands after resolving versions:
# Bun default
bun add -d --exact @shopify/cli@<version> @biomejs/biome@<version> lefthook@<version> @playwright/test@<version> @axe-core/playwright@<version>
# Existing pnpm repo
pnpm add -D --save-exact @shopify/cli@<version> @biomejs/biome@<version> lefthook@<version> @playwright/test@<version> @axe-core/playwright@<version>
Add vite, typescript, and vitest only when detected or requested.
After adding Playwright, install Chromium for local and CI runs:
bunx playwright install chromium
# pnpm repo:
pnpm exec playwright install chromium
Copy these resources from this skill into the target repo when missing:
scripts/run_silent.sh from scripts/run_silent.shlefthook.yml from resources/lefthook.shopify.yml.github/workflows/ci.yml from resources/github-actions.shopify-ci.yml.github/workflows/claude-code-review.yml from resources/github-actions.claude-code-review.yml.github/workflows/shopify-lighthouse-ci.yml from resources/github-actions.shopify-lighthouse-ci.yml when shop secrets are available or the user wants the templatetests/accessibility/shopify-a11y.spec.ts from resources/playwright-a11y.spec.ts when Playwright is absent or lacks axe coverageplaywright.config.ts from resources/playwright.config.shopify.ts when Playwright has no configvite.config.ts from resources/vite.config.shopify.ts when converting frontend builds to Vite.theme-check.yml from resources/theme-check.yml when Theme Check has no configAppend resources/agent-instructions.snippet.md to existing root AGENTS.md, CLAUDE.md, and .cursor/rules/*.mdc if they do not already mention run_silent.sh. Do not create agent instruction files from scratch unless the user asks.
Resource templates default to Bun. In pnpm repos, rewrite bun install, bun run, and bunx to the pnpm equivalents before writing the file.
Patch package.json with scripts that match installed tools. Preserve existing project scripts unless replacing an old equivalent.
Use the detected package manager when composing scripts:
<run> is bun run<run> is pnpm runDefault script shape after substitution:
{
"scripts": {
"check": "<run> check:theme && <run> check:biome && <run> check:type && <run> check:test && <run> check:a11y",
"check:theme": "shopify theme check",
"check:biome": "biome check .",
"check:type": "if [ -f tsconfig.json ]; then tsc --noEmit; fi",
"check:test": "if ls vitest.config.* >/dev/null 2>&1; then vitest run; fi",
"check:a11y": "if [ -n \"${BASE_URL:-}${SHOPIFY_PREVIEW_URL:-}\" ]; then playwright test tests/accessibility; else echo \"skipped: set BASE_URL or SHOPIFY_PREVIEW_URL for accessibility smoke tests\"; fi",
"build": "vite build"
}
}
For pnpm repos, the script body should use pnpm run ...; for Bun repos, use bun run .... Do not use npm or yarn as the package-manager fallback.
Use scripts/run_silent.sh for composite CI or agent-facing scripts:
source scripts/run_silent.sh
run_silent "theme check" bun run check:theme
run_silent "biome" bun run check:biome
run_silent "typecheck" bun run check:type
run_silent "vitest" bun run check:test
run_silent "playwright axe" bun run check:a11y
When old frontend build tooling exists (webpack, rollup, gulp, parcel, bespoke esbuild, or hand-written bundling scripts), propose a Vite migration but do not perform it without explicit user confirmation.
Confirmation should include:
assets/Rules:
assets/.emptyOutDir: false so Vite never deletes merchant/theme assets.Use resources/vite.config.shopify.ts as the starting template, then adapt entries to the repo.
Default accessibility gate:
@axe-core/playwrightBASE_URLwcag2a, wcag2aa, wcag21a, wcag21aa, wcag22aa when supportedSHOPIFY_A11Y_PATHS, a comma-separated list such as /,/collections/all,/products/example-productDo not add ESLint only for accessibility if the repo is Biome-first and mostly Liquid. Do not add WAVE to the default baseline; WAVE's API path needs API credits or a licensed stand-alone engine, so it belongs in a separate paid/enterprise workflow. Consider pa11y-ci or html-validate only as optional extensions when the user asks for deeper URL/sitemap or rendered-HTML validation.
If a preview URL is available, use the browser to inventory important pages before finalizing SHOPIFY_A11Y_PATHS. Do not consider the accessibility baseline complete until it covers at least homepage, one collection page, and one product page. Then propose any obvious high-traffic footer links, search, cart, account, and landing pages surfaced in navigation before hardcoding the path list in repo config.
Create or update three separate workflow surfaces:
ci.yml
__DEFAULT_BRANCH__ placeholder with the detected default branch before writing the workflow.SHOPIFY_PREVIEW_URL is available.shopify-lighthouse-ci.yml
shopify/lighthouse-ci-action@v1.SHOP_STORE, SHOP_CLIENT_ID, SHOP_CLIENT_SECRET.__DEFAULT_BRANCH__ placeholder with the detected default branch before writing the workflow.SHOPIFY_LIGHTHOUSE_PRODUCT_HANDLE and SHOPIFY_LIGHTHOUSE_COLLECTION_HANDLE repository variables for stable representative pages, otherwise the action defaults to the first product/collection.These credentials are easy to use but need an authenticated Shopify Dev Dashboard session. The app is created in the user's Shopify organization in Dev Dashboard, not inside an individual theme repo. Then it is installed on the selected benchmark store, which can be a dev store, client transfer store, or merchant-owned collaboration store if the organization has access.
Prefer a supervised headed-browser setup for this API-only Lighthouse app: open the browser, let the user log in and complete 2FA, then automate the setup steps with the user's explicit approval.
https://dev.shopify.com/dashboard in a headed browser.https://shopify.dev/apps/default-app-homeread_products and write_themesShopify CLI note:
shopify app init --name <name> --organization-id <org-id> --template <template>.Automate the repo-side setup after those values are known:
gh secret set SHOP_STORE --body "<store>.myshopify.com"
gh secret set SHOP_CLIENT_ID --body "<client-id>"
gh secret set SHOP_CLIENT_SECRET --body "<client-secret>"
# Only when the benchmark store is password protected:
gh secret set SHOP_PASSWORD --body "<storefront-password>"
Secret-handling rule:
gh secret set.SHOP_CLIENT_SECRET, avoid repeating it, and clear any temporary notes/clipboard when practical.Useful commands for secret capture:
# After the user copies the Client secret from the browser:
pbpaste | gh secret set SHOP_CLIENT_SECRET
# For non-secret values the agent may set directly:
gh secret set SHOP_STORE --body "<store>.myshopify.com"
gh secret set SHOP_CLIENT_ID --body "<client-id>"
The skill can infer or help gather:
SHOP_STORE from shopify.theme.toml, existing deploy workflows, or the user's supplied store domain.SHOPIFY_LIGHTHOUSE_PRODUCT_HANDLE and SHOPIFY_LIGHTHOUSE_COLLECTION_HANDLE by browsing the preview/store and choosing representative stable pages. These are repository variables, not secrets:gh variable set SHOPIFY_LIGHTHOUSE_PRODUCT_HANDLE --body "<product-handle>"
gh variable set SHOPIFY_LIGHTHOUSE_COLLECTION_HANDLE --body "<collection-handle>"
The skill cannot safely automate:
claude-code-review.yml
anthropics/claude-code-action@v1.claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}.CLAUDE_CODE_OAUTH_TOKEN.permissions.id-token: write; this workflow does not pass a github_token, so Claude Code Action uses the default GitHub App OIDC auth path.prompt for review instructions.claude_args: --append-system-prompt ... for extra behavioral framing.@beta -> @v1modedirect_prompt / override_prompt -> promptcustom_instructions -> claude_args: --append-system-promptmodel, max_turns, allowed_tools, disallowed_tools -> claude_argsClaude review prompt must ask for normal code review plus Shopify theme best practices and accessibility issues. Do not include private client risk rationale in the prompt.
When asked to upgrade, compare the repo's current setup against this skill's baseline criteria, then propose the smallest set of improvements to close gaps. Treat upgrade as a review-and-patch workflow, not a wholesale replacement.
Check:
SHOPIFY_A11Y_PATHSscripts/run_silent.sh and agent-instruction discoverabilityReport proposed changes first. Patch existing files in place only after the user confirms any risky migration, especially build-tool conversions.
Use fast staged checks on commit and full checks on push.
--path for theme root, not staged file lists.tsconfig.json existsBASE_URL is setDo not run Shopify Lighthouse CI locally by default.
Run quiet checks, not dev servers or builds unless the user asked for build verification.
# Bun
bunx lefthook run pre-commit
bunx lefthook run pre-push
# pnpm
pnpm exec lefthook run pre-commit
pnpm exec lefthook run pre-push
If existing repo failures block verification, report the failing command and whether it is from touched setup or inherited project debt.
Summarize:
development
Ship a Trello ticket end to end on any web app (Vercel, Fly.io, or other host — no Shopify): pull the latest main, read the card including Figma links, implement the change in a worktree, run the project's own tests/lint/typecheck, run de-slop and code-simplifier and fold the worthwhile cleanups in, QA desktop and mobile on a local Portless preview URL, capture screenshots, open or update the GitHub PR, link the PR and Trello to each other, attach screenshots to both, comment on the card, and move it to review. Use this whenever the user points you at a Trello card or ticket for a code task and wants it delivered as a reviewable PR — phrases like 'do this Trello ticket', 'ship this card', 'pick up this ticket and open a PR', 'update the PR for this card', or names a card/list/board with a feature or bug to implement. This is the default Trello-to-PR workflow for non-Shopify projects; for Shopify theme work use shopify-trello-delivery instead.
development
Run an extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth. Use for a thermo-nuclear code quality review, thermonuclear review, deep code quality audit, or especially harsh maintainability review.
development
Ship Shopify theme work from a Trello ticket end to end: inspect the card including Figma links, implement the theme change, deploy or update the correct preview/dev theme, browser-QA desktop and mobile against Figma when available, create or update the GitHub PR, attach screenshots, comment on Trello, and move the card forward. Use this whenever the user mentions a Shopify theme task with a Trello card, Figma design/artboard, preview theme, Customizer, dev theme, PR handoff, Ready for Review/Testing, or asks to update an existing Shopify PR from a ticket.
testing
Monitor PR checks and fix failures until green. Uses gh pr checks as the source of truth for PR-attached checks.