Docs: performance.md, the iapl-performance skill, AGENT.md 6.11b, doctor.md, audit, api.md, the measurements and the audit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
801b897ea0
commit
c6c5dfbcbf
+20
-10
@@ -1041,22 +1041,29 @@ Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-co
|
||||
125 % and 150 % zoom at 1366 (common on Windows). No horizontal scroll, no clipped text,
|
||||
the menu works, the hero CTA is visible.
|
||||
|
||||
### 6.11b Speed (Core Web Vitals)
|
||||
### 6.11b Speed (Core Web Vitals) — the handbook is [performance.md](../performance.md), the skill `iapl-performance`
|
||||
| What | How | Forbidden |
|
||||
|---|---|---|
|
||||
| LCP image (the first visible one, usually the hero) | `<Media priority>` — exactly one per page | `priority` on many images, the hero as a CSS `background-image` |
|
||||
| every other image | `<Media sizes={MEDIA_SIZES.third}>` — `sizes` = the width on screen | no `sizes` (downloads the full width), `<img>` |
|
||||
| LCP image (the first visible one, usually the hero) | `<Media priority>` — exactly one per page (preload + `fetchpriority="high"`) | `priority` on many images, the hero as a CSS `background-image`, a lazy hero |
|
||||
| above the fold, not the LCP (header logo) | `<Media eager>` — loads at once, no high priority, no preload | `priority` on the logo (it competes with the hero) |
|
||||
| every other image | `<Media sizes={MEDIA_SIZES.third}>` — `sizes` = the width on screen; lazy by default | no `sizes` (downloads the full width), `<img>` |
|
||||
| placeholder | `buildMediaPlaceholderHook` + a field in Media (blur + color) | empty boxes that "jump in" while loading |
|
||||
| uploads | `buildOptimizeUploadHook` (stops images over 1.5 MB / 2560 px, converts on request); `iapl-doctor --deep` counts stored images over the limits | 8 MB phone photos in the library |
|
||||
| background video | `videoMode="background"`, MP4 H.264 ≤ 20 MB, no sound, with a poster | a video as the hero without a poster, `autoplay` with sound |
|
||||
| video with content | `videoMode="player"` (loads after a click) | `preload="auto"` |
|
||||
| YouTube | `<YouTubeEmbed>` from `/client` (the iframe only after a click) | a bare `<iframe src="youtube.com/embed…">` |
|
||||
| next.config | `images: { ...buildImagesConfig() }` (AVIF/WebP, R2) | no `remotePatterns` → images from R2 without optimization |
|
||||
| fonts | `next/font`, max 2 families × 2–3 weights, `subsets: ['latin', 'latin-ext']` (PL), `display: 'swap'` | a `<link>` to Google Fonts, 6 weights "just in case" |
|
||||
| third-party scripts | `Analytics` (via `SiteProviders`, `analytics={{ defer: true }}`) / `ConsentScript` from the plugin | chat/map widgets loaded at start |
|
||||
| client components | small, interaction only (§6.9) | a whole section `'use client'` |
|
||||
| YouTube, maps, widgets | `<YouTubeEmbed>` from `/client` (the iframe only after a click); a map behind a click (a picture + a button) | a bare `<iframe>` that loads with the page |
|
||||
| next.config | `images: buildImagesConfig()` (AVIF/WebP, R2, 31-day cache) | no `remotePatterns` → images from R2 without optimization |
|
||||
| fonts | `next/font`, max 2 families, variable, `subsets: ['latin', 'latin-ext']` (PL), `display: 'swap'` | a `<link>` to Google Fonts, `display: 'block'`, 6 weights "just in case" |
|
||||
| third-party scripts | `Analytics` (via `SiteProviders`, `analytics={{ defer: true }}`) / `ConsentScript` from the plugin; `next/script` for anything else | `<script src>` without `async` in the layout, chat/map widgets loaded at start |
|
||||
| animations | `transform` / `opacity` only, the token durations (`duration-fast`, reduced motion built in) or `motion-reduce:`; IntersectionObserver for "is it on screen" | animating `height` / `top` / `margin`, `transition-all`, a `scroll` listener doing work per event |
|
||||
| client components | small, interaction only (§6.9); import from `@intecion/ipal-kit/client` freely — a page ships only what it renders (1.18.0) | a whole section `'use client'` |
|
||||
| data | the cached helpers of `lib/content` (`getSettings`, `resolveRoute`, `getSiteShell`…), `depth` as low as the page needs, `select` when you need one field, `cache()` around your own getters | `findGlobal` in a component without `cache()`, `depth: 2` "to be safe", a query per list item |
|
||||
| budgets | `e2e/performance.spec.ts` from the `iapl-performance` skill (`perfBudgets()` from `/doctor`): fails when a page gets slower | "it felt fast on my machine" |
|
||||
|
||||
Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms.
|
||||
Checks: `iapl-audit` (img/video outside Media, many `priority`, `h-screen`, fixed widths,
|
||||
Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms — the plugin's default
|
||||
budgets (`PERF_BUDGETS`). Checks: `iapl-doctor --only performance` (images config, fonts, render-blocking, embeds,
|
||||
animations, a budget test; `--url`: compression, blocking scripts, preloads, a lazy first image, HTML size; `--deep`:
|
||||
stored images over the limits), `iapl-audit` (img/video outside Media, many `priority`, `h-screen`, fixed widths,
|
||||
YouTube `<iframe>`) and `iapl-seo-check` (images without dimensions, LCP image without priority).
|
||||
|
||||
### 6.12 Exports and imports
|
||||
@@ -1554,6 +1561,7 @@ block library — [doctor.md](../doctor.md)):
|
||||
bash .agents/skills/iapl-audit/scripts/audit.sh
|
||||
pnpm exec iapl-doctor # + --deep --url http://localhost:3000 on the built site
|
||||
node .agents/skills/iapl-seo-check/scripts/seo-check.mjs http://localhost:3000
|
||||
pnpm test:e2e performance # the budget gate (iapl-performance) on the built site
|
||||
pnpm generate:types && pnpm tsc --noEmit
|
||||
pnpm build # --webpack in the script; locally, not only dev
|
||||
# hardcoding and the field zoo in blocks
|
||||
@@ -1614,6 +1622,7 @@ Anything that needs a developer → move it to the panel.
|
||||
| Rich text | [richtext.md](../richtext.md) |
|
||||
| Headers, CSP, 2FA, panel path | [security.md](../security.md) |
|
||||
| SEO, metadata, sitemap, JSON-LD, llms.txt | [seo.md](../seo.md) |
|
||||
| Speed: what the plugin does, what the project does, budgets, measuring, the doctor's performance group | [performance.md](../performance.md) |
|
||||
| Auto-slug | [slug.md](../slug.md) |
|
||||
| Media: collection, file names, optimization, placeholders | [media.md](../media.md) |
|
||||
| Image lightbox (enlarge, galleries, rich text images) | [lightbox.md](../lightbox.md) |
|
||||
@@ -1695,6 +1704,7 @@ the task matches — manually: `/<name>`.
|
||||
| `iapl-debug` | anything does not work — procedure + a symptom → cause → fix table |
|
||||
| `iapl-audit` | before every "done" — the §0b set + the §11 checks + panel (§6.5a) + hardcoding in JSX + tsc + build |
|
||||
| `iapl-seo-check` | the running site through the eyes of Googlebot and AI agents (head, canonical, hreflang, sitemap, 404, JSON-LD, llms, Markdown, MCP) |
|
||||
| `iapl-performance` | speed: the doctor's performance group, measuring the built site (phone and desktop), the budget gate `e2e/performance.spec.ts` (`resources/`), reading LCP / CLS / INP / bytes / queries — when building pages or blocks, before handing over, whenever "slow" or PageSpeed comes up |
|
||||
| `iapl-consent-check` | browser: no tracking pixels or cookies before consent; the Google tag may load before consent only in Consent Mode `advanced` (all signals `denied`) — a client who wants zero requests gets `consentMode: 'basic'` |
|
||||
| `iapl-doctor` | the whole site against the team standard in one command (`pnpm exec iapl-doctor`): versions, Node 22, layout, database names, env, headers, CSP, 2FA, cookie scanner, adminMeta, AGENTS.md, skills, seeds, block library, pnpm audit; `--url` / `--deep` for the running site and the database; `--strict` in the CI of a new site |
|
||||
| `iapl-plugin-gap` | IAPL has a bug or is missing a feature — report to the owner, wait for the decision; a marked workaround only after approval |
|
||||
|
||||
Reference in New Issue
Block a user