Files
ipal-kit/docs/dev/vibe.md
T
Radosław SmolińskiandClaude Opus 5.5 25719ae7ec Agent guide: ask architecture questions first, ipal-kit first, code rules
- AGENT.md: "Ask before you build" (languages, styling, content, forms,
  analytics/consent, SEO/GEO, database + media, admin, hosting/DNS) —
  answers go to AGENTS.md "Project decisions", never guessed; "ipal-kit
  first" hard rule — a gap is reported to the owner and the agent waits
  for the decision, no hand-built replacements or silent workarounds;
  short "Code rules" (SRP, small files, no duplicates, typed, i18n texts,
  checks) pointing to §8
- ipal-setup stage 0 and ipal-site phase 0: the architecture question
  list, answered before building; content questions keep defaults
- ipal-plugin-gap: report, offer options, wait, record the decision;
  ipal-block/collection/form/debug and vibe aligned; AGENTS.md template
  and the ipal-skills pointer block carry the rules
- docsConsistency: the rules reach every site-building skill

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:46:50 +01:00

18 KiB
Raw Blame History

vibe.md — prompts for the AI, step by step

Who it is for: the person who builds a client project by driving an AI agent (Antigravity, Claude Code, Cursor). Here are ready-made prompts to paste, in order, module by module. The rules the agent must follow are in AGENT.md; the process for humans is in PROGRAMISTA.md.


The agent works like an independent contractor (AGENT.md §0a): it asks once, in one list, only for missing data; it makes technical decisions itself; it checks its own work; it speaks up only with the final report (or when ipal-kit has a bug).

/ipal-site <brief: client, industry, pages and sections, languages, forms — or a path to a brief file>

You: answer the list of questions (or don't — it will use the defaults), and at the end read the report: what was done, check results, [TO FILL] placeholders, reports to ipal-kit. The steps below are guided mode — for when you want to control each stage or fix one thing.

Need Prompt
new section / section fix /ipal-block <Name> — <description/screenshot>
form /ipal-form <which form, where, who receives submissions>
new language /ipal-locale-add <code> — <who translates>
change fields that have content in the database /ipal-migrate-fields <what to what>
something does not work /ipal-debug <symptom / message>
SEO / Google does not see it /ipal-seo-check <url>
GDPR / pixels before consent /ipal-consent-check <url>
before handover /ipal-audit

How to work with the agent in guided mode (read once)

  1. One step = one prompt = one commit. Do not paste three steps at once. An agent that does everything at the same time loses the rules.
  2. Plan first, then code. Every prompt ends with a request for a plan; code only after your "OK". You check a plan in 30 seconds; bad code takes an hour to fix.
  3. Every step ends with proof: the output of pnpm build and the checks from AGENT.md §11. "Done" without command output = not done.
  4. A new conversation every few steps. A long context blurs the rules. Every new conversation starts with Prompt 0.
  5. You fill in the values in <…> before pasting.
  6. When the agent breaks a rule — use the repair prompts at the end of this file; do not explain it again from scratch.

Skills instead of long prompts. When the project has the ipal-kit skills (pnpm exec ipal-skills, AGENT.md §14), most steps are one short prompt, e.g. /ipal-block Hero — <description/screenshot>. The prompts below also work without skills; the short version is given at each step.

Prefix for every prompt (paste it at the start if the agent does not read AGENTS.md by itself):

Work according to node_modules/@intecion/ipal-kit/docs/agent/AGENT.md and the project's AGENTS.md.
Plan first (files to create/change + what goes in them), wait for my OK, then code.
At the end show the output of pnpm build and the checks from AGENT.md §11.

STEP 0 — Context (start of every new conversation)

Read node_modules/@intecion/ipal-kit/docs/agent/AGENT.md and AGENTS.md in the project root
in full. Do not write code yet.
Answer in 10 points which rules from AGENT.md matter most for this project,
and state which step of node_modules/@intecion/ipal-kit/docs/dev/vibe.md we are on
(check the repo state: git log, existing files).

Check: the agent mentions, among others, proxy.ts instead of middleware, no hardcoding, buildLinksField/CMSLink, minimum collections. If not — tell it to read again.


STEP 1 — Skeleton and installation

Short version: /ipal-setup (walks through steps 1–8, stage by stage).

Set up a new Payload 3 + Next 16 project according to PROGRAMISTA.md §1 and §2.1:
- .npmrc with the @intecion registry,
- @intecion/ipal-kit + the dependencies from PROGRAMISTA.md §1 (including @clocklimited/payload-2fa),
- pnpm.overrides to 3.90.2 for payload and all @payloadcms/*,
- build script with --webpack,
- remove the starter (frontend)/layout.tsx and page.tsx,
- .env.example from PROGRAMISTA.md §3 (no values), .env in .gitignore.
Database: <postgres|mongo>. Do NOT create middleware.ts.
Plan first.

Check: pnpm install without errors, no middleware.ts, .npmrc in the repo.


STEP 2 — Project AGENTS.md

Create AGENTS.md in the root from the template in AGENT.md §13. Data:
client <name>, domain <domain>, market <PL/AU/…>, industry <…>,
languages <pl, en, …> (default <pl>), media <R2/local>, email <SMTP/Graph>.
Project decisions: <e.g. "blog with categories", "404 = separate page", "no shop">.
Do not copy rules from AGENT.md — only a link.

STEP 3 — Configuration: i18n + payload.config

Create src/i18n.config.ts (as const satisfies I18nConfig) with languages <…>
and payload.config.ts according to PROGRAMISTA.md §2.3:
ipalKit with i18n, access, pages (slug 'pages'), seo, forms,
twoFactor with INJECTED payloadTotp (issuer: '<client name>'), whiteLabel: true,
email: mailAdapter(). Do not add content collections yet.
Plan first.

Check: the language list exists only in i18n.config.ts (grep 'pl' in src).


STEP 4 — Core collections + shared fields

Do this according to AGENT.md §5.3 and §6.2:
1. Shared section fields and links are in the plugin: buildSectionHeaderField, buildSectionSettingsField,
   buildLinkField, buildLinksField from @intecion/ipal-kit — do not copy them, do not create src/fields/.
2. collections/Media.ts: upload (mimeTypes images + PDF + mp4), alt required localized,
   normalizeFilenameHook, buildOptimizeUploadHook + buildOptimizeUploadField, buildMediaPlaceholderHook +
   buildMediaPlaceholderField (media.md); buildR2Storage(['media'], { s3Storage }) in payload.config.ts
   (R2 when all R2_* are set in env, otherwise local disk), s3Storage injected from @payloadcms/storage-s3 (storage.md).
3. collections/Pages.ts: title localized, buildSlugField, buildNoindexField,
   layout of type blocks (for now one Content block: buildSectionHeaderField + content richText),
   trackSlugHistoryHook, buildRevalidateHook (hooks.md).
Do NOT create users, settings, navigation or any other collections.
Then pnpm generate:types and payload generate:importmap.
Plan first.

Check: collections/ contains only Pages.ts and Media.ts; payload-types.ts has the types CmsLink, SectionHeaderData, SectionSettings.


STEP 5 — Design tokens and UI primitives

Before this: /impeccable init and /impeccable document → PRODUCT.md, DESIGN.md.

Based on DESIGN.md, create src/app/(frontend)/styles.css according to AGENT.md §6.11:
@theme with tokens (primary, background, foreground, muted + fonts), @source for the plugin,
mapping of --ipal-primary / --ipal-radius. Fonts through next/font.
Then the primitives 1:1 from node_modules/@intecion/ipal-kit/docs/agent/skills/ipal-block/resources/section-code.md:
components/ui/CMSLink.tsx,
Button.tsx, Media.tsx, Section.tsx, SectionHeader.tsx, and components/icons according to §6.10.
Zero hex values in components — tokens only.
Plan first.

STEP 6 — Routing, layout, pages

Do this according to PROGRAMISTA.md §2.6–2.8 and AGENT.md §4:
- src/proxy.ts with createProxy, matcher as an inline literal,
- src/lib/content.ts with createContentHelpers (PROGRAMISTA §2.7 — it also exports the routes, getSiteShell, resolveNav),
- app/(frontend)/[locale]/layout.tsx: NO <head>, <SiteProviders shell={await getSiteShell(locale)} …>
  (consent, equalChoice banner, Turnstile, Analytics, JSON-LD, preconnect — in the right order),
- [locale]/[[...slug]]/page.tsx: createPageRoute(content, { blocks, notFound, permanentRedirect }) +
  export const revalidate (literal), NO searchParams,
- [locale]/not-found.tsx: createNotFoundPage(content, { load: loadNotFoundView }) + notFoundView.ts ('use server', renderNotFoundView) — NO headers() (pages.md).
Plan first.

Check: / → /<default language>; pnpm build shows the pages as ●; grep -rn "<head" src/app = 0.


STEP 7 — SEO, system routes, security

Do this according to PROGRAMISTA.md §2.8–2.9 and seo.md:
- re-exports from lib/content: app/sitemap.xml/route.ts (sitemapRoute), robots.ts (robots), manifest.ts (manifest), llms.txt/route.ts (llmsRoute),
  api/health/route.ts — every route that reads the database with export const dynamic = 'force-dynamic',
- next.config.ts: htmlLimitedBots, buildSecurityHeaders,
- page metadata through generatePageMetadata from lib/content (shared cache), favicon through buildIconsMetadata,
- JSON-LD: Organization + WebSite come from SiteProviders using Site settings; local business → siteJsonLd in createContentHelpers (seo.md),
- src/instrumentation.ts with assertEnv(ipalEnvRules(...)) imported from @intecion/ipal-kit/env (env.md).
No CSP yet — that comes in step 14.
Plan first.

Check: curl -A "Googlebot" http://localhost:3000/pl | grep canonical — in <head>.


Short version: /ipal-nav <menu items, footer columns, market>.

Do this according to AGENT.md §6.8, code from node_modules/@intecion/ipal-kit/docs/agent/skills/ipal-nav/resources/nav-code.md:
- globals/Header.ts, Footer.ts (code from §6.8),
- globals/Company.ts for market <PL/AU/…>: name, address, <NIP/ABN/…>, phone, email —
  all localized where it is text,
- menu through resolveNav from lib/content (plugin, NOT lib/navigation.ts), components/layout/Header.tsx, Footer.tsx, MobileNav.tsx,
- legal links in the footer from System pages roles, NOT by hand,
- the project's own globals (Header, Footer, Company) get buildGlobalRevalidateHook (afterChange); plugin globals refresh through ipalKit({ revalidatePath }).
Wire it into [locale]/layout.tsx. a11y labels from the admin panel.
Plan first.

STEP 9 — Blocks (repeat for each section)

One section = one prompt. The list first, then one by one.

9a. List of blocks from the design:

Here is the site design: <link / screenshots / section description>.
List the blocks to build (camelCase slug, name, fields using the vocabulary of
AGENT.md §6.5, which sections are the same block with a different variant).
Goal: as few blocks as possible, each reusable. Do not write code.

9b. One block:

Short version: /ipal-block <Name> — <fields from 9a>, <appearance description / screenshot>.

Build the <name> block according to AGENT.md §6 (layer 3):
- src/blocks/<Name>/config.ts: buildSectionHeaderField, buildLinksField, media, items,
  buildSectionSettingsField — only the fields from the step 9a list, names from §6.5,
- Component.tsx: Section + SectionHeader + Media + CMSLink, max ~80 lines of JSX,
  repeated elements in <Name>Card.tsx, interaction in a separate 'use client' file (§6.9),
- add it to Pages.layout and to blocks/registry.ts,
- pnpm generate:types, prop types from @/payload-types.
Appearance: <description / screenshot>. Zero texts, links and hex values in the code.
Plan first.

Check with the checks from AGENT.md §11 (grep for ctaLabel, href="/, <img, file length).


STEP 10 — Forms, Turnstile, email

Short version: /ipal-form <form, who receives submissions>.

Do this according to forms.md, turnstile.md, email.md:
- form block: <RenderForm> from @intecion/ipal-kit/rsc + formClasses.ts (ipal-form skill) — fields, steps,
  select options and texts from the admin panel, no custom renderer,
- consent checkbox (GDPR consent) with a link to the policy through getSystemPagePath,
- Turnstile from SiteProviders in the layout — without passing siteKey to the block,
- RenderForm handles the honeypot and the GTM event from the admin panel by itself (forms.md).
Plan first.

Check: admin panel → Site integrations → Send test; submitting the form without consent → rejected.


Verify and finish according to consent.md and analytics.md:
- Analytics through SiteProviders (inside consent), IDs only from Site integrations,
- whether to turn on defer (Core Web Vitals) — <yes/no>,
- Meta Pixel: <in the admin panel | in GTM> (never both),
- policy link in the banner: automatic (no privacyPolicy parameter in the code).
Show how to check in Network that before consent nothing loads from
facebook.net / clarity.ms / licdn.com / tiktok, and that GA4/GTM starts with Consent Mode "denied".

GA4/GTM load before consent (Consent Mode v2, denied by default — no cookies, but with pings to Google); only non-Google pixels are blocked until consent (analytics.md).


STEP 12 — Content collections (only when the client needs them)

Short version: /ipal-collection <what the client needs>.

The client needs: <blog / case studies / products>. Run the test from AGENT.md §5.3
and confirm it is a collection. Then according to content.md and §5.4:
- collections/<Name>.ts: title, buildSlugField, SEO tab, buildNoindexField,
  trackSlugHistoryHook, setPublishedAtHook (blog), relations <…>,
- content.config.ts with { slug, perPage } — URL prefix from the admin panel (archive), NOT in the code,
- entries list block (EntriesList) + entry page, Article JSON-LD (seo.md).
Plan first.

STEP 13 — Hooks and redirects

Check according to hooks.md that these are wired:
buildRevalidateHook (a collection hook: Pages + content collections; plugin globals: ipalKit({ revalidatePath }); the project's own globals: buildGlobalRevalidateHook, as in step 8), trackSlugHistoryHook + resolveRedirect,
buildCrossLocaleFieldSync (languages from the config), buildPreventDeleteSystemPage, buildValidateUniqueRole.
Show a test: change a page's slug → the old URL returns 308 to the new one.

STEP 14 — CSP and admin panel

According to security.md: buildCsp in report-only mode with the flags <turnstile, analytics, youtube, r2Url>.
List what to check in the browser console before we switch to enforce.
Check the admin panel white-label (logo, name, Intecion credit) and 2FA for everyone.
Optionally adminRoute '<path>' with moving the folder.

STEP 15 — Look and feel (Impeccable)

A separate tool, after step 9, for finished blocks:

/impeccable polish <page/section>

After every Impeccable pass — a prompt for the agent:

Check the Impeccable changes with the checks from AGENT.md §11. Did text appear in JSX,
a hex value instead of a token, a new field with a forbidden name, or a file >80 lines of JSX? Fix it.

STEP 16 — Audit before handover

Short version: /ipal-audit (script), on the built app /ipal-seo-check http://localhost:3000 and /ipal-consent-check http://localhost:3000/<locale>, then the editor test and compliance by hand.

Run a full project audit:
1. All checks from AGENT.md §11 — show the command output.
2. The editor test from AGENT.md §11 — for every point show where it is changed in the admin panel.
3. The compliance checklist from PROGRAMISTA.md §5.
4. pnpm build — are the routes ● or ƒ?
List the problems with priorities. Do not fix anything yet.

Then the fixes one at a time, each with a separate prompt.


STEP 17 — Deployment

You do this yourself, according to PROGRAMISTA.md §4. You can give the agent:

Prepare the list of Coolify variables for this project (PROGRAMISTA.md §3)
and the §4.1 and §4.5 checklists filled in for this project. No secret values.

REPAIR PROMPTS (when the agent drifts)

Hardcoding / text in code:

Stop. This breaks AGENT.md §2. Every text, link, image and file comes from the admin panel.
Move <what> to a field in <block/global> and show the diff.

Zoo of CTA fields / monolithic section:

Stop. AGENT.md §6.5–6.6: CTA = buildLinksField() + CMSLink, image = media + Media,
max ~80 lines of JSX. Refactor <block> according to §6.7. If there is content in the database — run /ipal-migrate-fields first.

Unreadable admin panel (cta1/cta2, dozens of fields, "Item 01", Polish labels):

Stop. AGENT.md §6.5a: repeated items = an array with labels + rowLabel ("+ Add …"), zero numbered
fields and spare fields, EN labels of 1–3 words, descriptions ≤ 80 characters, settings in the sidebar.
Fix <block> (with content in the database → /ipal-migrate-fields) and run the empty block test.

The agent writes something the plugin already has:

Stop. Check in node_modules/@intecion/ipal-kit/docs and dist/*.d.ts whether the plugin
already has it (AGENT.md §1.1, §7). If it does — remove your code and use the plugin.

The plugin is missing something / the plugin has a bug: Short version: /ipal-plugin-gap <what does not work>.

Do not patch it silently. Write a report according to AGENT.md §1.3 (problem, proposed API, why it is universal)
in docs/plugin-requests/, tell me, and wait for my decision on that part — no workaround on your own.

A new collection you did not ask for:

Stop. AGENT.md §5.3 — minimum collections. Run the 4-question test for <collection>.
If it is a block or a global — rework it.

"Done" without proof:

Run /ipal-audit (without --quick) and show the full output. Without it the step is not finished.

The agent lost the rules (long conversation):

Read node_modules/@intecion/ipal-kit/docs/agent/AGENT.md again in full
and check your recent changes against §0 (compass). List the violations.

EXISTING PROJECT — upgrade to the latest ipal-kit

Short version: /ipal-upgrade.

Upgrade @intecion/ipal-kit to the latest version. Then go through the table
in PROGRAMISTA.md §6 row by row: for each, check whether it applies to the project
(show proof: grep / file), and list what needs to be done. Do not change code yet.

Then one item from the list = one prompt:

Do item <no.> from PROGRAMISTA.md §6 according to the docs file it names. Remove the local
version that the plugin replaces. Plan first, pnpm build at the end.