
enonic-nextxp-integration
Guides setup, development, and troubleshooting of the Next.js and Enonic XP headless integration (Next.XP framework). Covers Enonic adapter configuration, content type to React component mapping, Guillotine GraphQL data fetching, Content Studio preview mode, and draft/master branch switching. Use when building a Next.js frontend powered by Enonic XP, configuring the Next.XP adapter, mapping content types to components, fetching Enonic content via Guillotine in Next.js, or debugging Content Studio preview. Don't use for traditional server-side Enonic XP rendering, standalone Guillotine queries without Next.js, non-Next.js frontend frameworks with Enonic, or React4XP embedded rendering.
- Installs
- 463
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/webmaxru/enonic-agent-skills --skill enonic-nextxp-integration- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads enonic-nextxp-integration automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Next.js + Enonic XP Headless Integration (Next.XP)
Procedures
Step 1: Identify the workspace integration surface
- Inspect the workspace for Next.js entry points (
next.config.*,package.jsonwithnextdependency), Enonic XP app markers (build.gradlewithcom.enonic.xp), or existing Next.XP adapter references (@enonic/nextjs-adapter). - Execute
node scripts/find-nextxp-targets.mjs .to inventory Next.js projects,.envfiles withENONIC_*variables, component mapping files (_mappings.ts), and Guillotine query files when a Node runtime is available. - If a Node runtime is unavailable, inspect
package.json,.env, andsrc/components/_mappings.tsmanually to identify the integration surface. - If the workspace contains both an Enonic XP app and a Next.js frontend, confirm which side the task targets before proceeding.
- If the workspace is not a Next.js + Enonic XP project, stop and explain that this skill does not apply.
Step 2: Configure the Enonic adapter
- Read
references/nextxp-reference.mdbefore writing or modifying configuration. - Verify or create the
.env(or.env.localfor local development) file in the Next.js project root with the required variables:ENONIC_API_TOKEN— shared secret for preview mode authentication.ENONIC_APP_NAME— fully qualified Enonic application name (e.g.,com.example.myproject).ENONIC_MAPPINGS— locale-to-project/site mapping (e.g.,en:intro/hmdb).ENONIC_API— base URL for the Guillotine API endpoint (e.g.,http://127.0.0.1:8080/site/).
- Install the
@enonic/nextjs-adapterpackage if not already present:npm install @enonic/nextjs-adapter. - Import
@enonic/nextjs-adapter/baseMappingsat the top ofsrc/components/_mappings.tsto register built-in component renderers. - Verify the Next.js project was scaffolded from the
nextxp-templateor contains the expected file structure:src/components/_mappings.ts,src/app/[locale]/[[...contentPath]]/page.tsx, and API routes undersrc/app/api/. - Read
references/compatibility.mdto confirm version requirements between@enonic/nextjs-adapter(v4.x), Next.js (16+), React (19), and Enonic XP.
Step 3: Map content types to React components
- Read
references/nextxp-reference.mdfor the component registry API and mapping patterns. - Read
references/examples.mdfor complete content type mapping examples including queries, views, and processors. - For each Enonic content type that needs a custom rendering:
a. Create a Guillotine GraphQL query function in
src/components/queries/that fetches the fields specific to that content type using type introspection (... on AppName_ContentTypeName). b. For content types with HTML area (rich text) fields, userichTextQuery(fieldName)from@enonic/nextjs-adapterto generate the query fragment. Seereferences/nextxp-reference.mdfor the rich text rendering section. c. Create a React view component insrc/components/views/that acceptsFetchContentResultprops and renders the fetched data. UseRichTextViewfrom@enonic/nextjs-adapter/views/RichTextViewfor HTML area fields. d. Register both insrc/components/_mappings.tsusingComponentRegistry.addContentType(). - For page components (pages, parts, layouts):
a. Define the component XML in the Enonic app under
src/main/resources/site/pages/,parts/, orlayouts/. b. Create a corresponding React component insrc/components/pages/,parts/, orlayouts/. UseLayoutPropsfor layouts and the namedRegionViewexport for individual region rendering. c. Register usingComponentRegistry.addPage(),ComponentRegistry.addPart(), orComponentRegistry.addLayout(). - For layouts, use
LayoutPropstype andRegionView(singular, named export) for individual regions instead ofRegionsView. - Use
APP_NAMEandAPP_NAME_UNDERSCOREDimports from@enonic/nextjs-adapterto keep content type references dynamic.
Step 4: Configure Guillotine data fetching
- Read
references/nextxp-reference.mdfor the Guillotine query structure and variable passing. - Write GraphQL queries that use
$path:ID!as the primary variable for content retrieval viaguillotine { get(key:$path) { ... } }. - Use type introspection to access content-type-specific fields:
... on AppName_ContentTypeName { data { ... } }. - For rich text fields (HtmlArea), use
richTextQuery(fieldName)from the adapter instead of querying the field directly. Render withRichTextViewfrom@enonic/nextjs-adapter/views/RichTextView. - For parts and configurable components, export a query object with
query(path, context, config)andvariables(path, context, config)functions. - Use processors (optional async functions) to post-process query results before passing to the view.
- Use
ComponentRegistry.setCommonQuery()for data shared across all page components. Remove the common query if not needed to optimize performance. - Use
getUrl()andgetAsset()helper functions from the adapter for URL handling that works in both standalone and Content Studio preview modes. - For macros in rich text, register them with
ComponentRegistry.addMacro()before other components that useRichTextView. Seereferences/nextxp-reference.mdfor the macro registration API.
Step 5: Enable Content Studio preview mode
- Read
references/nextxp-reference.mdfor full preview architecture details. - Install the
Next.XPapp in Enonic XP:XP Menu → Applications → Install → search "Next.XP". - Add the Next.XP app to the target site in Content Studio via the "Applications" combobox on the site edit view.
- Verify default preview configuration: URL
http://127.0.0.1:3000and secret matchingENONIC_API_TOKEN. - For production, configure the Next.XP app with the deployed Next.js URL and shared secret via app config:
nextjs.default.url = <Next.js app URL> nextjs.default.secret = <shared secret> - Preview mode automatically switches the Guillotine API to the
draftbranch, while the public Next.js frontend uses themaster(published) branch. - Use
getUrl()in all component links to ensure URLs resolve correctly across preview, inline, and edit modes in Content Studio. - If preview shows a blank page, read
references/troubleshooting.mdfor diagnostic steps.
Step 6: Deploy to production
- Read
references/nextxp-reference.mdfor the deployment checklist. - Deploy the Enonic app to Enonic Cloud using
enonic cloud app install. - Create an ingress in Enonic Cloud to expose the Guillotine API (target path
/site, public path/api). - Deploy the Next.js app to Vercel or another hosting platform.
- Set production environment variables:
ENONIC_API,ENONIC_APP_NAME,ENONIC_API_TOKEN,ENONIC_MAPPINGS. - Configure the Next.XP app in Enonic Cloud to point to the production Next.js URL.
- Publish content in Content Studio to make it visible on the live frontend.
Step 7: Validate the integration
- Execute
node scripts/find-nextxp-targets.mjs .to confirm the adapter, mappings, and env configuration still resolve correctly. - Verify that standalone Next.js rendering works at
http://localhost:3000with published content. - Verify Content Studio preview renders correctly for both draft and published content.
- Test content type mappings by visiting content URLs and confirming custom views render.
- Use
validateData()from@enonic/nextjs-adapterin the page handler to catch invalid content responses. Seereferences/nextxp-reference.mdfor the SSG page handler pattern. - Run the workspace build (
npm run build) to catch TypeScript or build errors.
Error Handling
- If Content Studio preview shows a blank page, read
references/troubleshooting.mdfor preview proxy diagnostics, token mismatch detection, and CORS issues. - If Guillotine queries return empty or unexpected data, verify the content type name matches the introspection pattern and test the query in GraphQL Playground at
http://localhost:8080/site/<project>. - If
@enonic/nextjs-adapterimports fail, checkreferences/compatibility.mdfor version requirements and confirm the package is installed. - If content renders in preview but not on the public site, verify the content is published (moved from
drafttomasterbranch). - If component mappings are not applied, verify registrations in
_mappings.tsuse the correct fully-qualified content type or component name withAPP_NAME.
FAQ
What does the enonic-nextxp-integration skill do?
Guides setup, development, and troubleshooting of the Next.js and Enonic XP headless integration (Next.XP framework). Covers Enonic adapter configuration, content type to React component mapping, Guillotine GraphQL data fetching, Content Studio preview mode, and draft/master branch switching. Use when building a Next.js frontend powered by Enonic XP, configuring the Next.XP adapter, mapping content types to components, fetching Enonic content via Guillotine in Next.js, or debugging Content Studio preview. Don't use for traditional server-side Enonic XP rendering, standalone Guillotine queries without Next.js, non-Next.js frontend frameworks with Enonic, or React4XP embedded rendering.
How do I install enonic-nextxp-integration?
Run npx skills add https://github.com/webmaxru/enonic-agent-skills --skill enonic-nextxp-integration in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/enonic-nextxp-integration/ (personal) or .claude/skills/enonic-nextxp-integration/ (project).
Which AI agents can use enonic-nextxp-integration?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is enonic-nextxp-integration safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains enonic-nextxp-integration?
It is published by webmaxru in webmaxru/enonic-agent-skills. It has 463 recorded installs.
More from webmaxru/enonic-agent-skills
agent-skill-deploy
webmaxru/enonic-agent-skills
Deploys agent skill collections from any GitHub repository with a /skills folder to one or more distribution surfaces: GitHub releases, Claude Code marketplace, VS Code plugin marketplace, and Copilot CLI plugin marketplace. Handles pre-flight validation, conventional commit analysis, version bumping across surface configs, and surface-specific publishing with dry-run support. Use when releasing, publishing, or deploying a skills collection to any supported marketplace or creating a GitHub release for a skills repository. Don't use for deploying non-skill packages, npm modules, Docker images, or Azure resources.
enonic-content-type-generator
webmaxru/enonic-agent-skills
Generates Enonic XP content type XML schema definitions from natural-language descriptions. Covers structured content modeling including input types, form layout, option sets, item sets, mixins, x-data, and content-type inheritance. Use when creating, scaffolding, or generating Enonic XP content type definitions, adding fields or sets to existing content types, or querying Enonic XP input types and super-types. Do not use for non-Enonic content modeling, GraphQL queries, JavaScript/TypeScript controllers, or generic XML editing unrelated to Enonic schemas.
enonic-guillotine-query-builder
webmaxru/enonic-agent-skills
Open the skill to read its SKILL.md instructions.
agent-package-manager
webmaxru/enonic-agent-skills
Installs, configures, audits, and operates Agent Package Manager (APM) in repositories. Use when initializing apm.yml, installing or updating packages, validating manifests, managing lockfiles, compiling agent context, browsing MCP servers, setting up runtimes, or packaging resolved context for CI and team distribution. Don't use for writing a single skill by hand, generic package managers like npm or pip, or non-APM agent configuration systems.
github-agentic-workflows
webmaxru/enonic-agent-skills
Authors, reviews, installs, and debugs GitHub Agentic Workflows in repositories, including workflow markdown, frontmatter, gh aw compile and run flows, safe outputs, security guardrails, and operational patterns. Use when creating or maintaining GH-AW automation. Don't use for standard deterministic GitHub Actions YAML, generic CI pipelines, or non-GitHub automation systems.
skill-creator
webmaxru/enonic-agent-skills
Authors and structures professional-grade agent skills following the agentskills.io spec. Use when creating new skill directories, drafting procedural instructions, or optimizing metadata for discoverability. Don't use for general documentation, non-agentic library code, or README files.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.