From 8cd9830a22f26c0f8ff4c7454d4684f7ef5956fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Thu, 29 Oct 2026 13:34:34 +0100 Subject: [PATCH] ipal-doctor proposal: block library rules Co-Authored-By: Claude Opus 5.5 --- docs/dev/ipal-doctor-proposal.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/dev/ipal-doctor-proposal.md b/docs/dev/ipal-doctor-proposal.md index d8cf431..476686a 100644 --- a/docs/dev/ipal-doctor-proposal.md +++ b/docs/dev/ipal-doctor-proposal.md @@ -95,6 +95,20 @@ Source tags: **S** = static (files only, no network, no database), **R** = regis | `i18n-literals` | error in blocks, warning in components | S | no literal UI text where the panel or i18n is expected — runs `ipal-audit`'s `jsx-text.mjs` and its Polish-literal check | move the text to a localized field | | `audit` | as reported | S | `ipal-audit --quick` from the **installed package** (not the project's copy, which may be stale) — every `[ERROR]` / `[WARNING]` becomes a finding `audit:` | the `ipal-audit` skill | +### 2.5a Block library (from the approved block-library design, `docs/dev/block-library-proposal.md` §5.1, §7.3, §10) + +| Id | Sev | Src | Check | Fix hint | +|---|---|---|---|---| +| `blocks-registry` | error | S | `blocks/registry.ts` builds the registry with `createBlockRegistry(content, { ui, components, classNames, extra })` or renders through `RenderBlocks`; no hand-written `switch (blockType)` | blocks.md → Block library | +| `blocks-ui-required` | error | S | without `createBlockRegistry`, `components/ui/` holds the five primitives (Section, SectionHeader, Media, CMSLink, Button); with it, `ui/` is optional | the `ipal-block` skill | +| `blocks-ui-override` | warning | S | every file in `components/ui/` named like a library primitive (Section, SectionHeader, Media, CMSLink, Button, Container, Card) is passed through the registry's `ui` option. Otherwise the library blocks keep the plugin's version and the two looks drift apart | `createBlockRegistry(content, { ui: { Button } })` | +| `blocks-duplicate` | warning | S | a project block whose folder or slug matches a library block (or a variant of one) and is not a declared override or eject | use the library block + variant, or record the eject in "Project decisions" | +| `blocks-helper-copy` | warning | S | no local copies of plugin helpers (`buildItemsField`, `buildActionButtonsField`, `ctaHref`, and the other exported field builders) | import from the plugin | +| `blocks-tokens` | error | S | classes use design tokens only (no hex, no arbitrary colours) — the `ipal-audit` hex rule, extended by the design-token track's names | DESIGN.md / tokens | + +The list of library blocks and primitives is read from the installed plugin (an exported manifest), not +hard-coded in the doctor, so a new library block needs no doctor change. + ### 2.6 Live checks (`--url`) `--url` adds the **L** rules above plus: