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]>
This commit is contained in:
Radosław Smoliński
2026-10-29 11:46:50 +01:00
co-authored by Claude Opus 5.5
parent f57d089f55
commit 25719ae7ec
11 changed files with 195 additions and 52 deletions
+5
View File
@@ -5,6 +5,11 @@ description: Builds or refactors one page section (Payload block + React compone
# ipal-block
**ipal-kit first (hard rule, AGENT.md "ipal-kit first"):** anything the plugin covers is built with the
plugin's feature. It does not work or is not enough → report it with **ipal-plugin-gap** and wait for the owner's
decision on that part; no hand-built replacement, no silent workaround. **Code rules:** AGENT.md "Code rules"
(one job per file/component/function, no duplicates, typed, texts from the panel, a check for new behaviour).
One section per use of this skill. Details and ready code:
`node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` §6.
@@ -5,6 +5,11 @@ description: Decides whether something should be a Payload collection, a global,
# ipal-collection
**ipal-kit first (hard rule, AGENT.md "ipal-kit first"):** anything the plugin covers is built with the
plugin's feature. It does not work or is not enough → report it with **ipal-plugin-gap** and wait for the owner's
decision on that part; no hand-built replacement, no silent workaround. **Code rules:** AGENT.md "Code rules"
(one job per file/component/function, no duplicates, typed, texts from the panel, a check for new behaviour).
Sources: `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` §5,
`docs/content.md`, `docs/hooks.md`, `docs/seo.md`.
+4 -4
View File
@@ -25,9 +25,9 @@ through this procedure. Ask only when you are missing something you cannot get y
`force-dynamic` "to make it work", copying plugin code into the project = **no**).
5. **Prove it**: the same command from step 1 passes + `ipal-audit --quick` +
(rendering/SEO) `ipal-seo-check` on the build.
6. Bug on the ipal-kit side → a workaround in the project **only if it is clean and
marked** (`// WORKAROUND ipal-kit <version>: <description>`) + an **ipal-plugin-gap** report.
Record the case in `AGENTS.md` → "Project decisions" if it may come back.
6. Bug on the ipal-kit side → an **ipal-plugin-gap** report to the owner and **wait for the decision** — no
workaround on your own. Only an approved workaround goes in, marked
(`// WORKAROUND ipal-kit <version>: <description>`) and recorded in `AGENTS.md` → "Project decisions".
## Symptom → cause → fix
@@ -96,4 +96,4 @@ through this procedure. Ask only when you are missing something you cannot get y
- the docs tell you to import something that the entry point does not export;
- you are writing the same boilerplate in a second project in a row (a module candidate).
Then **ipal-plugin-gap**: symptom, minimal reproduction, version, proposed
change in the plugin, workaround used in the project. **Never** edit `node_modules`.
change in the plugin, the owner's decision (and the approved workaround, if any). **Never** edit `node_modules`.
+5
View File
@@ -5,6 +5,11 @@ description: Wires forms the ipal-kit way — forms built by the editor in the p
# ipal-form
**ipal-kit first (hard rule, AGENT.md "ipal-kit first"):** anything the plugin covers is built with the
plugin's feature. It does not work or is not enough → report it with **ipal-plugin-gap** and wait for the owner's
decision on that part; no hand-built replacement, no silent workaround. **Code rules:** AGENT.md "Code rules"
(one job per file/component/function, no duplicates, typed, texts from the panel, a check for new behaviour).
**The editor builds the form in the panel. The project has the action, a block with `<RenderForm>` and the classes.** Every
further form — including multi-step ones and ones with choice lists — is panel work only. Fields/labels typed by hand in JSX = an error
(ipal-audit catches it). API details: `docs/forms.md`, `turnstile.md`, `notifications.md`, `email.md`.
+21 -9
View File
@@ -1,12 +1,13 @@
---
name: ipal-plugin-gap
description: Handles the moment when @intecion/ipal-kit seems to lack a feature or behaves wrongly — verifies against the plugin docs and type definitions first, then writes a structured report for the plugin instead of patching the project with hooks, hardcoded values or copied plugin code. Use when tempted to work around the plugin, when a plugin function errors or is missing, or when the same need appears in several projects.
description: Handles the moment when @intecion/ipal-kit seems to lack a feature or behaves wrongly — verifies against the plugin docs and type definitions first, then reports the gap to the owner with a structured plugin request and waits for their decision instead of patching the project with hooks, hardcoded values, copied plugin code or any self-made workaround. Use when tempted to work around the plugin, when a plugin function errors or is missing, or when the same need appears in several projects.
---
# ipal-plugin-gap
Rule: AGENT.md §1.3 — **do not patch silently**. A report + a minimal, marked
workaround (if the work needs it) — and you keep working, you do not wait for a reply.
Rule: AGENT.md "ipal-kit first" and §1.3 — **report first, then wait**. You do nothing on your own for
that part until the owner decides; work on unrelated parts may go on. No hand-built replacement, no silent
workaround.
Report type: **bug** (the plugin behaves differently from the docs) or **improvement**
(the same code written in yet another project; no option exists that would remove it).
@@ -26,10 +27,18 @@ building block is a **plugin gap to report** (type: improvement) — not a reaso
The plugin has it → use it and tell the user where it was.
## 2. Report (when it really is missing or broken)
Save it in the project's `docs/plugin-requests/<date>-<topic>.md`. Show the user
right away only a **blocking bug** (you cannot go on without a workaround); everything else goes into
the final report (ipal-site, "For ipal-kit" section).
## 2. Report to the owner (when it really is missing or broken)
Save it in the project's `docs/plugin-requests/<date>-<topic>.md` and **tell the owner right away**:
the file, a one-paragraph summary and the options below. Then stop work on that part.
**Options you offer the owner** (they choose — you do not):
1. wait for a plugin fix / new option (the plugin request goes to the ipal-kit team);
2. use an existing plugin option or building block differently (if you found one with a trade-off — say which);
3. an approved, minimal workaround in the project (only if the owner says yes).
**After the decision:** write it into `AGENTS.md` → "Project decisions" (what, why, the request file, who approved).
A workaround is then minimal, in one file, marked `// WORKAROUND ipal-kit <version>: docs/plugin-requests/<file>`,
and listed in the final report (ipal-site, "For ipal-kit" section) so it can be removed after the plugin fix.
```markdown
# <topic>
@@ -40,11 +49,14 @@ the final report (ipal-site, "For ipal-kit" section).
<whether other projects will need it — be specific>
## Proposed API
<function signature / ipalKit option / admin panel field; usage example in the project>
## Temporary workaround (if needed)
<minimal, in one file, with the comment `// WORKAROUND ipal-kit <version>: docs/plugin-requests/<file>`>
## Options for the owner
1. wait for the plugin · 2. <existing option, with its trade-off> · 3. <minimal workaround, in one file — only if approved>
## Decision
<filled in after the owner decides: option, date, who; a workaround is marked `// WORKAROUND ipal-kit <version>: docs/plugin-requests/<file>`>
```
## 3. What not to do
- any workaround before the owner decided — including "temporary" ones,
- a hook with the client's domain/name/colour hardcoded,
- a copy of a plugin component in the project (e.g. `Analytics`, `CookieBanner`),
- edits / `patch-package` in `node_modules/@intecion/ipal-kit`,
+35 -6
View File
@@ -8,12 +8,16 @@ description: Complete start-to-finish install of @intecion/ipal-kit in a Payload
**Goal: the MANDATORY SET from AGENT.md §0b (18 items), with nothing left "to discover".** Stage 11
checks everything; you do not finish with gaps (exception: an `ipal-audit-skip:` line from a client decision, AGENT.md §0b).
**One stage = one commit** (`git commit -m "ipal-setup <N>: <stage>"`). Do not wait for an OK between
stages (AGENT.md §0a); collect questions in **one list at the start**: client, domain, market, languages,
database (Postgres/Mongo), R2 credentials, Turnstile keys, mail (SMTP or Graph), local business (LocalBusiness?),
cookie dialog mode (`inline`/`modal`/`detailed`; brief says nothing → `detailed`), `DESIGN.md`. Missing data does not
block you: wire the code, the value goes into `.env`/the panel later, anything missing goes into the report. Step-by-step mode
only on request. Full site build: **ipal-site**.
**Stage 0 first: ask the architecture questions and wait for the answers** (below). After that: **one stage = one
commit** (`git commit -m "ipal-setup <N>: <stage>"`), no waiting for an OK between stages (AGENT.md §0a). Missing
*content data* (keys, IDs, company data) does not block you: wire the code, the value goes into `.env`/the panel
later, anything missing goes into the report. Step-by-step mode only on request. Full site build: **ipal-site**.
**ipal-kit first (hard rule, AGENT.md "ipal-kit first"):** anything the plugin covers is built with the
plugin's feature. It does not work or is not enough → report it with **ipal-plugin-gap** and wait for the owner's
decision on that part; no hand-built replacement, no silent workaround. **Code rules:** AGENT.md "Code rules"
(one job per file/component/function, no duplicates, typed, texts from the panel, a check for new behaviour).
**ipal-kit helps, never limits:** you can turn off every module separately and override every default —
**the project config wins**. Every stage has a **Turn off / override** line; "currently always" = the plugin code
@@ -25,6 +29,31 @@ Entry points: `@intecion/ipal-kit` (config, builders, helpers), `/rsc` (server c
---
## 0. Architecture questions — ask, then wait (mandatory)
**Steps.** Read the brief, `DESIGN.md`/`PRODUCT.md` and any existing code. Send the owner **one list** with every
question the brief does not answer (rule: AGENT.md "Ask before you build"). **Wait for the answers** — do not start
stage 1 on a guess. Ask again about anything still open; a missing architecture answer is never filled with a default.
```
Before I set up the site I need your decisions on:
1. Languages: which ones, which is the default, URLs — every language with a prefix (/pl/…, /en/…) or the default without one?
2. Styling: a design system / DESIGN.md, or Tailwind tokens from scratch? Brand colours, fonts, light/dark theme?
3. Pages and content: which pages? Lists with their own URLs (blog, case studies, products) and their archive pages?
4. Forms: which forms, who receives the submissions, e-mail via SMTP (panel) or Microsoft Graph?
5. Analytics and consent: GA4 / GTM / Meta / other pixels? Consent Mode basic or advanced? Cookie dialog
inline / modal / detailed? Cookie scan of the finished site?
6. SEO/GEO: market, local business (address, opening hours)? AI access (llms.txt, Markdown, MCP, AI bots) — on?
7. Database: Postgres or MongoDB? Media: Cloudflare R2 or local disk (Coolify volume)?
8. Admin: 2FA (on by default), white-label with the client's logo, agency credit in the panel?
9. Hosting: Coolify — which server/project? Production domain(s), www or apex? Who adds the DNS records?
```
**Code.** None — write every answer into `AGENTS.md` → "Project decisions" (one line per topic; template: AGENT.md §13).
**Check.** All nine topics have an answer in "Project decisions"; nothing in it says "assumed" or "default".
**Turn off / override.** Never skipped. If the owner says "you decide" for a topic, write that down as their answer,
propose a concrete choice and get a yes before you build it.
## 1. Installation
**Steps.** Scaffold: `npx create-payload-app@latest <project>` (Blank, Postgres/Mongo), delete the starter
+30 -21
View File
@@ -10,30 +10,39 @@ decisions yourself, ask once for missing data, anticipate problems, check
your own work, and hand over a report at the end. The user should not have to
guide or correct you.
**Rhythm:** one phase = one commit (`feat(site): phase N — <what>`). Do not wait for an OK
between phases. Before each phase, go through the "Anticipate" table in AGENT.md §0a.
**Rhythm:** the architecture answers first (phase 0 — you wait for them). Then one phase = one commit
(`feat(site): phase N — <what>`), no waiting for an OK between phases. Before each phase, go through the
"Anticipate" table in AGENT.md §0a.
## Phase 0 — Discovery and one question list
**ipal-kit first (hard rule, AGENT.md "ipal-kit first"):** anything the plugin covers is built with the
plugin's feature. It does not work or is not enough → report it with **ipal-plugin-gap** and wait for the owner's
decision on that part; no hand-built replacement, no silent workaround. **Code rules:** AGENT.md "Code rules"
(one job per file/component/function, no duplicates, typed, texts from the panel, a check for new behaviour).
## Phase 0 — Discovery, architecture questions and one question list
1. Read: the brief (all attachments), `AGENTS.md`, `DESIGN.md`/`PRODUCT.md`,
`package.json` (ipal-kit version), existing code. New project or finishing one?
2. Write into `AGENTS.md` → "Site map": pages (from the brief), sections on each,
forms, languages, collections (only if there are lists with URLs — ipal-collection).
3. **One question list** — only what is not in the brief and cannot be settled
yourself, each with a **default answer** you will use if there is no reply:
3. **Architecture questions — mandatory, you wait for the answers.** Send the list from **ipal-setup**
stage 0 (languages + default locale + URLs, styling, pages/collections, forms + e-mail, analytics/consent/
cookie scan, SEO/GEO, database + media, 2FA/white-label/credit, hosting + domains + DNS) for every topic
the brief does not answer. Write the answers into `AGENTS.md` → "Project decisions". **Never guess an
architecture answer**, and do not start phase 1 until every topic is answered.
4. **Content questions** — data that is not in the brief (it does not change the architecture), each with a
**default** you use if there is no reply:
```
Before I finish, I need (if you don't answer, I'll use the value in brackets):
1. Site languages? (pl + en — as in the brief)
2. Production domain? (placeholder in .env, I'll set canonical after deployment)
3. Company data: tax ID (NIP), address, phone? ([TO FILL] in the panel)
4. Which address should form submissions go to? (without it the form seed won't run — the only question without which I can't deliver forms)
5. Analytics: GA4/GTM/pixel IDs? (off until the IDs are entered in the panel)
6. R2 details: bucket, endpoint, keys, media domain? (R2 is always wired; until the keys arrive, media stay local in dev)
7. Turnstile keys? (test keys in dev; you'll enter production keys in Site integrations)
8. AI access to content (llms.txt, Markdown, MCP, AI bots)? (on — I turn it off only at your explicit request)
9. Translations: should I make drafts for approval? (yes, marked in the report)
1. Company data: tax ID (NIP), address, phone? ([TO FILL] in the panel)
2. Analytics: GA4/GTM/pixel IDs? (off until the IDs are entered in the panel)
3. R2 keys (bucket, endpoint, access keys)? (until they arrive, media stay local in dev)
4. Turnstile keys? (test keys in dev; you'll enter production keys in Site integrations)
5. Translations: should I make drafts for approval? (yes, marked in the report)
```
Send the list and **keep working** on the default values. Fill in the answers
when they arrive. Stop only before an irreversible decision (AGENT §0a).
Send this list with the architecture questions. After the architecture answers arrive, **keep working**
on the content defaults and fill in the content answers when they arrive. Stop before an irreversible
decision (AGENT §0a) and on a plugin gap (ipal-plugin-gap — report, wait for the owner).
## Phase 1 — Foundation
- New project → **ipal-setup** (all of it, with `ipal-skills`, `AGENTS.md`).
@@ -111,8 +120,8 @@ JSON-LD, AI bots in robots — every gap is an `[ERROR]` to fix.
Plus by hand: the editor test (AGENT §11) in every language, the form (list in
ipal-form §6), keyboard (Tab through the menu, banner, form; visible focus),
404 in every language. Fix every `[ERROR]` (**ipal-debug**) and run the
check again. Never hand over with errors — exception: a blocking ipal-kit bug
(plugin gap report, `ipal-plugin-gap`, + workaround).
check again. Never hand over with errors — exception: an ipal-kit bug reported with `ipal-plugin-gap`
and waiting for the owner's decision (or handled by an approved, marked workaround).
## Phase 10 — Final report (the only big message to the user)
```markdown
@@ -134,9 +143,9 @@ Turnstile <✓ / waiting for keys> · forms from the panel ✓ · consent ✓ ·
## Fixed along the way
- <problem → cause → fix> (briefly, only what matters)
## For ipal-kit
- [bug|improvement] <topic> → docs/plugin-requests/<file> (workaround: <file:line>)
- [bug|improvement] <topic> → docs/plugin-requests/<file> · owner's decision: <wait / option / approved workaround at file:line>
## Next step
- <one thing, e.g. "give me the domain → deployment per PROGRAMISTA §4">
```
Do not report progress along the way. Exceptions: the question list from phase 0, a blocking
ipal-kit bug, an irreversible decision.
Do not report progress along the way. Exceptions: the question lists from phase 0, a plugin gap
(reported at once, ipal-plugin-gap), an irreversible decision.