IAPL rename: docs, agent guide, skills, reference site and starter on the new names; changelog draft

- docs, AGENT.md, the 16 skills, PROGRAMISTA and README use the preferred names (scripted, same list of forms);
  past CHANGELOG entries and the proposals in docs/dev are not rewritten
- AGENT.md: 'Names: IAPL and ipal-kit' — old name, new name, state in 1.x; what is not renamed; storageNames
- iapl-upgrade '→ 1.17.0', PROGRAMISTA §6 item 72, CHANGELOG 1.17.0 (draft): nothing required
- env.md, doctor.md (legacy-names, storage-names), stats.md, security.md, project-starter.md, iapl-reference, iapl-setup
- skill scripts read ipal-audit-skip and IPAL_IP_HEADER too; audit rule ids stay what they were
- reference site: iapl(), iapl-doctor.json, iapl-* skills, storageNames: 'iapl'; INDEX.md regenerated

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 17:36:09 +01:00
co-authored by Claude Fable 5.2
parent 425fac14fb
commit b91984fbcd
149 changed files with 1930 additions and 1747 deletions
+211 -168
View File
@@ -1,7 +1,7 @@
# AGENT.md — rules for AI (Payload 3 + Next 16 + @intecion/ipal-kit)
# AGENT.md — rules for AI (Payload 3 + Next 16 + IAPL, package `@intecion/ipal-kit`)
> **Who this is for:** an AI agent (Antigravity, Claude Code, Cursor) working in a client
> project built on ipal-kit. **Read all of it before your first change.** The rules are
> project built on IAPL (called ipal-kit before 1.17.0; names: "Names: IAPL and ipal-kit" below). **Read all of it before your first change.** The rules are
> hard, with no workarounds. API details for each module: `docs/<module>.md` (map in
> §12). Installation, deployment, migration and Gitea are covered in the document for humans:
> [the developer guide (PROGRAMISTA.md)](../dev/PROGRAMISTA.md).
@@ -9,19 +9,62 @@
> **In the project:**
> - a short `AGENTS.md` in the root (template in §13) that points to this file in
> `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` — do not copy the rules, a copy goes stale;
> (`pnpm exec ipal-skills` adds/refreshes the `ipal-kit:start…end` block with this pointer);
> (`pnpm exec iapl-skills` adds/refreshes the `iapl:start…end` block with this pointer);
> - skills in `.agents/skills/` (§14) — copied from the package with one command, refreshed
> after every ipal-kit update;
> after every IAPL update;
> - **the full plugin map** — every option, env variable, route, layout component, import
> map entry, hook, collection, global and every export: the **`ipal-reference`** skill
> (`.agents/skills/ipal-reference/SKILL.md` + `resources/api.md`). Before you write
> map entry, hook, collection, global and every export: the **`iapl-reference`** skill
> (`.agents/skills/iapl-reference/SKILL.md` + `resources/api.md`). Before you write
> anything "from scratch", check there.
---
## Names: IAPL and ipal-kit
The plugin is called **IAPL** (Intecion Advanced Payload Library) since 1.17.0. Before that it was called
ipal-kit. The **package is still `@intecion/ipal-kit`**: install lines and import paths did not change.
**Rule for an existing project: do not rename anything on your own.** Every old name works through 1.x. A
project moves to the new names only when its owner asks: the `iapl-upgrade` skill, "→ 1.17.0". In new code
use the name in the middle column. `pnpm exec iapl-doctor` lists what is still old (`legacy-names`, info).
| Before 1.17.0 | Now | In 1.x |
|---|---|---|
| `ipalKit()`, `IpalOptions` | `iapl()`, `IaplOptions` | both work, same function and type |
| `ipalEnvRules`, `IpalEnvFeatures` | `iaplEnvRules`, `IaplEnvFeatures` | both work |
| `ipalT`, `ipalVar`, `IPAL_TOKENS`, `IPAL_BREAKPOINTS`, `IpalTokenName`, `IpalGlobalSlug` | `iaplT`, `iaplVar`, `IAPL_TOKENS`, `IAPL_BREAKPOINTS`, `IaplTokenName`, `IaplGlobalSlug` | both work |
| commands `ipal-kit`, `ipal-doctor`, `ipal-skills`, `ipal-tokens`, `ipal-blocks` | `iapl`, `iapl-doctor`, `iapl-skills`, `iapl-tokens`, `iapl-blocks` | both installed, same programs |
| env `IPAL_IP_HEADER`, `IPAL_NOINDEX`, `IPAL_COOKIE_SCAN_URL`, `IPAL_COOKIE_SCAN_TOKEN`, `IPAL_SEED_ALLOW_FULL`, `IPAL_SEED_ALLOW_PROD_UPDATE`, `IPAL_DOCTOR_TOKEN`, `IPAL_DOCTOR_IMPORT_MAP` (crawler service: `IPAL_CRAWLER_SITES`) | the same with `IAPL_` | `IAPL_…` is read first, `IPAL_…` when it is missing or empty; set one, not both |
| `ipal-doctor.json` | `iapl-doctor.json` | whichever exists is read and written; never keep both |
| `ipal-audit-skip:` lines in `AGENTS.md` | `iapl-audit-skip:` | both read |
| pointer block `<!-- ipal-kit:start -->` … `<!-- ipal-kit:end -->` | `<!-- iapl:start -->` … `<!-- iapl:end -->` | both recognised; `iapl-skills` rewrites the old one in place |
| skills `ipal-<name>` (16) | `iapl-<name>` | `iapl-skills` installs the new folders and removes the 16 old ones by name; a project's own `ipal-…` skill is left alone |
| log prefix `[ipal]` | `[iapl]` | changed (a log filter on `[ipal]` needs the new prefix) |
**Not renamed — write them exactly like this, in every project:**
| Name | Why |
|---|---|
| package `@intecion/ipal-kit` and every import path (`@intecion/ipal-kit/client`, `…/tokens.css`), import-map paths `@intecion/ipal-kit/admin#…`, `node_modules/@intecion/ipal-kit/docs/…` | the package name changes in 2.0 |
| routes `/api/ipal/…` | proxies, cached pages and the crawler call them |
| CSS tokens `--ipal-*`, hooks `data-ipal="…"` | projects' own CSS uses them |
| `config.custom.ipal`, `custom.ipalAccounts`, `req.context` flags (`ipalSeed`, `ipalSkipIndexNow`, `ipalSkipAutoFill`, …), `ipalTotpView` server props, translation namespace `ipal` | projects' hooks and overrides read them |
| header `X-Ipal-Cookie-Crawler` | WAF rules |
**Two stored names have a second spelling, chosen once per site** (`iapl({ storageNames })`, docs/stats.md,
docs/security.md):
| | Site made before 1.17.0 (default, `storageNames: 'ipal'`) | Site made since (`storageNames: 'iapl'`, set by `iapl create`) |
|---|---|---|
| visitor cookie of the built-in statistics | `ipal_vid` | `iapl_vid` — and the layout passes `visitorCookie={IAPL_VISITOR_COOKIE}` to `<PageStats>` / `<SiteProviders stats={{ … }}>` |
| 2FA attempt counter in `payload-kv` | `ipal:2fa-verify:<collection>:<id>` | `iapl:2fa-verify:<collection>:<id>` |
Never switch `storageNames` on a live site: visitors' histories and running 2FA counts start again, and the
cookie list must be approved again. `iapl-doctor` (`storage-names`) reports a layout and a config that disagree.
## Main rule — the plugin helps, never limits
ipal-kit is a plugin: it helps the project and never limits it. Every module can be
IAPL is a plugin: it helps the project and never limits it. Every module can be
turned off on its own; every default (access rules, fields, hooks, labels, routes,
collections, globals) can be overridden and **the project config wins**; safe
defaults have an option to loosen/extend them; the plugin exports building blocks
@@ -30,27 +73,27 @@ or data shape where an option or an exported building block is enough.
**In practice:** before you write something from scratch or start fighting the plugin — find
the option or the exported builder (module docs §12, types in `dist/**/*.d.ts`). It is missing →
**plugin gap**: report it to the owner and wait for their decision (see "ipal-kit first" below), never
**plugin gap**: report it to the owner and wait for their decision (see "IAPL first" below), never
patch `node_modules` or fork the package.
**Docs language:** all ipal-kit docs, this guide and the skills are written in English.
**Docs language:** all IAPL docs, this guide and the skills are written in English.
Write new rules, AGENTS.md entries and plugin-gap reports in English.
> **VERY IMPORTANT — seeding after launch.** Once a site is live, **never run a full seed again**: the owner's
> edits on the live site must survive. Every later change targets **named records only** — specific pages,
> globals, forms or fields — listed in the seed (`only: [...]` / `SEED_ONLY="pages:kontakt,global:header"`).
> Never re-seed everything, not even in create-only mode, without the owner's explicit OK. `createSeeder`
> refuses a run with no record list against a production or non-local database unless `IPAL_SEED_ALLOW_FULL=1`
> refuses a run with no record list against a production or non-local database unless `IAPL_SEED_ALLOW_FULL=1`
> (set it only after that OK).
**Database names** (MongoDB and Postgres): the site's domain **with the dots removed**, plus `_prod` or `_dev` —
`intecion.com` → `intecioncom_prod` / `intecioncom_dev`, `architektimprez.pl` → `architektimprezpl_prod` /
`architektimprezpl_dev`. The name is the path of `DATABASE_URI`: `mongodb://…@mongo:27017/intecioncom_prod?authSource=admin`,
`postgres://…@db:5432/intecioncom_prod`. You derive the names from the domain and confirm them with the owner (ipal-setup
stage 0). `ipalEnvRules({ databaseName: true })` warns when they do not match (deployment.md §4.2a).
`postgres://…@db:5432/intecioncom_prod`. You derive the names from the domain and confirm them with the owner (iapl-setup
stage 0). `iaplEnvRules({ databaseName: true })` warns when they do not match (deployment.md §4.2a).
**`PAYLOAD_SECRET`:** at least 32 random characters, different per environment (`ipal-kit create` writes 64). In
production `ipalEnvRules` refuses a shorter one (`secretMinLength`, default 32, `0` = off). Never change it on a live
**`PAYLOAD_SECRET`:** at least 32 random characters, different per environment (`iapl create` writes 64). In
production `iaplEnvRules` refuses a shorter one (`secretMinLength`, default 32, `0` = off). Never change it on a live
site without the owner's OK: every login session and every stored API key depends on it (deployment.md §1).
**Seeding on production** (details: `node_modules/@intecion/ipal-kit/docs/seeding.md`). Write seeds with
@@ -61,16 +104,16 @@ site without the owner's OK: every login session and every stored API key depend
- Never delete; never seed users, passwords or secrets; globals: fill only empty fields; no media uploads.
- Every locale written separately with `fallbackLocale: false`; `context: { disableRevalidate: true, ipalSkipIndexNow: true }`.
- On production: dry run first (`SEED_DRY_RUN=1`), back up the database (Coolify **Backup now**), then the real run.
- `SEED_UPDATE=1` on production / a non-local database only with `IPAL_SEED_ALLOW_PROD_UPDATE=1`, after a backup;
- `SEED_UPDATE=1` on production / a non-local database only with `IAPL_SEED_ALLOW_PROD_UPDATE=1`, after a backup;
records an editor changed are always skipped and reported (`skip (edited)`) — never use `SEED_FORCE=1` there.
- After launch: named records only (`only` / `SEED_ONLY`); a full run of a live database is refused without `IPAL_SEED_ALLOW_FULL=1`.
- Schema and one-off data fixes → Payload migrations; field renames with content → **ipal-migrate-fields**; content → seeds.
- After launch: named records only (`only` / `SEED_ONLY`); a full run of a live database is refused without `IAPL_SEED_ALLOW_FULL=1`.
- Schema and one-off data fixes → Payload migrations; field renames with content → **iapl-migrate-fields**; content → seeds.
## Ask before you build — architecture questions
Before you set up a site (or a new part of one), **ask the owner these questions and wait for the answers**.
They decide the architecture; a wrong guess means rework. Ask them as **one list**, once, at the start —
the ready-to-send list is in **ipal-setup** stage 0 (ipal-site phase 0 uses the same list).
the ready-to-send list is in **iapl-setup** stage 0 (iapl-site phase 0 uses the same list).
| Topic | What you need to know |
|---|---|
@@ -84,10 +127,10 @@ the ready-to-send list is in **ipal-setup** stage 0 (ipal-site phase 0 uses the
| Admin | 2FA, white-label (client brand in the panel), agency credit |
| Hosting | Coolify, the production domain(s), who adds the DNS records (deployment.md §6) |
- **A new site starts with `ipal-kit create`** (docs/project-starter.md): `pnpm --config.auto-install-peers=false dlx
- **A new site starts with `iapl create`** (docs/project-starter.md): `pnpm --config.auto-install-peers=false dlx
@intecion/ipal-kit@<version> create <domain>` asks exactly these questions (or reads them from `--answers file.json`),
generates the site from the reference site, writes the answers into `AGENTS.md` and makes the first commit. Ask the owner
first, then pass the answers — the command never fills a gap. The manual path (`ipal-setup` stages 1–11) is for an
first, then pass the answers — the command never fills a gap. The manual path (`iapl-setup` stages 1–11) is for an
existing project or what the command does not cover yet: **single-language sites, a default language other than `pl`**, sites
without `en`, URLs without a prefix, Postgres — the command stops with a message pointing here.
- Write every answer into the project's `AGENTS.md` → **"Project decisions"** (one line per topic).
@@ -95,28 +138,28 @@ the ready-to-send list is in **ipal-setup** stage 0 (ipal-site phase 0 uses the
(Only *content* gaps — company data, texts, IDs — may wait: use `[TO FILL: …]` in the panel, §0a.)
- An answer that conflicts with these rules → say so straight away and propose a compliant option.
## ipal-kit first — hard rule
## IAPL first — hard rule
- **Anything the plugin covers, you build with the plugin's feature.** Always. Look it up first: the
**ipal-reference** skill, the module docs (§12), the types in `dist/**/*.d.ts`.
**iapl-reference** skill, the module docs (§12), the types in `dist/**/*.d.ts`.
- The only exceptions: the plugin's feature **does not work**, or it **is not enough** for this project.
- Even then: **report the gap to the owner first** with the **ipal-plugin-gap** skill and **do nothing on
- Even then: **report the gap to the owner first** with the **iapl-plugin-gap** skill and **do nothing on
your own** for that part until the owner decides (wait for a plugin fix / an approved option / an approved,
marked workaround). Work on unrelated parts may go on.
- **No hand-built replacements and no silent workarounds.** A workaround exists only after the owner approved
it, is marked `// WORKAROUND ipal-kit <version>: docs/plugin-requests/<file>` and is recorded in
it, is marked `// WORKAROUND IAPL <version>: docs/plugin-requests/<file>` and is recorded in
"Project decisions".
## Reference site — copy the pattern, not from memory
Every convention in this file is implemented in the **reference site**: one complete client site on ipal-kit
Every convention in this file is implemented in the **reference site**: one complete client site on IAPL
("Example Studio", made up), kept current with each release and built, seeded and smoke-tested in the plugin's CI.
Before you write a file the plugin expects you to wire (payload.config, layout, catch-all page, `lib/content.ts`,
proxy, SEO/GEO routes, forms, seeds, `AGENTS.md`, `DESIGN.md`, deploy notes), open
`node_modules/@intecion/ipal-kit/docs/agent/reference-site/INDEX.md`, find the matching file and copy its pattern —
short wiring files are in the index in full, longer ones are linked at the tag of your plugin version. Change only the
project's content (names, texts, blocks the site map needs), never the pattern. The index and this file disagree →
report it with **ipal-plugin-gap**: it is a plugin bug.
report it with **iapl-plugin-gap**: it is a plugin bug.
## Code rules
@@ -126,7 +169,7 @@ Short version of §8 — every skill follows it.
- **No duplicated logic** — extract it once; reuse the plugin's exports instead of rewriting them.
- **Typed, no `any`** (no `@ts-ignore`; unknown shape → `unknown` + a type guard).
- **Texts in i18n, never literals** — every visible text comes from the panel / localized fields (§2).
- **Tests or checks for new behaviour** — a unit test, an `ipal-audit` / `ipal-seo-check` result, or a
- **Tests or checks for new behaviour** — a unit test, an `iapl-audit` / `iapl-seo-check` result, or a
documented manual check (§8a).
```tsx
@@ -141,14 +184,14 @@ export function Offer({ header, items }: OfferBlockProps) { return <Section head
## 0. COMPASS (if you remember only this)
0. **Ask first.** Architecture questions before you build ("Ask before you build" above) — never guess.
1. **ipal-kit is mandatory.** A feature the plugin has goes through the plugin.
1. **IAPL is mandatory.** A feature the plugin has goes through the plugin.
Missing or broken → report it (plugin gap, §1.3) and wait for the owner's decision — no silent patch.
2. **Nothing hardcoded.** Text, image, link, file, company data → admin panel. Domains,
keys → `.env`. Also in an `||` fallback and in `catch`.
3. **Next 16 = `proxy.ts`.** NEVER `middleware.ts`.
4. **No explicit `<head>`, with ISR and `generateStaticParams`** — otherwise metadata
lands in `<body>` and SEO breaks.
5. **Minimum collections.** ipalKit adds Users, company data/navigation are globals,
5. **Minimum collections.** iapl adds Users, company data/navigation are globals,
FAQ/hero are blocks.
6. **A section = a composition of UI primitives.** `buildLinksField()` + `<CMSLink>`, upload +
`<Media>`, `<Section>` + `<SectionHeader>`. No `ctaLabel`/`pdfUrl` fields.
@@ -163,18 +206,18 @@ export function Offer({ header, items }: OfferBlockProps) { return <Section head
9. **One source of truth** — `i18n.config.ts`, `lib/content.ts`, never copies.
10. **"Done" only after** a local `pnpm build` + the checks from §11.
11. **Every site has the MANDATORY SET from §0b** — SEO, GEO (llms.txt, Markdown,
MCP), R2, Turnstile, forms from the builder. `ipal-audit` checks that it is
wired, `ipal-seo-check` — that it works. There is no "I'll do it later".
MCP), R2, Turnstile, forms from the builder. `iapl-audit` checks that it is
wired, `iapl-seo-check` — that it works. There is no "I'll do it later".
**How to add…** (details in the skill from §14)
| What | How |
|---|---|
| a page | in the panel: Pages + blocks, no code (§5.1) |
| a section (block) | a library block first: `blockOptions` → `libraryBlocks` in `src/blocks/configs.ts`, `createBlockRegistry(content, { Image, Link, sendForm })` in `blocks/registry.ts` (docs/block-library.md). None fits → `src/blocks/<Name>/config.ts` + `Component.tsx`, `extra` in the registry, `pageBlocks` → `pnpm generate:types` (+ `pnpm payload generate:importmap` with `rowLabel`) — **ipal-block** |
| a standard page (home, about, services, contact, legal, 404…) | `pageTemplates` from `@intecion/ipal-kit/templates` in the content seed (after launch only with `SEED_ONLY`) — **ipal-site** phase 6 |
| a form | the Forms panel (builder) from the seed `scripts/seed-form-*.ts`, a block with `<RenderForm>`, sending via `sendForm` — **ipal-form** |
| a language | `i18n.config.ts` (the only place) + a Postgres migration + content in the new language — **ipal-locale-add** |
| a collection with URLs | `content: { collections: [...] }` in `ipalKit` and `createContentHelpers` (§5.4) — **ipal-collection** |
| a section (block) | a library block first: `blockOptions` → `libraryBlocks` in `src/blocks/configs.ts`, `createBlockRegistry(content, { Image, Link, sendForm })` in `blocks/registry.ts` (docs/block-library.md). None fits → `src/blocks/<Name>/config.ts` + `Component.tsx`, `extra` in the registry, `pageBlocks` → `pnpm generate:types` (+ `pnpm payload generate:importmap` with `rowLabel`) — **iapl-block** |
| a standard page (home, about, services, contact, legal, 404…) | `pageTemplates` from `@intecion/ipal-kit/templates` in the content seed (after launch only with `SEED_ONLY`) — **iapl-site** phase 6 |
| a form | the Forms panel (builder) from the seed `scripts/seed-form-*.ts`, a block with `<RenderForm>`, sending via `sendForm` — **iapl-form** |
| a language | `i18n.config.ts` (the only place) + a Postgres migration + content in the new language — **iapl-locale-add** |
| a collection with URLs | `content: { collections: [...] }` in `iapl` and `createContentHelpers` (§5.4) — **iapl-collection** |
---
@@ -183,9 +226,9 @@ export function Offer({ header, items }: OfferBlockProps) { return <Section head
These are not options. Every project has **all** the items below, wired through the
plugin. Data is missing (domain, keys, bucket)? Wire the code anyway — it works once
the values are entered in `.env` / the panel, and you list what is missing in the report. You skip an item
**only** on a client decision recorded in `AGENTS.md` (the `ipal-audit-skip:` line, below).
**only** on a client decision recorded in `AGENTS.md` (the `iapl-audit-skip:` line, below).
The "Check" column: **A** = `ipal-audit` (code), **S** = `ipal-seo-check` (running
The "Check" column: **A** = `iapl-audit` (code), **S** = `iapl-seo-check` (running
site), **P** = a test in the panel. Full code: PROGRAMISTA.md §2.
| # | Area | What must exist (file) | Plugin API | Check |
@@ -198,18 +241,18 @@ site), **P** = a test in the panel. Full code: PROGRAMISTA.md §2.
| 5 | **GEO** — llms | `src/app/llms.txt/route.ts` (`llmsRoute`) and `src/app/llms-full.txt/route.ts` (`llmsFullRoute`) from `lib/content`; the `buildSummaryField()` field in Pages, `summaryField: 'aiSummary'` in `createContentHelpers` | `llmsRoute`, `llmsFullRoute`, `buildSummaryField` | A, S |
| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` (single-language: `src/app/md/[[...slug]]/route.ts`) = `export { markdownRoute as GET } from '@/lib/content'`; `createContentHelpers({ markdownAlternate: true })` (link in `<head>`); `createProxy(…, { NextResponse, markdown: true })` (without it `/md/…` gets redirected to a language) | `markdownRoute`, `markdownAlternate`, `createProxy({ markdown })` | A, S |
| 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` = `export { mcpGET as GET, mcpPOST as POST } from '@/lib/content'` (public — AI browses the site: `get_site_info`, `list_pages`, `search_content`, `get_page`); name: `createContentHelpers({ mcp: { serverName } })` | `mcpGET`, `mcpPOST` | A, S |
| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IPAL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S |
| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `iapl({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IAPL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S |
| 9 | **Media / R2 / speed** | `Media` with `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + field; **always** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` in `.env.example`; `<MediaPreconnect/>`; `images: buildImagesConfig()` and `buildUploadSecurityHeaders()` in `next.config.ts`; the project's `<Media>` via `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S |
| 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `<RenderForm>` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `ipalKit`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P |
| 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `<RenderForm>` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `iapl`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P |
| 11 | **Turnstile** | `<SiteProviders>` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P |
| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `ipalKit({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `<SiteProviders logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → *Approve cookies* → **Approve and add**; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookies → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `ipal-consent-check` |
| 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `withPayload(withSecurityConfig(nextConfig))` (no `X-Powered-By`); CSP: `buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', … } })` + `buildAdminCspHeaders` on `/admin/:path*` + `src/app/api/csp-report/route.ts` (`createCspReportRoute`) → read the reports → `mode: 'enforce'`; `twoFactor: { issuer, plugin: payloadTotp }` + `generate:importmap` (`TotpRedirectProvider`, `SafeTotpView`; check: a new admin lands on `/admin/setup-totp?back=%2Fadmin` with the QR, no reloading; a login with the password only gets `403` from `/api/globals/site-integrations` and `/api/form-submissions` — security.md "What the second factor covers"); own endpoints: `secondFactorPassed(req)` / `userMeetsRole(req, role)`; **an account without 2FA can only set it up** (`twoFactor.requireSetup`, default: nothing else answers, 72 h from creation or an admin's reset, then blocked until an admin chooses "Reopen setup" on the account) — so set 2FA up right after creating an account; `ipal-doctor --url` must report 0 accounts without 2FA; Postgres/SQLite: migration for `totpSetupFrom`; `IPAL_IP_HEADER` in production | security.md, forms.md | A |
| 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))`; staging with `IPAL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `ipalEnvRules` | A |
| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `iapl({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `<SiteProviders logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → *Approve cookies* → **Approve and add**; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookies → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `iapl-consent-check` |
| 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `withPayload(withSecurityConfig(nextConfig))` (no `X-Powered-By`); CSP: `buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', … } })` + `buildAdminCspHeaders` on `/admin/:path*` + `src/app/api/csp-report/route.ts` (`createCspReportRoute`) → read the reports → `mode: 'enforce'`; `twoFactor: { issuer, plugin: payloadTotp }` + `generate:importmap` (`TotpRedirectProvider`, `SafeTotpView`; check: a new admin lands on `/admin/setup-totp?back=%2Fadmin` with the QR, no reloading; a login with the password only gets `403` from `/api/globals/site-integrations` and `/api/form-submissions` — security.md "What the second factor covers"); own endpoints: `secondFactorPassed(req)` / `userMeetsRole(req, role)`; **an account without 2FA can only set it up** (`twoFactor.requireSetup`, default: nothing else answers, 72 h from creation or an admin's reset, then blocked until an admin chooses "Reopen setup" on the account) — so set 2FA up right after creating an account; `iapl-doctor --url` must report 0 accounts without 2FA; Postgres/SQLite: migration for `totpSetupFrom`; `IAPL_IP_HEADER` in production | security.md, forms.md | A |
| 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(iaplEnvRules({ storage: true, ipHeader: true }))`; staging with `IAPL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `iaplEnvRules` | A |
| 15 | System pages | Site settings → System pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P |
| 16 | **Nothing hardcoded** | every text, link, image, file, company data from the panel; domains and keys from `.env` (§2) | — | A, P |
| 17 | **Content** | one h1, the answer at the start of each section, facts, internal links, FAQ from real questions, `aiSummary`, sameAs, consistent company data (§0c) | — | S, P |
| 18 | **Scaling** | `fluid.css` / `fluid-wide.css`, hero on `--ipal-hero-min-h`, the screen list in §6.11a (including 1366×768) | — | A, browser |
| 19 | **Design tokens** | `DESIGN.md` + `src/design/tokens.ts` → `pnpm exec ipal-tokens` → `src/design/tokens.css`; `styles.css` imports `fluid-wide.css`, `tokens.css`, `tailwind.css`, the brand file (§6.11); fonts in `--font-family-body` / `--font-family-heading` | `defineTokens`, `ipal-tokens` | A (`ipal-tokens --check`), browser (both themes) |
| 19 | **Design tokens** | `DESIGN.md` + `src/design/tokens.ts` → `pnpm exec iapl-tokens` → `src/design/tokens.css`; `styles.css` imports `fluid-wide.css`, `tokens.css`, `tailwind.css`, the brand file (§6.11); fonts in `--font-family-body` / `--font-family-heading` | `defineTokens`, `iapl-tokens` | A (`iapl-tokens --check`), browser (both themes) |
**Turnstile works by itself:** both keys in the panel (or env) → the widget shows, and
`submitForm` **requires** a token; no keys → no widget, the form works.
@@ -219,7 +262,7 @@ Do not make the provider or the widget conditional in code — always wire them.
(dev). Always wire the code, so production does not save media to the container disk
(they disappear on redeploy).
### Forbidden substitutes (ERROR in `ipal-audit`)
### Forbidden substitutes (ERROR in `iapl-audit`)
| Instead of the plugin | Why not | Use |
|---|---|---|
@@ -239,7 +282,7 @@ Do not make the provider or the widget conditional in code — always wire them.
In the project's `AGENTS.md`, under "Project decisions", one line with the item keys and the reason:
```markdown
ipal-audit-skip: mcp, llms-full — the client does not want to share content with AI agents (email 2026-03-02)
iapl-audit-skip: mcp, llms-full — the client does not want to share content with AI agents (email 2026-03-02)
```
Keys: `llms`, `llms-full`, `markdown`, `mcp`, `jsonld`, `r2`, `turnstile`,
`analytics`, `twofactor`, `aibots`, `forms-seed`, `csp` (`audit.sh` understands only these). Without this line a missing item is an error.
@@ -250,7 +293,7 @@ Keys: `llms`, `llms-full`, `markdown`, `mcp`, `jsonld`, `r2`, `turnstile`,
The technology from §0b makes the site *able* to be highly visible. Whether Google
ranks it and an AI assistant quotes it depends on the content. When you enter content from the brief into
the panel (seed, phase 6 in ipal-site), apply the rules below — without inventing facts.
the panel (seed, phase 6 in iapl-site), apply the rules below — without inventing facts.
### Structure of every page
- **One `h1`** (the hero/page heading), then section `h2`s, `h3`s inside — no skipped
@@ -289,7 +332,7 @@ one is better. Google ignores the same description on many pages.
| "Thank you" after a form, a confirmation page | **yes** |
| internal search results, filter/parameter pages | **yes** (+ `disallowParams` in robots) |
| a test page, a draft page, a landing page only for a paid campaign | **yes** |
| staging, preview, a test copy of the whole site | **`IPAL_NOINDEX=1` in that environment's env** — not the checkbox |
| staging, preview, a test copy of the whole site | **`IAPL_NOINDEX=1` in that environment's env** — not the checkbox |
| homepage, archives (blog, projects) | **never** — the panel blocks saving |
| services, offer, contact, about us, posts | **never** |
| privacy policy, cookies, terms | **no** by default (they are a credibility signal, they do no harm); `noindex` only at the client's request |
@@ -299,7 +342,7 @@ noindex does **not** replace a redirect or a deletion: old address → change th
`trackSlugHistoryHook`), a page to remove → delete it. Keep draft content as a **draft**
(unpublished content is not publicly available), not as a published page with noindex.
Checks: `ipal-seo-check` (one h1, heading order, alt, OG image, thin pages,
Checks: `iapl-seo-check` (one h1, heading order, alt, OG image, thin pages,
internal links, noindex in the sitemap).
---
@@ -309,12 +352,12 @@ internal links, noindex in the sitemap).
You build the site from brief to handover. The human provides **business decisions and
content**, they do not lead you by the hand. You think, anticipate problems, solve them
yourself and check your own work yourself. For a full build use the
**ipal-site** skill — it guides you through all the stages.
**iapl-site** skill — it guides you through all the stages.
### You decide yourself (and record the decision in `AGENTS.md` → "Project decisions")
- technical choices within these rules: splitting into blocks, variants, names,
subcomponents, order of work, refactoring your own code,
- fixing everything found by the build, `ipal-audit`, `ipal-seo-check`, `ipal-consent-check`,
- fixing everything found by the build, `iapl-audit`, `iapl-seo-check`, `iapl-consent-check`,
- plugin defaults (media limits, ISR, robots) — unless the brief says otherwise.
### You ask only about this (collect the questions in **one list**, not one at a time)
@@ -336,36 +379,36 @@ placeholder `[TO FILL: …]` in the panel and list it in the final report.
|---|---|
| Does it work in **every language**? (slug, content, 404, switcher) | `/en/...` → 404, because the EN slug is empty |
| Does the page stay **static**? | `headers()`, `searchParams`, `cookies()` in the page tree (§4) |
| Does the schema change **lose data**? | renaming a field without a migration → **ipal-migrate-fields** |
| Does the schema change **lose data**? | renaming a field without a migration → **iapl-migrate-fields** |
| Will the build pass in a container **without a database**? | a route reading the database without `force-dynamic` |
| Is a new script / pixel / iframe **behind consent**? | YouTube, a map, a chat loaded before consent (GDPR) |
| Can the editor change it **without code**? | text, link or image in JSX (§2) |
| **Performance**? | an image outside `<Media>`, a video without `preload`, queries outside the cached helpers |
| **Security**? | a secret in the client, missing `server-only`, Local API without `overrideAccess: false` |
| Does the plugin **already have it**? | your own version of an ipal-kit feature (§1.1) |
| Does the plugin **already have it**? | your own version of an IAPL feature (§1.1) |
### Check it yourself before you say "done"
A full `ipal-audit`, `ipal-seo-check` and `ipal-consent-check` on the built
A full `iapl-audit`, `iapl-seo-check` and `iapl-consent-check` on the built
app (`pnpm build && pnpm start`), the editor test (§11). Attach the results
to the report — without them the task is not finished.
### When something does not work
Diagnose (**ipal-debug**: symptom → cause → fix), fix it at the source,
Diagnose (**iapl-debug**: symptom → cause → fix), fix it at the source,
check again. Do not report problems you can solve.
### Report only when
- **ipal-kit has a bug or is missing a feature** → **plugin gap** (report to the owner and
- **IAPL has a bug or is missing a feature** → **plugin gap** (report to the owner and
wait for their decision on that part — no workaround on your own; unrelated work goes on),
- you see an **ipal-kit improvement** useful in many projects → **plugin gap**
- you see an **IAPL improvement** useful in many projects → **plugin gap**
(type: improvement),
- **the task is finished** → the final report (format in **ipal-site**).
- **the task is finished** → the final report (format in **iapl-site**).
Do not report progress step by step or things you fixed yourself — they
go as one list into the final report.
---
## 1. ipal-kit IS MANDATORY
## 1. IAPL IS MANDATORY
### 1.1 Before you write anything
Check whether the plugin has it: the module docs (§12) and the types
@@ -386,9 +429,9 @@ Rule: **identical in every project → plugin. Depends on the client → project
### 1.3 When the plugin is missing something or something does not work
**Do not patch silently** (a hook with a hardcoded value, your own helper, `as any`). It
almost always means the plugin already has it (check the docs) or the plugin is missing it.
The **ipal-plugin-gap** skill: report to the owner and **wait for their decision** on that part
("ipal-kit first" at the top). A workaround only after approval, marked
(`// WORKAROUND ipal-kit <version>: …`) and recorded in "Project decisions". The report contains:
The **iapl-plugin-gap** skill: report to the owner and **wait for their decision** on that part
("IAPL first" at the top). A workaround only after approval, marked
(`// WORKAROUND IAPL <version>: …`) and recorded in "Project decisions". The report contains:
- a description of the problem / missing feature,
- the proposed API (function / option signature),
- why it is universal (useful in other projects).
@@ -427,7 +470,7 @@ CDN preconnect: `<MediaPreconnect />` (from env). Media: `normalizeFilenameHook`
```
src/
app/
(frontend)/ # any route group name works ((site) …); ipal-doctor finds it by structure
(frontend)/ # any route group name works ((site) …); iapl-doctor finds it by structure
styles.css # Tailwind + @source on node_modules/@intecion/ipal-kit/dist
[locale]/ # single-language: no [locale] (see i18n.md)
layout.tsx # no <head>; <SiteProviders shell={await getSiteShell(locale)}> + Header/Footer
@@ -445,7 +488,7 @@ src/
api/mcp/route.ts # export { mcpGET as GET, mcpPOST as POST } — public MCP (GEO)
api/health/route.ts # export { healthRoute as GET }
indexnow-key.txt/route.ts # export { indexNowKeyRoute as GET }
instrumentation.ts # assertEnv(ipalEnvRules({...})) from '@intecion/ipal-kit/env'
instrumentation.ts # assertEnv(iaplEnvRules({...})) from '@intecion/ipal-kit/env'
components/
forms/formClasses.ts # the ONLY place for the look of forms (RenderForm classNames)
ui/ # primitives: CMSLink, Button, Media, Section, SectionHeader
@@ -505,7 +548,7 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
7. **`export const dynamic = 'force-dynamic'`** on routes that read the database:
`manifest.ts`, `sitemap.xml/route.ts`, `llms.txt`, `api/health`. The plugin's
handlers have try/catch, but `dynamic` must be in the route file.
8. **`instrumentation.ts`** with `assertEnv(ipalEnvRules({...}))` imported from **`@intecion/ipal-kit/env`** (the root pulls in Payload → Edge/Turbopack crash), inside `if (process.env.NEXT_RUNTIME === 'nodejs')` (env.md).
8. **`instrumentation.ts`** with `assertEnv(iaplEnvRules({...}))` imported from **`@intecion/ipal-kit/env`** (the root pulls in Payload → Edge/Turbopack crash), inside `if (process.env.NEXT_RUNTIME === 'nodejs')` (env.md).
9. **RSC by default.** `'use client'` only for state/interaction, in a separate file;
the section stays a server component and passes data to it. Secrets: `import 'server-only'`.
10. **Blocks do not import `lib/*`** (cycle). Server-side data → `enhanceProps`.
@@ -516,7 +559,7 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
patched 15.x line. Pin `next` and `eslint-config-next` to the same 16.4.x (≥ 16.4.5):
`pnpm add next@16.4.6 eslint-config-next@16.4.6`, and make sure `sharp` resolves to 0.35.5 or later
(`pnpm why sharp`). The plugin's peer range stays open (`next >=15`) — the minimum is yours to keep.
**Check:** `pnpm ls next sharp` → next ≥ 16.4.5, sharp ≥ 0.35.5; `pnpm exec ipal-doctor` → no `next-min`
**Check:** `pnpm ls next sharp` → next ≥ 16.4.5, sharp ≥ 0.35.5; `pnpm exec iapl-doctor` → no `next-min`
finding; `pnpm dev` prints no security-upgrade warning.
12. **No open production advisories.** Node.js 20 or later for the plugin itself (its `nodemailer` 10 requires it);
**Payload 3.94 needs Node.js 22.23.5 or later** on the 22 line (`engines`: `">=22.23.5 <23"`, `.nvmrc` `22`), locally,
@@ -553,7 +596,7 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
project dependency on `nodemailer` or `@types/nodemailer`.
**Check:** `pnpm audit --prod` → no high or critical; `pnpm why dompurify happy-dom mongoose undici` → only the
fixed versions (dompurify 3.4.17 or later, happy-dom 21.0.4 or later, mongoose 8.24.7 or later, undici 7.30.1 or
later); `pnpm exec ipal-doctor` → no `transitive-min` finding; after a Payload or mongoose change run
later); `pnpm exec iapl-doctor` → no `transitive-min` finding; after a Payload or mongoose change run
`pnpm build`, open the panel and save a document.
---
@@ -576,7 +619,7 @@ By default: `pages`, `media` + the plugin's globals (`site-settings`,
`site-integrations`, Notifications, Cookie banner) + the project's globals
(navigation, footer, company). Nothing more until the client explicitly requires it.
**`users`** is added by `ipalKit` (an auth collection with `roles` and 2FA) — do not create it, unless
**`users`** is added by `iapl` (an auth collection with `roles` and 2FA) — do not create it, unless
you need extra fields (then your own `Users.ts` with the slug from `access.authCollection`;
the plugin adds roles and 2FA to it).
@@ -612,7 +655,7 @@ their own URLs → do not add them to `content`.
### 5.4 Wiring collections with URLs
```ts
// ipalKit({ content: contentConfig }) and createContentHelpers({ content: contentConfig })
// iapl({ content: contentConfig }) and createContentHelpers({ content: contentConfig })
export const contentConfig = {
collections: [{ slug: 'posts', perPage: 10 }],
} satisfies ContentOption
@@ -637,7 +680,7 @@ never by slug. pages.md.
`pricing`, `entryList` — with variants, `{ en, pl }` panels, accessibility and token-only styling, plus ten page
templates ([block-library.md](../block-library.md)). Turn them on with `libraryBlocks(blockOptions)`, render them with
`createBlockRegistry`, change them with their options (`fields`, `variants`, `classNames`, `ui`, `components`), own one
with `ipal-blocks eject`. The rules below are how those blocks are built and how you build your own when none fits.
with `iapl-blocks eject`. The rules below are how those blocks are built and how you build your own when none fits.
Three problems that must never repeat: **a zoo of CTA fields** (`ctaLabel`,
`cta2Text`, `buttonUrl`…), **files as text** (`pdfUrl: '/files/x.pdf'`),
@@ -658,7 +701,7 @@ Three problems that must never repeat: **a zoo of CTA fields** (`ctaLabel`,
7. **Empty field = the element does not render** (no "Lorem", no empty `<div>`).
8. **Server by default;** interaction in a separate, small `'use client'` file with simple props.
9. **Types from `@/payload-types`**, named export, imports from `@/…`, no barrels.
10. **Every new block:** an empty-block test in the panel (§6.5a) + `ipal-audit --quick`.
10. **Every new block:** an empty-block test in the panel (§6.5a) + `iapl-audit --quick`.
### 6.1 Three layers
```
@@ -701,7 +744,7 @@ Field labels as `{ en, pl }` objects (the panel runs in English and Polish; §6.
With the block library they come from the plugin: `Section`, `SectionHeader`, `Media`, `CMSLink`, `buttonClass`,
`Container`, `Card` from `@intecion/ipal-kit/blocks/rsc` (no project copies; `src/components/ui/` holds only a
project version you pass in with `createBlockRegistry(content, { ui: { Media } })`). A project without the library:
code 1:1 from [section-code.md](./skills/ipal-block/resources/section-code.md). Each one has one job:
code 1:1 from [section-code.md](./skills/iapl-block/resources/section-code.md). Each one has one job:
| Primitive | Does | Instead of |
|---|---|---|
@@ -719,7 +762,7 @@ Turnstile and consent are in `<SiteProviders>` in the layout, not in props.
### 6.4 Layer 3 — section = composition
The model shape of a section (the whole component; the `config.ts` schema and an example with
repeated items — `FeatureGrid` + `FeatureCard` — in [section-code.md](./skills/ipal-block/resources/section-code.md)):
repeated items — `FeatureGrid` + `FeatureCard` — in [section-code.md](./skills/iapl-block/resources/section-code.md)):
```tsx
// src/blocks/Hero/Component.tsx — the whole component
@@ -793,18 +836,18 @@ empty fields, without guessing, without numbered slots. You design the schema fo
- Texts are `{ en: '…', pl: '…' }` (one key per admin language of the project):
`label`, `admin.description`, option `label`, tab `label`, `labels.singular/plural`,
`admin.group`. Type: `AdminText` from `@intecion/ipal-kit`; shorthand `adminText('Title', 'Tytuł')` from
`@intecion/ipal-kit/blocks`. In a schema file `ipal-audit` accepts both; the same words in a component are an error.
`@intecion/ipal-kit/blocks`. In a schema file `iapl-audit` accepts both; the same words in a component are an error.
- `admin.description` only when the label is not enough — one sentence ≤ 120 characters:
what it does / where it shows, with a format example (`'Section id for #links, e.g. "pricing".'`),
never how the code works (no component, function, env-var or package names).
- Select options with a readable `label` ("Inverted (dark)"), not the raw value.
- The admin panel runs in English and Polish by default (ipal-kit sets
- The admin panel runs in English and Polish by default (IAPL sets
`i18n.supportedLanguages` when the project has not); set your own list to change it.
The plugin's own texts are overridable: field/global labels via `globalOverrides` /
`collectionOverrides`, component texts via `i18n.translations.<lang>.ipal.<key>`
(keys: `adminTexts` from `@intecion/ipal-kit`). Building blocks for your own admin
components: `ipalT`, `formatNumber`, `formatDateTime`, `defineTexts`, `ADMIN_LANGUAGES`,
`applyAdminI18n` (already applied by `ipalKit`), `adminDocumentTitle` + `<DocumentTitle>` (`/admin`;
components: `iaplT`, `formatNumber`, `formatDateTime`, `defineTexts`, `ADMIN_LANGUAGES`,
`applyAdminI18n` (already applied by `iapl`), `adminDocumentTitle` + `<DocumentTitle>` (`/admin`;
a custom view's tab title in the admin language — Payload's `meta.title` is one fixed string),
types `AdminText`, `AdminLanguage`, `AdminTextKey` — details in i18n.md "Admin panel languages and texts".
**Check:** Polish panel → the view's browser tab reads in Polish.
@@ -846,7 +889,7 @@ buildSectionSettingsField(), // sideb
**Empty-block test** (after every new block, in the panel): add the block to a page →
at the start ≤ 6 items are visible, everything is in English, buttons and items are added
with "+ Add …", collapsed rows have readable names, nothing requires knowledge of the code.
Automatic checks: `ipal-audit` (the "panel:" section). After adding `rowLabel` in
Automatic checks: `iapl-audit` (the "panel:" section). After adding `rowLabel` in
the project: `pnpm payload generate:importmap`.
### 6.6 Anti-patterns → fix
@@ -885,8 +928,8 @@ className={v === 'a' ? 'x' : v === 'b' ? 'y' : 'z'}
### 6.8 Header and Footer (navigation globals)
Code (globals, `Header`, `Footer`, `MobileNav`; `resolveNav` from the plugin): [nav-code.md](./skills/ipal-nav/resources/nav-code.md).
Skill: **ipal-nav**.
Code (globals, `Header`, `Footer`, `MobileNav`; `resolveNav` from the plugin): [nav-code.md](./skills/iapl-nav/resources/nav-code.md).
Skill: **iapl-nav**.
- Navigation, footer, company data = **project globals** (`header`, `footer`, `company`),
built with `buildLinkField` — the company data model depends on the country (NIP/ABN/EIN).
@@ -904,9 +947,9 @@ Skill: **ipal-nav**.
- A global changed on every page → `afterChange: [buildGlobalRevalidateHook({ revalidatePath })]`
(it calls `revalidatePath('/', 'layout')`). `buildRevalidateHook` is for collections. The plugin's globals
(Site settings, Site integrations, Cookie banner, Notifications) refresh ISR themselves once you pass
`ipalKit({ revalidatePath })` (from `next/cache`); without it the change shows after the `revalidate` window.
`iapl({ revalidatePath })` (from `next/cache`); without it the change shows after the `revalidate` window.
- The plugin's globals: read public (Site integrations: admin only), write editor+. Change their access, admin
or hooks with `ipalKit({ globalOverrides: { notifications: { access: { update: authenticated } } } })` —
or hooks with `iapl({ globalOverrides: { notifications: { access: { update: authenticated } } } })` —
an object merges key by key (your keys win), a function `(global) => global` takes over. Never copy a plugin global.
- Only `[locale]/layout.tsx` fetches globals and passes them as props.
@@ -934,7 +977,7 @@ Skill: **ipal-nav**.
8. **An enlarged image is never a hand-made modal** (no `useState(index)` + `div role="dialog"`,
`glightbox`, `photoswipe`, a link to the raw file in a new tab) — `<LightboxTrigger>` around the
thumbnail (a client component you render from a server block with plain `lightboxImage(…)` data),
one `<SiteProviders lightbox>`, labels from Form messages → Image viewer (lightbox.md). `ipal-audit`
one `<SiteProviders lightbox>`, labels from Form messages → Image viewer (lightbox.md). `iapl-audit`
warns about lightbox libraries and hand-made image dialogs.
### 6.10 Icons
@@ -942,14 +985,14 @@ Skill: **ipal-nav**.
Two sources, nothing in between: **graphics from the client** (also the logo, brand icons) →
upload + `<Media>`; **a fixed set of UI icons** → a `select` field with names +
a `lucide-react` map in `src/components/icons/` (names in a separate file, so the block
config does not import React). Code: [section-code.md](./skills/ipal-block/resources/section-code.md). **Never** SVG pasted into a section's JSX.
config does not import React). Code: [section-code.md](./skills/iapl-block/resources/section-code.md). **Never** SVG pasted into a section's JSX.
### 6.11 Styles — the design-token standard ([design-tokens.md](../design-tokens.md))
Every site uses the same `--ipal-*` token names and Tailwind utilities; only the values differ per brand.
- **The brand lives in two files:** `DESIGN.md` (human, template `ipal-setup/resources/DESIGN.md`) and
`src/design/tokens.ts` (`defineTokens` from `@intecion/ipal-kit/tokens`, template `ipal-setup/resources/tokens.ts`).
`pnpm exec ipal-tokens` writes `src/design/tokens.css` (commit it) and fails on a WCAG AA contrast error.
- **The brand lives in two files:** `DESIGN.md` (human, template `iapl-setup/resources/DESIGN.md`) and
`src/design/tokens.ts` (`defineTokens` from `@intecion/ipal-kit/tokens`, template `iapl-setup/resources/tokens.ts`).
`pnpm exec iapl-tokens` writes `src/design/tokens.css` (commit it) and fails on a WCAG AA contrast error.
Never edit the generated file; never put brand values in `styles.css` or in a component.
- **`styles.css` is the same on every site:** `@import "tailwindcss"`, `@intecion/ipal-kit/fluid-wide.css` (or
`fluid.css`), `@intecion/ipal-kit/tokens.css`, `@intecion/ipal-kit/tailwind.css`, `../../design/tokens.css` (last), `@source` of the plugin's dist.
@@ -964,18 +1007,18 @@ Every site uses the same `--ipal-*` token names and Tailwind utilities; only the
- Fonts via `next/font` with `variable: '--font-family-body'` / `'--font-family-heading'` on `<html>` (not
`--font-body`: a `var()` cycle with the `font-body` utility). Max 2 families.
- Values a CSS variable can't reach (`next/og`, e-mail, `theme-color`): `resolveColors(tokens)` from `@/design/tokens`.
In inline styles / charts: `IPAL_TOKENS.primary` or `ipalVar('primary')`; breakpoints in JS: `IPAL_BREAKPOINTS`.
- A missing role every site would need → **ipal-plugin-gap**; a project-only decorative colour → `styles.css` below the
In inline styles / charts: `IAPL_TOKENS.primary` or `iaplVar('primary')`; breakpoints in JS: `IAPL_BREAKPOINTS`.
- A missing role every site would need → **iapl-plugin-gap**; a project-only decorative colour → `styles.css` below the
imports + `DESIGN.md` → Deviations.
- JSON-LD only via `<JsonLdGraph>` from `/rsc` — never your own `<script dangerouslySetInnerHTML>`.
- No CSS Modules and no `style={{…}}` — exception: a dynamic value from data.
- Variants → `Record<Variant, string>`, not ternary chains.
Example `styles.css`: [section-code.md](./skills/ipal-block/resources/section-code.md).
Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-code.md).
### 6.11a Scaling (fluid / responsive) — from 360 px to 1920 px
- **Scale from the plugin:** `fluid-wide.css` (grows up to 1920 px — the default for new sites) or `fluid.css`
(stops at 1280 px). No `clamp()` in components or `styles.css`; different numbers from `DESIGN.md` → min/max
pairs in `src/design/tokens.ts` (`fs: { h1: ['2.25rem', '4rem'] }`, `space: { section: [3, 8] }`) → `ipal-tokens`.
pairs in `src/design/tokens.ts` (`fs: { h1: ['2.25rem', '4rem'] }`, `space: { section: [3, 8] }`) → `iapl-tokens`.
- **Screen height:** instead of `h-screen` / `100vh` → `min-h-[var(--ipal-hero-min-h)]` (svh, with
a limit). Hero heading `--ipal-fs-display-fit`, hero spacing `--ipal-space-section-fit` — on
1366×768 the hero CTA must be visible without scrolling.
@@ -1006,8 +1049,8 @@ Example `styles.css`: [section-code.md](./skills/ipal-block/resources/section-co
| client components | small, interaction only (§6.9) | a whole section `'use client'` |
Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms.
Checks: `ipal-audit` (img/video outside Media, many `priority`, `h-screen`, fixed widths,
YouTube `<iframe>`) and `ipal-seo-check` (images without dimensions, LCP image without priority).
Checks: `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
@@ -1057,8 +1100,8 @@ project → **plugin gap**, not a copy.
| Slug / noindex / description for AI | `buildSlugField`, `buildNoindexField`, `buildSummaryField` | slug.md, seo.md |
| System pages and their protection | `getSystemPagePath`, `buildPreventDeleteSystemPage`, `buildValidateUniqueRole` | pages.md, hooks.md |
| ISR after save, old slug → 308, images across languages | `buildRevalidateHook`, `trackSlugHistoryHook`, `buildCrossLocaleFieldSync` | hooks.md |
| ISR after a global is saved | plugin globals: `ipalKit({ revalidatePath })`; your own globals: `buildGlobalRevalidateHook({ revalidatePath })` | hooks.md |
| Change a plugin global (access, hooks, fields) | `ipalKit({ globalOverrides })` | access.md |
| ISR after a global is saved | plugin globals: `iapl({ revalidatePath })`; your own globals: `buildGlobalRevalidateHook({ revalidatePath })` | hooks.md |
| Change a plugin global (access, hooks, fields) | `iapl({ globalOverrides })` | access.md |
| Roles and access | `adminOnly`, `adminOrEditor`, `adminOrSelf`, `adminOrSelfIn(slug)` (several auth collections), `authenticated`, `requireRole`, `hasMinimumRole` (+ `…Field`); staff checks: `userMeetsRole(req, role)`, `isAdmin(req.user, req.payload)` (roles count only for accounts of a staff collection; in a client component `isAdmin(user, config)` with `useConfig()`, imported from **`@intecion/ipal-kit/client`** (the main entry does not build there with webpack), in middleware `isAdmin(user, { staffCollections: ['users'] })` — without the last argument there it is always `false`), `staffCollectionSlugs(payload)`, `access.staffCollections`; second factor in your own code: `secondFactorPassed(req)`, `requireSecondFactor(access)`; injected `users`: `access.authAccess`, first user = admin (`access.firstUserAdmin`) | access.md, security.md |
| Data from globals | `getGlobal`, `getSiteSettings`, `getSiteIntegrations` | payload-helpers.md |
@@ -1082,7 +1125,7 @@ project → **plugin gap**, not a copy.
| Sending | `createSubmitAction({ getCachedPayload, headers })` (`/server`) | forms.md |
| A file on a form (CV, specification) | `forms: { attachments: true }` + a **File** field in the panel; the file is e-mailed to the company and **never stored** (no Media, no bucket, no download). Options `FormAttachmentsOption` (`maxSizeMB`, `maxTotalMB`, `maxFiles`, `fileTypes`: `FormFileType` / `FormFileDetect`, `allowRisky`, `scan`: `FormFileScanInput` → `FormFileScanResult`, `strictPdf`, `notice`, `maxConcurrent`, `path`, `submit`: `FormSubmitEndpointOptions`); block `buildFileBlock` / `fileBlock`; types `FORM_FILE_TYPES`, refused `RISKY_FILE_EXTENSIONS`; own markup `getFileProps` / `getFiles` / `removeFile`, `fileFieldRules`, `fileFieldError`, `formatFileSize`, `BuilderFileLimits`, `BuilderFile`; own transfer `submitForm({ files })` + `splitFormFiles`; transport ceiling `mailAttachmentLimit` | forms.md "Files", email.md "Attachments" |
| Message texts and step button texts | Form messages → `getFormTexts(locale)` | notifications.md |
| A form in the database | seed `ipal-form/resources/seed-form.template.ts` | forms.md, seeding.md |
| A form in the database | seed `iapl-form/resources/seed-form.template.ts` | forms.md, seeding.md |
| Antispam / limit / IP | honeypot in `BuilderForm` (`getHoneypotProps` on `useBuilderForm`), Turnstile from `SiteProviders` (`createSubmitAction({ turnstileHostnames })` pins the domain), `clientIp`, `setRateLimitStore`, `setUnknownIpFactor` | forms.md, turnstile.md |
| GTM event after sending | `buildFormAnalyticsFields` (panel) — `RenderForm` sends it itself | forms.md |
| A form outside the builder (e.g. filters) | `useForm` + `buildValidator`, `required`, `email`… | forms.md |
@@ -1096,7 +1139,7 @@ project → **plugin gap**, not a copy.
| JSON-LD | `getSiteShell().jsonLd`, `getPageJsonLd`, `build*JsonLd`, `formatOpeningHours`, `sameAsUrls`, `<JsonLdGraph>` | seo.md |
| Product / category JSON-LD (an entry that is not an article) | `pageJsonLd.entries` + `buildProductJsonLd` | seo.md |
| llms.txt / llms-full / Markdown / MCP | `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`/`mcpPOST`; `markdownAlternate: true`; `createProxy({ markdown: true })` | seo.md, content.md, mcp.md |
| IndexNow | `ipalKit({ indexNow: true })` + `indexNowKeyRoute` | seo.md |
| IndexNow | `iapl({ indexNow: true })` + `indexNowKeyRoute` | seo.md |
| Search | `createSearchRoute({ …, isPathVisible })` | content.md |
**Media, look, speed**
@@ -1104,12 +1147,12 @@ project → **plugin gap**, not a copy.
|---|---|---|
| R2, file names, optimization, preview | `buildR2Storage`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` | storage.md |
| Image / video in `<Media>` | `mediaImageProps`, `videoProps`, `MEDIA_SIZES` | storage.md |
| Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `ipalKit({ lightbox: true })` → Form messages → Image viewer | lightbox.md |
| Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `iapl({ lightbox: true })` → Form messages → Image viewer | lightbox.md |
| YouTube without cookies before a click | `<YouTubeEmbed>` (`/client`) | storage.md |
| `next.config` | `buildImagesConfig`, `buildSecurityHeaders` (`csp`), `buildCsp`, `buildCspHeaders`, `buildAdminCsp` / `buildAdminCspHeaders`, `buildUploadSecurityHeaders`, `withSecurityConfig` (hides `X-Powered-By`) | storage.md, security.md |
| CSP reports, nonces | `createCspReportRoute` (`parseCspReports`, type `CspViolation`), `createProxy({ csp })` + `<SiteProviders nonce>` (dynamic pages only), `createCspNonce`, `CSP_NONCE_HEADER`, `buildReportingEndpoints`, `cspHeaderKey`, `DEFAULT_CSP_REPORT_GROUP`; types `BuildAdminCspArgs`, `CspDirective`, `CspSources`, `CreateCspReportRouteArgs`, `WithSecurityConfigOptions` | security.md |
| Fluid typography and spacing | `fluid.css` / `fluid-wide.css` (`--ipal-*` variables); your own sizes: `fluidClamp`, `FLUID_SCALE`, `FLUID_RANGES` | design-tokens.md |
| Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec ipal-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IPAL_TOKENS`, `ipalVar`, `IpalTokenName`, `IPAL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md |
| Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec iapl-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IAPL_TOKENS`, `iaplVar`, `IaplTokenName`, `IAPL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md |
| Accessibility widget CSS | `@intecion/ipal-kit/a11y.css` (works through the tokens) | accessibility.md |
**Consent, analytics, operations**
@@ -1119,22 +1162,22 @@ project → **plugin gap**, not a copy.
| Settings window: in the bar / small / large with cookie details | `<CookieBanner settings="inline" \| "modal" \| "detailed">` — do not build your own window or cookie list | consent.md → "Large window with details" |
| A consent-dependent script | `ConsentScript` | consent.md |
| Cookie table on the policy page | `<CookieTable>` (`/rsc`), `getCookieTable` | consent.md |
| Cookie list filled from the panel (scan, then one approval adds every cookie to the list, the policy table and the detailed window) | `ipalKit({ cookieScanner: true })` + `pnpm generate:importmap` + migration; the editor approves on `/admin/cookie-approval`; project cookies: `cookieScanner.declarations` / `integrations`; per-entry review: `approval: false` — do not type the list by hand or build your own scanner or approval page | cookie-scanner.md |
| Pre-consent check in a browser (button in the panel, violations, dashboard + e-mail warning) | `cookieScanner: { crawl: true }` + env `IPAL_COOKIE_SCAN_URL` / `IPAL_COOKIE_SCAN_TOKEN` (`ipalEnvRules({ cookieCrawl: true })`) + the site's `host=token` in the shared service's `IPAL_CRAWLER_SITES`; never Playwright/Chromium in the site | cookie-scanner.md → Browser crawl |
| Cookie list filled from the panel (scan, then one approval adds every cookie to the list, the policy table and the detailed window) | `iapl({ cookieScanner: true })` + `pnpm generate:importmap` + migration; the editor approves on `/admin/cookie-approval`; project cookies: `cookieScanner.declarations` / `integrations`; per-entry review: `approval: false` — do not type the list by hand or build your own scanner or approval page | cookie-scanner.md |
| Pre-consent check in a browser (button in the panel, violations, dashboard + e-mail warning) | `cookieScanner: { crawl: true }` + env `IAPL_COOKIE_SCAN_URL` / `IAPL_COOKIE_SCAN_TOKEN` (`iaplEnvRules({ cookieCrawl: true })`) + the site's `host=token` in the shared service's `IAPL_CRAWLER_SITES`; never Playwright/Chromium in the site | cookie-scanner.md → Browser crawl |
| GA4, GTM, Pixel, Clarity, LinkedIn, TikTok | IDs in the panel — `SiteProviders` loads `Analytics` (`analytics={{ defer: true }}`; `consentMode: 'basic'` = no Google request before consent) | analytics.md |
| Mail | `email: mailAdapter()`, `sendEmail` | email.md |
| Env validation, health | `assertEnv(ipalEnvRules({…}))` (`/env`), `healthRoute` | env.md |
| Env validation, health | `assertEnv(iaplEnvRules({…}))` (`/env`), `healthRoute` | env.md |
| 2FA, white-label, headers | `twoFactor: { issuer, plugin: payloadTotp }`, `whiteLabel`, `buildSecurityHeaders` | security.md, white-label.md |
| Panel link preview + noindex (site name, description, preview image, technology support credit) | on by default (`adminMeta`, `agency`) — do not hand-write `admin.meta` for it; override single keys in `admin.meta` or `adminMeta: { … }` | white-label.md |
| Rate limit (forms, MCP, search) | built in; IP from `IPAL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
| Rate limit (forms, MCP, search) | built in; IP from `IAPL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
**Compliance (PL/EU) — the mechanism from the plugin, the content from the client:** policy pages
as System pages, `CookieBanner` + `CookieButton`, a `consent` checkbox in
forms (enforced server-side), the controller's data in a global, the cookie
table from the panel (`<CookieTable>` and the `settings="detailed"` window, scan: ipal-consent-check). You do not write legal texts. An accessibility widget — only when the client
table from the panel (`<CookieTable>` and the `settings="detailed"` window, scan: iapl-consent-check). You do not write legal texts. An accessibility widget — only when the client
requires it (accessibility.md).
**Security:** 2FA enforced (`ipalKit({ twoFactor: { issuer, plugin:
**Security:** 2FA enforced (`iapl({ twoFactor: { issuer, plugin:
payloadTotp } })`, never `twoFactor: false` without a client decision). No `X-Powered-By`:
`withPayload(withSecurityConfig(nextConfig))`. CSP in three steps (security.md → "ROLL OUT CSP"):
(1) `buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', <flags for what the
@@ -1150,13 +1193,13 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Feature (default) | Turn off | Override / building blocks |
|---|---|---|
| Plugin globals: write editor+ (Site integrations: admin) | — | `ipalKit({ globalOverrides: { <slug>: { access, admin, hooks } } })`; a function `(global) => global` takes over (`applyGlobalOverrides`) |
| Global saves revalidate the layout (with `ipalKit({ revalidatePath })`) | omit `revalidatePath`; once: `context: { disableRevalidate: true }` | `buildGlobalRevalidateHook` on your own globals |
| Plugin globals: write editor+ (Site integrations: admin) | — | `iapl({ globalOverrides: { <slug>: { access, admin, hooks } } })`; a function `(global) => global` takes over (`applyGlobalOverrides`) |
| Global saves revalidate the layout (with `iapl({ revalidatePath })`) | omit `revalidatePath`; once: `context: { disableRevalidate: true }` | `buildGlobalRevalidateHook` on your own globals |
| Form files (`forms.attachments`): off; when on — 10 MB, PDF/DOC/DOCX ticked, programs/macros/archives refused, no antivirus, Graph sends files of 3 MB and more through a draft it deletes | omit `attachments`; `forms.fields.file: false`; `mailAdapter({ graph: { largeAttachments: false } })` | `maxSizeMB` / `maxTotalMB` / `maxFiles` / `fileTypes` / `allowRisky` / `scan` / `strictPdf` / `notice` / `submit`; `buildFileBlock`; `formSubmissionOverrides.fields` for the file fields of a submission |
| Staff features without `access` (no roles field): every account of the panel's login collection passes (`userMeetsRole`); accounts of other auth collections never do | add `access` (roles decide) | `access.staffCollections` (more staff collections), `globalOverrides`, `forms.formSubmissionOverrides`, `consentLog.collectionOverrides`, `stats.collectionOverrides` |
| Cookie check (`crawl`): start editor+ or the token, results token-only for the running job, latest result only, dashboard warning on, e-mail off until recipients are set | omit `crawl`; `crawl.dashboard: false` | `crawl.serviceUrl` / `token` / `siteUrl` / `maxPages` / `acceptSelector` / `consentMode` / `trackerHosts` / `globalOverride`; *Cookie check → Warning e-mails to*; building blocks `ingestCrawlResult`, `findCrawlViolations`, `parseCrawlResult` |
| Cookie admin: one *Cookies* entry — review list and site check as tabs, their own entries out of the navigation (pages and API kept) | `cookieScanner.adminLayout: 'separate'` | `addCookieScannerTabs`, `CookieReviewTab`, `CookieSiteCheckTab`; `collectionOverrides` / `crawl.globalOverride` win |
| Theme choice in localStorage under `theme` (next-themes' key); old `ipal-theme` moved before paint; declared to the cookie scanner as necessary local storage | — | `ipalKit({ theme: { storageKey } })`; `<ThemeSwitcher storageKey>` / `useTheme({ storageKey })` |
| Theme choice in localStorage under `theme` (next-themes' key); old `ipal-theme` moved before paint; declared to the cookie scanner as necessary local storage | — | `iapl({ theme: { storageKey } })`; `<ThemeSwitcher storageKey>` / `useTheme({ storageKey })` |
| Cookie list entries have a **Type** (cookie / local / session storage), filled by the scanner; `<CookieTable>` shows it when needed | `<CookieTable storageColumn={false}>` | `storageColumn`, `storageTypes`, Cookies → Settings window → Cookie list headings → Type |
| Text written in one language fills the empty languages (cookie list, cookie review), never over a language's own text | `fillEmptyLocales: false` | `fillEmptyLocales: { 'cookie-settings': [...], 'cookie-review': [...] }`; `buildFillEmptyLocalesGlobalHook` / `…CollectionHook` for your own globals and collections |
| Cookie approval: one summary + **Approve and add** (editor+), unknown cookies approved as `marketing` + "Needs description", dashboard reminder while cookies wait; nothing reaches the cookie banner before approval | `cookieScanner.approval: false` (per-entry review) | `approval.unknownCategory`, `approval.dashboard: false`; building blocks `approveCookies`, `loadCookieApproval`, `countPendingCookies`, `flagGoneEntries`, `sameCookie` |
@@ -1168,15 +1211,15 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| 2FA setup required: an account without TOTP reaches only the setup screen; 72 h window from creation / admin reset, then blocked; status and "Reopen setup" on the account page, notice on the dashboard, `POST /api/ipal/two-factor/reset` | `twoFactor.requireSetup: false`; parts: `requireSetup: { dashboardNotice: false, statusField: false, setupNotice: false }` | `requireSetup: { windowHours, exempt }` (`exempt` returns exactly `true`, never `async`), `twoFactor.resetAccess` (default: an admin who entered its own code; the reset ends the account's sessions), texts `twoFactor*`; `twoFactorSetupState(req)`, `buildSetupFields`, `backfillSetupFrom`, `buildTwoFactorResetEndpoint`. **Postgres/SQLite: migration for `totp_setup_from` applied when the new container starts (`prodMigrations` or `pnpm payload migrate && pnpm start`; never a pre-deployment command — deployment.md §4.3), or every login answers 500** |
| The second factor on every collection and global, whichever plugin added it, and on the plugin's endpoints; an unrecognised 2FA package = startup error | per entity: `custom.ipal.secondFactor: false` or `{ read: false }` (or the package's `custom.totp.disableAccessWrapper`); everywhere: `twoFactor.guard: false` (not recommended) | `requireSecondFactor` / `secondFactorPassed` in your own access functions and endpoints |
| At most 5 verify attempts per account in 10 minutes (`POST /api/verify-totp` → `429`); the count is kept in memory and in the database (`payload.kv`), so a restart or a second instance does not reset it | `twoFactor.verifyLimit: false` | `verifyLimit: { max, windowMinutes, store: 'memory' }` |
| 2FA verify and setup attempts only from the site's own origin: a request a browser marks as coming from elsewhere (`Origin`, `Sec-Fetch-Site`) gets `403` and is not counted. **Set `serverURL`**: behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host` the site's own page is refused without it (logged once per origin: `[ipal] 2FA: a code from origin … was refused`) | `twoFactor.sameOrigin: false` | `sameOrigin: { origins: ['https://app.example.com'] }`; `requestFromOwnOrigin`, `reportRefusedOrigin` |
| 2FA verify and setup attempts only from the site's own origin: a request a browser marks as coming from elsewhere (`Origin`, `Sec-Fetch-Site`) gets `403` and is not counted. **Set `serverURL`**: behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host` the site's own page is refused without it (logged once per origin: `[iapl] 2FA: a code from origin … was refused`) | `twoFactor.sameOrigin: false` | `sameOrigin: { origins: ['https://app.example.com'] }`; `requestFromOwnOrigin`, `reportRefusedOrigin` |
| Stored secrets are write-only: `smtpPassword` and `turnstileSecretKey` come back as `'********'` over REST, GraphQL and in the panel; an empty save keeps the value, `'[[clear]]'` removes it; server code reads the real value with the Local API. **The panel is the source — never add an env variable for them** (`TURNSTILE_SECRET_KEY` is deprecated) | `secrets: { writeOnly: false }` | `writeOnlySecret(field)` / `writeOnlySecrets(fields, names)` for your own secret fields; with versions on the entity add `hooks.afterRead: [maskSecretsOnRestore]` |
| The SMTP password stays with its server: a save in the panel or over the API that changes the server, port or user name without the password is refused (`400` "Enter the password again…"), whatever the transport says — otherwise an admin session points the server at its own machine and a test e-mail hands the password over. A change of the transport alone asks for nothing. Seeds and scripts (Local API, access control off) are not asked | `secrets: { reenterOnChange: false }` | `writeOnlySecret(field, { boundTo: [...] })`, `buildKeepSecret`, `SMTP_PASSWORD_BOUND_TO` |
| The admin panel opens for `editor` and above; an account with only `user` sees "Unauthorized" (the API is not touched). First start logs how many accounts are below the role | `accounts: { panelRole: 'user' }` (or `false`) | `panelRole: 'admin'`; your own `access.admin`; `panelAccess(role)` |
| Nobody creates an account for themselves, or takes one over. A staff collection (also the project's own, also one a later plugin adds) without a `create` / `update` / `delete` / `unlock` / `read` / `readVersions` rule gets one (on a collection a later plugin adds the plugin's rule is put in front of its own and both must allow; `custom: { ipal: { accountRules: false } }` on it keeps its own): with the plugin's roles, or wherever an account of it can hold `editor` or `admin` (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship holding a list — the value in the account's `roles` array makes a plugin admin or editor; a single-valued `roles` field is not affected: its value never counts) — create, delete, unlock: an admin; update: an admin or the account itself; the `roles` field: only an admin. With roles of its own that hold neither `editor` nor `admin`, or none: an account of that same collection, or a plugin admin, and an account never changes its own roles — **the plugin cannot rank a project's own roles: write that collection's rules** (`ipal-doctor` → `staff-own-roles`). `read`: a staff account. Payload's first-user route answers only for the panel's login collection (the first account, which becomes admin), in any spelling of the URL. `access.firstUserAdmin: false` with a default role below the panel role: the default panel role is not applied (logged), an explicit one is refused at start. With a slug in `access.staffCollections` that is not an auth collection Payload does not start (`/api/health` 503) | `accounts: { adminOnlyCreate: false, adminOnlyWrite: false, staffOnlyRead: false, firstUserRoute: 'all' }` | your own rule wins; `firstUserRoute: ['users', 'partners']`; a collection with open sign-up keeps its routes; `staffCreateAccess`, `staffUpdateAccess(slug)`, `staffReadAccess`, `sameStaffCollectionAccess(slug)`, `rolesByAdminOnly`, `rolesNotOwn(slug)`, `hasPluginRoles`, `applyStaffAccountAccess`, `adoptLateAuthCollections`, `buildFirstUserEndpoint` |
| Nobody creates an account for themselves, or takes one over. A staff collection (also the project's own, also one a later plugin adds) without a `create` / `update` / `delete` / `unlock` / `read` / `readVersions` rule gets one (on a collection a later plugin adds the plugin's rule is put in front of its own and both must allow; `custom: { ipal: { accountRules: false } }` on it keeps its own): with the plugin's roles, or wherever an account of it can hold `editor` or `admin` (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship holding a list — the value in the account's `roles` array makes a plugin admin or editor; a single-valued `roles` field is not affected: its value never counts) — create, delete, unlock: an admin; update: an admin or the account itself; the `roles` field: only an admin. With roles of its own that hold neither `editor` nor `admin`, or none: an account of that same collection, or a plugin admin, and an account never changes its own roles — **the plugin cannot rank a project's own roles: write that collection's rules** (`iapl-doctor` → `staff-own-roles`). `read`: a staff account. Payload's first-user route answers only for the panel's login collection (the first account, which becomes admin), in any spelling of the URL. `access.firstUserAdmin: false` with a default role below the panel role: the default panel role is not applied (logged), an explicit one is refused at start. With a slug in `access.staffCollections` that is not an auth collection Payload does not start (`/api/health` 503) | `accounts: { adminOnlyCreate: false, adminOnlyWrite: false, staffOnlyRead: false, firstUserRoute: 'all' }` | your own rule wins; `firstUserRoute: ['users', 'partners']`; a collection with open sign-up keeps its routes; `staffCreateAccess`, `staffUpdateAccess(slug)`, `staffReadAccess`, `sameStaffCollectionAccess(slug)`, `rolesByAdminOnly`, `rolesNotOwn(slug)`, `hasPluginRoles`, `applyStaffAccountAccess`, `adoptLateAuthCollections`, `buildFirstUserEndpoint` |
| A password set on a staff account has at least 12 characters and is not the e-mail address; existing passwords are not checked | `accounts: { password: false }` | `password: { minLength }`; `checkPassword`, `buildPasswordRuleHook` |
| While Turnstile cannot check (wrong secret, Cloudflare down): a text form is accepted, a form with files is refused | `forms: { turnstileOnConfigError: 'allow' }` | `'reject'`, `{ text, files }`; `turnstileOnConfigError` at a call site wins |
| Dashboard alerts by role: integration details for admins, a neutral line for editors, nothing for others; cookie alerts for editors and above. `'all'` checks nothing — no role, no second factor | `dashboardAlerts: { integrations: 'all', cookies: 'all' }` | `integrations: 'editor'`; the components' `details` / `audience` props |
| The `back` link of the 2FA setup and verify screens is checked on the server (`SafeTotpView` in front of the package's views): only a path on the site's origin inside the admin route is kept, anything else (`javascript:`, another host) becomes the admin root. Needs `generate:importmap` in the same deploy — with a stale map the 2FA screens have no code form and nobody can sign in (`ipal-doctor`, the start log and a notice above the screen report it; the notice is a hint from the file on disk and never replaces the screen; `twoFactor.importMapCheck: false` turns it off); check: password only → `/admin/verify-totp?back=https%3A%2F%2Fexample.com%2F` → code → lands on `/admin` | `twoFactor.safeBack: false` | `safeBack: (back, { adminRoute, origin }) => string`; `safeAdminBack`, `wrapTotpViews` (`@intecion/ipal-kit`), `SafeTotpView` (`@intecion/ipal-kit/admin`) for own views |
| The `back` link of the 2FA setup and verify screens is checked on the server (`SafeTotpView` in front of the package's views): only a path on the site's origin inside the admin route is kept, anything else (`javascript:`, another host) becomes the admin root. Needs `generate:importmap` in the same deploy — with a stale map the 2FA screens have no code form and nobody can sign in (`iapl-doctor`, the start log and a notice above the screen report it; the notice is a hint from the file on disk and never replaces the screen; `twoFactor.importMapCheck: false` turns it off); check: password only → `/admin/verify-totp?back=https%3A%2F%2Fexample.com%2F` → code → lands on `/admin` | `twoFactor.safeBack: false` | `safeBack: (back, { adminRoute, origin }) => string`; `safeAdminBack`, `wrapTotpViews` (`@intecion/ipal-kit`), `SafeTotpView` (`@intecion/ipal-kit/admin`) for own views |
| The 2FA package's endpoints (`/api/setup-totp`, `verify-totp`, `remove-totp`, `admin/*`) answer accounts of the 2FA collection only; reset and remove need the second factor | — (always on with 2FA) | `adminManageAccess` through the wrapped factory (security.md "Resetting 2FA") |
| Roles count only for accounts of a staff collection, in every predicate and access function | — | `access.staffCollections` |
| `enabled: false` keeps the schema | — | — (no endpoints, `onInit` or admin components; no DROP TABLE in `migrate:create`) |
@@ -1189,14 +1232,14 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Construction mode hides pages in Markdown, MCP | `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }` | `isPathVisible`, `isPathVisibleIn(mode, path)`, `pathOf(url)`, type `PathVisibility` |
| Construction mode filters the sitemap and llms.txt | `underConstructionSeo: false` | `include` / `getIncludedPaths` in the low-level builders |
| `getSettings` at `depth: 1` | — | `createContentHelpers({ settingsDepth: 2 })` (every request pays) |
| Image lightbox (off) | — (opt-in: `<SiteProviders lightbox>`, `LightboxTrigger`, `RenderRichText lightbox`, `ipalKit({ lightbox: true })` for panel labels) | `texts`, `classNames`, `unstyled`, `--ipal-lightbox-*` variables, `renderImage`, `renderDialog`, `loop`, `useLightbox`, `withLightboxUploads`, `lightboxImage` |
| Image lightbox (off) | — (opt-in: `<SiteProviders lightbox>`, `LightboxTrigger`, `RenderRichText lightbox`, `iapl({ lightbox: true })` for panel labels) | `texts`, `classNames`, `unstyled`, `--ipal-lightbox-*` variables, `renderImage`, `renderDialog`, `loop`, `useLightbox`, `withLightboxUploads`, `lightboxImage` |
| `RenderRichText` renders unsafe link URLs as `#` | `safeLinks={false}` (fully trusted content only) | your own `converters` |
| Search engines tab in Site settings | `searchSettings: false` (top level, works without `seo`; `seo.searchSettings` still works) | `searchSettings: (fields) => fields`; `verificationFrom`, `robotsOptionsFrom` |
| Verification `<meta>` from the panel | empty fields = no tag | `const { verification, ...meta } = await generatePageMetadata(…)` |
| AI crawler policy from the panel | `robots` instead of `getRobots`; policy `default` | `buildRobots({ ...robotsOptionsFrom(settings), aiBotRules })`; `AI_ASSISTANT_BOTS`, `AI_TRAINING_BOTS` |
| Sitemap split / CDN cache / memo | `sitemapOptions: { maxUrls: Infinity, cacheControl: false, memoSeconds: 0 }` | `sitemapEntries`, `createSitemapRouteHandler`, `buildSitemapIndexXml`, `buildSitemapEntries` |
| Sitemap error = 503 + `Retry-After` | — (correct HTTP behaviour) | your own route with `buildSitemapXml` |
| IndexNow silent with `IPAL_NOINDEX` | `indexNow` off by default | `submitToIndexNow` by hand |
| IndexNow silent with `IAPL_NOINDEX` | `indexNow` off by default | `submitToIndexNow` by hand |
---
@@ -1208,10 +1251,10 @@ its own tests). Order from the cheapest:
| Level | What | When |
|---|---|---|
| Types | `pnpm generate:types && pnpm tsc --noEmit` | after every schema change |
| Rules | `ipal-audit --quick` (hardcoding, the §0b set, panel) | after every block / collection |
| Rules | `iapl-audit --quick` (hardcoding, the §0b set, panel) | after every block / collection |
| Build | `pnpm build` — page routes `●` (SSG), not `ƒ` | before every "done" |
| Smoke (Playwright) | `ipal-audit/resources/smoke.spec.template.ts` → `tests/smoke.spec.ts`: all URLs from the sitemap 200 + title + one h1, 404, GEO routes, banner, form end-to-end | before handover and after every ipal-kit update |
| Site in the browser | `ipal-seo-check`, `ipal-consent-check`, `cookie-scan` | before handover, after deploy |
| Smoke (Playwright) | `iapl-audit/resources/smoke.spec.template.ts` → `tests/smoke.spec.ts`: all URLs from the sitemap 200 + title + one h1, 404, GEO routes, banner, form end-to-end | before handover and after every IAPL update |
| Site in the browser | `iapl-seo-check`, `iapl-consent-check`, `cookie-scan` | before handover, after deploy |
| Project logic | vitest for your own functions (mapping company data to JSON-LD, helpers, hooks, migration scripts with `--dry-run`) | when you write logic the plugin does not have |
| Panel | the editor test (§11) and the empty-block test (§6.5a) | every new block / global |
@@ -1221,10 +1264,10 @@ Rules:
- **Every fixed bug = a test** that would have caught it (smoke or vitest), so it does not come back.
- **Test the form for real**: sending → a record in Form Submissions → mail to the company **and**
confirmation to the customer (locally: Site integrations → Send test + adapter logs).
- **Do not test the plugin in the project** (e.g. whether `submitForm` validates) — ipal-kit does that. When
- **Do not test the plugin in the project** (e.g. whether `submitForm` validates) — IAPL does that. When
the plugin's behavior is wrong: plugin gap.
- Tests in the project's CI: types + audit `--quick` + build on every push; smoke on staging
(`IPAL_NOINDEX=1`) before a production deployment.
(`IAPL_NOINDEX=1`) before a production deployment.
## 8. CODE STANDARDS
@@ -1312,14 +1355,14 @@ Record the key project decisions (stack, decisions, page modes) in the project's
## 11. BEFORE YOU SAY "DONE"
**Run, do not guess** — `ipal-audit` (the §0b set + the rules below) and `ipal-seo-check`
(GEO and SEO on the built site) instead of manual greps; then `ipal-doctor` for the whole site against the team
**Run, do not guess** — `iapl-audit` (the §0b set + the rules below) and `iapl-seo-check`
(GEO and SEO on the built site) instead of manual greps; then `iapl-doctor` for the whole site against the team
standard (versions, Node 22, layout, database names, env, headers, 2FA, cookie scanner, AGENTS.md, skills, seeds,
block library — [doctor.md](../doctor.md)):
```bash
bash .agents/skills/ipal-audit/scripts/audit.sh
pnpm exec ipal-doctor # + --deep --url http://localhost:3000 on the built site
node .agents/skills/ipal-seo-check/scripts/seo-check.mjs http://localhost:3000
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 generate:types && pnpm tsc --noEmit
pnpm build # --webpack in the script; locally, not only dev
# hardcoding and the field zoo in blocks
@@ -1375,7 +1418,7 @@ Anything that needs a developer → move it to the panel.
| Under-construction mode | [construction.md](../construction.md) |
| Visit statistics (optional) | [stats.md](../stats.md) |
| Light / dark theme | [theme.md](../theme.md) |
| Design tokens, `ipal-tokens`, DESIGN.md | [design-tokens.md](../design-tokens.md) |
| Design tokens, `iapl-tokens`, DESIGN.md | [design-tokens.md](../design-tokens.md) |
| Payload helpers (getSiteSettings…) | [payload-helpers.md](../payload-helpers.md) |
| Rich text | [richtext.md](../richtext.md) |
| Headers, CSP, 2FA, panel path | [security.md](../security.md) |
@@ -1386,12 +1429,12 @@ Anything that needs a developer → move it to the panel.
| R2, `buildImagesConfig`, YouTube | [storage.md](../storage.md) |
| Front end: `createContentHelpers` (`@/lib/content`), `createPageRoute`, `SiteProviders` | [frontend.md](../frontend.md) |
| Integrations (the `site-integrations` global, statuses, email test) | [integrations.md](../integrations.md) |
| New site from the reference site: `ipal-kit create`, `@intecion/ipal-kit/starter` | [project-starter.md](../project-starter.md) |
| New site from the reference site: `iapl create`, `@intecion/ipal-kit/starter` | [project-starter.md](../project-starter.md) |
| Deployment, production env, health check | [deployment.md](../deployment.md) |
| Seeds on production: create-only, dry run, backup, update guard | [seeding.md](../seeding.md) |
| Meta Pixel / GA4 via GTM | [gtm-meta-pixel.md](../gtm-meta-pixel.md) |
| Turnstile | [turnstile.md](../turnstile.md) |
| ipal-doctor: the site against the team standard, `ipal-doctor.json`, `/api/ipal/doctor` | [doctor.md](../doctor.md) |
| iapl-doctor: the site against the team standard, `iapl-doctor.json`, `/api/ipal/doctor` | [doctor.md](../doctor.md) |
| Panel white-label | [white-label.md](../white-label.md) |
---
@@ -1411,14 +1454,14 @@ file points to them.
Before your first change, read all of:
`node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`
Module details: `node_modules/@intecion/ipal-kit/docs/<module>.md`.
Skills: `.agents/skills/ipal-*` (refresh: `pnpm exec ipal-skills`). Always run `ipal-audit` before "done".
Skills: `.agents/skills/iapl-*` (refresh: `pnpm exec iapl-skills`). Always run `iapl-audit` before "done".
The rules in AGENT.md take precedence over your general knowledge of Next/Payload.
ipal-kit first: anything the plugin covers is built with the plugin. Missing or broken → plugin gap (ipal-plugin-gap): report to the owner and wait; never a hand-built replacement or a patch in `node_modules`.
IAPL first: anything the plugin covers is built with the plugin. Missing or broken → plugin gap (iapl-plugin-gap): report to the owner and wait; never a hand-built replacement or a patch in `node_modules`.
Code rules: AGENT.md "Code rules" (single responsibility, no duplicates, typed, texts from the panel, checks).
Write everything in this file in English.
## Site map
- <pages from the brief, the sections on each — written by ipal-site>
- <pages from the brief, the sections on each — written by iapl-site>
## Project decisions
- Architecture answers (AGENT.md "Ask before you build"), one line each: languages + default + URLs ·
@@ -1429,13 +1472,13 @@ Write everything in this file in English.
- <approved workarounds: what, why, plugin-request file, owner's approval>
- Launch date: <date> — from then on seeds touch named records only (AGENT.md "seeding after launch")
- <exceptions to the rules — with the reason>
- <only on a client decision> ipal-audit-skip: <keys from AGENT.md §0b> — <reason, source of the decision>
- <only on a client decision> iapl-audit-skip: <keys from AGENT.md §0b> — <reason, source of the decision>
```
**Claude Code** reads `CLAUDE.md`, not `AGENTS.md` — add a `CLAUDE.md` in the root with one
line `@AGENTS.md` (an import), instead of copying the content. `pnpm exec ipal-skills` does this itself:
it adds the `<!-- ipal-kit:start -->…<!-- ipal-kit:end -->` block to `AGENTS.md` (a pointer to
AGENT.md, `ipal-reference`, `ipal-setup`), and creates a missing `CLAUDE.md` with `@AGENTS.md`.
line `@AGENTS.md` (an import), instead of copying the content. `pnpm exec iapl-skills` does this itself:
it adds the `<!-- iapl:start -->…<!-- iapl:end -->` block to `AGENTS.md` (a pointer to
AGENT.md, `iapl-reference`, `iapl-setup`), and creates a missing `CLAUDE.md` with `@AGENTS.md`.
On every run it replaces only the text between the markers — it does not touch your own content.
---
@@ -1448,66 +1491,66 @@ the task matches — manually: `/<name>`.
| Skill | When |
|---|---|
| `ipal-site` | **a whole site from brief to report** — guides you through the other skills (§0a) |
| `ipal-reference` | **the full plugin map**: `ipalKit` options, env, routes, proxy, layout, import map, hooks, collections, globals + `resources/api.md` (every export) — before you write something yourself |
| `ipal-setup` | a new project from scratch (foundation) — complete installation stage by stage |
| `ipal-block` | a new or revised section (block) — schema, panel (§6.5a), component |
| `ipal-collection` | "we need a blog / products / …" — before a file appears in `src/collections` |
| `ipal-nav` | header, menu, footer, company data |
| `ipal-form` | a form from the panel: renderer, `submitForm` action, Turnstile, mails, GTM |
| `ipal-locale-add` | a new language — configuration, content, the `locale-coverage` script |
| `ipal-migrate-fields` | changing fields that already contain content — 3 phases, a script with dry-run |
| `ipal-upgrade` | updating ipal-kit in an existing project |
| `ipal-debug` | anything does not work — procedure + a symptom → cause → fix table |
| `ipal-audit` | before every "done" — the §0b set + the §11 checks + panel (§6.5a) + hardcoding in JSX + tsc + build |
| `ipal-seo-check` | the running site through the eyes of Googlebot and AI agents (head, canonical, hreflang, sitemap, 404, JSON-LD, llms, Markdown, MCP) |
| `ipal-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'` |
| `ipal-doctor` | the whole site against the team standard in one command (`pnpm exec ipal-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 |
| `ipal-plugin-gap` | ipal-kit has a bug or is missing a feature — report to the owner, wait for the decision; a marked workaround only after approval |
| `iapl-site` | **a whole site from brief to report** — guides you through the other skills (§0a) |
| `iapl-reference` | **the full plugin map**: `iapl` options, env, routes, proxy, layout, import map, hooks, collections, globals + `resources/api.md` (every export) — before you write something yourself |
| `iapl-setup` | a new project from scratch (foundation) — complete installation stage by stage |
| `iapl-block` | a new or revised section (block) — schema, panel (§6.5a), component |
| `iapl-collection` | "we need a blog / products / …" — before a file appears in `src/collections` |
| `iapl-nav` | header, menu, footer, company data |
| `iapl-form` | a form from the panel: renderer, `submitForm` action, Turnstile, mails, GTM |
| `iapl-locale-add` | a new language — configuration, content, the `locale-coverage` script |
| `iapl-migrate-fields` | changing fields that already contain content — 3 phases, a script with dry-run |
| `iapl-upgrade` | updating IAPL in an existing project |
| `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-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 |
Run the scripts in the skills, do not read them (the output is enough): `ipal-audit/scripts/audit.sh`, `pnpm exec ipal-doctor`,
`ipal-seo-check/scripts/seo-check.mjs`, `ipal-consent-check/scripts/consent-check.mjs`,
`ipal-locale-add/scripts/locale-coverage.ts`; templates to copy are in `resources/`.
Run the scripts in the skills, do not read them (the output is enough): `iapl-audit/scripts/audit.sh`, `pnpm exec iapl-doctor`,
`iapl-seo-check/scripts/seo-check.mjs`, `iapl-consent-check/scripts/consent-check.mjs`,
`iapl-locale-add/scripts/locale-coverage.ts`; templates to copy are in `resources/`.
**Installation in the project** (once and after every ipal-kit update) — `ipal-skills` is
**Installation in the project** (once and after every IAPL update) — `iapl-skills` is
a command (`bin`) of the package:
```bash
pnpm exec ipal-skills # → .agents/skills/ipal-*
pnpm exec ipal-skills --dry-run # only show what will change
pnpm exec ipal-skills --dest .claude/skills # Claude Code looks for skills in .claude/skills
pnpm exec ipal-skills --no-pointer # skills only, without touching AGENTS.md / CLAUDE.md
pnpm exec iapl-skills # → .agents/skills/iapl-*
pnpm exec iapl-skills --dry-run # only show what will change
pnpm exec iapl-skills --dest .claude/skills # Claude Code looks for skills in .claude/skills
pnpm exec iapl-skills --no-pointer # skills only, without touching AGENTS.md / CLAUDE.md
```
Besides the skills, the command maintains the pointer to the guide: the `ipal-kit:start…end` block in
Besides the skills, the command maintains the pointer to the guide: the `iapl:start…end` block in
`AGENTS.md` (it creates the file when missing) and in `CLAUDE.md` (when missing — it creates `CLAUDE.md`
with `@AGENTS.md`; when `CLAUDE.md` already imports `@AGENTS.md` — it does not duplicate it). Run it
**right after `pnpm add @intecion/ipal-kit`** — the plugin has no `postinstall` script.
It copies only the `ipal-*` folders: adds new ones, replaces existing ones entirely, removes
It copies only the `iapl-*` folders: adds new ones, replaces existing ones entirely, removes
retired ones. Name the project's own skills **without** the `ipal-` prefix — they stay untouched.
`--dest` must be a subdirectory of the project. Commit the copied `ipal-*` to the project repo.
`--dest` must be a subdirectory of the project. Commit the copied `iapl-*` to the project repo.
**External skills (opt-in)** — well-known third-party skills, vendored into the package at pinned commits
(text only, licence + `SOURCE.md` in each folder). `ipal-skills` downloads nothing; it checks every file
(text only, licence + `SOURCE.md` in each folder). `iapl-skills` downloads nothing; it checks every file
against `docs/agent/external/manifest.json` before copying:
```bash
pnpm exec ipal-skills --external # all ext-* next to the ipal-* skills
pnpm exec ipal-skills --external ext-accessibility,ext-payload # only these
pnpm exec iapl-skills --external # all ext-* next to the iapl-* skills
pnpm exec iapl-skills --external ext-accessibility,ext-payload # only these
```
| Skill | Publisher · licence | What it is for | Our override |
|---|---|---|---|
| `ext-react-best-practices` | Vercel · MIT | React/Next performance rules (waterfalls, bundles, RSC, re-renders) | no `swr` / client-fetch libraries — Server Components + Payload / `@/lib/content` |
| `ext-composition-patterns` | Vercel · MIT | compound components instead of boolean props, React 19 APIs | block schema and `RenderBlocks` follow §6 |
| `ext-accessibility` | Addy Osmani · MIT | WCAG 2.2 audit and fixes | Lighthouse / axe only as pinned devDependencies; ipal-kit components fixed via props or a plugin gap |
| `ext-accessibility` | Addy Osmani · MIT | WCAG 2.2 audit and fixes | Lighthouse / axe only as pinned devDependencies; IAPL components fixed via props or a plugin gap |
| `ext-frontend-design` | Anthropic · Apache-2.0 | distinctive visual direction, design quality floor | `DESIGN.md` tokens win; use it to write/extend `DESIGN.md` + `src/design/tokens.ts`, mapping its palette onto the `--ipal-*` roles (design-tokens.md) — never new token names, never hex/fonts/text in components |
| `ext-payload` | Payload CMS · MIT | Payload 3 reference (v3.92.1) | reference only, never Payload 4 guidance; ipal-kit features first |
| `ext-payload` | Payload CMS · MIT | Payload 3 reference (v3.92.1) | reference only, never Payload 4 guidance; IAPL features first |
**Our rules win.** Every `ext-*` SKILL.md starts with an override note; when an external skill conflicts with
this file, the project's `AGENTS.md` or `DESIGN.md`, those win — ipal-kit first, Payload data fetching over `swr`,
this file, the project's `AGENTS.md` or `DESIGN.md`, those win — IAPL first, Payload data fetching over `swr`,
`DESIGN.md` tokens, Payload 3 not 4. `ext-*` folders are touched only with `--external`, and only those with
ipal-kit's `SOURCE.md`; do not name the project's own skills `ext-…`. Use them only after the owner chose them
IAPL's `SOURCE.md`; do not name the project's own skills `ext-…`. Use them only after the owner chose them
("Project decisions").
**`tsconfig.json` must exclude the skills directory** (it contains `.ts`/`.tsx` templates that
break `tsc` and `next build`): `"exclude": ["node_modules", ".agents"]` (with `--dest
.claude/skills` — `".claude"`). Without it `ipal-skills` prints a warning and exits with
.claude/skills` — `".claude"`). Without it `iapl-skills` prints a warning and exits with
code 1. The commands in this file and in the skills assume `.agents/skills/` — with a different
`--dest` replace the path.