Files
ipal-kit/docs/agent/skills/ipal-upgrade/SKILL.md
T
Radosław SmolińskiandClaude Opus 5.5 0e7966dfbb
CI / check (push) Canceled after 0s
1.14.2 upgrade notes
ipal-upgrade, PROGRAMISTA §6 item 51 and security.md point at 1.14.2 instead of
"after 1.14.1".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 21:34:09 +01:00

13 KiB
Raw Blame History

name, description
name description
ipal-upgrade Upgrades an existing project to the latest @intecion/ipal-kit and replaces hand-written code that the plugin now provides — proxy, route handlers, consent wrapper, language switcher, rich text parser, form logic, noindex, redirects, env validation, privacy link label, 404 page, CTA field zoo. Use when the user asks to update ipal-kit, migrate an older project, or clean up duplicated logic in a project.

ipal-upgrade

What changed in the version: node_modules/@intecion/ipal-kit/docs/CHANGELOG.md (the "Requires project changes" sections — do all of them). List of changes: …/docs/dev/PROGRAMISTA.md §6. Rule: when the plugin provides something the project has written by hand — remove the local version.

1. Update the package

pnpm add @intecion/ipal-kit@latest
pnpm payload generate:importmap   # new admin panel components from the plugin (e.g. RowLabel)
rm -rf .next

Copy the skills again (AGENT.md §14) — they may have changed. Postgres with migrations: new plugin fields (e.g. privacyLinkLabel) → pnpm payload migrate:create.

1a. AGENT.md §0b set

After the update, a full ipal-audit shows a "missing: …" section — the missing items of the MANDATORY SET (GEO: llms-full, Markdown, MCP; R2; Turnstile through getTurnstileConfig…). Wire each one according to PROGRAMISTA §2 — it is part of the update, not an extra. Skip one only with a client decision in AGENTS.md (ipal-audit-skip:).

1.8.x → 1.9.0 (PROGRAMISTA §6, items 17–21): twoFactor.plugin required; getTurnstileConfig instead of turnstileSiteKey (with both keys set the token is required — check that every form has the widget); clientIp(await headers()) in the form action + IPAL_IP_HEADER in the production env; buildR2Storage wired.

→ 1.9.2 (PROGRAMISTA §6, items 28–33) — import instead of code, start with item 28 (security): a custom FormRenderer passed the Emails tab (company addresses) to the HTML → a block with <RenderForm> + formClasses.ts, remove the renderer. Then: layout → SiteProviders, page and 404 → createPageRoute / createNotFoundPage, GEO routes → re-exports from lib/content, src/fields/section*.ts and lib/navigation.ts → buildSection*Field, resolveNav, resolveLink. Check every item in the browser (form: submission + email; page: 200, 404, metadata). Postgres: migrate:create (new form field types and texts in Notifications).

→ 1.11.0 (PROGRAMISTA §6, items 34–37): remove the workarounds — a copy of publicForm (→ RenderForm values / prepareBuilderForm), manual remotePatterns/dangerouslyAllowLocalIP (→ buildImagesConfig()), conditional storage in ipalEnvRules, a custom product JSON-LD graph (→ pageJsonLd.entries + buildProductJsonLd), a custom RenderBlocks for h1 (→ isFirst). Links to posts: buildLinkField({ relationTo: [...] }) with a data migration.

