Agent instructions: mandatory feature set (SEO, GEO, R2, Turnstile, forms) enforced by audits

- AGENT.md §0b: one table of everything every site must have (SEO meta/maps,
  JSON-LD, llms.txt + llms-full, Markdown, MCP, AI bots, R2, panel forms,
  Turnstile, consent, security, ops, system pages, zero hardcodes), the
  forbidden replacements (own forms, nodemailer, reCAPTCHA, hand-written
  JSON-LD, static SEO files, raw S3) and an `ipal-audit-skip:` escape hatch that
  needs a recorded client decision.
- ipal-audit: "missing: …" errors for every mandatory item and for plugin
  replacements; ipal-seo-check: runtime GEO checks (llms, Markdown, MCP,
  JSON-LD, AI bots, health). Both verified on bare and complete fixtures.
- Skills (setup, site, form, upgrade, audit, seo-check) and PROGRAMISTA.md
  wire the full set from step one; GEO is no longer "optional".
- Fix: createProxy({ markdown: true }) lets /md/... through — multilingual
  sites redirected /md/pl/x to /pl/md/pl/x, so the documented Markdown route
  never worked — and handles Accept: text/markdown.
- createContentHelpers({ markdownAlternate: true }) adds the text/markdown
  alternate link in generatePageMetadata.
