frontend
/frontend
Tworzy szkielety frontendu Magento 2: motywy, moduły RequireJS, komponenty Knockout, LESS i CSS, szablony e-maili transakcyjnych oraz podpięcie zasobów statycznych, wykrywając Luma, Hyva lub motyw własny.
- Autor
- muon-m2 ↗
- Repozytorium
- magento2-tools ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 04.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 20
- Skrypty
- 4
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 04.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 4 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: templates/ko-ui-component.js, templates/requirejs-config.js, templates/requirejs-module.js, templates/theme-registration.php
Co robi i kiedy
Tworzy szkielety frontendu Magento 2: motywy, moduły RequireJS, komponenty Knockout, LESS i CSS, szablony e-maili transakcyjnych oraz podpięcie zasobów statycznych, wykrywając Luma, Hyva lub motyw własny.
Oryginalny opis (EN)
Frontend scaffolding for Magento 2: themes, RequireJS modules, Knockout components, LESS/CSS, transactional email templates, static asset wiring. Use to add frontend behaviour or a theme. Detects Luma, Hyva, or a custom theme and generates matching scaffolds. For Swissup Breeze stores (magento2-tools:context theme.breeze) defer theme creation to magento2-tools:breeze-theme and widget/JS work to magento2-tools:breeze-adapt. For a CMS widget (etc/widget.xml) use magento2-tools:widget.
Jak działa
- Core Rules
- Workflow
- Inputs
- Outputs
- Reference Files
- Templates
- Theme Awareness
- Acceptance Criteria
- Related Skills
Podgląd SKILL.md
---
name: frontend
version: 1.0.6
description: >-
Frontend scaffolding for Magento 2: themes, RequireJS modules, Knockout components, LESS/CSS,
transactional email templates, static asset wiring. Use to add frontend behaviour or a theme.
Detects Luma, Hyva, or a custom theme and generates matching scaffolds. For Swissup Breeze stores
(magento2-tools:context theme.breeze) defer theme creation to magento2-tools:breeze-theme and
widget/JS work to magento2-tools:breeze-adapt. For a CMS widget (etc/widget.xml) use
magento2-tools:widget.
---
# Magento 2 Frontend Create
Frontend-specific scaffolding `module-create` doesn't cover.
## Core Rules
- **Theme-aware.** Detect theme from `context` (Luma / Hyva / custom). Hyva
installs use Alpine.js + Tailwind, NOT Knockout/RequireJS.
- **Breeze-aware.** `context` emits a separate `theme.breeze` object
(`installed` / `active` / `parent`) for Swissup Breeze (Breezefront) stores. Breeze
replaces RequireJS/Knockout/jQuery with a Cash-based stack, and a Breeze child theme
has a different layout (`web/css/breeze/_default.less` with `@critical` guards, a
`Swissup/breeze-*` parent, a Breeze-only layout handle). This skill does NOT scaffold
Breeze themes or Breeze widgets — it **routes** them: theme work → `breeze-theme`,
widget/JS adapter work → `breeze-adapt`. See Phase 1.
- **One operation per invocation.** Each call generates ONE of: theme, RequireJS module,
KO/Alpine component, LESS scaffold, email template, static asset.
- **Layout-driven.** Generated assets include the layout XML to activate them, not just
the source files.
- **Append-safe.** Never overwrite an existing `requirejs-config.js` or `email_templates.xml`
— append/merge.
- **Coding style.** Any generated PHP (blocks, ViewModels) follows PER-CS 3.0 as the baseline,
with the Magento 2 coding standard taking precedence on any conflict; `--standard=Magento2`
PHPCS is the gate. See `context/references/php-coding-style.md`.
- **Source of truth.** Generate from templates → shared references → baked-in Magento 2 knowledge
→ official Magento/Adobe docs (live-fetched only when uncertain). Do NOT read, grep, or "study"
other modules under `app/code`/`vendor/*`/Magento core to infer conventions, entity shapes,
naming, or wiring. Narrow exceptions: the target module/class of this operation, and the specific
contract of a module this code explicitly depends on. Affirm sources in the final report. See
`context/references/source-of-truth.md`.
## Workflow
### Phase 0 — Context Resolution
Invoke `context`. Capture theme detection result.
### Phase 1 — Operation Plan
Ask:
- Operation: theme | requirejs-module | ko-component | alpine-component | email-template | static-asset
- Parent theme (for theme operation)
- Module to host (for non-theme operations)
If the theme is Hyva and the user asks for `ko-component`, suggest `alpine-component`
instead — Hyva doesn't run Knockout.
**Breeze routing (check `theme.breeze` from Phase 0):**
- If `theme.breeze.active` is true (or the user asks for a "Breeze theme" / "Breeze child
theme") and the operation is `theme` → **stop and route to `breeze-theme`**.
A Breeze child theme is not a Luma/Hyva scaffold; generating one here would produce the
wrong structure (Luma `web/css/source/` instead of Breeze `web/css/breeze/` with
`@critical` guards, and a Luma parent instead of `Swissup/breeze-*`).
- If `theme.breeze.active` is true and the operation is `requirejs-module` or `ko-component`,
note that Breeze does not run RequireJS/Knockout on Breeze-enhanced pages. Generate the
Luma-fallback scaffold if the user still wants it, but **suggest `breeze-adapt`**
to add the matching Cash `$.widget` adapter (run `breeze-compat` first to
see what needs adapting).
- If `theme.breeze.installed` is true but `active` is false, surface that Breeze is installed
but not the active theme, and ask which stack the user is targeting before scaffolding.
### Phase 2 — Generate
Per operation:
#### Theme
- `theme.xml`, `registration.php`, `composer.json`
- Parent theme reference
- `web/css/source/_extend.less`
- `view.xml`
- `Magento_Theme/layout/default.xml` stub
#### RequireJS module
- `view/frontend/web/js/{name}.js` with module pattern
- `view/frontend/requirejs-config.js` registration (append-safe)
#### Knockout component (UI component)
- Component class extending `uiComponent`
- HTML template
- LESS/CSS sibling
- Layout XML wiring
#### Alpine component (Hyva)
- `view/frontend/templates/{name}.phtml` with `x-data`, `x-show`, etc.
- `view/frontend/layout/{handle}.xml` to render the template
#### Email template
- `view/frontend/email/{name}.html`
- `etc/email_templates.xml` registration (append-safe)
- `etc/config.xml` default path
#### Static asset
- `view/frontend/web/css/...` or `view/frontend/web/images/...`
- Layout reference
### Phase 3 — Verify
- `xmllint --noout` on every XML file.
- `node --check` on every JS file.
- `npm run lint` if the project has a JS linter.
- **Apply the shared module-hygiene baseline (required).** After generating or modifying PHP
files, run
`${CLAUDE_PLUGIN_ROOT}/skills/context/scripts/add-license-headers.sh <path> {Vendor}`
— where `<path>` is the host `app/code/{Vendor}/{Module}/` (or the
`app/design/frontend/{Vendor}/{Theme}/` theme dir) — to stamp the standard copyright header
onto every new `.php` (idempotent — it skips files that already carry it). When adding a
`composer.json` `require` entry, resolve a **bounded** constraint via
`${CLAUDE_PLUGIN_ROOT}/skills/context/scripts/resolve-dep-constraint.sh <vendor/package>`
— never `"*"`. See `context/references/module-hygiene.md`.
### Phase 4 — Report
Brief: files created + activation commands.
Theme generation requires:
```
{ctx.magento_cli} setup:upgrade
{ctx.magento_cli} setup:static-content:deploy -f
```
> **Docs may now be stale.** This change modified module code. Run
> `docs --module={Vendor}_{Module}` to refresh the module's README,
> CHANGELOG, and `docs/*.md` (technical reference, guides, and API references as
> applicable).
## Inputs
```
/frontend <operation> [operation-specific flags]
```
## Outputs
Files written under `{ctx.magento_root}/app/code/{Vendor}/{Module}/view/frontend/` or
`src/app/design/frontend/{Vendor}/{Theme}/`.
## Reference Files
- `references/theme-patterns.md` — Luma inheritance, Hyva inheritance, custom theme.
- `references/requirejs-patterns.md` — module structure, deps, shim.
- `references/ko-component-patterns.md` — UI component vs KO-only.
- `references/alpine-patterns.md` — Hyva Alpine.js patterns.
- `references/less-css-rules.md` — `_module.less` convention, var/mixin scoping.
- `references/email-template-rules.md` — Magento-specific variable syntax, fallback paths.
- `references/static-asset-rules.md` — publish path, fallback chain.
- `context/references/source-of-truth.md` — source-of-truth hierarchy + the
no-unrelated-module-scanning rule (allowed reads, live-doc fetch protocol, report affirmation).
## Templates
- `templates/theme.xml`
- `templates/theme-registration.php`
- `templates/theme-composer.json`
- `templates/theme-view.xml`
- `templates/requirejs-module.js`
- `templates/requirejs-config.js`
- `templates/ko-ui-component.js`
- `templates/ko-ui-component.html`
- `templates/alpine-component.phtml`
- `templates/email-template.html`
- `templates/email_templates.xml`
- `templates/_extend.less`
## Theme Awareness
| Detected theme | Default scaffolds |
|----------------|------------------|
| Luma | Standard Magento patterns; RequireJS-heavy |
| Hyva | Tailwind/Alpine.js; no KO; AlpineJS components instead |
| Breeze (`theme.breeze.active`) | Cash-based stack; no RequireJS/KO. Route theme → `breeze-theme`, widgets → `breeze-adapt` |
| Custom | Ask user; default to Luma unless told otherwise |
## Acceptance Criteria
- Theme generation produces a working theme registered in `app/design/frontend/`.
- RequireJS modules pass `node --check`.
- KO components render in browser without errors when wired correctly.
- Hyva-detected projects do NOT receive KO scaffolds — Alpine scaffolds instead.
## Related Skills
| Phase | Skill |
|-------|-------|
| 0 | `context` |
| 1 (Breeze theme) | `breeze-theme` — scaffold a Swissup Breeze child theme |
| 1 (Breeze widget/JS) | `breeze-adapt` — build the Breeze Cash adapter; `breeze-compat` to scope it first |
| (after Phase 3) | `review` for the host module |
| (caller) | `feature` Phase 5 (F* tasks) |
Pliki w paczce (20)
- SKILL.md 8 KB
- references/alpine-patterns.md 2 KB
- references/email-template-rules.md 3 KB
- references/ko-component-patterns.md 3 KB
- references/less-css-rules.md 2 KB
- references/requirejs-patterns.md 2 KB
- references/static-asset-rules.md 2 KB
- references/theme-patterns.md 3 KB
- templates/_extend.less 1 KB
- templates/alpine-component.phtml 1 KB
- templates/email-template.html 1 KB
- templates/email_templates.xml 1 KB
- templates/ko-ui-component.html 1 KB
- templates/ko-ui-component.js 1 KB
- templates/requirejs-config.js 1 KB
- templates/requirejs-module.js 1 KB
- templates/theme-composer.json 1 KB
- templates/theme-registration.php 1 KB
- templates/theme-view.xml 1 KB
- templates/theme.xml 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · muon-m2/magento2-tools | 100 | MIT |
| speakeasy-api/gram | 100 | AGPL-3.0 |
| kriscard/Skills | 100 | MIT |
| tlkppm/ModelBridge | 100 | MIT |
| Tristan578/project-forge | 100 | Apache-2.0 |
| Tyler-R-Kendrick/agent-skills | 100 | MIT |
| matteocervelli/llms | 100 | MIT |
| kid-sid/codex-spellbook | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki d942ff53c3eb (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100breeze-theme
Tworzy szkielet motywu potomnego Swissup Breeze (Breezefront): theme.xml z rodzicem Swissup/breeze-*, układ tylko dla Breeze i nadpisania w web/css/breeze/_default.less. - 100breeze-adapt
Adaptuje istniejący moduł Magento 2 do Swissup Breeze, generując moduł towarzyszący {Vendor}_{Module}Breeze, który zamienia widgety RequireJS, Knockout i jQuery na Cash `$.widget`, bez edycji modułu docelowego. - 100magento-hyva
Rozwija motywy Hyvä dla Magento 2: Alpine.js i Tailwind CSS, komponenty Magewire, motyw potomny i build Tailwinda, nadpisywanie szablonów i layout XML oraz kompatybilność Luma-Hyvä. - 100magento-frontend
Buduje frontend Magento 2: layout XML, bloki, szablony PHTML, ViewModels, motywy, JavaScript (RequireJS, KnockoutJS) oraz LESS i CSS, przy dostosowywaniu sklepu i budowie motywów. - 98orchardcore-theme-creator
Tworzy nowe motywy Orchard Core z manifestem, układami stron i zasobami frontendu, takimi jak CSS i JavaScript. - 90team-shinchan:frontend
Tworzy komponenty interfejsu w React lub CSS i nadaje im style.