plugins/aem/cloud-service/skills/create-component/SKILL.md
Creates complete AEM components with dialog, HTL template, Sling Model, unit tests, and clientlibs. Supports extending Core Components and project components. When a Figma design URL is provided, fetches the design via Figma MCP (get_design_context) and translates it into pixel-perfect HTL, CSS, and JS. Follows Adobe Experience League best practices for AEM Cloud Service and 6.5. Use this skill whenever the user mentions creating, building, generating, or scaffolding an AEM component, or mentions component types like teaser, card, hero, banner, accordion, tabs, carousel, list, navigation, breadcrumb, or any custom AEM component. Also trigger when the user wants to extend a Core Component, create a component dialog, add a Sling Model, or convert a Figma design into an AEM component.
npx skillsauth add adobe/skills create-componentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates complete AEM components following Adobe best practices.
This configuration check needs to happen first because without it, the skill will use incorrect project paths and package names, causing every generated file to be wrong.
First tool call: Read .aem-skills-config.yaml in the project root (same level as pom.xml).
Check: Does the file exist and does it have configured: true?
| Status | Action | | --- | --- | | File missing or configured: false | Stop and display the error message below. Do not explore the codebase or proceed — the config values are needed for correct file paths and naming. Wait for the user to configure. | | configured: true | Read project, package, and group values from the YAML file. Proceed with component creation. |
Project configuration required!
Before creating components, configure your project settings in:
`.aem-skills-config.yaml` (in your project root, same level as pom.xml)
Open the file and update:
- project: Your AEM project name (e.g., 'mysite', 'wknd')
- package: Your Java package (e.g., 'com.mysite.core')
- group: Your component group (e.g., 'MySite Components')
- configured: true
After updating, ask me to create the component again.
Doing any of the following before configuration is set will lead to incorrect assumptions and wasted effort:
The config file is the single source of truth for project values — skipping it leads to wrong paths and package names in every generated file.
Only create the exact fields the user specified — adding extra fields creates authoring confusion and maintenance burden, and renaming fields breaks content contracts.
Load reference for full rules: references/no-hallucination-rules.md
| Step | Action | | --- | --- | | 0 | Configuration validation (do this first — see above) | | 1 | Extract & validate component name | | 1.5 | Component extension decision (if extending) | | 2 | Gather requirements & confirm dialog specification | | 2.3 | Figma design fetch (if Figma URL provided) | | 3 | Create all component files | | 3.11 | Dependency verification (required for servlets) | | 4 | Completion summary |
.aem-skills-config.yaml from the project rootconfigured: trueproject, package, and group valuesDo not infer project values from the file system, existing components, Java files, pom.xml, or prior knowledge. These sources may be outdated or inconsistent — .aem-skills-config.yaml is the single source of truth because the user explicitly sets it.
references/aem-conventions.md for file structure templates, naming conventions, and patterns/apps/[project]/components/core/src/main/java/[package-path]/models/My Component -> my-component)Tier 1: Check Project Components First
/apps/{project}/components/{component}sling:resourceSuperTypeTier 2: Check Core Components
| User Says | Maps To | | --- | --- | | image | core/wcm/components/image/v3/image | | teaser, card | core/wcm/components/teaser/v2/teaser | | text, richtext | core/wcm/components/text/v2/text | | title, heading | core/wcm/components/title/v3/title | | list | core/wcm/components/list/v4/list | | button, cta | core/wcm/components/button/v2/button | | navigation, nav | core/wcm/components/navigation/v2/navigation | | container, section | core/wcm/components/container/v1/container | | accordion | core/wcm/components/accordion/v1/accordion | | tabs | core/wcm/components/tabs/v1/tabs | | carousel | core/wcm/components/carousel/v1/carousel | | embed, video | core/wcm/components/embed/v2/embed |
Tier 3: Not Found - Ask user for clarification.
For extension patterns, load: references/extending-core-components.md
Required when extending with "hide", "remove", "add custom field", or "override" (these operations need Sling Resource Merger patterns to work correctly):
Load reference: references/extending-core-components.md
| User Request | Action | | --- | --- | | "Add custom fields" | Create new tab OR add to existing | | "Hide {tab}" | Use sling:hideResource="{Boolean}true" | | "Hide {field}" | Use sling:hideResource="{Boolean}true" | | "Override {field}" | Use sling:hideProperties + new values |
When extending Core Components:
@Self @Via(type = ResourceSuperType.class) for model delegationComponentExporter interfaceresourceType to @Model annotationsling:hideResource in dialog for inherited tabs/fieldsNote: If the parent component is a project component (not a Core Component), use direct Java class extension (
extends ParentModel) instead of the delegation pattern. The@Self @Via(type = ResourceSuperType.class)pattern is only for Core Components. Loadreferences/extending-core-components.mdfor the decision table.
Echo back EXACTLY what you understood before creating:
Dialog Specification Confirmed:
I will create exactly {N} fields:
| # | Field Label | Field Type | Property Name |
|---|-------------|------------|---------------|
| 1 | {label1} | {type1} | {name1} |
No additional fields will be added.
Is this correct?
Load: references/figma-design-rules.md
When user provides a Figma URL (figma.com/design/..., figma.com/make/..., or figma.com/board/...):
fileKey and nodeId (see references/figma-design-rules.md Rule 1)- to : in the node-id query parameterbranchKey as fileKey for branch URLsget_design_context via the plugin-figma-figma MCP server (see Rule 2):{ "server": "plugin-figma-figma", "toolName": "get_design_context", "arguments": { "nodeId": "<extracted-node-id>", "fileKey": "<extracted-file-key>", "clientLanguages": "html,css,javascript", "clientFrameworks": "htl" } }Precedence when BOTH dialog spec AND Figma URL are provided:
When ONLY Figma URL is provided (no dialog spec):
Figma response handling:
| User Indicates | Servlet Required? | | --- | --- | | External API integration | Yes (GET) | | Dynamic data loading | Yes (GET) | | Form submission | Yes (POST) | | Search/filter | Yes (GET) | | Static dialog content | No |
Create ALL files in this order:
Path: ui.apps/src/main/content/jcr_root/apps/[project]/components/{component-name}/.content.xml
Load: references/aem-conventions.md
Path: ui.apps/.../components/{component-name}/_cq_dialog/.content.xml
Load: references/dialog-patterns.md
For extended components: Load references/extending-core-components.md — Sling Resource Merger is required here because dialog inheritance only works through the merger; without it, parent dialog nodes won't be resolved.
When a user specifies an image or photo field:
data-sly-resource — do NOT create a fileupload dialog field with manual <img> rendering.cq/gui/components/authoring/dialog/fileupload when the user explicitly asks for a non-image file upload.references/htl-patterns.md (Image Handling section) for the correct embedding pattern.Path: ui.apps/.../components/{component-name}/{component-name}.html
Load: references/htl-patterns.mdIf Figma URL provided, ALSO load: references/figma-design-rules.md (Rules 5, 8) — Convert JSX structure to semantic HTL with BEM classes. Replace static text with Sling Model expressions. Use the Figma screenshot as visual truth for element hierarchy.
i18n check: If the component has static display text (labels, button text, placeholder strings), use HTL i18n expressions: ${'Label Text' @ i18n}. Do not handle static text translation in the Sling Model — keep it in HTL where translation is automatic.
Path: core/src/main/java/[package-path]/models/{ComponentName}Model.java
Load: references/model-patterns.md, references/java-standards.md
For extensions: Load references/extending-core-components.md
Delegation Pattern (for Core Component extensions):
@Model(adaptables = SlingHttpServletRequest.class,
adapters = {CustomModel.class, ComponentExporter.class},
resourceType = CustomModel.RESOURCE_TYPE)
@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
public class CustomModel implements ComponentExporter {
@Self @Via(type = ResourceSuperType.class)
private com.adobe.cq.wcm.core.components.models.List coreList;
// Use FQN for core interfaces to avoid import collision
}
Path: core/src/main/java/[package-path]/models/{ItemName}.java
Path: core/src/test/java/[package-path]/models/{ComponentName}ModelTest.java
Load: references/test-patterns.md
Path: ui.apps/.../clientlibs/clientlib-{component-name}/
Load: references/clientlib-patterns.mdIf Figma URL provided, ALSO load: references/figma-design-rules.md (Rules 6, 7) — Extract exact colors, fonts, sizes, spacing, border-radius from the Figma response. Place all CSS into css/{component-name}.css using BEM naming. Create JS in js/{component-name}.js only if the design implies interactivity. Verify pixel-perfect fidelity against the Figma screenshot.
Path: ui.apps/.../clientlibs/clientlib-{component-name}-dialog/
Load: references/clientlib-patterns.md (Dialog JavaScript Pattern section)
Path: core/src/main/java/[package-path]/servlets/{ComponentName}Servlet.java
Load: references/sling-servlet-standards.md
Path: core/src/test/java/[package-path]/servlets/{ComponentName}ServletTest.java
Before completing, verify dependencies in core/pom.xml:
aem-sdk-api (GSON, Jackson, Commons)provided scope for AEM runtime librariesComponent '{component-name}' created successfully!
## Files Created
- ui.apps/.../components/{component-name}/.content.xml
- ui.apps/.../components/{component-name}/_cq_dialog/.content.xml
- ui.apps/.../components/{component-name}/{component-name}.html
- core/.../models/{ComponentName}Model.java
- core/.../models/{ComponentName}ModelTest.java
- ui.apps/.../clientlibs/clientlib-{component-name}/
[+ servlet files if applicable]
## Dialog Fields (Exact Match)
{table matching specification}
Would you like me to add any additional fields or build the project?
| User Says | Granite Resource Type | | --- | --- | | Textfield | granite/ui/components/coral/foundation/form/textfield | | Textarea | granite/ui/components/coral/foundation/form/textarea | | Richtext, RTE | cq/gui/components/authoring/dialog/richtext | | Pathfield, Path | granite/ui/components/coral/foundation/form/pathfield | | Image, Photo | Embed Core Image component (see references/htl-patterns.md Image Handling section). Do not use fileupload for image rendering. | | Fileupload, File Upload | cq/gui/components/authoring/dialog/fileupload (for non-image files: PDFs, documents) | | Multifield | granite/ui/components/coral/foundation/form/multifield | | Checkbox | granite/ui/components/coral/foundation/form/checkbox | | Select, Dropdown | granite/ui/components/coral/foundation/form/select | | Numberfield | granite/ui/components/coral/foundation/form/numberfield | | Datepicker | granite/ui/components/coral/foundation/form/datepicker |
For complete mappings: assets/field-type-mappings.md
Load on-demand based on what you're creating:
| Creating | Load Reference | | --- | --- | | Any component | .aem-skills-config.yaml (project root, load first — see Configuration Gate Check), then references/aem-conventions.md | | Dialog XML | references/dialog-patterns.md | | HTL Template | references/htl-patterns.md | | Sling Model | references/model-patterns.md, references/java-standards.md | | Unit Tests | references/test-patterns.md | | Clientlibs | references/clientlib-patterns.md | | Extending Core Component | references/extending-core-components.md | | Extending Core Component — worked example & checklists | references/extending-core-components-example.md (load when you need a complete worked example of extending a Core Component, unit testing patterns, or the implementation checklist) | | Sling Servlet | references/sling-servlet-standards.md | | Core Component patterns | references/core-components.md | | No Hallucination rules | references/no-hallucination-rules.md | | Figma design integration | references/figma-design-rules.md | | Troubleshooting | references/troubleshooting.md | | Examples | references/examples.md |
If encountering issues during or after component creation, consult references/troubleshooting.md for common problems and solutions.
development
Start AEM Workflows on AEM as a Cloud Service using all available triggering mechanisms. Use when starting workflows manually via the Timeline UI, programmatically via WorkflowSession.startWorkflow(), via the HTTP Workflow API, through Manage Publication, or passing initial metadata and payload to a workflow instance.
development
Single entry point for all AEM as a Cloud Service Workflow skills. Covers workflow model design, custom process step and participant chooser development, launcher configuration, workflow triggering, and production support including debugging stuck/failed workflows, triaging incidents with Cloud Manager logs, thread pool analysis, and Sling Job diagnostics for the Granite Workflow Engine.
development
[BETA] Implement custom AEM Workflow Java components on AEM as a Cloud Service. This skill is in beta. Verify all outputs before applying them to production projects. Use when writing WorkflowProcess steps, ParticipantStepChooser implementations, registering services via OSGi DS R6 annotations, reading step arguments from MetaDataMap, accessing JCR payload via WorkflowSession adapter, reading and writing workflow metadata and variables, and handling errors with WorkflowException for retry behavior.
development
Start AEM Workflows on AEM 6.5 LTS using all available triggering mechanisms. Use when starting workflows manually via the Timeline UI, programmatically via WorkflowSession.startWorkflow(), via the HTTP Workflow API, through Manage Publication, through replication triggers, or passing initial metadata and payload to a workflow instance.