Magento frontend

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Magento frontend is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Build Magento 2 frontend — layout XML, blocks, PHTML templates, ViewModels, themes, JavaScript (RequireJS/KnockoutJS), and LESS/CSS. Use when customizing the storefront, building themes, or working with frontend components.

How to use this skill

Skill file

Magento 2 Frontend Development

Before writing code

Fetch live docs:

  1. Web-search site:developer.adobe.com commerce frontend-core for frontend development guide
  2. Fetch https://developer.adobe.com/commerce/frontend-core/guide/css/preprocess for CSS/LESS docs
  3. Web-search site:developer.adobe.com commerce frontend-core guide layouts for layout XML reference
  4. Web-search site:developer.adobe.com commerce frontend-core guide templates for template guide

Layout XML

How Layouts Work

Layout files map to route handles and define the page structure:

Key Layout Instructions

Layout Files Location

Blocks and Templates

Block Classes

PHTML Templates

ViewModels (Recommended)

MVVM pattern — inject ViewModels into blocks via layout XML arguments:

JavaScript

RequireJS

KnockoutJS

JS Mixins

Extend existing JS modules without overriding:

jQuery Widgets

Custom widgets extend $.widget:

Themes

Theme Structure

app/design/frontend/VendorName/theme-name/
├── etc/view.xml              # Image sizes, responsive breakpoints
├── registration.php          # Theme registration
├── theme.xml                 # Theme name, parent
├── composer.json
├── Magento_Module/           # Module overrides
│   ├── layout/               # Layout XML overrides
│   └── templates/            # Template overrides
├── web/
│   ├── css/source/           # LESS source files
│   ├── images/
│   └── js/
└── media/preview.jpg

Theme Inheritance

Themes declare a parent in theme.xml. Fallback chain: current theme → parent theme → module views → framework. Override files by placing them in the same relative path.

Hyva Themes (Modern Alternative)

Open source since late 2025. Replaces KnockoutJS + RequireJS + jQuery with Alpine.js + Tailwind CSS. Dramatically faster: ~5 requests vs ~230, ~0.4MB vs ~3MB page weight.

LESS/CSS

Best Practices

Fetch the frontend development guide for exact layout XML schema, template escaping methods, and RequireJS configuration patterns before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.