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
+46 -42
View File
@@ -1,25 +1,25 @@
# ipal-doctor — one check for the whole site
# iapl-doctor — one check for the whole site
`ipal-doctor` checks a site against the team's rules and lists every gap with a fix hint and a doc link. It covers
`iapl-doctor` checks a site against the team's rules and lists every gap with a fix hint and a doc link. It covers
what drifts between sites: versions, Node, the folder layout, database names, env rules, security headers, 2FA, the
cookie scanner, the admin preview, the agent guide, seeds, the block library, and the running site.
Related: [AGENT.md §11](./agent/AGENT.md), the `ipal-doctor` skill, [deployment.md](./deployment.md),
Related: [AGENT.md §11](./agent/AGENT.md), the `iapl-doctor` skill, [deployment.md](./deployment.md),
[seeding.md](./seeding.md), [security.md](./security.md), [blocks.md](./blocks.md).
## Run it
```bash
pnpm exec ipal-doctor # this project, human-readable
pnpm exec ipal-doctor --strict --offline # CI on a new site: any finding fails
pnpm exec ipal-doctor --deep --url http://localhost:3000 # + database (read-only) and the running site
pnpm exec ipal-doctor --json > doctor.json # machine-readable
pnpm dlx --package=@intecion/ipal-kit@latest ipal-doctor # the newest rules, before an upgrade
pnpm exec iapl-doctor # this project, human-readable
pnpm exec iapl-doctor --strict --offline # CI on a new site: any finding fails
pnpm exec iapl-doctor --deep --url http://localhost:3000 # + database (read-only) and the running site
pnpm exec iapl-doctor --json > doctor.json # machine-readable
pnpm dlx --package=@intecion/ipal-kit@latest iapl-doctor # the newest rules, before an upgrade
```
`ipal-doctor` is a bin of the package (`bin/ipal-doctor.mjs`), like `ipal-skills`. `pnpm exec` uses the rules of
`iapl-doctor` is a bin of the package (`bin/iapl-doctor.mjs`), like `iapl-skills`. `pnpm exec` uses the rules of
the version the site has installed — reproducible in CI. The report header names both: the rules version and the
site's ipal-kit.
site's IAPL.
| Option | What it does |
|---|---|
@@ -29,7 +29,7 @@ site's ipal-kit.
| `--strict` | any finding that is not silenced fails (= `--fail-on info`) |
| `--fail-on error\|warning\|info` | the lowest severity that fails (default `error`) |
| `--offline` | skips the two rules that need the registry: `plugin-latest` (`pnpm view`) and `deps-audit` (`pnpm audit --prod`) |
| `--url <url>` | also checks the running site: headers, X-Powered-By, CSP, `/api/health`, admin noindex and link preview, production noindex, and `ipal-seo-check` (robots, sitemap, canonical, hreflang, JSON-LD, llms, MCP) |
| `--url <url>` | also checks the running site: headers, X-Powered-By, CSP, `/api/health`, admin noindex and link preview, production noindex, and `iapl-seo-check` (robots, sitemap, canonical, hreflang, JSON-LD, llms, MCP) |
| `--staging` | with `--url`: the site is a staging copy, so it must be noindex |
| `--admin-route <path>` | with `--url`: the panel path (default `/admin`) |
| `--deep` | read-only database checks through `pnpm exec payload run` (below) |
@@ -38,7 +38,7 @@ site's ipal-kit.
| `--sites <glob>` | many projects at once, e.g. `'../*-web'`: a rule × site table (always exit 0 — a report, never a gate) |
**Exit codes:** `0` nothing at or above `--fail-on` · `1` findings at or above it · `2` the doctor could not run (not
a project root, a broken `ipal-doctor.json`, a bad option) · `3` a rule crashed (the others still report).
a project root, a broken `iapl-doctor.json`, a bad option) · `3` a rule crashed (the others still report).
**Severities:** `error` breaks a team rule or is a security or data risk; `warning` is drift to fix; `info` is
worth knowing. Without `--strict`, only errors fail.
@@ -47,8 +47,8 @@ worth knowing. Without `--strict`, only errors fail.
- **Static** (default): reads files only — `package.json`, the installed versions in `node_modules`, the config
files, `.env` / `.env.example` (only variable names and the database name ever reach the report, never values),
the import map, `AGENTS.md`, the skills folder. It also runs `ipal-audit --quick` from the installed package. No
build, no database, no server. It writes nothing, except one date in `ipal-doctor.json` (below) outside CI.
the import map, `AGENTS.md`, the skills folder. It also runs `iapl-audit --quick` from the installed package. No
build, no database, no server. It writes nothing, except one date in `iapl-doctor.json` (below) outside CI.
- **Live** (`--url`): GET requests only, no login, a doctor user agent, each path once per run. `localhost` is exempt
from the HSTS check (plain http).
- **Deep** (`--deep`): `pnpm exec payload run node_modules/@intecion/ipal-kit/dist/modules/doctor/probe.js` in the
@@ -56,12 +56,12 @@ worth knowing. Without `--strict`, only errors fail.
waiting for approval; the project's own env rules (`register()` from `instrumentation.ts`); the committed import map
against a freshly generated one (written to a temporary file next to it and removed). Run it locally against the dev
database, or in the Coolify app container's terminal against the MongoDB container.
- **Deep through the site**: with `--url` (and no `--deep`), when `IPAL_DOCTOR_TOKEN` is set in the doctor's
- **Deep through the site**: with `--url` (and no `--deep`), when `IAPL_DOCTOR_TOKEN` is set in the doctor's
environment, the doctor reads the same counts from `GET /api/ipal/doctor` of the running site.
### The status endpoint — `GET /api/ipal/doctor`
Added by `ipalKit` and **off until the site has `IPAL_DOCTOR_TOKEN`** (at least 32 characters): before that it answers
Added by `iapl` and **off until the site has `IAPL_DOCTOR_TOKEN`** (at least 32 characters): before that it answers
404. With the token set it needs `Authorization: Bearer <token>`, is rate-limited (10 a minute per client IP) and
returns counts only — never names, e-mails or values:
@@ -69,7 +69,7 @@ returns counts only — never names, e-mails or values:
{ "node": "v22.20.0", "openSignUp": [], "pendingCookies": 0, "plugin": "1.15.0", "staffOnOwnRoles": [], "staffOpenToOthers": [], "turnstile": null, "turnstileSecretFromEnv": false, "usersSetupClosed": 0, "usersWithout2fa": 0 }
```
Turn off: `ipalKit({ doctor: false })`. Adapt: `ipalKit({ doctor: { tokenVar: 'MY_TOKEN', access: ({ req }) => isAdmin(req.user, req.payload) } })` (a logged-in staff admin may read it too; the second factor is checked for you — never test `req.user.roles` by hand, an account of another collection can carry the same value)
Turn off: `iapl({ doctor: false })`. Adapt: `iapl({ doctor: { tokenVar: 'MY_TOKEN', access: ({ req }) => isAdmin(req.user, req.payload) } })` (a logged-in staff admin may read it too; the second factor is checked for you — never test `req.user.roles` by hand, an account of another collection can carry the same value)
(`access` lets a logged-in admin read it without the token). Building blocks: `buildDoctorEndpoint`,
`collectDoctorStatus` from `@intecion/ipal-kit/doctor`.
@@ -85,52 +85,56 @@ Turn off: `ipalKit({ doctor: false })`. Adapt: `ipalKit({ doctor: { tokenVar: 'M
| | `node-22` | warning | `engines.node` only 22 (`">=22 <23"`), `.nvmrc` / `.node-version` = 22; with `--deep`, the running Node |
| | `pnpm-pinned` | info | `packageManager` is set |
| | `deps-audit` | error on critical/high, info on moderate/low | `pnpm audit --prod` (registry) |
| layout | `layout-required` | error | the AGENT.md §3 files (proxy, i18n config, instrumentation, `lib/content`, every route, the frontend files — `layout`, `actions`, `not-found`, `notFoundView` (`.ts` or `.tsx`), the catch-all page — in the route group found by structure: any `app/(<group>)` (or `app` itself) holding `[locale]/[[...slug]]/page.tsx` or `[[...slug]]/page.tsx`, a localized one first, `(frontend)` on a tie (two matches → a warning naming both); `layout.frontend` sets it, `blocks/registry.ts`, `collections/{Pages,Media}.ts`, `components/layout`, `components/forms/formClasses.ts`); an `ipal-audit-skip` key (`llms`, `llms-full`, `markdown`, `mcp`, `indexnow`) drops its file |
| layout | `layout-required` | error | the AGENT.md §3 files (proxy, i18n config, instrumentation, `lib/content`, every route, the frontend files — `layout`, `actions`, `not-found`, `notFoundView` (`.ts` or `.tsx`), the catch-all page — in the route group found by structure: any `app/(<group>)` (or `app` itself) holding `[locale]/[[...slug]]/page.tsx` or `[[...slug]]/page.tsx`, a localized one first, `(frontend)` on a tie (two matches → a warning naming both); `layout.frontend` sets it, `blocks/registry.ts`, `collections/{Pages,Media}.ts`, `components/layout`, `components/forms/formClasses.ts`); an `iapl-audit-skip` key (`llms`, `llms-full`, `markdown`, `mcp`, `indexnow`) drops its file |
| | `layout-forbidden` | error | no `middleware.ts`, no `lib/{pages,locales,navigation}.ts`, `fields/{link,sectionHeader,sectionSettings}.ts` |
| | `layout-extra` | info | `src/` entries outside the allow list (AGENT.md §3 + `seed/`, `design/`, `db.ts`, `env.rules.ts`, `content.config.ts`; extend with `layout.allow`) |
| | `naming` | warning | block folders, collection and global files PascalCase, `scripts/*` kebab-case, no `index.ts` barrels |
| | `importmap` | error | the import map exists, holds the entries for what the config turns on (2FA incl. `SafeTotpView`, `TwoFactorStatusField`, `TwoFactorAlert`; R2, cookie scanner, `adminMeta`), names no export the plugin no longer has; with `--deep`, equals a fresh one. Warning: the config uses the 2FA package's own setup / verify view as a view's `Component` (outside the `back` link check — security.md); not for that path as `ipalTotpView` of `SafeTotpView` or in `admin.dependencies` |
| | `tsconfig-skills` | error | `tsconfig.json` excludes the skills folder |
| env | `db-name` | error | `DATABASE_URI` in `.env` and `.env.example` names `<domain without dots>_dev`; a local `.env` on `_prod` is an error; `--env-file` checks `_prod` (`databaseNamesFor`) |
| | `env-rules` | error / warning | `instrumentation.ts` calls `assertEnv(ipalEnvRules(…))` from `/env`, with `storage` (R2), `cookieCrawl` (crawl), `ipHeader`; `databaseName` suggested (info) |
| | `env-rules` | error / warning | `instrumentation.ts` calls `assertEnv(iaplEnvRules(…))` from `/env`, with `storage` (R2), `cookieCrawl` (crawl), `ipHeader`; `databaseName` suggested (info) |
| | `env-example` | warning / error | `.env.example` lists the variables those rules name; no credentials or secret values in it |
| | `env-live` | error | (deep) the project's env rules pass in the real environment |
| security | `security-headers` | error | `buildSecurityHeaders`; live: HSTS, nosniff, Referrer-Policy, Permissions-Policy, frame protection |
| | `powered-by` | error | `withSecurityConfig`; live: no `X-Powered-By` on `/` and the admin |
| | `csp` | warning / info | CSP on the site and the admin; report-only is info, a warning after 4 weeks (`seen`) |
| | `2fa` | error | `twoFactor: { plugin: payloadTotp }` + the package; deep: 0 users without TOTP (the message says how many of them are blocked because their setup window has passed); error: a Postgres / SQLite project whose migrations do not mention the 2FA column `totp_setup_from` (every login would answer 500; a warning when there is no migrations folder — the doctor cannot see a schema that gets there another way); warning: `twoFactor.requireSetup: false`; info: no setup window (`windowHours: false`) |
| | `access-missing` | warning | `ipalKit` has an `access` option — without it there are no roles and every panel account is an admin |
| | `access-missing` | warning | `iapl` has an `access` option — without it there are no roles and every panel account is an admin |
| | `csrf-empty` | warning | the config sets `serverURL` or `csrf` — otherwise Payload accepts the login cookie from any origin |
| | `open-signup` | info | (deep) auth collections whose `create` rule lets an anonymous request through: sign-up is open there (intended for a customer zone — silence with a reason) |
| | `staff-own-roles` | warning | (deep) a staff collection with role values of its own, neither `editor` nor `admin` among them, that runs on the plugin's default account rules: the plugin cannot rank those roles, so inside the collection every account may create an account with any role and change or delete another. Write the collection's own rules |
| | `staff-accounts-open` | error (warning for `read`, `readVersions`) | (deep) a staff collection that an account of another, non-staff auth collection may create in, read (also its versions), update, delete from or unlock — it can make itself staff, change a staff password, list the accounts or lift a login lock. The account rules are off (`accounts: false`, `adminOnlyCreate` / `adminOnlyWrite` / `staffOnlyRead: false`) or the project's own rule is wider. Asked with a made-up outside account; a rule that throws counts as closed |
| | `turnstile-degraded` | warning / error | (deep) Turnstile is checking forms; while it is not (wrong or missing secret, Cloudflare down) a warning, an error once it has lasted 24 hours (counted from the recorded start to now) |
| | `turnstile-env-key` | warning | (deep) the Turnstile secret key is in the panel, not in the deprecated `TURNSTILE_SECRET_KEY` environment variable |
| | `storage-names` | warning | the visitor cookie the layout sets (`<PageStats visitorCookie>`, default `ipal_vid`) is the one the config makes the cookie scanner declare (`storageNames`, stats.md) |
| | `cookie-scanner` | error / warning / info | `cookieScanner` on (with `crawl`, else info); deep: nothing waits for approval (warning) |
| admin | `admin-meta` | warning | ipal-kit ≥ 1.14.5, no `adminMeta: false` / `agency: false`; live: the admin `og:image` is `/api/ipal/admin-og` |
| admin | `admin-meta` | warning | IAPL ≥ 1.14.5, no `adminMeta: false` / `agency: false`; live: the admin `og:image` is `/api/ipal/admin-og` |
| | `admin-noindex` | error | (live) the admin login page is noindex |
| agents | `agents-md` | error / warning | `AGENTS.md` with a non-empty `## Project decisions`, the `ipal-kit:start…end` pointer for the installed version, `CLAUDE.md` with `@AGENTS.md` |
| | `skills-current` | warning | `.agents/skills/ipal-*` equal the installed plugin's (`planSkills`, what `ipal-skills` would change) |
| seeds | `seed-named` | error / warning | every `seed*` script uses `createSeeder` (`only` / `SEED_ONLY`, the full-seed guard), deletes nothing, has no `fresh`/`reset` script, does not switch the guard off (`guard: false`, `allowFull: true`, `IPAL_SEED_ALLOW_FULL=1` in a script or committed env file); after launch a seed without an `only` list is a warning |
| agents | `agents-md` | error / warning | `AGENTS.md` with a non-empty `## Project decisions`, the `iapl:start…end` pointer for the installed version, `CLAUDE.md` with `@AGENTS.md` |
| | `legacy-names` | info / warning | names from before the rename to IAPL (1.17.0) the project still uses: `ipal-doctor.json`, `ipalKit` / `ipalEnvRules` and the other old exports in the config and `instrumentation.ts`, old commands in `package.json` scripts, `IPAL_*` in env files, the old pointer block, `ipal-audit-skip`, `ipal-*` skill folders. All of them work, so this is information; a **warning** only for two doctor files side by side, or one variable set as `IAPL_…` and `IPAL_…` with different values |
| | `skills-current` | warning | `.agents/skills/iapl-*` equal the installed plugin's (`planSkills`, what `iapl-skills` would change) |
| seeds | `seed-named` | error / warning | every `seed*` script uses `createSeeder` (`only` / `SEED_ONLY`, the full-seed guard), deletes nothing, has no `fresh`/`reset` script, does not switch the guard off (`guard: false`, `allowFull: true`, `IAPL_SEED_ALLOW_FULL=1` in a script or committed env file); after launch a seed without an `only` list is a warning |
| blocks | `blocks-registry` | error | `blocks/registry.ts` uses `createBlockRegistry` or `RenderBlocks` (no `switch (blockType)`) |
| | `blocks-ui-required` | error | without `createBlockRegistry`, `components/ui/` has Section, SectionHeader, Media, CMSLink, Button |
| | `blocks-ui-override` | warning | a `components/ui/` file named like a library primitive is passed through `createBlockRegistry({ ui })` |
| | `blocks-duplicate` | warning | a project block whose `slug` (or `interfaceName`) matches a library block — also a slug renamed through the block's `slug` option — unless it is an override in `createBlockRegistry({ components })` |
| | `blocks-helper-copy` | warning | no local copy of a plugin field builder (`blockLibraryManifest.fieldBuilders`), `ctaHref`, `buildActionButtonsField` |
| | `blocks-tokens` | error / warning | from `ipal-audit`: hex colours, the token standard not wired, `ipal-tokens --check` |
| audit | `i18n-literals` | error / warning | from `ipal-audit`: hardcoded text in blocks (error) and components (warning), Polish literals in code (not the panel's `adminText()` / `{ en, pl }` labels in a schema file — the `ipal-audit` skill) |
| | `audit:<title>` | as reported | every other `ipal-audit --quick` finding, one per file |
| live | `live-reachable`, `live-health`, `live-noindex`, `live-seo` | error / warning | the URL answers; `/api/health` 200; production not noindex (staging must be); every `ipal-seo-check` error and warning |
| | `blocks-tokens` | error / warning | from `iapl-audit`: hex colours, the token standard not wired, `iapl-tokens --check` |
| audit | `i18n-literals` | error / warning | from `iapl-audit`: hardcoded text in blocks (error) and components (warning), Polish literals in code (not the panel's `adminText()` / `{ en, pl }` labels in a schema file — the `iapl-audit` skill) |
| | `audit:<title>` | as reported | every other `iapl-audit --quick` finding, one per file |
| live | `live-reachable`, `live-health`, `live-noindex`, `live-seo` | error / warning | the URL answers; `/api/health` 200; production not noindex (staging must be); every `iapl-seo-check` error and warning |
| deep | `deep-status` | error | the deep check could not finish |
| — | `doctor-config` | error / warning | `ipal-doctor.json` problems: invalid JSON, an entry without a reason, an expired `until` |
| — | `doctor-config` | error / warning | `iapl-doctor.json` problems: invalid JSON, an entry without a reason, an expired `until` |
| — | `doctor-crash` | error (exit 3) | a rule threw |
The block rules read `blockLibraryManifest` (`@intecion/ipal-kit/blocks`), so a new library block needs no doctor
change.
## Adapt it — `ipal-doctor.json`
## Adapt it — `iapl-doctor.json`
Every rule can be silenced, lowered or raised — **with a reason** — in `ipal-doctor.json` in the project root:
Every rule can be silenced, lowered or raised — **with a reason** — in `iapl-doctor.json` in the project root
(a project that has `ipal-doctor.json`, the name before 1.17.0, keeps it: the doctor reads and writes whichever
of the two exists, `iapl-doctor.json` when both do):
```json
{
@@ -160,7 +164,7 @@ Every rule can be silenced, lowered or raised — **with a reason** — in `ipal
Silenced findings stay in the report: in JSON with `"silenced": true` and the reason, in the human output under
"Silenced", in the summary count. `--strict` does not fail on them.
`ipal-audit-skip: <keys> — <reason>` lines in `AGENTS.md` (a client decision, AGENT.md §0b) count too: the audit honours
`iapl-audit-skip: <keys> — <reason>` lines in `AGENTS.md` (a client decision, AGENT.md §0b) count too: the audit honours
its keys, and the doctor maps `twofactor` → `2fa`, `csp` → `csp`, and drops the files of `llms`, `llms-full`, `markdown`,
`mcp`, `indexnow` from `layout-required`.
@@ -188,9 +192,9 @@ New sites only (the starter's and the reference site) gate on the doctor; existi
```yaml
- run: pnpm install --frozen-lockfile
- run: pnpm exec ipal-doctor --strict --offline # static, right after install
- run: pnpm exec iapl-doctor --strict --offline # static, right after install
# … build, start the app on :3000 with the CI database …
- run: pnpm exec ipal-doctor --strict --offline --deep --url http://localhost:3000
- run: pnpm exec iapl-doctor --strict --offline --deep --url http://localhost:3000
```
The plugin's own CI does the same for `reference/` (`.gitea/workflows/ci.yml`).
@@ -217,18 +221,18 @@ console.log(formatReport(report))
| Variable | Where | Effect |
|---|---|---|
| `IPAL_DOCTOR_TOKEN` | the site (Coolify), ≥ 32 characters | turns `GET /api/ipal/doctor` on; in the doctor's environment, `--url` uses it to read the deep counts |
| `CI` | the doctor's environment | set → the doctor never writes `seen` into `ipal-doctor.json` |
| `IAPL_DOCTOR_TOKEN` | the site (Coolify), ≥ 32 characters | turns `GET /api/ipal/doctor` on; in the doctor's environment, `--url` uses it to read the deep counts |
| `CI` | the doctor's environment | set → the doctor never writes `seen` into `iapl-doctor.json` |
| `NO_COLOR` | the doctor's environment | no colours in the human report |
| `PAYLOAD_CONFIG_PATH` | the project | `--deep` loads this config instead of `src/payload.config.ts` |
| `IPAL_DOCTOR_IMPORT_MAP` | internal | set by the doctor for the probe: the committed import map to compare |
| `IAPL_DOCTOR_IMPORT_MAP` | internal | set by the doctor for the probe: the committed import map to compare |
## Relation to the other checks
| Tool | When |
|---|---|
| `ipal-audit` | inside the edit loop: is the code I just wrote built the ipal-kit way (+ tsc and build without `--quick`) |
| `ipal-seo-check` | what crawlers see on a running site |
| `ipal-consent-check` | tracking waits for consent (a real browser) — not run by the doctor |
| `ipal-skills` | copies the skills; the doctor's `skills-current` uses the same comparison (`planSkills`) |
| **`ipal-doctor`** | the whole site against the team standard: runs `ipal-audit --quick` and (with `--url`) `ipal-seo-check` from the installed package and adds everything they do not check |
| `iapl-audit` | inside the edit loop: is the code I just wrote built the IAPL way (+ tsc and build without `--quick`) |
| `iapl-seo-check` | what crawlers see on a running site |
| `iapl-consent-check` | tracking waits for consent (a real browser) — not run by the doctor |
| `iapl-skills` | copies the skills; the doctor's `skills-current` uses the same comparison (`planSkills`) |
| **`iapl-doctor`** | the whole site against the team standard: runs `iapl-audit --quick` and (with `--url`) `iapl-seo-check` from the installed package and adds everything they do not check |