ddtcorex/maestro-skills / skills/magento2-dev-core
magento2-dev-core
VerifiedUse for Magento 2 module work: architecture, dependency injection, repositories, plugins, secure backend code, CLI, cron. Core skill, always load it first. Keywords dependency injection, plugin.
references/report-theme.md
View on GitHub# Report Theme - Standard HTML Styles
Standard inline CSS for performance audit HTML reports. Every `report.html` generated by `magento2-performance-audit` must use this theme verbatim (inline `<style>`, no external CDN) so all audits share the same visual language: Maestro header lockup, primary accents, Inter stack, cards, badges, KPI grid, checks, tables.
## Inline `<style>` (copy verbatim into `<head>`)
```html
<style>
/* Copied from the Maestro design system (design-system/MASTER.md, assets/maestro-logo), verified 2026-10-23 */
:root{--bg:#f8fafc;--card:#ffffff;--border:#e2e8f0;--text:#0f172a;--muted:#64748b;--green:#16a34a;--green-bg:#dcfce7;--yellow:#ca8a04;--yellow-bg:#fef9c3;--red:#dc2626;--red-bg:#fee2e2;--blue:#2563eb}
/* Surface tokens (header and links): an overlay redefines these in its colors slot block */
:root{--header-bg:linear-gradient(135deg,#0f172a 0%,#1e40af 100%);--header-text:#ffffff;--header-accent:#0a84ff;--header-code-bg:rgba(255,255,255,0.14);--link-decoration:none}
*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.6}
code{font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
a{color:var(--blue);text-decoration:var(--link-decoration)}a:hover{text-decoration:underline}
.header{background:var(--header-bg);color:var(--header-text);padding-block:32px;border-bottom:4px solid var(--header-accent)}
.header-inner{max-width:1100px;margin:0 auto;padding-inline:24px}
.header h1{margin:0 0 8px;font-size:28px;letter-spacing:-0.02em}
.header .meta{opacity:0.85;font-size:13px;line-height:1.7}
.header .meta code{background:var(--header-code-bg);padding:2px 6px;border-radius:6px;font-size:12px}
.container{max-width:1100px;margin:0 auto;padding:24px}
.card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:20px;margin:16px 0;box-shadow:0 1px 2px rgba(15,23,42,0.04)}
.card h2{margin:0 0 12px;font-size:16px;letter-spacing:-0.01em;display:flex;align-items:center;gap:8px}
h2 .badge{font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;padding:4px 8px;border-radius:999px;border:1px solid var(--border)}
.badge-green{background:var(--green-bg);color:var(--green);border-color:#bbf7d0}
.badge-yellow{background:var(--yellow-bg);color:var(--yellow);border-color:#fde68a}
.badge-red{background:var(--red-bg);color:var(--red);border-color:#fecaca}
.badge-gray{background:#f8fafc;color:var(--muted)}
.kpi{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:12px 0}
@media (max-width:640px){.kpi{grid-template-columns:1fr}}
.kpi .box{border:1px solid var(--border);border-radius:12px;padding:12px;background:#ffffff}
.kpi .box .label{font-size:11px;letter-spacing:0.06em;text-transform:uppercase;color:var(--muted)}
.kpi .box .value{font-size:20px;font-weight:700;margin-top:4px}
.kpi .box .sub{font-size:12px;color:var(--muted)}
table{width:100%;border-collapse:collapse;font-size:13px;margin:8px 0}
th,td{border:1px solid var(--border);padding:8px 10px;text-align:left;vertical-align:top}
th{background:#f8fafc;font-weight:600;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var(--muted)}
td code, li code{background:#f8fafc;padding:1px 6px;border-radius:6px;font-size:12px}
.url,td.url{overflow-wrap:anywhere;word-break:break-all}
.check{margin:6px 0;display:flex;gap:8px;align-items:flex-start;font-size:13px}
.check .icon{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0;margin-top:1px}
.icon-ok{background:var(--green-bg);color:var(--green);border:1px solid #bbf7d0}
.icon-warn{background:var(--yellow-bg);color:var(--yellow);border:1px solid #fde68a}
.icon-fail{background:var(--red-bg);color:var(--red);border:1px solid #fecaca}
.icon-skip{background:#f8fafc;color:var(--muted);border:1px solid var(--border)}
ul{margin:8px 0;padding-left:18px}
.footer{color:var(--muted);font-size:12px;text-align:center;padding:16px}
.verdict{font-weight:700}
</style>
```
## Structure
Layout rule: every card renders its context note below table markup, never above the data. Rationale: context annotates data the reader has already seen.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{title}} - {{date}}</title>
<!-- inline <style> above -->
</head>
<body>
<div class="header"><div class="header-inner"><div class="header-top">{{brand_logo}}<!-- default Maestro lockup, see Brand defaults --><div class="header-side">{{header_side}}</div></div><div class="eyebrow">{{eyebrow}}</div><h1>{{heading}}</h1><div class="subtitle">{{subtitle}}</div><div class="meta">{{meta}}</div></div></div>
<div class="container">
<div class="kpi">{{kpi}}</div>
<div class="card"><h2>URLs Audited <span class="badge badge-gray">{{scope}}</span></h2>{{urls}}</div>
<!-- one .card per Audit Report Template section: Infrastructure, Cache Status, ... Database, Per-Page Query Detail (7 <details>), etc. -->
<!-- context note below table in each card: context annotates data the reader has already seen -->
<div class="card" style="border-left:4px solid var(--red)"><h2>Recommendations <span class="badge badge-red">{{count}} actions</span></h2>{{recommendations}}</div>
<div class="footer">Generated {{date}} from live govard captures on <code>{{host}}</code> (audit <code>{{session}}</code>). <a href="report.md">Markdown</a> · <a href="report.pdf">PDF via Print</a></div>
</div>
</body>
</html>
```
## Usage
- Copy `report-perf.html.template` (with `{{theme_css}}` replaced by `report-theme.css`) and replace `{{title}}`, `{{date}}`, `{{meta}}`, `{{kpi}}`, `{{urls}}`, `{{sections}}`, `{{host}}`, `{{session}}` from the same data that populates `report.md`.
- Render every audited URL as `<td class="url"><code>…</code></td>` (bare `<td>` does not pick up the wrapping rule below); long URLs wrap via `.url,td.url{overflow-wrap:anywhere;word-break:break-all}` instead of overflowing.
- Brand slots `{{brand_logo}}`, `{{brand_colors}}`, `{{brand_font}}` default to the Maestro values below; an overlay replaces all three together, never one alone.
- Header layout: the gradient is full-bleed, but its text lives in `.header-inner`, which uses the same `max-width:1100px` and `24px` side padding as `.container`, so header and card left edges align at every viewport width. Keep both rules in sync if either changes.
- Theme rule: the header is one of the brand-fixed surfaces, set only through the `--header-` tokens, and it stays fixed across light and dark modes; only data tokens follow the mode. Inverting it (a light header in dark mode) reads as a bug, not theming.
- Keep `Per-Page Query Detail` for deep as 7 `<details><summary>home - 363 queries, 42 shapes</summary><table>...</table></details>` blocks (see `report-template.md`); quick may use `Skipped: quick - 3 pages only, Per-Page Detail deferred to deep`.
- PDF via `google-chrome --headless --no-pdf-header-footer --print-to-pdf="report.pdf" "file://$(pwd)/report.html"` - verify with `pdftotext`.
### Brand defaults (Maestro)
The template ships with Maestro defaults in all three slots, so a default render carries the brand: inline SVG lockup, primary accents, Inter with JetBrains Mono for code. Token copies carry the source stamp tests pin, so drift is detected without duplicating ownership.
`{{brand_logo}}` sits at the left of the header top row, with the client line (`.header-side`: client, stack, measurement date) on the right and the eyebrow, title, subtitle and meta below, defaulting to the inline SVG lockup: the Maestro M in white on a blue rounded tile, with the Maestro wordmark in white for the dark header. Default renders keep the SVG, drop the marker line; an overlay fills the marker, drops the default block. Never use an external image: single-file HTML stays offline capable with the logo inline.
`{{brand_colors}}` sits after the `:root` rules and defaults to the Maestro palette already there. An overlay fills it with one `:root` block redefining only tokens from the overlay token map below, header tokens included, which stay fixed in both modes per the theme rule above.
`{{brand_font}}` sits on its own line after the `body` rule and defaults to the Inter stack in `body` plus the JetBrains Mono `code` rule. An overlay replaces it with one `body` rule setting only the family stack, leaving size, line height, and spacing untouched.
### Overlay token map
An overlay rebrands through custom properties, never selectors, so an upstream class rename cannot drop its branding. Only these tokens may be set:
| Token | Role |
|---|---|
| `--bg` | page background |
| `--card` | card background |
| `--border` | card and table lines |
| `--text` | body text |
| `--muted` | secondary text, table headings |
| `--blue` | links and inline accents |
| `--header-bg` | header background, a color or a gradient |
| `--header-text` | header title and meta text |
| `--header-accent` | header bottom border |
| `--header-code-bg` | code chips in the header meta |
| `--link-decoration` | link underline, `none` or `underline` |
| `--chart-before` | bars of the previous run in the client chart (report contract 2) |
| `--chart-after` | bars of this run in the client chart (report contract 2) |
Status colors stay stock.
Each slot takes one construct:
- `{{brand_colors}}` is one `:root{...}` block of tokens from the table.
- `{{brand_font}}` is one complete `body{font-family:Inter}` rule carrying the whole family stack.
A bare `font-family:Inter;` declaration merges into the next selector, dropping that rule: the font never applies and links lose their style. Unread properties such as `--brand-primary` do nothing. Keep text tokens at 4.5:1 contrast; a bright accent belongs on `--header-accent`.
```css
:root{--header-bg:#ffffff;--header-text:#0f172a;--header-accent:#0a84ff;--header-code-bg:#f8fafc;--blue:#2563eb}
body{font-family:Inter,system-ui,sans-serif}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |