一键导入
liferay-fragment-development
Guidelines and workflows for creating, structuring, developing, and mapping properties for page fragments in Liferay DXP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines and workflows for creating, structuring, developing, and mapping properties for page fragments in Liferay DXP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Activate this skill whenever you are running E2E tests, capturing screenshots, promoting visual baselines, or interpreting E2E test results for Liferay fragments. It specifies the exact commands for full-suite runs, targeted fragment runs, and visual baseline promotion, and documents the current known platform blocker.
Activate this skill when a task is large enough to benefit from splitting work across concurrent or hierarchical subagents — for example, running research and implementation in parallel, or delegating lint/test execution to a background agent while the coordinator continues planning. It defines the collaboration patterns, spawn constraints, output integration rules, and conflict resolution protocol.
Activate this skill when executing any multi-phase fragment development task — scaffolding, linting, compatibility build, E2E testing, or documentation update — where the output of one phase is the required input to the next. It defines the canonical pipeline phases, their inputs/outputs, and the active constraints that prevent a downstream phase from starting before its upstream gate has passed.
Activate this skill whenever you are creating a branch, opening a Pull Request, merging code, or performing any Git / GitHub CLI operation in the liferay-fragments repository. It enforces branch naming conventions, pre-commit validation gates, the PR auto-merge protocol, and the code-review requirement.
Activate this skill whenever you are planning a new feature, bug fix, enhancement, or any tracked piece of work. It mandates issue-first development and prescribes the exact workflow for creating, syncing, and closing GitHub Issues using the gh-issue-sync.cjs automation tool.
Activate this skill whenever you are building, packaging, or releasing fragment ZIP collections. It defines the mandatory three-target build strategy that produces separate ZIPs for Liferay 2026.Q1+, pre-2026.Q1, and pre-2025.Q3, and specifies the exact dataType and checkbox default-value transformation rules for each target.
| name | liferay-fragment-development |
| description | Guidelines and workflows for creating, structuring, developing, and mapping properties for page fragments in Liferay DXP. |
This skill guides AI agents and developers in creating, styling, structuring, and localizing Liferay page fragments according to the repository's rules.
This configuration check needs to happen first.
First step: Before scaffolding any fragment, verify if the current collection directory requires any specific theme-aware HTML or configuration setup. Stop and ask the user for clarification if the target collection path is not specified.
To bootstrap a new fragment with standard scaffolding, run the following command from the workspace root:
npm run create-fragment "[Collection Name]" "[Fragment Name]"
This runs scripts/create-fragment.js, which does the following:
collection.json at <Collection Name>/main/collection.json with a display name and description. This file is required — the build script (create-fragment-zips.sh) discovers collections by looking for this file, and without it the collection is silently excluded from all ZIP builds.<Collection Name>/main/<safe-fragment-name>/.fragment.json with explicit paths.fragment-build.json linking commons.js by default.configuration.json), HTML (index.html), JS (index.js), CSS (index.css), and metadata (test/metadata.json).<Collection Name>/main/Language_en_US.properties.Load: references/configuration-schema.md when defining configuration.json.
Every fragment must follow these structural guidelines:
fragment.json must explicitly define htmlPath, jsPath, cssPath, and configurationPath. Do not rely on Liferay's implicit folder naming defaults.initMyFragment()).return statements are strictly prohibited.fragmentElement.querySelector instead of the global document.querySelector..ftl if the fragment contains ANY FreeMarker logic (e.g., conditional checks [#if], loops [#list], [#assign]) or references Liferay variables (e.g., ${siteSpritemap})..html ONLY for strictly static HTML or basic data-lfr-editable fields."type": "input" (instead of "type": "component") and a typeOptions mapping in fragment.json (e.g., "typeOptions": { "fieldTypes": ["text", "number"] })."type": "input" instructs Liferay DXP to inject the input context map (containing input.label, input.required, input.errorMessage, input.readOnly, input.name) into the FreeMarker template context.input context map in your template code, always declare a defensive fallback (e.g. [#assign lfrInput = input!{}]) to prevent Liferay DXP from raising compile-time NullPointerException errors during import and saving it in DRAFT status.#ffffff, #333333) are prohibited in index.css and will fail the linter. Always use var() tokens (e.g. var(--primary), var(--body-bg))..meridian-theme, .liferay-dialect-theme, .classic-theme).configuration.json (including those within validValues arrays) MUST have a corresponding entry in the collection's Language_en_US.properties file.form-fragments) consolidate all per-fragment properties into a single root-level Language_en_US.properties file. Check if the collection root has this file.lfr.key=lfr.key) are prohibited.configuration.json must have a meaningful description to assist content creators.Load: references/site-scoped-discovery.md when the fragment interacts with custom objects to use the Dynamic Discovery Pattern.
data-lfr-editable) MUST be wrapped in a .meta-editor-mappable-fields container.docs/fragments/ must be created or updated.configuration.json fieldSets and fields.