# shopify/skeleton-theme architecture

> Architecture diagram of the GitHub repository shopify/skeleton-theme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shopify/skeleton-theme
- Repository: https://github.com/shopify/skeleton-theme

## Overview

##### Project type and purpose
- This is a Shopify “Skeleton Theme”: a front-end template/theme for Shopify stores built with Liquid, JSON templates, CSS, and JavaScript.
- Its purpose is to provide a minimal, modular, maintainable starting point for merchants and developers to build Shopify storefronts.

##### File structure
- Top-level artifacts
- assets: static resources (critical.css, JS, images, fonts, logos)
- blocks: reusable, nestable UI fragments (Liquid + schema)
- config: global settings (settings_schema.json, settings_data.json)
- layout: top-level wrappers (theme.liquid, password.liquid)
- locales: translation files for internationalization
- sections: full-width, customizable page modules (with schema and inner blocks)
- snippets: small reusable Liquid/HTML fragments
- templates: JSON or Liquid page definitions combining sections
- CI/config files (.github/workflows, theme-check.yaml, shopifyignore) indicate automated linting, testing, and deployment via Shopify CLI.

##### README for additional insights
- README outlines Shopify CLI usage, specifies JSON‐based templates, Liquid section/block schemas, and recommends `{% stylesheet %}` and `{% javascript %}` tags.
- Emphasis on modular directory structure following Shopify’s theme architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    direction TB

    %% Developer Tools and Workflow
    subgraph "Developer Environment"
        DevWS["Developer Workstation / GitHub Repo"]:::devTools
        CLI["Shopify CLI & Local Preview"]:::devTools
    end

    subgraph "Continuous Integration"
        CI["GitHub Actions & theme-check"]:::ci
    end

    %% File Categories
    subgraph "Theme File Structure"
        Layout["Layout"]:::files
        Templates["Templates"]:::files
        Sections["Sections"]:::files
        Blocks["Blocks"]:::files
        Snippets["Snippets"]:::files
        Assets["Assets"]:::files
        Config["Config & Locales"]:::files
    end

    %% Shopify Platform
    subgraph "Shopify Platform"
        Engine["Liquid Rendering Engine"]:::platform
        AdminUI["Merchant Admin Settings UI"]:::admin
        CDN["CDN for Static Assets"]:::platform
        Server["Storefront HTTP Server"]:::platform
    end

    Browser["Browser / Storefront"]:::admin

    %% Workflow Connections
    DevWS -->|"git commit & push"| CI
    CI -->|"CI pipeline uploads"| CLI
    CLI -->|"deploy theme files"| Engine
    AdminUI -->|"settings_data.json"| Engine
    Engine -->|"render pages"| Server
    Server -->|"serve HTML"| Browser
    Browser -->|"fetch CSS/JS/Images"| CDN
    CLI -->|"sync assets"| CDN

    %% File Structure Relationships
    Engine -->|"uses layout templates"| Layout
    Layout -->|"calls templates"| Templates
    Templates -->|"compose sections"| Sections
    Sections -->|"nest blocks"| Blocks
    Sections -->|"include assets"| Assets
    Blocks -->|"include snippets"| Snippets
    Engine -->|"reads config & locales"| Config

    %% Click Events
    click DevWS "https://github.com/shopify/skeleton-theme/blob/main/.gitignore"
    click CI "https://github.com/shopify/skeleton-theme/blob/main/.github/workflows/ci.yml"
    click Assets "https://github.com/shopify/skeleton-theme/blob/main/assets/critical.css"
    click Layout "https://github.com/shopify/skeleton-theme/blob/main/layout/theme.liquid"
    click Templates "https://github.com/shopify/skeleton-theme/blob/main/templates/index.json"
    click Sections "https://github.com/shopify/skeleton-theme/blob/main/sections/header.liquid"
    click Blocks "https://github.com/shopify/skeleton-theme/blob/main/blocks/group.liquid"
    click Snippets "https://github.com/shopify/skeleton-theme/blob/main/snippets/css-variables.liquid"
    click Config "https://github.com/shopify/skeleton-theme/blob/main/config/settings_schema.json"
    click Config "https://github.com/shopify/skeleton-theme/blob/main/config/settings_data.json"
    click Config "https://github.com/shopify/skeleton-theme/blob/main/locales/en.default.json"

    %% Styles
    classDef devTools fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef ci fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef files fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef platform fill:#ffddcc,stroke:#333,stroke-width:1px
    classDef admin fill:#eeeeee,stroke:#333,stroke-width:1px
```