→ 1.11.1 (PROGRAMISTA §6, items 38–45): remove the workarounds (WORKAROUND ipal-kit comments) — the NEXT_RUNTIME condition around the revalidatePath injected into buildRevalidateHook (a global's own afterChange hook keeps it — ipal-nav), the form focus guard, a custom theme (→ ThemeScript/ThemeSwitcher), a custom table of contents (→ extractHeadings + TableOfContents + headingIds), catching notFound for a redirect (→ onMissing: 'redirectHome'), background colour only for JPEG in <Media>, a custom type instead of CmsLink['appearance'] (→ per-shape types from generate:types: CmsLink, CmsLinkPlain, CmsLinkNoLabel, CmsLinkPlainNoLabel; style: LinkAppearance). Cookie banner: buttons.save → buttons.savePreferences — in migrate:create choose rename for the column to keep the texts.

→ 1.12.3 (PROGRAMISTA §6, item 46): Postgres/SQLite: migrate:create (new Cookie banner group → detailLabels, only new columns — no rename). A custom cookie settings window or a cookie list added to the banner → <CookieBanner settings="detailed"> and remove the copy. With detailed: Cookie banner → Cookie list filled in (scan, ipal-consent-check) and Detail labels in every language.

→ 1.13.0 (PROGRAMISTA §6, item 47; CHANGELOG "What projects must update" — do all 7, in order):

  1. Project without access (no roles field): every logged-in account can now use the plugin's admin and editor features (Site integrations, settings globals, test e-mail, stats, consent records, forms, form submissions); before, nobody could through the API. Check who can log in (grep -rn "auth:" src/collections, open sign-up, customer accounts). Untrusted accounts → add access (roles), or narrow with globalOverrides, forms.formOverrides / forms.formSubmissionOverrides, consentLog.collectionOverrides, stats.collectionOverrides. Verify: log in as a non-staff account → GET /api/globals/site-integrations is 403.
  2. Project with access: plain user accounts can no longer edit Site settings, Cookie banner, Notifications or forms, or create/delete users. List staff accounts in the panel (Users → Roles) and give them editor / admin, or loosen with globalOverrides, forms.formOverrides.access, access.authAccess. Verify: an editor saves Site settings.
  3. Postgres/SQLite: pnpm payload migrate:create → migrate (Site settings → Search engines: search_verification_*, ai_crawlers_policy, the ai_crawlers_rules table, localized llms_intro). With enabled: false the migration now keeps (or restores) the plugin's tables — check it has no DROP TABLE. MongoDB: nothing.
  4. pnpm payload generate:importmap, pnpm ipal:skills, rm -rf .next.
  5. Behaviour to check (grep the project, fix what applies): getSettings / getSiteShell read at depth: 1 (code that reads a relation of a relation → createContentHelpers({ settingsDepth: 2 })); sitemap() throws at runtime instead of returning [] (sitemapRoute answers 503); a twoFactor.collectionSlug other than admin.user stops startup (allowCollectionMismatch: true); requests without a client IP share one limited bucket (proxy hides the IP → IPAL_IP_HEADER, or setUnknownIpFactor); RenderRichText turns unsafe link URLs into # (safeLinks).
  6. Review the new options with the user (AGENT.md §7.1): consentMode: 'basic', revalidatePath, turnstileHostnames, Site settings → Search engines (verification codes, or keep DNS verification), app/robots.ts → export { getRobots as default } + force-dynamic, createSearchRoute({ …, isPathVisible }), access.firstUserAdmin.
  7. Remove the workarounds: a plugin after ipalKit that adds afterChange or access to the plugin globals → ipalKit({ revalidatePath }) / globalOverrides; a hand-written global revalidation hook → buildGlobalRevalidateHook({ revalidatePath }); consentFieldName passed only because the option was ignored → forms.consentFieldName works now; your own seed guard / upsert code → @intecion/ipal-kit/seed (createSeeder).

Every upgrade — Next.js 16.4.1 or later (AGENT.md §4 item 11): pnpm ls next sharp; below 16.4.1 → pnpm add next@^16.4.1 eslint-config-next@^16.4.1 sharp@^0.35.5, rm -rf .next, build, redeploy on Coolify (a new image ships the fixed next and sharp). Check: pnpm dev prints no security-upgrade warning.

Every upgrade — dependency advisories (AGENT.md §4 item 12): pnpm audit --prod; with payload 3.90.x add the dompurify and undici overrides, pnpm install, audit again. Check: no high or critical.

→ 1.14.0 (PROGRAMISTA §6, items 48–49; CHANGELOG "What projects must update" — do all 8, in order):

  1. pnpm payload generate:importmap — @intecion/ipal-kit/admin#FaviconCheck (hint under Site settings → Site icon) and the RowLabel entries are injected into every project; then pnpm ipal:skills, rm -rf .next. Check: pick a 32×32 PNG as the site icon → a warning appears under the field; saving still works.
  2. Node.js 20.9 or later (the plugin's nodemailer 10 needs it) — check the Coolify build image and .nvmrc / engines. Remove nodemailer and @types/nodemailer from the project's own package.json if someone added them (the plugin's copy is the one mailAdapter uses). Check: Site integrations → E-mail sending → send a test e-mail over SMTP (and over Microsoft Graph when the project uses it).
  3. Next.js 16.4.1 or later — the "Every upgrade — Next.js" step above (next@^16.4.3, sharp@^0.35.5).
  4. Dependency advisories — the "Every upgrade — dependency advisories" step above (dompurify / undici overrides on payload 3.90.x). Check: pnpm audit --prod → no high or critical.
  5. Cookie list kept by hand → offer cookieScanner: true (+ crawl: true with IPAL_COOKIE_SCAN_URL, IPAL_COOKIE_SCAN_TOKEN and the site in the service's IPAL_CRAWLER_SITES, cookie-scanner.md); an own image modal → lightbox: true + <SiteProviders lightbox> (PROGRAMISTA item 48). Turning either on → Postgres/SQLite migrate:create → migrate. Without them: no schema change.
  6. Admin languages: English and Polish by default when the project sets no i18n.supportedLanguages. Ask the client; English only → i18n: { supportedLanguages: { en } }. Own admin texts → i18n.translations.<lang>.ipal.
  7. Frontend texts: validator messages are full sentences and pl locales get Polish fallbacks — grep the project's tests and code for the old strings ('required', 'invalid email') and update them.
  8. Sidebar: roles (users) and Cookie banner → Consent version moved to the sidebar — update editor instructions. Nothing else to change: the statistics tab title, the cookie scanner's integration names and the maintenance notice's close button follow the language by themselves.

→ 1.14.2 (PROGRAMISTA §6, item 51; 2FA setup loop; security.md) — required with 2FA on:

  1. pnpm payload generate:importmap — the plugin swaps @clocklimited/payload-2fa/rsc#TOTPProvider for @intecion/ipal-kit/admin#TotpRedirectProvider; commit importMap.js, rm -rf .next, redeploy on Coolify. Check: log in as a new admin (or a throwaway one) → /admin/setup-totp?back=%2Fadmin with the QR code, no reloading; after the code → back on /admin. A project that wrote its own x-pathname proxy rule for /admin as a workaround can drop it.

→ 1.14.1 (PROGRAMISTA §6, item 50; X-Powered-By, CSP; security.md) — nothing required, recommended in this order:

  1. Hide X-Powered-By — next.config.ts: export default withPayload(withSecurityConfig(nextConfig)) (import withSecurityConfig from @intecion/ipal-kit); remove a hand-written poweredByHeader: false or a header override if the project had one. Check: curl -sI localhost:3000/pl | grep -i x-powered-by → nothing (also on /admin and /api/health).
  2. CSP, report-only first — no CSP yet, or a hand-written one → buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', r2Url: process.env.R2_PUBLIC_URL, <flags for what the site loads> } }), the admin rule { source: '/admin/:path*', headers: buildAdminCspHeaders({ mode: 'report-only', reportUri: '/api/csp-report' }) } after the site-wide one, and src/app/api/csp-report/route.ts = export const POST = createCspReportRoute(). Flags: what the panel's Site integrations and the code load (analytics, metaPixel, linkedIn, tiktok, clarity, turnstile, youtube, googleMaps); anything else → extra. Check: curl -sI localhost:3000/pl | grep -iE 'content-security-policy-report-only|reporting-endpoints'; the main pages and /admin in a browser, accept the cookie banner → no [Report Only] lines in the console. Deploy.
  3. Enforce later — after a few days of clean [csp] lines in the Coolify logs: mode: 'enforce' in both places, redeploy, check the pages again. Record the date in AGENTS.md → "Project decisions".

2. Inventory (no code changes)

For every item in the PROGRAMISTA §6 table show evidence (grep / file) of whether it applies to the project. Run the ipal-audit skill (--quick) and attach the result. Result: a prioritised to-do list — carry it out right away. Stop only before an irreversible change (data migration with content → ipal-migrate-fields, changing published slugs).

3. Item by item

One item = one change = one commit:

  1. read the docs file it points to,
  2. replace the local code with the plugin function, remove the old code (do not keep both),
  3. pnpm build — it passes before you take the next item.

Items that rename fields in the database (e.g. the ctaLabel → links refactor) need a data migration before the old fields are removed — ask the user whether the project already has content.

4. Finish

A full ipal-audit with no errors + a list of things to check in the admin panel.