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
+89 -10
View File
@@ -34,6 +34,69 @@
8. **Zero `any` i `@ts-ignore`.** Typy z `@/payload-types`, `unknown` + guard.
9. **Jedno źródło prawdy** — `i18n.config.ts`, `lib/content.ts`, nigdy kopie.
10. **„Gotowe” dopiero po** lokalnym `pnpm build` + kontrolach z §11.
11. **Każda strona ma OBOWIĄZKOWY KOMPLET z §0b** — SEO, GEO (llms.txt, Markdown,
MCP), R2, Turnstile, formularze z buildera. `ipal-audit` sprawdza, czy jest
wpięty, `ipal-seo-check` — czy działa. Nie ma „zrobię później”.
---
## 0b. OBOWIĄZKOWY KOMPLET — każda strona, bez wyjątku
To nie są opcje. Każdy projekt ma **wszystkie** pozycje poniżej, wpięte przez
plugin. Brakuje danych (domena, klucze, bucket)? Wpinasz kod i tak — działa po
wpisaniu wartości w `.env` / panelu, a brak wpisujesz do raportu. Pomijasz pozycję
**tylko** z decyzji klienta zapisanej w `AGENTS.md` (linia `ipal-audit-skip:`, niżej).
Kolumna „Kontrola”: **A** = `ipal-audit` (kod), **S** = `ipal-seo-check` (działająca
strona), **P** = test w panelu. Pełny kod: PROGRAMISTA.md §2.
| # | Obszar | Co musi być (plik) | API pluginu | Kontrola |
|---|---|---|---|---|
| 1 | i18n + routing | `src/proxy.ts`, `[locale]/[[...slug]]/page.tsx` z ISR + `generateStaticParams`, `not-found.tsx` | `createProxy`, `createContentHelpers`, `resolveRoute`, `resolveRedirect` | A, S |
| 2 | **SEO** — meta | `generateMetadata` w każdej trasie stron; favicon i OG z Site Settings; `htmlLimitedBots` w `next.config.ts`; tab SEO + `buildNoindexField` w Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S |
| 3 | **SEO** — mapy | `src/app/sitemap.xml/route.ts`, `src/app/robots.ts`, `src/app/manifest.ts` (wszystkie z `force-dynamic` poza robots) | `sitemapRoute`, `robots`, `createManifestHandler` | A, S |
| 4 | **SEO** — dane strukturalne | `<JsonLdGraph>` w `[locale]/layout.tsx`: `WebSite` + `Organization` (lub `LocalBusiness` dla firmy lokalnej) z danych z panelu; `Breadcrumb` na podstronach; `FAQPage` przy bloku FAQ | `build*JsonLd`, `JsonLdGraph` (`/rsc`) | A, S |
| 5 | **GEO** — llms | `src/app/llms.txt/route.ts` i `src/app/llms-full.txt/route.ts` (`full: true`); pole `buildSummaryField()` w Pages, `summaryField: 'aiSummary'` w trasach AI | `createLlmsTxtRoute`, `buildSummaryField` | A, S |
| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts`; `createContentHelpers({ markdownAlternate: true })` (link w `<head>`); `createProxy(…, { NextResponse, markdown: true })` (bez tego `/md/…` dostaje redirect na język) | `createMarkdownRenderer`, `markdownResponse`, `markdownAlternate`, `createProxy({ markdown })` | A, S |
| 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` (publiczny — AI przegląda stronę: `get_site_info`, `list_pages`, `search_content`, `get_page`) | `createMcpRoute` | A, S |
| 8 | **GEO** — boty AI | robots **wpuszcza** boty AI (domyślne `aiBots: 'allow'`); `'block-training'` / `'disallow'` tylko z decyzji klienta | `buildRobots` | S |
| 9 | **Media / R2** | `Media` z `normalizeFilenameHook` + `buildOptimizeUploadHook`; **zawsze** `buildR2Storage(['media'], { s3Storage })` w `payload.config.ts` + `@payloadcms/storage-s3` w zależnościach; `R2_*` w `.env.example`; `<MediaPreconnect/>` w layoutcie | `buildR2Storage`, `normalizeFilenameHook`, `MediaPreconnect` | A |
| 10 | **Formularze** | formularze w panelu (kolekcja Forms); jeden `FormRenderer` + jedna akcja `sendForm` → `submitForm`; `forms: {…}` w `ipalKit`; `email: mailAdapter()` | `submitForm`, `useForm`, `isHoneypotTripped`, `mailAdapter` | A, P |
| 11 | **Turnstile** | `<TurnstileProvider siteKey={…}>` w `[locale]/layout.tsx`, `siteKey` z `getTurnstileConfig(payload)`; widget w `FormRenderer` (`useTurnstile`); klucze w Site Integrations | `getTurnstileConfig`, `TurnstileProvider`, `useTurnstile` | A, P |
| 12 | Zgoda + analityka | `ConsentProvider`, `CookieBanner`, `CookieButton`, `Analytics` w layoutcie; ID narzędzi w panelu | consent.md, analytics.md | A, `ipal-consent-check` |
| 13 | Bezpieczeństwo | `buildSecurityHeaders` w `next.config.ts`; `twoFactor: { issuer, plugin: payloadTotp }`; CSP `report-only` → `enforce`; `IPAL_IP_HEADER` na produkcji | security.md, forms.md | A |
| 14 | Operacje | `src/app/api/health/route.ts`; `src/instrumentation.ts` z `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` | `createHealthRoute`, `assertEnv`, `ipalEnvRules` | A |
| 15 | Strony systemowe | Site Settings → System Pages: homepage, 404, polityka prywatności, cookies; linki prawne w stopce przez rolę | `getSystemPagePath`, `getNotFoundPage` | P |
| 16 | **Zero hardkodów** | każdy tekst, link, obraz, plik, dane firmy z panelu; domeny i klucze z `.env` (§2) | — | A, P |
**Turnstile działa sam:** oba klucze w panelu (lub env) → widget się pokazuje, a
`submitForm` **wymaga** tokenu; brak kluczy → widgetu nie ma, formularz działa.
Nie warunkujesz providera ani widgetu w kodzie — wpinasz zawsze.
**R2 działa sam:** komplet `R2_*` w env → media w buckecie; brak → dysk lokalny
(dev). Kod wpinasz zawsze, żeby produkcja nie zapisywała mediów na dysk kontenera
(znikają przy redeployu).
### Zakazane zamienniki (ERROR w `ipal-audit`)
| Zamiast pluginu | Dlaczego nie | Użyj |
|---|---|---|
| własny formularz z polami w JSX, `react-hook-form`, `formik` | klient nie zmieni pól; brak Turnstile, rate limitu, zgody RODO | builder w panelu + `FormRenderer` + `submitForm` |
| własna trasa `api/contact` / `api/send` / `api/form`, `nodemailer` / `resend` / `@sendgrid` w projekcie | omija walidację i bramki `submitForm`, drugi transport maili | server action `sendForm` → `submitForm`, maile z Forms → Emails przez `mailAdapter()` |
| reCAPTCHA, hCaptcha, własna captcha | drugi mechanizm, brak statusu w panelu | Turnstile z pluginu |
| ręczny `<script type="application/ld+json">` | brak escapowania, rozjazd z panelem | `JsonLdGraph` |
| własny `sitemap.ts` / tekstowy `robots.txt` w `public/` | bez hreflang, noindex i stron systemowych | `sitemapRoute`, `robots` z `lib/content` |
| własny `llms.txt` w `public/` | statyczny, starzeje się | `createLlmsTxtRoute` |
| `@aws-sdk/client-s3` / własny upload do bucketa | omija hooki mediów i URL z `R2_PUBLIC_URL` | `buildR2Storage` |
### Świadomy wyjątek (tylko z decyzji klienta)
W `AGENTS.md` projektu, w „Ustaleniach”, jedna linia z kluczami pozycji i powodem:
```markdown
ipal-audit-skip: mcp, llms-full — klient nie chce udostępniać treści agentom AI (mail 2026-03-02)
```
Klucze: `llms`, `llms-full`, `markdown`, `mcp`, `jsonld`, `r2`, `turnstile`,
`analytics`, `csp`, `twofactor`. Bez tej linii brak pozycji to błąd.
---
@@ -160,17 +223,23 @@ src/
(frontend)/
styles.css # Tailwind + @source na node_modules/@intecion/ipal-kit/dist
[locale]/ # jednojęzyczny: bez [locale] (patrz i18n.md)
layout.tsx # bez <head>; ConsentProvider + Analytics
layout.tsx # bez <head>; JsonLdGraph, TurnstileProvider, ConsentProvider + Analytics
actions.ts # sendForm → submitForm (jedyna droga wysyłki formularzy)
not-found.tsx # 404 z panelu (getNotFoundPage)
[[...slug]]/page.tsx # PODWÓJNE nawiasy; RenderBlocks
(payload)/ # panel (generowany)
manifest.ts # createManifestHandler + force-dynamic
sitemap.xml/route.ts # sitemapRoute z lib/content + force-dynamic (wygląd z pluginu)
robots.ts # z lib/content
robots.ts # z lib/content (boty AI wpuszczone)
llms.txt/route.ts # createLlmsTxtRoute (GEO)
llms-full.txt/route.ts # createLlmsTxtRoute({ full: true }) (GEO)
md/[locale]/[[...slug]]/route.ts # createMarkdownRenderer — strona jako Markdown (GEO)
api/mcp/route.ts # createMcpRoute — publiczny serwer MCP (GEO)
api/health/route.ts # createHealthRoute
instrumentation.ts # assertEnv(ipalEnvRules({...})) z '@intecion/ipal-kit/env'
fields/ # sectionHeader.ts, sectionSettings.ts (linki: z pluginu)
components/
forms/FormRenderer.tsx # jedyny renderer formularzy z panelu (ipal-form)
ui/ # prymitywy: CMSLink, Button, Media, Section, SectionHeader
layout/ # Header, Footer, MobileNav (§6.8)
icons/ # names.ts + Icon.tsx (§6.10)
@@ -202,7 +271,7 @@ Bez skrótów (`HeroSection`, nie `HeroSec`). Nie twórz `lib/pages.ts`,
## 4. NEXT 16 — RENDERING, SEO, BUILD
1. **`proxy.ts`, nigdy `middleware.ts`.** Istnieje middleware.ts → usuń. Proxy:
`export const proxy = createProxy(i18nConfig, { NextResponse })`, matcher
`export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })`, matcher
jako **literał inline** (`['/((?!api|admin|_next|.*\\..*).*)']`), nie import.
2. **Bez jawnego `<head>` w layoutcie.** Wypycha metadata do `<body>`.
`<MediaPreconnect/>` w `<body>` (React 19 hoistuje).
@@ -569,8 +638,8 @@ Przykładowy `styles.css`: [kod-sekcji.md](./skills/ipal-block/resources/kod-sek
| Render bloków | `RenderBlocks` + mapa `registry` (nigdy `switch`) | blocks.md |
| Rich text | `RenderRichText` (`/rsc`), styl przez `converters` | richtext.md |
| Wartość zlokalizowana | `resolveLocalized(value, locale)` (nie `getSafeString`) | forms.md |
| Formularz | builder w panelu + `submitForm`; logika `useForm`/`useContactForm` | forms.md |
| Turnstile | `TurnstileProvider` w layoutcie + `useTurnstile()` | turnstile.md |
| Formularz | builder w panelu + `FormRenderer` + akcja `sendForm` → `submitForm`; logika `useForm`; IP: `clientIp(await headers())` | forms.md |
| Turnstile | `TurnstileProvider siteKey={(await getTurnstileConfig(payload)).siteKey}` w layoutcie + `useTurnstile()` — przy obu kluczach token jest wymagany | turnstile.md |
| Slug | `buildSlugField({ from: 'title' })` | slug.md |
| noindex | `buildNoindexField()` | seo.md |
| Ścieżki językowe | `getLocalizedSlugs`, `switchLocalePath`, `LanguageSwitcher` | i18n.md |
@@ -580,12 +649,14 @@ Przykładowy `styles.css`: [kod-sekcji.md](./skills/ipal-block/resources/kod-sek
| Stary slug → 308 | `trackSlugHistoryHook` + `resolveRedirect` | hooks.md |
| Obrazy między językami | `buildCrossLocaleFieldSync` (języki z configu) | hooks.md |
| Ochrona stron systemowych | `buildPreventDeleteSystemPage`, `buildValidateUniqueRole` | hooks.md |
| Metadata, sitemap, JSON-LD, llms.txt | `generatePageMetadata` (z `createContentHelpers`), `sitemap`, `build*JsonLd`, `createLlmsTxtRoute` | seo.md |
| Metadata, sitemap, JSON-LD | `generatePageMetadata` (z `createContentHelpers`), `sitemapRoute`, `build*JsonLd` + `JsonLdGraph` | seo.md |
| GEO (AI) | `createLlmsTxtRoute` (+ `full: true`), `createMarkdownRenderer` + `markdownResponse`, `markdownAlternate: true`, `createProxy({ markdown: true })`, `createMcpRoute`, `buildSummaryField` | seo.md, content.md, mcp.md |
| Consent, analytics, pixele | `ConsentProvider`, `CookieBanner`, `Analytics` (wewnątrz providera) | consent.md, analytics.md |
| Nagłówki, CSP, 2FA | `buildSecurityHeaders`, `buildCsp`, `twoFactor` (wstrzyknięty `payloadTotp`) | security.md |
| Media, R2 | `buildR2Storage(['media'], { s3Storage })` (adapter wstrzyknięty), `normalizeFilenameHook`, `buildOptimizeUploadHook` + `buildOptimizeUploadField`, `MediaPreconnect` | storage.md |
| Email | `email: mailAdapter()` | email.md |
| Walidacja env | `assertEnv(ipalEnvRules({...}))` z `@intecion/ipal-kit/env` | env.md |
| Walidacja env | `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` z `@intecion/ipal-kit/env` | env.md |
| Rate limit (formularze, MCP, wyszukiwarka) | wbudowany; IP z `IPAL_IP_HEADER`; kilka instancji → `setRateLimitStore` | forms.md |
**Compliance (PL/EU) — mechanizm z pluginu, treść od klienta:** strony polityk
jako System Pages, `CookieBanner` + `CookieButton`, checkbox `consent` w
@@ -653,6 +724,10 @@ payloadTotp } })`, nigdy `twoFactor: false` bez decyzji klienta). CSP: najpierw
| `ctaLabel`, `buttonUrl`, `pdfUrl` w blokach | zoo pól, brak spójności | `buildLinksField()` |
| brak `@source` na plugin w CSS | komponenty pluginu bez stylów | `@source` |
| kolekcja `users`/`settings`/`faq` | duplikat Payloada / zły byt | §5.3 |
| formularz z polami w JSX + `api/contact` + `nodemailer` | klient nie zmieni formularza, spam bez Turnstile i limitu | §0b: builder + `submitForm` |
| „GEO zrobię później” — brak llms/md/MCP | strona niewidoczna dla asystentów AI | §0b.5–7 |
| media na dysku kontenera na produkcji | pliki znikają przy redeployu | `buildR2Storage` zawsze |
| `TurnstileProvider` tylko „gdy jest klucz” w kodzie | widget znika po zmianie w panelu, bot omija weryfikację | provider zawsze, `getTurnstileConfig` |
Wspólny mianownik: **duplikacja** (dwa źródła prawdy) albo **przerwany łańcuch**
(zmiana nie dotarła tam, gdzie trzeba). Jedno źródło + weryfikacja grepem
@@ -677,8 +752,11 @@ projektu (§13), nie polegaj na pamięci sesji.
## 11. ZANIM POWIESZ „GOTOWE”
**Uruchom, nie zgaduj:**
**Uruchom, nie zgaduj** — `ipal-audit` (komplet §0b + reguły poniżej) i `ipal-seo-check`
(GEO i SEO na zbudowanej stronie) zamiast ręcznych grepów:
```bash
bash .agents/skills/ipal-audit/scripts/audit.sh
node .agents/skills/ipal-seo-check/scripts/seo-check.mjs http://localhost:3000
pnpm generate:types && pnpm tsc --noEmit
pnpm build # --webpack w skrypcie; lokalnie, nie tylko dev
# hardkody i zoo pól w blokach
@@ -761,6 +839,7 @@ Reguły z AGENT.md mają pierwszeństwo przed Twoją ogólną wiedzą o Next/Pay
## Ustalenia projektu
- <decyzje specyficzne dla klienta, np. „blog bez autorów”, „404 = strona główna”>
- <wyjątki od reguł — z uzasadnieniem>
- <tylko przy decyzji klienta> ipal-audit-skip: <klucze z AGENT.md §0b> — <powód, źródło decyzji>
```
---
@@ -783,8 +862,8 @@ zadanie pasuje — ręcznie: `/<nazwa>`.
| `ipal-migrate-fields` | zmiana pól, w których jest już treść — 3 fazy, skrypt z dry-run |
| `ipal-upgrade` | aktualizacja ipal-kit w istniejącym projekcie |
| `ipal-debug` | cokolwiek nie działa — procedura + tabela objaw → przyczyna → naprawa |
| `ipal-audit` | przed każdym „gotowe” — kontrole §11 + panel (§6.5a) + hardkody w JSX + tsc + build |
| `ipal-seo-check` | działająca strona oczami Googlebota (head, canonical, hreflang, sitemap, 404) |
| `ipal-audit` | przed każdym „gotowe” — komplet §0b + kontrole §11 + panel (§6.5a) + hardkody w JSX + tsc + build |
| `ipal-seo-check` | działająca strona oczami Googlebota i agentów AI (head, canonical, hreflang, sitemap, 404, JSON-LD, llms, Markdown, MCP) |
| `ipal-consent-check` | przeglądarka: zero pikseli i cookies śledzących przed zgodą |
| `ipal-plugin-gap` | ipal-kit ma błąd albo brakuje funkcji — raport + oznaczone obejście, praca idzie dalej |
+7 -1
View File
@@ -1,6 +1,6 @@
---
name: ipal-audit
description: Audits an ipal-kit (Payload 3 + Next 16) project against AGENT.md rules with a deterministic script — hardcoded texts/links, forbidden field names, monolithic sections, middleware.ts, missing ISR/generateStaticParams, hex colors, server imports in client components, extra collections, then tsc and build. Use before saying a task is done, after any block/collection/layout change, after an Impeccable pass, and when asked to review or audit the project.
description: Audits an ipal-kit (Payload 3 + Next 16) project against AGENT.md rules with a deterministic script — the mandatory feature set (SEO, JSON-LD, llms.txt, Markdown, MCP, R2, Turnstile, panel forms, consent, 2FA, health, env), forbidden replacements (own forms, nodemailer, reCAPTCHA, hand-written JSON-LD), hardcoded texts/links, forbidden field names, monolithic sections, middleware.ts, missing ISR/generateStaticParams, hex colors, server imports in client components, extra collections, then tsc and build. Use before saying a task is done, after any block/collection/layout change, after an Impeccable pass, and when asked to review or audit the project.
---
# ipal-audit
@@ -24,6 +24,12 @@ Kontrole z AGENT.md §11 jako skrypt — zawsze te same, bez interpretacji.
na ślepo (np. `searchParams` jest OK w trasie archiwum z paginacją).
5. Uruchom ponownie, aż wynik to `0 error(s)`.
## „missing: …” — obowiązkowy komplet (AGENT.md §0b)
Każde `[ERROR] missing: X` to pozycja kompletu, której nie ma w kodzie. Wpinasz ją
wg wskazówki (PROGRAMISTA §2) — nie pytasz, czy trzeba. Jedyny wyjątek: decyzja
klienta zapisana w `AGENTS.md` jako `ipal-audit-skip: <klucze> — <powód>` (klucze
w AGENT.md §0b). Nie dopisujesz tej linii sam, żeby „przeszło”.
## Czego skrypt nie sprawdzi (zrób ręcznie)
- **Test redaktora** (AGENT.md §11): czy każdy tekst, obraz, przycisk, sekcja,
@@ -175,6 +175,76 @@ while IFS= read -r rule; do
report "$level" "$title" "§7 / seo.md" "$(printf '%s\n' "$HTML" | grep -F "$rule|" | cut -d'|' -f3-)"
done <<< "$(printf '%s\n' "$HTML" | cut -d'|' -f1-2 | sort -u)"
# --- Mandatory feature set (AGENT.md §0b) ---
# Every site wires all of these through the plugin. A missing one is an ERROR
# unless AGENTS.md records the client's decision: `ipal-audit-skip: mcp, llms-full — reason`.
SKIP=$(grep -hiE '^[-* ]*ipal-audit-skip:' AGENTS.md 2>/dev/null | sed 's/^[^:]*://; s/—.*//; s/ - .*//' | tr ',' ' ')
skipped() { for k in $SKIP; do [ "$k" = "$1" ] && return 0; done; return 1; }
# has <regex> <paths…> — true when any file under the paths matches
has() { local re="$1"; shift; grep -rqE "$re" "$@" 2>/dev/null; }
# need LEVEL key "what" "how" <regex> <paths…>
need() {
local level="$1" key="$2" what="$3" how="$4" re="$5"; shift 5
[ -n "$key" ] && skipped "$key" && return 0
has "$re" "$@" || report "$level" "missing: $what" "§0b — $how" "$what"
}
CFG=$(ls src/payload.config.ts payload.config.ts 2>/dev/null | head -1)
APP=$(dirs src/app)
if [ -n "$APP" ]; then
# SEO
need ERROR '' "page metadata" "generatePageMetadata (lib/content) in generateMetadata of the page routes" 'generatePageMetadata|createPageMetadata|createMetadataGenerator' src/app
need ERROR '' "sitemap.xml route" "src/app/sitemap.xml/route.ts → sitemapRoute" 'sitemapRoute|createSitemapRouteHandler|buildSitemapEntries|sitemap' src/app/sitemap.xml src/app/sitemap.ts
need ERROR '' "robots" "src/app/robots.ts → robots from lib/content" 'robots|buildRobots' src/app/robots.ts
need ERROR '' "manifest" "src/app/manifest.ts → createManifestHandler" 'createManifestHandler|buildManifest' src/app/manifest.ts
need ERROR '' "htmlLimitedBots" "next.config.ts — metadata must reach crawlers in <head>" 'htmlLimitedBots' next.config.ts next.config.mjs next.config.js
need ERROR jsonld "structured data" "<JsonLdGraph> with WebSite + Organization/LocalBusiness in [locale]/layout.tsx" 'JsonLdGraph' src
# GEO
need ERROR llms "llms.txt" "src/app/llms.txt/route.ts → createLlmsTxtRoute" 'createLlmsTxtRoute|buildLlmsTxt' src/app
need ERROR llms-full "llms-full.txt" "src/app/llms-full.txt/route.ts → createLlmsTxtRoute({ full: true })" 'full: *true' src/app/llms-full.txt
need ERROR markdown "Markdown route" "src/app/md/[locale]/[[...slug]]/route.ts → createMarkdownRenderer + markdownResponse" 'createMarkdownRenderer' src/app
need ERROR markdown "Markdown in proxy" "proxy.ts → createProxy(i18nConfig, { NextResponse, markdown: true }) — without it /md/… is redirected to /<locale>/md/…" 'markdown: *(true|['"'"'"])|prefersMarkdown' src/proxy.ts proxy.ts
need WARNING markdown "Markdown alternate link" "createContentHelpers({ markdownAlternate: true }) or markdownHref in metadata" 'markdownAlternate|markdownHref' src
need ERROR mcp "MCP server" "src/app/api/mcp/route.ts → createMcpRoute (public: AI browses the site)" 'createMcpRoute' src/app
need WARNING '' "AI summary field" "buildSummaryField() in Pages + summaryField: 'aiSummary' in llms/MCP routes" 'buildSummaryField' src
# Ops
need ERROR '' "health route" "src/app/api/health/route.ts → createHealthRoute" 'createHealthRoute' src/app
need ERROR '' "env validation" "src/instrumentation.ts → assertEnv(ipalEnvRules({...})) from @intecion/ipal-kit/env" 'assertEnv' src/instrumentation.ts instrumentation.ts
need ERROR '' "security headers" "next.config.ts → buildSecurityHeaders" 'buildSecurityHeaders' next.config.ts next.config.mjs next.config.js
# Consent, analytics, Turnstile (layout)
need ERROR '' "cookie consent" "ConsentProvider + CookieBanner + CookieButton in [locale]/layout.tsx" 'CookieBanner' src/app
need ERROR analytics "analytics" "<Analytics> inside ConsentProvider (IDs from the panel)" '<Analytics' src/app
need ERROR turnstile "Turnstile provider" "<TurnstileProvider siteKey> in [locale]/layout.tsx — always, it hides itself without keys" 'TurnstileProvider' src
need WARNING turnstile "getTurnstileConfig" "siteKey from getTurnstileConfig(payload) — off unless BOTH keys are set" 'getTurnstileConfig' src
need WARNING '' "MediaPreconnect" "<MediaPreconnect/> in the layout (R2 CDN preconnect from env)" 'MediaPreconnect' src/app
# Forms
need ERROR '' "form submission via the plugin" "server action sendForm → submitForm (ipal-form)" 'submitForm' src
fi
if [ -n "$CFG" ]; then
need ERROR '' "forms in ipalKit" "$CFG → ipalKit({ forms: {…} }) — forms are built in the panel" 'forms *:' "$CFG"
need ERROR '' "mailAdapter" "$CFG → email: mailAdapter() — form e-mails go through the panel transport" 'mailAdapter\(' "$CFG"
need ERROR r2 "R2 storage" "$CFG → buildR2Storage(['media'], { s3Storage }) — always wired, local disk only without R2_* env" 'buildR2Storage' "$CFG"
need ERROR r2 "@payloadcms/storage-s3" "pnpm add @payloadcms/storage-s3 (same version as payload)" '"@payloadcms/storage-s3"' package.json
need ERROR twofactor "2FA" "$CFG → twoFactor: { issuer, plugin: payloadTotp }" 'payloadTotp' "$CFG"
report WARNING "robots blocks AI bots" "§0b.8 — only with the client's decision in AGENTS.md" \
"$(skipped aibots || g "aiBots: *'(disallow|block-training)'" src --include=*.ts)"
fi
need WARNING r2 "R2 env in .env.example" ".env.example lists R2_BUCKET, R2_ENDPOINT, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_PUBLIC_URL" 'R2_BUCKET' .env.example
need WARNING '' "IPAL_IP_HEADER in .env.example" "header the rate limit trusts, e.g. cf-connecting-ip (forms.md)" 'IPAL_IP_HEADER' .env.example
# Plugin replacements (§0b "Zakazane zamienniki")
report ERROR "own form / mail / captcha stack" "§0b — forms come from the panel builder, mail from mailAdapter, bot check from Turnstile" \
"$(g "from '(nodemailer|resend|@sendgrid/[a-z]+|react-hook-form|formik|react-google-recaptcha|@hcaptcha/react-hcaptcha|@aws-sdk/client-s3)'" src --include=*.ts --include=*.tsx)"
report ERROR "own form/mail API route" "§0b — use the sendForm server action → submitForm" \
"$(find src/app -type d \( -path '*api/contact*' -o -path '*api/send*' -o -path '*api/form*' -o -path '*api/mail*' -o -path '*api/newsletter*' \) 2>/dev/null)"
report ERROR "hand-written JSON-LD script" "§0b — <JsonLdGraph> escapes and wraps @graph" \
"$(g 'application/ld\+json' src --include=*.tsx | grep -v 'JsonLdGraph')"
report ERROR "static SEO files in public/" "§0b — sitemap, robots and llms are generated from the panel" \
"$(ls public/sitemap.xml public/robots.txt public/llms.txt public/llms-full.txt 2>/dev/null)"
report WARNING "<form> outside the form renderer" "§0b — forms render from the panel via FormRenderer (a search box is fine)" \
"$(g '<form[ >]' src --include=*.tsx | grep -v 'components/forms/')"
# --- Compile & build ---
if [ "$QUICK" -eq 0 ]; then
echo
+9 -5
View File
@@ -29,14 +29,16 @@ export default buildConfig({
`generate:importmap`, restart.
## 2. Layout — Turnstile raz
`<TurnstileProvider siteKey={turnstileSiteKey}>` w `[locale]/layout.tsx`, siteKey z
`getSiteIntegrations(payload)` (turnstile.md). Brak klucza = widget wyłączony,
formularz działa (dev) — **nie** warunkuj providera.
`<TurnstileProvider siteKey={(await getTurnstileConfig(payload)).siteKey}>` w
`[locale]/layout.tsx` (turnstile.md) — **zawsze**, nie warunkuj providera ani widgetu.
Zachowanie z pluginu: **oba klucze** (panel lub env) → widget widoczny, a `submitForm`
**wymaga** tokenu (bot nie ominie, nie wysyłając go); brak kluczy → widgetu nie ma,
weryfikacji nie ma, formularz działa; jeden klucz → wyłączony + alert na dashboardzie.
## 3. Kod (skopiuj z `resources/`, dostosuj tylko klasy)
| Plik | Do projektu | Rola |
|---|---|---|
| `actions.ts` | `src/app/(frontend)/[locale]/actions.ts` | jedna akcja `sendForm`: honeypot → IP → `submitForm` → tekst z Notifications |
| `actions.ts` | `src/app/(frontend)/[locale]/actions.ts` | jedna akcja `sendForm`: honeypot → IP (`clientIp`, `IPAL_IP_HEADER`) → `submitForm` → tekst z Notifications |
| `FormBlock.tsx` | `src/blocks/FormBlock/Component.tsx` | serwer: RichText (potwierdzenie, pola „message”), bind akcji |
| `FormRenderer.tsx` | `src/components/forms/FormRenderer.tsx` | klient: dowolny formularz z panelu przez `useForm` |
@@ -82,7 +84,9 @@ Zapytanie strony: `depth` ≥ 1 (relacja `form` jako obiekt). Rejestr bloków:
(Send test w panelu działa = transport OK; brak maila mimo to → zakładka Emails formularza);
- [ ] niezaznaczona zgoda → komunikat z Notifications (nie angielski fallback);
- [ ] 6 szybkich wysyłek → `rate_limited`;
- [ ] Turnstile z kluczami → widget widoczny; zły sekret → formularz przechodzi, a w panelu (dashboard + Site Integrations → Turnstile) jest czerwony alert;
- [ ] Turnstile z kluczami → widget widoczny; wysłanie bez rozwiązanego widgetu → `turnstile`;
zły sekret → formularz przechodzi, a w panelu (dashboard + Site Integrations → Turnstile) jest czerwony alert;
- [ ] Turnstile bez kluczy → brak widgetu, formularz przechodzi;
- [ ] drugi język → etykiety i komunikaty w tym języku;
- [ ] GTM Preview → zdarzenie z nazwą z panelu po sukcesie;
- [ ] `ipal-audit --quick` → zero hardkodów w FormRenderer/FormBlock;
+8 -3
View File
@@ -1,6 +1,6 @@
---
name: ipal-seo-check
description: Checks a running ipal-kit site the way Googlebot sees it — metadata inside <head> (not streamed to body), title, description, self canonical, hreflang with x-default, noindex pages leaking into the sitemap, error pages in the sitemap, robots.txt, soft 404s, favicon, llms.txt. Use after building pages, before handing over, after deploys, after an ipal-kit upgrade, and whenever SEO, indexing, Search Console or "Google doesn't see" problems come up.
description: Checks a running ipal-kit site the way Googlebot and AI agents see it — metadata inside <head> (not streamed to body), title, description, self canonical, hreflang with x-default, noindex pages leaking into the sitemap, error pages in the sitemap, robots.txt, soft 404s, favicon, JSON-LD, and GEO (llms.txt, llms-full.txt, Markdown version, text/markdown alternate, MCP server, AI bots in robots, health). Use after building pages, before handing over, after deploys, after an ipal-kit upgrade, and whenever SEO, indexing, Search Console or "Google doesn't see" problems come up.
---
# ipal-seo-check
@@ -28,11 +28,16 @@ Sprawdza **działającą** aplikację, nie kod — dokładnie to, co dostaje Goo
| unknown URL returns 200 | brak `notFound()` w catch-all |
| sitemap URLs not 200 | w sitemapie adresy z przekierowaniem (stare slugi) |
| robots.txt points to localhost | `NEXT_PUBLIC_SERVER_URL` nieustawione w buildzie |
| no JSON-LD structured data | brak `<JsonLdGraph>` w `[locale]/layout.tsx` albo pusta nazwa w Site Settings |
| `/llms.txt` / `/llms-full.txt` → 404 | brak trasy `createLlmsTxtRoute` (drugiej z `full: true`) |
| Markdown version `/md/…` → 404 | brak `src/app/md/[locale]/[[...slug]]/route.ts`; strona noindex/draft |
| MCP not answering initialize | brak `src/app/api/mcp/route.ts` albo Cloudflare Access bez Bypass (mcp.md) |
3. `[WARNING]` oceń: brak opisu / zduplikowane tytuły to **treść w panelu** —
uzupełnij z briefu albo wypisz w raporcie dla klienta.
4. Uruchom ponownie aż `0 error(s)`.
## Czego skrypt nie sprawdzi
Search Console (indeksacja, ręczne działania), Core Web Vitals, dane
strukturalne JSON-LD (sprawdź w Rich Results Test), treść merytoryczną.
Search Console (indeksacja, ręczne działania), Core Web Vitals, poprawność
JSON-LD (obecność sprawdza; treść w Rich Results Test), treść merytoryczną.
Pozycje pominięte z decyzji klienta czyta z `ipal-audit-skip:` w `AGENTS.md`.
@@ -1,5 +1,7 @@
#!/usr/bin/env node
// ipal-seo-check — what Googlebot actually sees on a running site (Node 18+, no dependencies).
import { readFileSync } from 'node:fs'
// ipal-seo-check — what Googlebot and AI agents actually see on a running site (Node 18+, no dependencies).
// node seo-check.mjs <baseUrl> [--max 20]
// node seo-check.mjs http://localhost:3000 # after `pnpm build && pnpm start`
// node seo-check.mjs https://klient.pl --max 40 # production
@@ -14,6 +16,13 @@ const origin = args[0].replace(/\/$/, '')
const maxIdx = args.indexOf('--max')
const MAX = maxIdx >= 0 ? Number(args[maxIdx + 1]) || 20 : 20
const UA = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
// Client decisions recorded in AGENTS.md (AGENT.md §0b): `ipal-audit-skip: mcp, llms-full — reason`
let SKIP = []
try {
const line = readFileSync('AGENTS.md', 'utf8').split('\n').find((l) => /^[-* ]*ipal-audit-skip:/i.test(l))
if (line) SKIP = line.replace(/^[^:]*:/, '').split(/—| - /)[0].split(',').map((k) => k.trim()).filter(Boolean)
} catch {}
const skipped = (key) => SKIP.includes(key)
let errors = 0
let warnings = 0
@@ -89,7 +98,8 @@ for (let i = 0; sample.length < Math.min(MAX, urls.length); i++) {
const multiLocale = hasAlternates || byLocale.size > 1
const urlSet = new Set(urls.map(norm))
const titles = new Map()
const issues = { status: [], noHead: [], body: [], title: [], longTitle: [], desc: [], canonical: [], canonSelf: [], noindex: [], hreflang: [], xdefault: [], reciprocal: [], favicon: [] }
const issues = { status: [], noHead: [], body: [], title: [], longTitle: [], desc: [], canonical: [], canonSelf: [], noindex: [], hreflang: [], xdefault: [], reciprocal: [], favicon: [], jsonLd: [], mdAlt: [] }
const checkedPaths = []
for (const url of sample) {
let page
@@ -121,6 +131,9 @@ for (const url of sample) {
if (/noindex/i.test(robotsMeta)) issues.noindex.push(url)
if (!/<link[^>]+rel="(?:shortcut )?icon"/i.test(head)) issues.favicon.push(url)
if (!/application\/ld\+json/i.test(html)) issues.jsonLd.push(url)
if (!/<link[^>]+type="text\/markdown"/i.test(head)) issues.mdAlt.push(url)
checkedPaths.push(new URL(url).pathname)
if (multiLocale) {
const alts = tags(head, /<link[^>]+hreflang="[^"]+"[^>]*>/gi).map((t) => ({ lang: attr(t, 'hreflang'), href: attr(t, 'href') }))
@@ -148,6 +161,8 @@ if (issues.desc.length) report('WARNING', 'missing meta description', 'fill SEO
if (dupTitles.length) report('WARNING', 'duplicate titles', 'unique meta titles per page', dupTitles)
if (issues.longTitle.length) report('WARNING', 'titles over 65 chars (truncated in results)', 'shorten in the SEO tab', issues.longTitle)
if (issues.favicon.length) report('WARNING', 'no favicon link in head', 'buildIconsMetadata(settings.favicon) in root generateMetadata', issues.favicon.slice(0, 3))
if (!skipped('jsonld') && issues.jsonLd.length) report('ERROR', 'no JSON-LD structured data', '<JsonLdGraph> WebSite + Organization in [locale]/layout.tsx (AGENT.md §0b.4)', issues.jsonLd.slice(0, 5))
if (!skipped('markdown') && issues.mdAlt.length) report('WARNING', 'no text/markdown alternate link in head', 'createContentHelpers({ markdownAlternate: true }) (AGENT.md §0b.6)', issues.mdAlt.slice(0, 3))
// --- 5. 404 ---------------------------------------------------------------
const firstLocale = [...byLocale.keys()].find((l) => l && l.length <= 5) ?? ''
@@ -157,9 +172,44 @@ for (const path of [`/${firstLocale ? firstLocale + '/' : ''}ipal-seo-check-${Da
else if (r.res.status !== 404 && !(r.res.status >= 300 && r.res.status < 400)) report('WARNING', `unknown URL returns ${r.res.status}`, 'expected 404')
}
// --- 6. llms.txt (info-level) -------------------------------------------------
const llms = await get('/llms.txt', { body: false }).catch(() => null)
if (!llms || llms.res.status !== 200) report('WARNING', 'no /llms.txt', 'createLlmsTxtRoute (seo.md) — AI-readable site summary')
// --- 6. GEO: llms, Markdown, MCP, AI bots (AGENT.md §0b.5–8) ---------------
const ok = async (path, opts) => { try { return await get(path, opts) } catch { return null } }
if (!skipped('llms')) {
const llms = await ok('/llms.txt')
if (!llms || llms.res.status !== 200) report('ERROR', `/llms.txt → ${llms?.res.status ?? 'unreachable'}`, 'createLlmsTxtRoute (seo.md)')
else if (!/^#\s+\S/m.test(llms.text)) report('WARNING', '/llms.txt has no "# Site name" heading', 'fill Site Settings → name/description')
}
if (!skipped('llms-full')) {
const full = await ok('/llms-full.txt', { body: false })
if (!full || full.res.status !== 200) report('ERROR', `/llms-full.txt → ${full?.res.status ?? 'unreachable'}`, 'createLlmsTxtRoute({ full: true })')
}
if (!skipped('markdown') && checkedPaths.length) {
const path = checkedPaths[0]
const md = await ok(`/md${path === '/' ? '' : path}`)
const type = md?.res.headers.get('content-type') ?? ''
if (!md || md.res.status !== 200 || !/markdown/i.test(type)) report('ERROR', `Markdown version /md${path} → ${md?.res.status ?? 'unreachable'} ${type}`, 'src/app/md/[locale]/[[...slug]]/route.ts (content.md)')
}
if (!skipped('mcp')) {
let mcpOk = false
let tools = []
try {
const rpc = (body) => fetch(origin + '/api/mcp', { body: JSON.stringify(body), headers: { 'content-type': 'application/json' }, method: 'POST' }).then((r) => (r.ok ? r.json() : null))
const init = await rpc({ id: 1, jsonrpc: '2.0', method: 'initialize', params: { protocolVersion: '2025-06-18' } })
mcpOk = Boolean(init?.result?.serverInfo)
tools = ((await rpc({ id: 2, jsonrpc: '2.0', method: 'tools/list' }))?.result?.tools ?? []).map((t) => t.name)
} catch {}
if (!mcpOk) report('ERROR', 'MCP server /api/mcp not answering initialize', 'createMcpRoute (mcp.md) — public, AI browses the site')
else if (!tools.includes('list_pages')) report('WARNING', 'MCP without list_pages / get_site_info', 'update @intecion/ipal-kit to ≥ 1.9.0')
}
if (!skipped('aibots') && robots.res.status === 200) {
const groups = robots.text.split(/(?=^user-agent:)/im)
const blocked = ['ClaudeBot', 'GPTBot', 'PerplexityBot', 'OAI-SearchBot'].filter((bot) =>
groups.some((g) => new RegExp(`^user-agent:.*\\b${bot}\\b`, 'im').test(g) && /^disallow:\s*\/\s*$/im.test(g)),
)
if (blocked.length) report('WARNING', 'robots.txt blocks AI bots', 'aiBots: allow (default) — block only with the client decision in AGENTS.md', blocked)
}
const health = await ok('/api/health', { body: false })
if (!health || health.res.status !== 200) report('WARNING', `/api/health → ${health?.res.status ?? 'unreachable'}`, 'createHealthRoute (Coolify healthcheck)')
// --- output -------------------------------------------------------------
for (const f of findings) {
+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**).
+20 -7
View File
@@ -27,8 +27,10 @@ między fazami. Przed fazą przejdź tabelę „Przewidujesz” z AGENT.md §0a.
3. Dane firmy: NIP, adres, telefon? ([DO UZUPEŁNIENIA] w panelu)
4. Na jaki adres wysyłać zgłoszenia z formularza? ([DO UZUPEŁNIENIA] w Forms → Emails)
5. Analityka: ID GA4/GTM/pikseli? (wyłączona do czasu wpisania ID w panelu)
6. Media: R2 czy lokalnie? (lokalnie w dev, R2 gotowe do włączenia env)
7. Tłumaczenia: robię wersje robocze do akceptacji? (tak, oznaczone w raporcie)
6. Dane R2: bucket, endpoint, klucze, domena mediów? (R2 jest wpięty zawsze; do czasu kluczy media lokalnie w dev)
7. Klucze Turnstile? (testowe w dev; produkcyjne wpiszesz w Site Integrations)
8. Dostęp AI do treści (llms.txt, Markdown, MCP, boty AI)? (włączony — wyłączam tylko na Twoje wyraźne życzenie)
9. Tłumaczenia: robię wersje robocze do akceptacji? (tak, oznaczone w raporcie)
```
Wyślij listę i **pracuj dalej** na wartościach domyślnych. Odpowiedzi wpisujesz,
gdy przyjdą. Zatrzymujesz się tylko przed decyzją nieodwracalną (AGENT §0a).
@@ -36,7 +38,9 @@ między fazami. Przed fazą przejdź tabelę „Przewidujesz” z AGENT.md §0a.
## Faza 1 — Fundament
- Nowy projekt → **ipal-setup** (całość, z `ipal-skills`, `AGENTS.md`).
- Istniejący na starszym ipal-kit → **ipal-upgrade** przed czymkolwiek innym.
- Wyjście: `pnpm build` przechodzi, `/admin` działa, `ipal-audit --quick` = 0 błędów.
- Wyjście: `pnpm build` przechodzi, `/admin` działa, `ipal-audit --quick` = 0 błędów —
**także zero „missing: …”**, czyli komplet AGENT.md §0b (SEO, GEO, R2, Turnstile,
formularze, consent, bezpieczeństwo) wpięty od pierwszej fazy, nie na końcu.
## Faza 2 — Model treści
- Strony = `Pages` + bloki. Kolekcje tylko dla list z URL-ami (**ipal-collection**).
@@ -53,7 +57,8 @@ Każdy blok: schemat ze słownika pól, kompozycja prymitywów, zero tekstu w JS
(`ipal-audit --quick` po każdym bloku — błędy naprawiasz od razu).
## Faza 5 — Formularze → **ipal-form**
Formularze tworzysz w panelu (albo seedem) — kod piszesz raz.
Formularze tworzysz w panelu (albo seedem) — kod piszesz raz. **Nigdy** własny
formularz z polami w JSX, trasa `api/contact`, `nodemailer`, reCAPTCHA (AGENT.md §0b).
## Faza 6 — Treść w panelu, każdy język
1. Skopiuj `resources/seed-content.template.ts` → `scripts/seed-content.ts`,
@@ -69,10 +74,12 @@ Formularze tworzysz w panelu (albo seedem) — kod piszesz raz.
briefu przez panel — przygotowane (WebP/JPG ≤ 1.5 MB, ≤ 2560 px).
## Faza 7 — Integracje (panel, nie kod)
Site Integrations: transport e-mail + **Send test**, Turnstile, analityka/piksele
Site Integrations: transport e-mail + **Send test**, Turnstile (oba klucze — jeden
klucz = Turnstile wyłączony i czerwony alert na dashboardzie), analityka/piksele
(tylko z ID od klienta), consent (kategorie zgodne z użytymi narzędziami).
Site Settings: nazwa, opis, OG image, favicon. SEO tab: meta title/description
każdej strony (≤ 60 / ≤ 155 znaków, unikalne).
Site Settings: nazwa, opis (zasila llms.txt i MCP), OG image, favicon. SEO tab: meta
title/description każdej strony (≤ 60 / ≤ 155 znaków, unikalne); `aiSummary` —
zostaw auto-fill albo popraw, gdy streszczenie jest słabe.
## Faza 8 — Wygląd
`DESIGN.md` istnieje → tokeny w `@theme`. Brak → neutralne tokeny + w raporcie
@@ -88,6 +95,8 @@ node .agents/skills/ipal-seo-check/scripts/seo-check.mjs http://localhost:3000
node .agents/skills/ipal-consent-check/scripts/consent-check.mjs http://localhost:3000/<locale>
pnpm payload run .agents/skills/ipal-locale-add/scripts/locale-coverage.ts
```
`ipal-seo-check` sprawdza też GEO: `/llms.txt`, `/llms-full.txt`, `/md/…`, `/api/mcp`,
JSON-LD, boty AI w robots — każdy brak to `[ERROR]` do naprawy.
Plus ręcznie: test redaktora (AGENT §11) w każdym języku, formularz (lista w
ipal-form §6), klawiatura (Tab przez menu, baner, formularz; widoczny focus),
404 w każdym języku. Każdy `[ERROR]` naprawiasz (**ipal-debug**) i uruchamiasz
@@ -102,6 +111,10 @@ kontrolę ponownie. Nie oddajesz z błędami — wyjątek: blokujący błąd ipa
- języki: <…> · integracje: <e-mail ✓ Send test, Turnstile ✓, analityka: czeka na ID>
## Kontrole
build ✓ (n tras ●) · ipal-audit 0/0 · seo-check <e>/<w> · consent-check 0 naruszeń · locale-coverage 0
## Komplet (AGENT.md §0b)
SEO ✓ · JSON-LD ✓ · llms.txt + llms-full ✓ · Markdown ✓ · MCP ✓ · R2 <✓ / czeka na klucze> ·
Turnstile <✓ / czeka na klucze> · formularze z panelu ✓ · consent ✓ · 2FA ✓ · health ✓
(pominięte z decyzji klienta: <ipal-audit-skip albo „brak”>)
## Do uzupełnienia przez Ciebie / klienta (w panelu)
- [DO UZUPEŁNIENIA: NIP] → Company · … (pełna lista z seeda)
- tłumaczenia robocze do akceptacji: <strony>
+13 -1
View File
@@ -5,7 +5,8 @@ description: Upgrades an existing project to the latest @intecion/ipal-kit and r
# ipal-upgrade
Lista zmian: `node_modules/@intecion/ipal-kit/docs/dev/PROGRAMISTA.md` §6.
Co się zmieniło w wersji: `node_modules/@intecion/ipal-kit/docs/CHANGELOG.md` (sekcje
„Wymaga zmian w projekcie” — zrób wszystkie). Lista zmian: `…/docs/dev/PROGRAMISTA.md` §6.
Zasada: gdy plugin dostarcza coś, co projekt ma ręcznie — **usuń lokalną wersję**.
## 1. Aktualizacja pakietu
@@ -18,6 +19,17 @@ Skopiuj skille na nowo (AGENT.md §14) — mogły się zmienić.
Postgres z migracjami: nowe pola pluginu (np. `privacyLinkLabel`) →
`pnpm payload migrate:create`.
## 1a. Komplet AGENT.md §0b
Po aktualizacji pełny **ipal-audit** pokaże sekcję „missing: …” — brakujące pozycje
obowiązkowego kompletu (GEO: llms-full, Markdown, MCP; R2; Turnstile przez
`getTurnstileConfig`…). Każdą wpinasz wg PROGRAMISTA §2 — to część aktualizacji,
nie dodatek. Pomijasz tylko z decyzją klienta w `AGENTS.md` (`ipal-audit-skip:`).
**1.8.x → 1.9.0 (PROGRAMISTA §6, poz. 17–21):** `twoFactor.plugin` wymagany;
`getTurnstileConfig` zamiast `turnstileSiteKey` (przy obu kluczach token jest
wymagany — sprawdź, że każdy formularz ma widget); `clientIp(await headers())` w
akcji formularza + `IPAL_IP_HEADER` w env produkcji; `buildR2Storage` wpięty.
## 2. Inwentaryzacja (bez zmian w kodzie)
Dla **każdej** pozycji tabeli PROGRAMISTA §6 pokaż dowód (grep / plik), czy
dotyczy projektu. Uruchom skill **ipal-audit** (`--quick`) i dołącz wynik.