- JSDoc/docs JSON-LD examples use JsonLdGraph; docs/CHANGELOG.md for 1.9.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-16 01:26:10 +02:00
co-authored by Claude Opus 5.5
parent ab854ef37a
commit d3e5efb9f8
23 changed files with 571 additions and 83 deletions
+27 -13
View File
@@ -1,10 +1,13 @@
---
name: ipal-setup
description: Sets up a new client project on Payload 3 + Next 16 + @intecion/ipal-kit from an empty folder — registry and dependencies, version overrides, i18n config, payload.config with ipalKit (2FA injected, white-label), core collections, design tokens, UI primitives, proxy, layout and catch-all page, SEO routes, security headers, env validation. Use when starting a new website project or when a project is missing its ipal-kit foundation.
description: Sets up a new client project on Payload 3 + Next 16 + @intecion/ipal-kit from an empty folder with the full mandatory feature set (AGENT.md §0b) — registry and dependencies, version overrides, i18n config, payload.config with ipalKit (2FA injected, white-label, forms, mailAdapter, R2 storage), core collections, design tokens, UI primitives, proxy with Markdown negotiation, layout with JSON-LD, Turnstile and consent, catch-all page, SEO routes, GEO routes (llms.txt, llms-full.txt, Markdown, MCP), security headers, env validation. Use when starting a new website project or when a project is missing its ipal-kit foundation.
---
# ipal-setup
**Cel: OBOWIĄZKOWY KOMPLET z AGENT.md §0b — wszystkie 16 pozycji.** Wszystko
sprawdza etap 11; nie kończysz z brakami (chyba że `ipal-audit-skip` z decyzji klienta).
Kod i szczegóły: `node_modules/@intecion/ipal-kit/docs/dev/PROGRAMISTA.md` §1–2
(przed instalacją pakietu: poproś użytkownika o ten plik albo działaj wg kroków
poniżej i doczytaj po `pnpm add`). Reguły: `docs/agent/AGENT.md`.
@@ -14,27 +17,38 @@ pytania o brakujące dane zbierasz w jedną listę na początku; tryb „krok po
tylko, gdy użytkownik o to poprosi. Pełna budowa strony: skill **ipal-site**.
1. **Instalacja** — `.npmrc` (`@intecion:registry=…`, `legacy-peer-deps=true`),
`pnpm add @intecion/ipal-kit` + zależności z PROGRAMISTA §1, `pnpm.overrides`
`pnpm add @intecion/ipal-kit` + zależności z PROGRAMISTA §1 **razem z
`@payloadcms/storage-s3` i `@clocklimited/payload-2fa`**, `pnpm.overrides`
na wersję `payload` dla wszystkich `@payloadcms/*`, build z `--webpack`.
Nigdy instalacja z gita. Nie twórz `middleware.ts`.
2. **Skille i AGENTS.md** — skopiuj skille (AGENT.md §14), w `tsconfig.json` `"exclude": ["node_modules", ".agents"]`, utwórz `AGENTS.md`
wg AGENT.md §13 z danymi od użytkownika (zapytaj o: klient, domena, rynek,
języki, R2/lokalnie, SMTP/Graph).
języki, dane R2, klucze Turnstile, SMTP/Graph).
3. **Konfiguracja** — `src/i18n.config.ts` (`as const satisfies I18nConfig`),
`payload.config.ts` wg PROGRAMISTA §2.3: `twoFactor` z **wstrzykniętym**
`payloadTotp`, `whiteLabel: true`, `email: mailAdapter()`.
4. **Rdzeń** — wspólne pola i prymitywy (`../ipal-block/resources/kod-sekcji.md`), `Pages`, `Media`
`payloadTotp`, `whiteLabel: true`, `email: mailAdapter()`, `forms: {…}`,
**`buildR2Storage(['media'], { s3Storage })` zawsze** (bez `R2_*` w dev = dysk lokalny).
`.env.example` z `R2_*`, `IPAL_IP_HEADER`, `NEXT_PUBLIC_SERVER_URL`.
4. **Rdzeń** — wspólne pola i prymitywy (`../ipal-block/resources/kod-sekcji.md`), `Pages` (z `buildSummaryField()` — GEO), `Media`
z `normalizeFilenameHook` + `buildOptimizeUploadHook`/`buildOptimizeUploadField` (PROGRAMISTA §2.4, storage.md). Żadnych innych kolekcji.
5. **Style** — `styles.css` z `@theme` z `DESIGN.md` (jeśli brak — zapytaj o
Impeccable albo załóż neutralne tokeny), `@source` na plugin (AGENT.md §6.11, przykład w `../ipal-block/resources/kod-sekcji.md`).
6. **Routing** — `proxy.ts` (`createProxy`), `lib/content.ts`, layout bez
`<head>`, catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
6. **Routing** — `proxy.ts` (`createProxy(i18nConfig, { NextResponse, markdown: true })`), `lib/content.ts`
(`markdownAlternate: true`), layout bez `<head>` z `JsonLdGraph`, `TurnstileProvider`
(`getTurnstileConfig`), consent i `Analytics` (PROGRAMISTA §2.8), catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
`not-found.tsx` z `LocaleView` — bez `headers()`, wersja na każdy język (PROGRAMISTA §2.6–2.8, pages.md).
7. **SEO i bezpieczeństwo** — sitemap (`sitemap.xml/route.ts` = `sitemapRoute`, bez CSS w `public/`), robots, manifest, llms.txt, health
(wszystkie z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
`instrumentation.ts` z `assertEnv` z `@intecion/ipal-kit/env` (PROGRAMISTA §2.8–2.9, env.md).
8. **Nawigacja** — skill **ipal-nav**.
9. `pnpm generate:types`, `pnpm payload generate:importmap`, skill **ipal-audit**
(pełny), lista kroków w panelu dla użytkownika (PROGRAMISTA §2.11).
7. **SEO i bezpieczeństwo** — sitemap (`sitemap.xml/route.ts` = `sitemapRoute`, bez CSS w `public/`), robots, manifest, health
(z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
`instrumentation.ts` z `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` z `@intecion/ipal-kit/env` (PROGRAMISTA §2.8–2.9, env.md).
8. **GEO (obowiązkowe)** — `llms.txt`, `llms-full.txt` (`full: true`), `md/[locale]/[[...slug]]/route.ts`,
`api/mcp/route.ts` (publiczny), `summaryField: 'aiSummary'` w trasach AI; robots
wpuszcza boty AI (PROGRAMISTA §2.8, AGENT.md §0b.5–8).
9. **Formularze** — skill **ipal-form** (renderer + akcja raz; formularze w panelu).
10. **Nawigacja** — skill **ipal-nav**.
11. **Kontrola kompletu** — `pnpm generate:types`, `pnpm payload generate:importmap`,
**ipal-audit** (pełny) = 0 błędów, w tym sekcja „missing: …” (§0b); po
`pnpm build && pnpm start` **ipal-seo-check** = 0 błędów (llms, Markdown, MCP, JSON-LD).
Potem lista kroków w panelu dla użytkownika (PROGRAMISTA §2.11) z kluczami
Turnstile i transportem maila.
Dalej: bloki (skill **ipal-block**), kolekcje treści (**ipal-collection**).