diff --git a/docs/dev/reference-site-proposal.md b/docs/dev/reference-site-proposal.md new file mode 100644 index 0000000..ac289ff --- /dev/null +++ b/docs/dev/reference-site-proposal.md @@ -0,0 +1,402 @@ +# Reference site — proposal + +Status: **design approved.** The owner decided D1–D10 on 2026-10-29 (§10): D3 was revised to the team's +existing deploy process (no Dockerfile), D9 no longer applies, and D10 is MongoDB only. All four sibling +tracks have answered, and their designs are folded in. Nothing is built yet: building starts when the +coordinator confirms all five designs (starter, doctor, blocks, tokens, reference site) are in and +consistent. +Branch: `claude/reference-site-57ce26`. Written 2026-10-29 against ipal-kit 1.14.6. + +## 1. What it is + +The reference site is one complete, realistic client site built on `@intecion/ipal-kit`. It uses every +convention in `docs/agent/AGENT.md`. It is updated in the same change as each plugin release, so it is +never behind. It has three jobs: + +1. **Agents copy from it.** When AGENT.md or a skill says "do X", there is a working file that does X. +2. **The project starter is generated from it.** `ipal-kit create` = the reference site minus its demo + content (§6). +3. **It is the plugin's real-world test.** CI builds it, runs `ipal-doctor` on it and runs smoke tests + against it (§7). If a release breaks a real site, the release fails here first. + +The site belongs to a made-up company, so it never contains real client data (§5). + +## 2. Where it lives + +### Options + +| | A. Grow `dev/` into it | B. Separate repository | C. A folder in the plugin, not shipped | +|---|---|---|---| +| Plugin tests | `dev/` exists to test edge cases: SQLite, `twoFactor: false`, crawl on, a test email adapter, odd configs. A real site needs the opposite: 2FA on, a real email transport, the real DB. One app can't be both. Tests get slower and flakier. | Not affected | Not affected: `dev/` stays the test sandbox | +| Staying current | Same commit as the plugin | Lags behind. It needs a published version, a bump PR and a second CI. It drifts. | **Same commit as the plugin.** It uses the plugin through `link:..`, so a breaking change fails CI in the same PR. | +| Starter source | Messy: test-only config would leak into new sites | Clean, but the starter must fetch another repo | Clean: the starter copies one folder | +| Shipped in npm | `dev/` isn't shipped | — | Not shipped: `files` is `dist`, `docs`, `bin` | +| Agents in a client project | Can't see it | Need access to the repo | **Can't see it by default** (not in `node_modules`). Fixed with a pointer (§8). | + +### Recommendation: C — `reference/` in the plugin repo + +``` +ipal-kit/ + src/ dist/ docs/ bin/ # the plugin (shipped) + dev/ # test sandbox (unchanged; used by vitest and playwright) + reference/ # the reference site (NOT shipped) + services/cookie-crawler/ +``` + +- `reference/package.json` depends on `"@intecion/ipal-kit": "link:.."` in the repo. The starter + rewrites this to the released version (`"1.15.0"`, pinned exactly, as on the live sites). +- Install it with its own lockfile: `pnpm --dir reference install --ignore-workspace`. The repo has no + pnpm workspace today, so the plugin's install and lockfile don't change. +- It is a normal project: `src/`, `AGENTS.md`, `.env.example`, `docs/DEPLOY.md`, its own `README.md`. + No Dockerfile (D3). + `reference/` is the project root, so a file's path in `reference/` equals its path in a client project. +- **How agents reach it** (C's one gap): the docs ship a generated **file index with excerpts** + (`docs/agent/reference-site/INDEX.md`, §8). The full tree is at + `https://git.intecion.net/IntecionSoftware/ipal-kit/src/tag/v/reference`, one URL per release + tag. The doc pages link to the file for their module. + +Why not grow `dev/`: `dev/` is tuned for fast unit and integration tests. It turns 2FA off, uses SQLite +and has a single test page. Turning it into a showcase would make the plugin's own test suite slower +and would mix test hacks into code that agents copy. Keep both: **`dev/` tests the plugin, `reference/` +shows how a project uses it.** The e2e smoke tests move to `reference/` (§7). `dev/e2e.spec.ts` keeps +its admin-logo test. + +## 3. Stack and conventions (copies the live sites, decisions in §10) + +| | Reference site | Why | +|---|---|---| +| DB | **MongoDB only** (`@payloadcms/db-mongodb`): a local Mongo in dev, a separate Coolify MongoDB resource in production, a service container in CI | All 7 live sites use Mongo. **D2 + D10, accepted.** The adapter sits alone in `src/db.ts`, so a future Postgres client is one file, but v1 ships no Postgres files. | +| DB name | `example-studiopl_dev` locally, `example-studiopl_prod` in Coolify | the plugin's `databaseNamesFor()` (on `main` since 0ed3898): domain without dots, hyphens kept, + `_dev`/`_prod`. Never hand-written. | +| Next / Payload | Same versions as the plugin's devDependencies (Next 16.4.3, Payload 3.90.2) | One supported set per release | +| Styling | Tailwind 4 + the token standard (track "design tokens") | | +| Media | Local in dev, R2 (`@payloadcms/storage-s3`) in prod, through env | AGENT.md §0b | +| Email | `IPAL_*` transport env; in dev, a local mail catcher of the developer's choice; in CI, a Mailpit service container that the smoke test reads | Forms are tested end to end without a real inbox | +| Start | `node --disable-proto=throw node_modules/next/dist/bin/next start` | As intecioncom-web | +| Package manager | pnpm 10, Node 22 | As the plugin CI | + +## 4. What it shows + +The made-up company is **`Pracownia Przykład` / "Example Studio"**, a small Polish architecture and +interior-design studio with an English version. It has services, case studies and a blog, which are +the content types most client sites have. Domain: `example-studio.test` locally and in CI, and +`example.com`-style placeholders in copy. Mapped item by item: + +### 4.1 Languages +- `pl` (default) + `en`, URLs `/pl/...`, `/en/...`, `/` → default locale via the proxy. +- `src/i18n.config.ts` as the single source; localized slugs (`/pl/uslugi` ↔ `/en/services`). +- Every seeded record is filled in both languages; `locale-coverage` = 0 gaps (checked in CI). +- The admin panel in en/pl (plugin default). + +### 4.2 Pages, templates and blocks +Every page is a `Pages` document built from **library blocks only** (track "shared block library", +`docs/dev/block-library-proposal.md` on `claude/block-library-1152ba`, still pending the owner). +- The blocks are imported from the plugin, never copied: configs from `@intecion/ipal-kit/blocks` + (`libraryBlocks`), components and `createBlockRegistry` from `@intecion/ipal-kit/blocks/rsc`, and + page templates from `@intecion/ipal-kit/templates`. The reference site ejects nothing (eject is an + optional phase-2 tool of the block track). +- Phase-1 blocks: hero, textMedia, featureGrid, gallery, faq, cta, contact, team, pricing, logos, + testimonials, stats, richText, steps, entryList. Each has a `variant` select (pricing has none) and + `settings.background` default / muted / inverted. +- Page templates: home, about, services, service, contact, blogIndex, post, legal, cookiePolicy, + notFound. Pages are seeded from `pageTemplates` + `upsertBySlug`. +- Case studies are the one project-specific collection (`content.collections`, built per + ipal-collection). They're listed with entryList and gallery, so the site also shows how a project + adds its own collection next to the library. + +| Page (pl / en) | Shows | +|---|---| +| `Strona główna` / Home (`homepage` role) | Hero, feature grid, case-study cards, testimonials, CTA, FAQ (JSON-LD FAQPage) | +| `O nas` / About | Rich text, team, stats, timeline | +| `Usługi` / Services + 3 service pages | Archive vs detail template, `Service` JSON-LD | +| `Realizacje` / Case studies (collection with URLs) | `content.collections` archive + detail, gallery with the **lightbox** | +| Blog (collection `posts`) | Archive with pagination, post template, table of contents, author/date, `Article` JSON-LD | +| `Kontakt` / Contact | Contact form, opening hours, map/address from Company | +| `Wycena` / Quote | Multi-step form (the current `dev/` form, moved here) | +| `Polityka prywatności`, `Polityka cookies`, `Regulamin` | `privacyPolicy` / `cookiePolicy` / `termsOfService` roles; the cookie list comes from the scan | +| 404 | `notFound` role, `createNotFoundPage` | +| **`Bloki` / Blocks** (showcase) | Every block × every `variant` on one page, `noindex`. Each block appears at least once on the **inverted** background (and muted), which tests the token re-mapping inside inverse sections. The place to see the whole library. Phase-2 blocks (video, tabs, map, cookieTable, comparisonTable) are added when they ship. | +| **Design** (styleguide) | Every token: colours, type scale, spacing, radius, shadows, in light and dark side by side; `noindex` | +| Maintenance | Construction mode (toggle documented, off by default) | + +Globals: Header (with a mobile menu), Footer, Company (NAP, NIP placeholder, socials), Site settings +(name, description, logo, favicon, OG image, theme, search engines, system pages). + +### 4.3 Design tokens, light and dark +- Tokens from the token standard only (draft in `docs/dev/design-tokens-proposal.md` on + `claude/design-tokens-95806d`). The plugin exports `@intecion/ipal-kit/tokens.css` (neutral + defaults: light in `:root`, dark in `[data-theme=dark]`) and `@intecion/ipal-kit/tailwind.css` (a + Tailwind 4 `@theme inline` map plus the dark variant). Components use utilities such as `bg-surface`, + `text-fg`, `py-section` and `rounded-card`. No hex, no `dark:` for colours (they flip on their own), + and no raw size in any component (the doctor checks this). +- The project overrides only `src/design/tokens.css`, generated from `src/design/tokens.ts` by + `ipal-tokens` (the TS source is still the tokens track's open decision). It overrides the brand layer: + primary, secondary, accent, bg, fonts through next/font `--font-family-body` / `--font-family-heading`, and radius. + The files are built on `claude/design-tokens-build` (9511b12): `tokens.css`, `tailwind.css`, `a11y.css` and the `@intecion/ipal-kit/tokens` entry. The reference site imports them from the plugin and vendors nothing. +- The `/design` page lists the tokens from the token list the plugin exports, and shows the dark side in a + `data-theme="dark"` wrapper. +- Theme switcher + `Site settings → Theme` (theme.md), no flash of the wrong theme. Both themes appear + in the smoke test's screenshots. +- `DESIGN.md` in the project root describes the made-up brand. It shows what a real project's + `DESIGN.md` should contain. + +### 4.4 Forms, email, consent, cookies +- Contact + quote forms seeded with `ipal-form` templates: an email to the company **and** a + confirmation to the customer, in both languages; `createSubmitAction`; Turnstile (test keys in dev + and CI); rate limit. +- `CookieBanner` with detailed settings and consent log (`consentLog: true`); GTM/GA4/Meta Pixel wired + but **off** until IDs are entered (placeholder IDs only in an `.env.example` comment). +- Cookie scanner with `crawl: true` pointed at `services/cookie-crawler` (run on its own in dev; a service container in CI); + the seeded cookie list is in the **approved** state, plus one pending sample, so the review/approve + flow can be tried in the panel. + +### 4.5 SEO and GEO +- `generatePageMetadata`, hreflang, canonical from `NEXT_PUBLIC_SERVER_URL`. +- `sitemap.xml`, `robots.ts` (AI crawler policy from the panel), `llms.txt`, `llms-full.txt`, + `/md/[locale]/...`, `/api/mcp`, IndexNow key route, `manifest.ts`. +- JSON-LD: Organization (from Company), WebSite, BreadcrumbList, plus per template (§4.2). +- Every page has a meta title and description written by hand within limits, plus `aiSummary`; + `ipal-seo-check` = 0 errors in CI. +- Search Console: a DNS-verification note in the deploy notes (no API, per team rule). + +### 4.6 Security and admin +- CSP + security headers from the plugin through `next.config` / `proxy.ts`, no `X-Powered-By`, + a `csp-report` route. +- `adminMeta` on (noindex, OG image, icon); `whiteLabel: true` with the default Intecion credit. +- **2FA on** (`twoFactor: { issuer: 'Example Studio', plugin: payloadTotp }`). For CI and local + smoke tests a seeded test admin has a known TOTP secret from `.env.example`. The test computes the + code, so the real 2FA flow is tested, not skipped. +- `access` roles: admin + editor accounts seeded (test values only, in `.env.example`). +- `instrumentation.ts` with `assertEnv(ipalEnvRules(...))`. + +### 4.7 Seeding with named records +- `src/seed/` uses `createSeeder` (`@intecion/ipal-kit/seed`): `upsertBySlug`, `fillGlobal`, `summary`. +- **Two layers, two scripts:** + - `seed:base`: what every new site needs, kept by the starter (system pages, globals, forms, + cookie banner texts, notifications). + - `seed:demo`: the made-up company's content, removed by the starter. +- Named, targeted seeds for after launch use the plugin's keys (on `main` since 0ed3898): + `SEED_ONLY="pages:kontakt,forms:Wycena,global:header"` or `createSeeder({ only: [...] })`. This is the + rule "after launch only targeted seeds for named records, never a full seed", shown in code. +- `SEED_DRY_RUN=1` and production guards as in seeding.md. + +### 4.8 Deploy (Coolify): the team's existing process (D3, revised by the owner) +The reference site deploys exactly the way the team's sites already do. There is no Dockerfile and no +new image model: + +1. **Build and check locally:** `pnpm generate:types && pnpm build && pnpm start`, then `ipal-doctor`, + then push. +2. **Coolify builds and runs the app from the Git repo** with its default build pack (Nixpacks), as on + the five live sites without a Dockerfile (e.g. intecioncom-web): + - install: `pnpm install --frozen-lockfile`; + - build: `pnpm generate:types && pnpm build`; + - start: `pnpm start` = `node --disable-proto=throw node_modules/next/dist/bin/next start`, port 3000. + + Node comes from `engines` (`">=22 <23"`). +3. **MongoDB is a separate Coolify resource on the same server and Docker network.** `DATABASE_URI` + points at its internal hostname, with database `example-studiopl_prod` (`databaseNamesFor`). The + database is never exposed outside that network. +4. **Targeted seeds run from the app container's Terminal in Coolify.** The container is built from the + whole repo, so it has the sources, `node_modules` and the Payload CLI: + `SEED_ONLY="pages:kontakt" SEED_DRY_RUN=1 pnpm seed` (`seed` = `payload run src/seed/index.ts`), then + **Backup now** on the + Mongo resource, then the real run (`deployment.md` §4.7, `seeding.md` "Running a seed on Coolify"). + The CI job checks this: after `next build` it runs the same command against the built tree, so a + change that breaks the seed in the deployed container fails CI. + +No Dockerfile, no `docker-compose.yml` and no image model, in the reference site or in the starter's +output. In dev, the developer uses their own local MongoDB; the cookie crawler runs on its own from +`services/cookie-crawler` when crawl is being tested. + +`docs/DEPLOY.md` in the site is the short project-level runbook. It links to the plugin's +`docs/deployment.md` and doesn't repeat it: +- the local check before every push (build, start, `ipal-doctor --strict`, smoke tests); +- the Coolify app: Git source and branch, default build pack (Nixpacks), the install, build and start + commands above, port 3000, + domains (apex + www), the www ↔ apex redirect that matches `NEXT_PUBLIC_SERVER_URL`, health check + `/api/health`; +- the Coolify MongoDB resource: same server and network, internal `DATABASE_URI`, database + `example-studiopl_prod`, scheduled backups + **Backup now** before any seed; +- the env list with build/runtime flags (`NEXT_PUBLIC_*` at build time); +- targeted seeds from the app Terminal, with `SEED_ONLY`, a dry run first, and never a full seed after + launch; +- DNS records (A/AAAA, www, mail SPF/DKIM/DMARC, the Search Console TXT verification); +- rollback: redeploy the previous commit in Coolify; restore the Mongo backup only when data changed. + +### 4.9 AGENTS.md with filled "Project decisions" +`AGENTS.md` follows the §13 template, with every architecture answer filled in for the made-up client, +one line each. Examples: "languages: pl (default), en, prefixed URLs", "database: Mongo, db +`example-studiopl_prod`", "2FA: on, issuer Example Studio", "credit: Intecion default". It also has one +approved exception, to show the format. The starter blanks these lines into `<…>` prompts. +`CLAUDE.md` = `@AGENTS.md`; `.agents/skills/` installed by `ipal-skills` (committed, so the tree shows +what a real project contains). + +## 5. Placeholder content rules + +- A made-up company only. Names, addresses, NIP, phone numbers and e-mail addresses use reserved or + obviously fake values (`example.com`, `+48 000 000 000`, `NIP 000-000-00-00`, + `ul. Przykładowa 1, 00-000 Warszawa`). +- No real client names, logos, reviews or photos; nothing copied from the team's live sites. +- Images: a few generated or CC0 images (abstract architecture, interiors), WebP, each ≤ 300 kB, in + `reference/seed-media/` with a `LICENSES.md`. +- Texts are realistic in length and structure (headings, lists, FAQ), so SEO, GEO and layout checks + mean something. They are written for the site, never lorem ipsum. + +## 6. Reference site ⇄ starter — one source of truth + +**Proposal: the reference site is the only source of truth; the starter is generated from it.** + +- `reference/starter.manifest.json` marks each path as `keep`, `drop` (demo) or `template` (text with + `{{domain}}`, `{{dbBase}}`, `{{siteName}}`, `{{issuer}}`, `{{locales}}` placeholders). Demo = `seed/demo/`, + `seed-media/`, the case-study and blog demo records, the Blocks showcase page. The `/design` styleguide is kept (D5, accepted). +- The starter is a command of the plugin itself (owner decision, no separate package): + `pnpm dlx @intecion/ipal-kit@X.Y.Z create `. At `prepublishOnly`, `pnpm build:starter` reads + `reference/starter.manifest.json` and writes `dist/starter/template.json.gz` plus the gzipped + lockfile. `reference/` itself stays out of `files`. Nothing is fetched from git when a developer runs + it. The lockfile is the reference one with `link:..` rewritten to the exact version. +- Release gate (starter track): `pnpm pack` → `dlx` the packed tarball → install → build → + `ipal-doctor --strict`. +- `ipal-kit create` applies the variant flags, pins the plugin version, writes `AGENTS.md` decisions + from its prompts and runs `ipal-skills`. +- The starter keeps **no template files of its own**, so it can't drift. CI proves it (§7, job 3). + +Status: **agreed with the starter session** (2026-10-29). Its script copies `reference/`, swaps +placeholders and drops demo content. The contract is in the shared notes (`reference-site-for-starter.md`): +- placeholder names `{{projectName}}`, `{{domain}}`, `{{serverUrl}}`, `{{dbBase}}`, `{{siteName}}`, + `{{issuer}}`, `{{mcpName}}`, `{{locales}}` and `{{defaultLocale}}`; +- the fake values are **unique strings** (`example-studiopl`, `example-studio.pl`, `Example Studio`). + The generator fails when one of them is left in a file the manifest doesn't map, so a new file can't + leak the made-up client into a real site; +- variants inside a file use comment markers that keep the reference site runnable: + `// @starter:if ` … `// @starter:endif` (`{/* @starter:if */}` in TSX). Whole-file + variants go in the manifest (`{ "if": "theme" }`). The flags are `theme`, `cookieScanner`, `crawl`, + `graph`, `localBusiness`, `twoFactor`, `r2`, `singleLocale`, plus one CSP flag per analytics tool. The + reference site itself is the "everything on" build. The starter CI job also builds the "everything + off" output and `singleLocale`, so both ends of the flag range stay valid; +- the made-up company's NIP, address and phone live only in `src/seed/demo/`; +- the "Project decisions" block sits between `` markers; +- the database adapter is in `src/db.ts`. **D10, decided: MongoDB only in v1.** There is no + `db.postgres.ts`, no `src/migrations/` and no `--db postgres`; a Postgres client later means adding + one file next to `db.ts`. + +The owner confirmed it as D6 (2026-10-29). + +## 7. How it stays current + +### Plugin CI (`.gitea/workflows/ci.yml`), new job `reference` +1. Build the plugin (already done), then `pnpm --dir reference install --frozen-lockfile --ignore-workspace`. +2. `generate:types` + `generate:importmap` → `git diff --exit-code` (committed files are current). +3. `tsc --noEmit`, `next build`: page routes must be SSG (●), not dynamic. +4. Start it on Mongo (service container) + `seed:base` + `seed:demo`. Then run one targeted seed the way + Coolify's Terminal does (`SEED_ONLY="pages:kontakt" SEED_DRY_RUN=1 pnpm seed` + in the built tree), so the documented production seed path is tested. +5. **`ipal-doctor` on `reference/` → 0 findings, strict.** The CLI follows the doctor track's draft + (`docs/dev/ipal-doctor-proposal.md` on `claude/ipal-doctor-26c394`, pending the owner). It is a + zero-dependency bin in the plugin, linked into `reference/` through `link:..`. + - **Static pass, right after install** (needs `node_modules`, the committed `importMap.js` and the + `ipal-*` skills; no build, DB or server): + `node bin/ipal-doctor.mjs reference --strict --offline --json > doctor-static.json`. + `--offline` skips the registry lookups; with `link:..` the installed plugin is the repo version + anyway. + - **Deep + HTTP pass, after build, start and seed:** + `node bin/ipal-doctor.mjs reference --strict --offline --deep --url http://localhost:3000`. + `--deep` reads the DB read-only (users without TOTP, pending cookies, the exact import-map diff); + `--url` checks the headers, CSP, `/api/health`, admin noindex and link preview, and runs + ipal-seo-check. + - `--strict` = `--fail-on info`, so even info findings fail. Exit codes: 0 ok, 1 findings, 2 could not + run, 3 a rule crashed. The `--json` report is kept as a CI artifact. + - What the reference site needs for zero findings: + - `reference/ipal-doctor.json` `{ "domain": "example-studio.pl", "launched": false }`; the CI Mongo + database is named after it: `example-studiopl_dev` (from `databaseNamesFor('example-studio.pl')`); + - **CSP enforced, not report-only.** It is the example, so it has no silenced CSP entry; + - only conventional entries at the top of `src/`; `AGENTS.md` with a non-empty "Project + decisions" section; `CLAUDE.md` = `@AGENTS.md`; `engines.node` `">=22 <23"` + `.nvmrc` `22`; + - ipal-audit `--quick` (run inside the doctor) without warnings. + - `ipal-doctor.json` is a `template` file in the starter manifest (`{{domain}}`, `launched: false`). +6. `ipal-seo-check`, `ipal-consent-check`, `locale-coverage` → 0 errors. +7. **Playwright smoke tests** (`reference/e2e/`), each in pl and en where it applies: + - home renders, no console errors, both themes; + - every page in the sitemap returns 200, has a title, canonical, hreflang and JSON-LD; + - `robots.txt`, `llms.txt`, `/md/...`, `/api/mcp`, `/api/health` respond; + - the contact form sends, and Mailpit receives the company mail and the customer confirmation; + - the cookie banner: reject → no analytics cookie; accept → consent logged; + - security headers + CSP present, no `X-Powered-By`; + - admin login with the computed TOTP → dashboard, Intecion credit, `og:` tags on `/admin/login`; + - 404 page from the panel. +8. **Starter job:** generate a site from `reference/` with the manifest → install → build → + `ipal-doctor --strict --offline` (static). This proves the starter output is valid at every commit. + +Runtime: about 6–8 minutes. Steps 1–3 run on every PR; the full job runs on `main` and before each +release (**D4, accepted**). + +### Release checklist (`docs/dev/PROGRAMISTA.md`, release section), new steps +- [ ] Anything new or changed in this release is used in `reference/` (a new option set, a new + route wired, a new block shown). A PR that adds a feature without touching `reference/` gets a + reviewer question. A `test/docsConsistency` check will flag new exports that `reference/` never + imports (with an allow-list). +- [ ] `reference/` upgrade done the way `ipal-upgrade` tells client projects; the upgrade notes are + tested here first. +- [ ] CI `reference` job green, including the starter job. +- [ ] Regenerate `docs/agent/reference-site/INDEX.md` (script, part of `pnpm build`). +- [ ] Tag `v`: the tag URL is what the docs link to. + +## 8. How agents use it + +### `docs/agent/AGENT.md`, new short section after "ipal-kit first" +> **Reference site.** Every convention in this file is implemented in the reference site, a complete +> example project kept current with each release. Before writing a file the plugin expects you to wire +> (layout, catch-all page, `lib/content.ts`, proxy, SEO/GEO routes, forms, seeds, `DEPLOY.md`, +> AGENTS.md), look up the matching file in `node_modules/@intecion/ipal-kit/docs/agent/reference-site/INDEX.md` +> and copy its pattern. Change only the project's content, never the pattern. If the reference site +> and this file disagree, report it (ipal-plugin-gap): it's a plugin bug. + +### `docs/agent/reference-site/INDEX.md` (generated, shipped) +One row per file: path, what it shows, which AGENT.md section or doc page it implements. Short wiring +files (≤ 40 lines: routes, `proxy.ts`, `instrumentation.ts`, layout, `actions.ts`, `next.config`, +`DEPLOY.md`) are included **in full**, so an agent in a client project has them offline. Longer +files get an excerpt + the tag URL. + +### Skills +- **ipal-site**, phase 1 and phase 4: "copy the structure from the reference site (INDEX.md)"; phase 8: + "the reference site's `/design` page is the styleguide to reproduce". +- **ipal-setup**: new projects start with `ipal-kit create` (generated from the reference site); + existing projects compare their wiring files against INDEX.md. +- **ipal-reference**: each module row links its reference file. +- **ipal-upgrade**: "the reference site's diff between two tags shows exactly what a project must + change": `git diff v1.14.6 v1.15.0 -- reference/` (linked). +- **ipal-block**: the Blocks showcase page as the example of every block and variant. + +Per the CLAUDE.md rule, these texts land in the same change that builds the reference site. + +## 9. Build plan (after approval) + +One branch, one commit per phase, each phase green in CI before the next: + +1. Skeleton: `reference/` project, link to plugin, Mongo (local), i18n, proxy, layout, + catch-all, `lib/content`, system routes, instrumentation, 2FA, adminMeta, security headers. +2. Content model + base seed: Pages, Media, posts, case studies, globals, system pages, forms. +3. Blocks + tokens: wait for the block-library and token tracks to land on `main`; wire them, + showcase and styleguide pages. +4. Demo seed: the made-up company in pl/en, images. +5. Deploy: DEPLOY.md (the team's Coolify process), AGENTS.md with decisions. +6. CI job + Playwright smoke tests + doctor (once the doctor track lands). +7. Starter manifest + starter job (with the starter track). +8. Agent guide: AGENT.md section, INDEX.md generator, skill updates, release checklist. + +Dependencies: phase 3 needs the block library and tokens merged; phase 6 needs the doctor CLI; phase 7 +needs the starter. Phases 1–2 and 4–5 can start right away. + +## 10. Decisions (all made by the owner, 2026-10-29) + +| # | Decision | Accepted | +|---|---|---| +| D1 | Where it lives | **C: `reference/` in the plugin repo, not shipped**; `dev/` stays the test sandbox | +| D2 | Database of the reference site (and so the starter default) | **MongoDB**: all 7 live sites use it. The plugin's Postgres support stays tested by `dev/` + vitest. | +| D3 | Deploy style for every new site | **Revised by the owner: the team's existing process.** Build and check locally; Coolify builds and runs the app from the repo (no Dockerfile); MongoDB is a separate Coolify resource on the same Docker network; targeted seeds run from the app container's Terminal (§4.8). The first answer (a standalone Dockerfile) is withdrawn. | +| D4 | CI cost | Fast part on every PR; full job (start, seed, doctor, Playwright, starter) on `main` and before each release | +| D5 | Does the starter keep the `/design` styleguide page? | **Yes**, `noindex`; it helps the designer of each new site. Drop the Blocks showcase. | +| D6 | Source of truth with the starter | **Reference site is the source**, starter generated by manifest (agreed with the starter session, confirmed by the owner) | +| D7 | Made-up company | `Pracownia Przykład` / "Example Studio" (architecture studio): services, case studies, blog | +| D8 | Is the reference site deployed anywhere? | Optional: a Coolify app at `reference.` with `noindex`, redeployed per release. Useful for showing clients; not required. | + +| D9 | Dockerfile image type | **Doesn't apply**: there is no Dockerfile (D3 revised) | +| D10 | Postgres in v1 (= starter D12) | **MongoDB only.** No Postgres files or `--db postgres` in v1 |