From 8cf5a58045f70c40c95b34b3fea44575cc6fd71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 1 Dec 2026 16:10:23 +0100 Subject: [PATCH] Doctor: the performance rules are errors (owner's decision for 1.18.0); lowered or silenced per rule in iapl-doctor.json; growth stays warnings; audit reports them as errors; legacy:site lists perf-* errors an old site meets; docs, skills, changelog; reference skills refreshed Co-Authored-By: Claude Opus 5.5 --- docs/CHANGELOG.md | 13 +++++- docs/agent/AGENT.md | 2 +- docs/agent/skills/iapl-audit/SKILL.md | 2 +- docs/agent/skills/iapl-audit/scripts/audit.sh | 10 ++-- docs/agent/skills/iapl-doctor/SKILL.md | 7 ++- docs/agent/skills/iapl-performance/SKILL.md | 7 ++- docs/dev/perf/README.md | 2 +- docs/doctor.md | 31 +++++++++---- docs/performance.md | 4 +- reference/.agents/skills/iapl-audit/SKILL.md | 2 +- .../skills/iapl-audit/scripts/audit.sh | 10 ++-- reference/.agents/skills/iapl-doctor/SKILL.md | 7 ++- .../.agents/skills/iapl-performance/SKILL.md | 16 +++++-- .../.agents/skills/iapl-reference/SKILL.md | 3 +- .../skills/iapl-reference/resources/api.md | 22 +++++---- scripts/legacy-site-check.mjs | 7 ++- src/modules/doctor/rules/growth.ts | 2 +- src/modules/doctor/rules/performance.ts | 46 ++++++++++--------- test/performance.test.ts | 12 +++-- 19 files changed, 136 insertions(+), 69 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ef5c8bb..a0af392 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -67,13 +67,22 @@ once there are more than 20. > barrels are no longer one client boundary, the table of contents measures once per frame, Turnstile stops > polling once drawn, the cookie banner honours reduced motion. Nothing to do. > +> 9. **`iapl-doctor` can now fail on the performance rules** (`perf-*`: images config, fonts, render-blocking, +> embeds, animations, a budget test; `--url`: uncompressed HTML, blocking scripts, more than four font preloads, a +> lazy first image, HTML over 150 KB; `--deep`: stored images over 1.5 MB / 2560 px) — they are **errors**, so a +> plain run exits 1 on them and `--strict` too. None measures time: the same site gives the same answer every run. +> A site with Playwright and no budget test gets `perf-budgets` (copy the `iapl-performance` skill's template). +> Lower one with a reason: `iapl-doctor.json` → `"rules": { "perf-fonts": { "severity": "warning", "reason": "…" } }`; +> silence one: `{ "off": true, "reason": "…", "until": "2027-03-01" }` (docs/doctor.md). The `growth-*` rules stay +> warnings and infos. +> > **New, off until a project turns it on:** `iapl({ unusedMedia: true })` — above the Media list, how many files no > page, entry or setting uses, with a link to Payload's list filtered to them (deleting stays manual; **run > `pnpm generate:importmap`** after turning it on); `forms: { submissionRetentionDays }`; `Media eager` (a logo > above the fold, no high priority); `createNotFoundPage({ load, placeholder })` (the reference site keeps its 404 > height: CLS 0). -> **Doctor:** the `performance` and `growth` groups (warnings; `growth-versions-config` is a hint), thresholds in -> `iapl-doctor.json` → `growth`. **Agents:** the `iapl-performance` skill (`pnpm exec iapl-skills`) and the budget +> **Doctor:** the `performance` group (errors, point 9) and the `growth` group (warnings and infos; +> `growth-versions-config` is a hint), thresholds in `iapl-doctor.json` → `growth`. **Agents:** the `iapl-performance` skill (`pnpm exec iapl-skills`) and the budget > gate template. **Recommended for projects:** `index: true` on `slugHistory.slug`; the heading font with > `preload: false` (the starter's default now); a placeholder of the 404 content's height. diff --git a/docs/agent/AGENT.md b/docs/agent/AGENT.md index a4ec2d0..203589b 100644 --- a/docs/agent/AGENT.md +++ b/docs/agent/AGENT.md @@ -1063,7 +1063,7 @@ Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-co | 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 — the plugin's default -budgets (`PERF_BUDGETS`). Checks: `iapl-doctor --only performance` (images config, fonts, render-blocking, embeds, +budgets (`PERF_BUDGETS`). Checks: `iapl-doctor --only performance` — **errors** since 1.18.0, an accepted exception lowered or silenced with a reason in `iapl-doctor.json` (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 `