Kit de landing pages Next.js : pages à blocs, formulaires de leads, bandeau cookies, pixels avec consentement
Installer
genpm add @core/kit-landingCe que vous obtenez
- Source dans src/app/(landing)/, 14 fichiers. (21,1 ko)
- Règles IA dans src/app/(landing)/AGENTS.md, plus les fichiers de règles de l’IDE.
- Variables d’environnement ajoutées à .env.example : GA4_MEASUREMENT_ID, META_PIXEL_ID, TIKTOK_PIXEL_ID, CONSENT_POLICY_VERSION, EXPERIMENTS_SECRET.
- Résout @core/consent, @core/experiments, @core/kit-cms, @core/pixels pour vous.
README
Ce paquet n’a pas de README.
Voici exactement ce que lit votre IA quand elle travaille dans src/app/(landing). Rien d’autre n’est ajouté à son contexte.
@core/kit-landing — rules for AI agents
Purpose
Conversion landing pages on top of @core/kit-cms: the landings collection (blocks, SEO, minimal layout without
site navigation, conversion goal, thank-you page) served at /lp/<slug>, lead forms that store the submission with
its UTM parameters and fire one deduplicated lead event (server + browser with the same eventId, only with
consent), a cookie banner, consent-gated GA4/Meta/TikTok pixels and a real-deadline countdown block.
A/B tests with @core/experiments: a landing can name an experiment and show blocksB to variant b.
Map
_templates/genpm.md— the exact lines this kit adds to the project'ssrc/genpm/*.ts(generated, always current).lp/[slug]/page.tsx— landing.lp/[slug]/lead/[formKey]/route.ts— form posts.lp/[slug]/thanks/page.tsx— thank-you + browser event.api/consent/route.ts— saves the banner choice and deletes cookies of rejected categories._lib/landings.ts— collection andlandingPath._lib/conversion.ts— lead handling and thelanding.lead-eventjob._components/site-tracking.tsx—<SiteTracking />(banner + pixels) for the root layout._blocks/countdown.tsx._lib/widgets.ts— "Leads by landing (7 days)" dashboard widget.
Integration
- @core/kit-cms must be integrated first.
- Add the lines of
_templates/genpm.mdto the project'ssrc/genpm/*.ts(it says which file and where): the landings collection and lead event, thecountdownblock, the sitemap source and the admin resource and widget. Lines marked "A/B tests (optional)" are only needed for step 5. - Root layout: render
<SiteTracking policyHref="/cookies" />at the end of<body>, and addclassName="site-chrome"to the site header and footer so minimal landings can hide them. Add<CookieSettingsButton />(@core/consent/react, a client component that callsopenConsentPreferences()) in the footer. - Env (all optional; a platform is active only when configured): public ids
GA4_MEASUREMENT_ID,META_PIXEL_ID,TIKTOK_PIXEL_IDand the server tokens described in src/lib/pixels/AGENTS.md. BumpCONSENT_POLICY_VERSIONwhen the cookie policy changes (everyone is asked again). - A/B tests (optional): set
EXPERIMENTS_SECRET, add the "A/B tests (optional)" lines of_templates/genpm.md, run the kit-cmssetup-schedules.tsagain (schedulesexperiments.prune), create an experiment with variantsa(control) andband goallead, then set its key and the "variant B" sections on the landing. - Give editors the
landings:*permission if they should manage landings (defineRole, @core/rbac). - Verify: create a landing with a hero and a form block, submit it with UTM parameters, see the submission with
its UTM in Admin → Submissions, and the
Leadevent in each platform's test tool after accepting cookies.
Conventions
- One conversion goal per landing; the form block's form decides what is collected.
- Hero images: the first block gets
fetchPriority="high"; keep LCP under 2.5 s on mobile. - Lead events carry no personal data in the browser; the server event sends only hashed identifiers (@core/pixels).
Don't
- No fake urgency: countdowns only with the real end date of a real offer (they disappear afterwards and never reset); "only X left" only with real stock (EU Directive 2005/29/EC, DSA).
- Testimonials, ratings and numbers only from real data the person provides; if missing, leave the block out and say so.
- Never load a pixel outside
ConsentGate, never pre-tick consent boxes, never fireleadwithout a stored submission.
# @core/kit-landing — rules for AI agents
## Purpose
Conversion landing pages on top of @core/kit-cms: the `landings` collection (blocks, SEO, minimal layout without
site navigation, conversion goal, thank-you page) served at `/lp/<slug>`, lead forms that store the submission with
its UTM parameters and fire one deduplicated `lead` event (server + browser with the same `eventId`, only with
consent), a cookie banner, consent-gated GA4/Meta/TikTok pixels and a real-deadline countdown block.
A/B tests with @core/experiments: a landing can name an experiment and show `blocksB` to variant `b`.
## Map
- `_templates/genpm.md` — the exact lines this kit adds to the project's `src/genpm/*.ts` (generated, always current).
- `lp/[slug]/page.tsx` — landing. `lp/[slug]/lead/[formKey]/route.ts` — form posts. `lp/[slug]/thanks/page.tsx` — thank-you + browser event.
- `api/consent/route.ts` — saves the banner choice and deletes cookies of rejected categories.
- `_lib/landings.ts` — collection and `landingPath`. `_lib/conversion.ts` — lead handling and the `landing.lead-event` job.
- `_components/site-tracking.tsx` — `<SiteTracking />` (banner + pixels) for the root layout. `_blocks/countdown.tsx`.
- `_lib/widgets.ts` — "Leads by landing (7 days)" dashboard widget.
## Integration
1. @core/kit-cms must be integrated first.
2. Add the lines of `_templates/genpm.md` to the project's `src/genpm/*.ts` (it says which file and where): the
landings collection and lead event, the `countdown` block, the sitemap source and the admin resource and widget.
Lines marked "A/B tests (optional)" are only needed for step 5.
3. Root layout: render `<SiteTracking policyHref="/cookies" />` at the end of `<body>`, and add `className="site-chrome"`
to the site header and footer so minimal landings can hide them. Add `<CookieSettingsButton />` (@core/consent/react, a client
component that calls `openConsentPreferences()`) in the footer.
4. Env (all optional; a platform is active only when configured): public ids `GA4_MEASUREMENT_ID`, `META_PIXEL_ID`,
`TIKTOK_PIXEL_ID` and the server tokens described in src/lib/pixels/AGENTS.md. Bump `CONSENT_POLICY_VERSION`
when the cookie policy changes (everyone is asked again).
5. A/B tests (optional): set `EXPERIMENTS_SECRET`, add the "A/B tests (optional)" lines of `_templates/genpm.md`, run the
kit-cms `setup-schedules.ts` again (schedules `experiments.prune`), create an experiment
with variants `a` (control) and `b` and goal `lead`, then set its key and the "variant B" sections on the landing.
6. Give editors the `landings:*` permission if they should manage landings (`defineRole`, @core/rbac).
7. Verify: create a landing with a hero and a form block, submit it with UTM parameters, see the submission with
its UTM in Admin → Submissions, and the `Lead` event in each platform's test tool after accepting cookies.
## Conventions
- One conversion goal per landing; the form block's form decides what is collected.
- Hero images: the first block gets `fetchPriority="high"`; keep LCP under 2.5 s on mobile.
- Lead events carry no personal data in the browser; the server event sends only hashed identifiers (@core/pixels).
## Don't
- No fake urgency: countdowns only with the real end date of a real offer (they disappear afterwards and never reset);
"only X left" only with real stock (EU Directive 2005/29/EC, DSA).
- Testimonials, ratings and numbers only from real data the person provides; if missing, leave the block out and say so.
- Never load a pixel outside `ConsentGate`, never pre-tick consent boxes, never fire `lead` without a stored submission.
L’arborescence exacte qui sera injectée, après .genpmignore. Épinglée à
// Colección `landings` sobre @core/content: bloques, SEO, diseño, objetivo de conversión y página de gracias.
import { z } from 'zod';
import { blocks } from '@/genpm/blocks';
import { defineCollection } from '@/lib/content';
import { SeoFieldsSchema, seoAdminFields } from '@/lib/seo';
export const LANDING_PREFIX = '/lp';
export const landingPath = (e: { slug: string }) => `${LANDING_PREFIX}/${e.slug}`;
export const LandingSchema = z.object({
title: z.string().min(1).max(160),
blocks: blocks.schema.default([]),
/** `minimal`: sin cabecera ni pie del sitio (menos distracciones). */
layout: z.enum(['full', 'minimal']).default('minimal'),
/** Qué cuenta como conversión. `lead`: un envío de formulario desde la landing. */
goal: z.enum(['lead', 'click']).default('lead'),
/** Test A/B (@core/experiments): clave de un experimento cuya variante `b` muestra `blocksB` en lugar de `blocks`. */
experiment: z.string().max(48).optional().transform((v) => v || undefined),
blocksB: blocks.schema.default([]),
thanksTitle: z.string().max(160).default('Thank you!'),
thanksText: z.string().max(2000).default('We have received your details and will get back to you soon.'),
seo: SeoFieldsSchema,
});
export type LandingData = z.infer<typeof LandingSchema>;
export const landings = defineCollection('landings', {
label: { singular: 'Landing page', plural: 'Landing pages' },
schema: LandingSchema,
localized: false,
fields: [
{ name: 'title', label: 'Internal title', type: 'text', required: true, list: true },
blocks.field('blocks', 'Sections'),
{
name: 'layout',
label: 'Layout',
type: 'select',
options: [
{ value: 'minimal', label: 'Minimal (no site header/footer)' },
{ value: 'full', label: 'Full site layout' },
],
},
{ name: 'goal', label: 'Conversion goal', type: 'select', list: true, options: [{ value: 'lead', label: 'Lead (form submission)' }, { value: 'click', label: 'Click on a call to action' }] },
{ name: 'experiment', label: 'A/B test key (optional)', type: 'text', help: 'Create the experiment in Admin → Experiments with variants a and b and goal "lead".' },
blocks.field('blocksB', 'Sections for variant B (A/B test)'),
{ name: 'thanksTitle', label: 'Thank-you page title', type: 'text' },
{ name: 'thanksText', label: 'Thank-you page text', type: 'textarea' },
...seoAdminFields,
],
});
Ce paquet ne déclare aucun serveur MCP.
| Version | Commit | Publié | Analyse |
|---|---|---|---|
| 1.0.1 | f730e59 | il y a 4 heures | analyse réussie |
- proposé
- GenPM propose la commande npm et ne l’exécute que si vous acceptez.
- Utilisé par (1)
- @core/kit-dropshipping ^1.0.0
- analyse
- analyse réussie · 0 problème
- commit
- v1.0.1 → f730e5984cd035cc0e8a4f1e503380f56c10e410 · vérifié après téléchargement
- scripts
- Aucun. GenPM n’exécute jamais le code des paquets.
- licence
- MIT
- Qualité
- 100/100
- Licence reconnuevalidé
- AGENTS.md explique son objectifvalidé
- AGENTS.md donne les étapes d’intégrationvalidé
- AGENTS.md liste conventions ou interditsvalidé
- Contient des testsvalidé
- Analyse de sécurité réussievalidé
- Publié au cours des 6 derniers moisvalidé
- Éditeur vérifiévalidé
- Résumé et mots-clésvalidé
- signalement
- Vous avez repéré un problème ?