Shopify Theme Delivery
Overview
Treat a Shopify theme change as a versioned source package. Match the requested
delivery boundary: local source, remote preview, release preparation, or live
release. Local source work closes with relevant local verification; remote
identity, write authorization, and release evidence apply when that boundary
requires them.
Use the current project's maintained theme route when one exists. Project
classifiers, runbooks, guarded operators, target registries, and brand systems
take precedence over this portable fallback, including a narrower valid route.
Do not layer a second draft-release workflow over the selected project route.
Preserve current user scope and authority; missing project evidence blocks the
affected remote action, not unrelated source work.
Required Entry Contract
For source-only work, remote-only fields may be not-applicable. Before a
remote read, resolve the exact target and read scope; read access does not
require write or publish authorization. Before a remote write, establish the
applicable target, source, preservation, authorization, and acceptance fields:
SHOPIFY_THEME_DELIVERY
store: <store domain or registry key>
base_theme: <name and id>
target_theme: <name, id and role>
target_draft: <name and id, or not-applicable for a live-file patch>
current_live: <name and id>
edit_scope: <routes / surfaces / files>
change_class: <static-visual / structural-theme / dynamic-runtime>
delivery_mode: <local-source / live-file-patch / stable-draft / role-transition>
preserve: <merchant content, settings, app blocks, locales, integrations>
excluded: <checkout, data, publish, apps, other routes>
write_approval: <not-needed / pending / approved exact scope>
publish_approval: <not-requested / pending / approved exact scope>
acceptance: <routes, viewports, interactions, settling checks>
Never guess a store, theme ID, live state, resource assignment, preview URL, or
approval state. Prefer project registries and guarded scripts over remembered
IDs or raw commands. A local CSS/Liquid/test change may proceed without remote
identity; resolve identity before remote inspection and the additional write
requirements before mutation.
Requests whose primary object is product, inventory, collection, metafield,
customer, or order data belong to Shopify Admin/data operations. App and
extension deployment belongs to app delivery. Checkout logic belongs to its
own supported extension/function surface. Split mixed requests into separate
theme and non-theme scopes with separately resolved authority and acceptance.
Classify the Change Before Coding
| Class |
Typical work |
Minimum proof |
| Static visual |
copy, tokens, spacing, typography, responsive CSS |
affected styles/content; viewport, overflow and focus checks when impacted |
| Structural theme |
Liquid, schema, section composition, JSON templates |
JSON/schema validation, section wiring, Theme Editor preservation |
| Dynamic runtime |
search, filters, predictive results, sticky actions, DOM observers |
idempotency, isolated settling test, one real mutation, affected interaction |
Use the highest applicable class. A styling task that adds a MutationObserver
is a dynamic-runtime task.
Verification depth and remote write mode are separate decisions. Use the
project's supported mode: exact files on the current live theme, its stable
draft slot, or an authorized theme-role transition. Dynamic runtime risk does
not by itself require a new draft or role transition. Broader verification
does not expand the allowed file manifest or remote effect.
Follow the selected operator's exact target, reviewed source revision, preimage,
rollback, and readback requirements. Do not impose a universal main-branch
equality rule or invalidate unchanged evidence for unrelated mainline commits.
If the project route is unavailable or unsupported, repair its evidence or
source path; do not switch to a broader write mode or an unguarded writer.
Without a project route, resolve a supported exact write mechanism before any
mutation. These mode descriptions do not grant authority.
Freeze the Complete Desired State
Before editing, produce one owner-reviewable package scaled to the affected
surface. A narrow fix may list unrelated surfaces as excluded; a full-theme
replacement requires the complete store-wide matrix:
- Brand system: tone, palette, typography, spacing, radii, surfaces, imagery,
motion, accessibility, and responsive rules.
- Surface matrix: global shell, homepage, collection, product, cart, search,
content pages, account, localization/markets, and eligible checkout surface.
- Ownership matrix:
- source owns structure, shared components, tokens, CSS, and JavaScript;
- Theme Editor owns exposed copy, images, menus, section settings, and order;
- Shopify data owns products, collections, metafields, inventory, customers,
and orders;
- publication and rollback follow the exact authorized effect and selected
operator's contract.
- Preservation contract: existing section IDs, merchant content, settings,
app blocks, localization, data bindings, and integrations to retain.
- Definition of done: local validation and, for remote delivery, exact readback,
relevant route/viewport checks, evidence, and the requested draft/live state.
Do not claim a complete theme when only the homepage or global CSS is covered.
For a broad redesign or remote operation, read the matching sections of
references/shopify-theme-delivery-standard.md. A bounded change needs only
its affected surface, preservation intent, checks, and requested delivery state.
Choose the Correct Edit Layer
| Change |
Edit layer |
| Page composition, section order, defaults |
templates/*.json |
| Rendered module and merchant-editable schema |
sections/*.liquid |
| Shared markup or Liquid logic |
snippets/* |
| Styling, behavior, static media |
assets/* |
| Global shell or asset loading |
layout/theme.liquid only when truly global |
| Theme-wide configurable settings |
config/settings_schema.json |
| Current merchant values |
Avoid config/settings_data.json; require authority for exact keys |
JSON templates are composition data. Never place Liquid, HTML, CSS, or
JavaScript in them. Preserve existing section IDs and settings unless migration
is explicit. Modern checkout is not a normal theme surface.
Use One Bounded Authorization Envelope
A draft-theme write is still a Shopify mutation. A current explicit user request
that names the operation, target, and intended effect authorizes that scope;
do not ask for equivalent confirmation again. Read-only inspection does not
authorize a write. If write authority is missing, prepare the exact reviewable
manifest and target first, then request one compact authorization for the batch:
Approve writing <manifest or N named files> to draft theme <id> on <store>,
followed by exact readback and preview-only browser acceptance; no publish,
live-theme change, data mutation, app deploy, or checkout mutation.
For a supported live-file patch, bind the exact live theme, named files, reviewed
revision, preimages, and receipt-based rollback; it has no draft or promotion
step. Ask again only when the target, scope, material effect, credential boundary,
or rollback method changes materially. A correction within the authorized
effect does not require another equivalent confirmation.
Delivery Workflow
Inventory — Locate affected source, callers, and preservation constraints.
Resolve remote identity and assignments when remote work is requested.
Design — Reuse existing requirements and design decisions. Establish a
full surface matrix for a broad redesign; ask only about unresolved choices
that materially change the outcome.
Implement in source — Use sections/snippets/assets; change templates
only for composition. Keep merchant content configurable.
Validate locally — Use focused checks appropriate to the changed files.
Run Theme Check for relevant Liquid/schema changes and the bundled validator
when validating a theme package:
node scripts/validate-theme-package.mjs \
--theme /path/to/theme \
--changed-files /path/to/changed-files.txt
Resolve the script relative to this skill. Pass --allow-settings-data
only when the user authorized those settings. Isolated copy/styling does not
require full browser acceptance; material interaction, navigation, checkout,
or responsive behavior does. Scale checks to affected behavior; repeat or
broaden passing checks only for new changes, failures, or a concrete concern.
Prove dynamic stability when applicable — Follow
references/dynamic-ui-stability.md. The enhancer must settle after initial
render and after one genuine external mutation. Verify locally for local
delivery; remote acceptance follows only when remote delivery is requested.
Local source work ends after the applicable local checks.
Execute the selected remote effect — Only for authorized remote work,
use the selected exact-file, stable-draft, or role-transition writer. Reuse
the project draft slot when selected; never create a candidate solely
because verification is broad. Never publish as a side effect of a draft write.
Read back remotely — Compare the exact changed-file manifest, file
count, content hashes/checksums, and release marker against the selected target.
Accept in browser — Use the exact draft preview or public URL for the
selected live theme. Check affected routes, viewports, interactions, console
errors, overflow, focus, reduced motion, and dynamic settling as applicable.
Broad redesigns cover all promised surfaces on desktop/mobile. Use target
readiness rather than whole-page network idleness for bounded checks.
Hand off — Report the change, strongest relevant checks, actual delivery
state, and remaining work. For remote work include exact identity, readback,
rollback evidence, and applicable browser acceptance.
Publish when selected and authorized — An existing explicit publish
request covering this target and effect suffices. Verify live identity,
public routes, and the selected rollback evidence after publication.
A live-file patch has no promotion step.
Use references/acceptance-and-handoff.md for remote acceptance or a structured
handoff when useful. Omit fields outside the requested delivery boundary.
Dynamic UI Stability Gate
For DOM-enhancing theme JavaScript:
- make every enhancement idempotent;
- observe the smallest stable container, not the whole document by default;
- avoid replacing children when the desired DOM already exists;
- filter, pause, or disconnect the observer around owned writes;
- coalesce mutation bursts into one scheduled enhancement;
- clean up observers, listeners, and scheduled work;
- prove repeated execution does not duplicate components or state;
- prove initial render settles: the scheduled-work count is unchanged between
the 300 ms and 600 ms checkpoints;
- append one genuine external result mutation, prove exactly one additional
enhancement, then prove the next 300 ms to 600 ms window is unchanged.
Use a minimal synthetic page first so unrelated theme animation frames do not
hide a feedback loop. Then verify affected behavior in the local app or theme
fixture; for requested remote delivery, also verify the exact draft or live target.
Release Markers and Stale Previews
Put a narrow marker in the target section or asset. Do not use
layout/theme.liquid as a routine marker for one route.
Diagnose a mismatch in this order:
- store and target theme identity;
- route/resource handle, ID, visibility, and
template_suffix;
- JSON template wiring and section type;
- remote changed-file readback and checksum;
- target marker in preview HTML;
- loaded CSS/JavaScript URLs and runtime/cascade state;
- private-session/mobile comparison;
- bounded Shopify processing delay;
- browser, CDN, or proxy cache.
Do not repush the whole theme or publish repeatedly to chase cache. Classify
the mismatch from evidence. When readback matches and public delivery still
shows exact prior bytes during bounded propagation, use read-only observation.
Propagation delay alone does not authorize another write, publication, new
candidate, or automatic rollback. Reconcile uncertain writes from receipts and
target readback before any serial continuation; never blind-retry.
Experience-to-Skill Learning Loop
A conversation summary is not learned behavior. Promote a lesson only when:
- a minimal reproducer captures the failure;
- an executable regression fails before the fix and passes after it;
- the relevant skill instruction or reference is updated;
- the skill package and target implementation both validate;
- project-neutral rules are extracted without store IDs, credentials,
internal approval mechanics, private paths, or company-only policy.
This process is deliberate and reviewable; the skill must not silently mutate
itself from chat history.
Completion Gate
Local source work closes after relevant local validation, including dynamic
settling when applicable. Remote identities, publication, and remote browser
evidence are not local completion gates. For remote delivery, apply only the
gates required by the selected effect:
- exact target and live identities recorded;
- changed files match approved scope;
- JSON/schema/Theme Check validation passes;
- dynamic-runtime settling regression passes when applicable;
- remote readback matches the local manifest;
- every promised surface has the required local, preview, or public evidence;
- affected viewport and interaction acceptance passes;
- no unintended
settings_data.json, Shopify data, app, checkout, file, or
theme-role mutation occurred;
- publish state, rollback target, and next action are explicit.
Red Flags
Stop when any of these appears:
- “Use whichever theme is open.”
- “Push the entire folder and see what changes.”
- “Use browser clicks to upload many source files.”
- “Change
settings_data.json to make it match.”
- “The draft looks good, so call it published.”
- “The homepage is done, so the whole theme is done.”
- “The MutationObserver works, so performance is fine.”
- “Public HTML differs, therefore the source is wrong.”
1---2name: shopify-theme-delivery3description: Use when planning, building, migrating, validating, previewing, diagnosing, or releasing a Shopify Online Store 2.0 theme, including Liquid, JSON templates, sections, snippets, theme CSS or JavaScript, Theme Editor preservation, draft-theme writes, stale previews, dynamic DOM enhancements, or multi-page acceptance.4---56# Shopify Theme Delivery78## Overview910Treat a Shopify theme change as a versioned source package. Match the requested11delivery boundary: local source, remote preview, release preparation, or live12release. Local source work closes with relevant local verification; remote13identity, write authorization, and release evidence apply when that boundary14requires them.1516Use the current project's maintained theme route when one exists. Project17classifiers, runbooks, guarded operators, target registries, and brand systems18take precedence over this portable fallback, including a narrower valid route.19Do not layer a second draft-release workflow over the selected project route.20Preserve current user scope and authority; missing project evidence blocks the21affected remote action, not unrelated source work.2223## Required Entry Contract2425For source-only work, remote-only fields may be `not-applicable`. Before a26remote read, resolve the exact target and read scope; read access does not27require write or publish authorization. Before a remote write, establish the28applicable target, source, preservation, authorization, and acceptance fields:2930```text31SHOPIFY_THEME_DELIVERY32store: <store domain or registry key>33base_theme: <name and id>34target_theme: <name, id and role>35target_draft: <name and id, or not-applicable for a live-file patch>36current_live: <name and id>37edit_scope: <routes / surfaces / files>38change_class: <static-visual / structural-theme / dynamic-runtime>39delivery_mode: <local-source / live-file-patch / stable-draft / role-transition>40preserve: <merchant content, settings, app blocks, locales, integrations>41excluded: <checkout, data, publish, apps, other routes>42write_approval: <not-needed / pending / approved exact scope>43publish_approval: <not-requested / pending / approved exact scope>44acceptance: <routes, viewports, interactions, settling checks>45```4647Never guess a store, theme ID, live state, resource assignment, preview URL, or48approval state. Prefer project registries and guarded scripts over remembered49IDs or raw commands. A local CSS/Liquid/test change may proceed without remote50identity; resolve identity before remote inspection and the additional write51requirements before mutation.5253Requests whose primary object is product, inventory, collection, metafield,54customer, or order data belong to Shopify Admin/data operations. App and55extension deployment belongs to app delivery. Checkout logic belongs to its56own supported extension/function surface. Split mixed requests into separate57theme and non-theme scopes with separately resolved authority and acceptance.5859## Classify the Change Before Coding6061| Class | Typical work | Minimum proof |62| --- | --- | --- |63| Static visual | copy, tokens, spacing, typography, responsive CSS | affected styles/content; viewport, overflow and focus checks when impacted |64| Structural theme | Liquid, schema, section composition, JSON templates | JSON/schema validation, section wiring, Theme Editor preservation |65| Dynamic runtime | search, filters, predictive results, sticky actions, DOM observers | idempotency, isolated settling test, one real mutation, affected interaction |6667Use the highest applicable class. A styling task that adds a MutationObserver68is a dynamic-runtime task.6970Verification depth and remote write mode are separate decisions. Use the71project's supported mode: exact files on the current live theme, its stable72draft slot, or an authorized theme-role transition. Dynamic runtime risk does73not by itself require a new draft or role transition. Broader verification74does not expand the allowed file manifest or remote effect.7576Follow the selected operator's exact target, reviewed source revision, preimage,77rollback, and readback requirements. Do not impose a universal main-branch78equality rule or invalidate unchanged evidence for unrelated mainline commits.79If the project route is unavailable or unsupported, repair its evidence or80source path; do not switch to a broader write mode or an unguarded writer.81Without a project route, resolve a supported exact write mechanism before any82mutation. These mode descriptions do not grant authority.8384## Freeze the Complete Desired State8586Before editing, produce one owner-reviewable package scaled to the affected87surface. A narrow fix may list unrelated surfaces as `excluded`; a full-theme88replacement requires the complete store-wide matrix:89901. Brand system: tone, palette, typography, spacing, radii, surfaces, imagery,91 motion, accessibility, and responsive rules.922. Surface matrix: global shell, homepage, collection, product, cart, search,93 content pages, account, localization/markets, and eligible checkout surface.943. Ownership matrix:95 - source owns structure, shared components, tokens, CSS, and JavaScript;96 - Theme Editor owns exposed copy, images, menus, section settings, and order;97 - Shopify data owns products, collections, metafields, inventory, customers,98 and orders;99 - publication and rollback follow the exact authorized effect and selected100 operator's contract.1014. Preservation contract: existing section IDs, merchant content, settings,102 app blocks, localization, data bindings, and integrations to retain.1035. Definition of done: local validation and, for remote delivery, exact readback,104 relevant route/viewport checks, evidence, and the requested draft/live state.105106Do not claim a complete theme when only the homepage or global CSS is covered.107For a broad redesign or remote operation, read the matching sections of108`references/shopify-theme-delivery-standard.md`. A bounded change needs only109its affected surface, preservation intent, checks, and requested delivery state.110111## Choose the Correct Edit Layer112113| Change | Edit layer |114| --- | --- |115| Page composition, section order, defaults | `templates/*.json` |116| Rendered module and merchant-editable schema | `sections/*.liquid` |117| Shared markup or Liquid logic | `snippets/*` |118| Styling, behavior, static media | `assets/*` |119| Global shell or asset loading | `layout/theme.liquid` only when truly global |120| Theme-wide configurable settings | `config/settings_schema.json` |121| Current merchant values | Avoid `config/settings_data.json`; require authority for exact keys |122123JSON templates are composition data. Never place Liquid, HTML, CSS, or124JavaScript in them. Preserve existing section IDs and settings unless migration125is explicit. Modern checkout is not a normal theme surface.126127## Use One Bounded Authorization Envelope128129A draft-theme write is still a Shopify mutation. A current explicit user request130that names the operation, target, and intended effect authorizes that scope;131do not ask for equivalent confirmation again. Read-only inspection does not132authorize a write. If write authority is missing, prepare the exact reviewable133manifest and target first, then request one compact authorization for the batch:134135```text136Approve writing <manifest or N named files> to draft theme <id> on <store>,137followed by exact readback and preview-only browser acceptance; no publish,138live-theme change, data mutation, app deploy, or checkout mutation.139```140141For a supported live-file patch, bind the exact live theme, named files, reviewed142revision, preimages, and receipt-based rollback; it has no draft or promotion143step. Ask again only when the target, scope, material effect, credential boundary,144or rollback method changes materially. A correction within the authorized145effect does not require another equivalent confirmation.146147## Delivery Workflow1481491. **Inventory** — Locate affected source, callers, and preservation constraints.150 Resolve remote identity and assignments when remote work is requested.1512. **Design** — Reuse existing requirements and design decisions. Establish a152 full surface matrix for a broad redesign; ask only about unresolved choices153 that materially change the outcome.1543. **Implement in source** — Use sections/snippets/assets; change templates155 only for composition. Keep merchant content configurable.1564. **Validate locally** — Use focused checks appropriate to the changed files.157 Run Theme Check for relevant Liquid/schema changes and the bundled validator158 when validating a theme package:159160 ```bash161 node scripts/validate-theme-package.mjs \162 --theme /path/to/theme \163 --changed-files /path/to/changed-files.txt164 ```165166 Resolve the script relative to this skill. Pass `--allow-settings-data`167 only when the user authorized those settings. Isolated copy/styling does not168 require full browser acceptance; material interaction, navigation, checkout,169 or responsive behavior does. Scale checks to affected behavior; repeat or170 broaden passing checks only for new changes, failures, or a concrete concern.1715. **Prove dynamic stability when applicable** — Follow172 `references/dynamic-ui-stability.md`. The enhancer must settle after initial173 render and after one genuine external mutation. Verify locally for local174 delivery; remote acceptance follows only when remote delivery is requested.175 Local source work ends after the applicable local checks.1766. **Execute the selected remote effect** — Only for authorized remote work,177 use the selected exact-file, stable-draft, or role-transition writer. Reuse178 the project draft slot when selected; never create a candidate solely179 because verification is broad. Never publish as a side effect of a draft write.1807. **Read back remotely** — Compare the exact changed-file manifest, file181 count, content hashes/checksums, and release marker against the selected target.1828. **Accept in browser** — Use the exact draft preview or public URL for the183 selected live theme. Check affected routes, viewports, interactions, console184 errors, overflow, focus, reduced motion, and dynamic settling as applicable.185 Broad redesigns cover all promised surfaces on desktop/mobile. Use target186 readiness rather than whole-page network idleness for bounded checks.1879. **Hand off** — Report the change, strongest relevant checks, actual delivery188 state, and remaining work. For remote work include exact identity, readback,189 rollback evidence, and applicable browser acceptance.19010. **Publish when selected and authorized** — An existing explicit publish191 request covering this target and effect suffices. Verify live identity,192 public routes, and the selected rollback evidence after publication.193 A live-file patch has no promotion step.194195Use `references/acceptance-and-handoff.md` for remote acceptance or a structured196handoff when useful. Omit fields outside the requested delivery boundary.197198## Dynamic UI Stability Gate199200For DOM-enhancing theme JavaScript:201202- make every enhancement idempotent;203- observe the smallest stable container, not the whole document by default;204- avoid replacing children when the desired DOM already exists;205- filter, pause, or disconnect the observer around owned writes;206- coalesce mutation bursts into one scheduled enhancement;207- clean up observers, listeners, and scheduled work;208- prove repeated execution does not duplicate components or state;209- prove initial render settles: the scheduled-work count is unchanged between210 the 300 ms and 600 ms checkpoints;211- append one genuine external result mutation, prove exactly one additional212 enhancement, then prove the next 300 ms to 600 ms window is unchanged.213214Use a minimal synthetic page first so unrelated theme animation frames do not215hide a feedback loop. Then verify affected behavior in the local app or theme216fixture; for requested remote delivery, also verify the exact draft or live target.217218## Release Markers and Stale Previews219220Put a narrow marker in the target section or asset. Do not use221`layout/theme.liquid` as a routine marker for one route.222223Diagnose a mismatch in this order:2242251. store and target theme identity;2262. route/resource handle, ID, visibility, and `template_suffix`;2273. JSON template wiring and section type;2284. remote changed-file readback and checksum;2295. target marker in preview HTML;2306. loaded CSS/JavaScript URLs and runtime/cascade state;2317. private-session/mobile comparison;2328. bounded Shopify processing delay;2339. browser, CDN, or proxy cache.234235Do not repush the whole theme or publish repeatedly to chase cache. Classify236the mismatch from evidence. When readback matches and public delivery still237shows exact prior bytes during bounded propagation, use read-only observation.238Propagation delay alone does not authorize another write, publication, new239candidate, or automatic rollback. Reconcile uncertain writes from receipts and240target readback before any serial continuation; never blind-retry.241242## Experience-to-Skill Learning Loop243244A conversation summary is not learned behavior. Promote a lesson only when:2452461. a minimal reproducer captures the failure;2472. an executable regression fails before the fix and passes after it;2483. the relevant skill instruction or reference is updated;2494. the skill package and target implementation both validate;2505. project-neutral rules are extracted without store IDs, credentials,251 internal approval mechanics, private paths, or company-only policy.252253This process is deliberate and reviewable; the skill must not silently mutate254itself from chat history.255256## Completion Gate257258Local source work closes after relevant local validation, including dynamic259settling when applicable. Remote identities, publication, and remote browser260evidence are not local completion gates. For remote delivery, apply only the261gates required by the selected effect:262263- exact target and live identities recorded;264- changed files match approved scope;265- JSON/schema/Theme Check validation passes;266- dynamic-runtime settling regression passes when applicable;267- remote readback matches the local manifest;268- every promised surface has the required local, preview, or public evidence;269- affected viewport and interaction acceptance passes;270- no unintended `settings_data.json`, Shopify data, app, checkout, file, or271 theme-role mutation occurred;272- publish state, rollback target, and next action are explicit.273274## Red Flags275276Stop when any of these appears:277278- “Use whichever theme is open.”279- “Push the entire folder and see what changes.”280- “Use browser clicks to upload many source files.”281- “Change `settings_data.json` to make it match.”282- “The draft looks good, so call it published.”283- “The homepage is done, so the whole theme is done.”284- “The MutationObserver works, so performance is fine.”285- “Public HTML differs, therefore the source is wrong.”