aem-skill-building-blocks

Implements AEM Edge Delivery Services blocks using TypeScript, Vite, and scoped CSS patterns.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/capella-hotel-group/capella-hotel-group-poc --skill aem-skill-building-blocks-capella-hotel-group
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aem-skill-building-blocks
Source: https://github.com/capella-hotel-group/capella-hotel-group-poc/tree/main/.github/skills/aem-skill-building-blocks
Command: npx skills add https://github.com/capella-hotel-group/capella-hotel-group-poc --skill aem-skill-building-blocks-capella-hotel-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dompurify, and includes references (resource) components.

What problem does it solve? Implementing AEM Edge Delivery Services blocks in a TypeScript + Vite project requires strict conventions — auto-discovered block entries, @/* import aliases, null-safe DOM queries, replaceChildren() mutations, and DOMPurify sanitization. This Skill guides AI agents through those conventions so block code compiles cleanly and follows project standards. ## Core Features & Use Cases - Block Development Workflow: Step-by-step process for creating new blocks in src/blocks/ or modifying existing ones, from pattern research through TypeScript decoration and CSS styling. - TypeScript & CSS Enforcement: Bundled reference guidelines covering the exact decorate(block: HTMLElement) signature, null-guarding under strictNullChecks, design-token usage, mobile-first breakpoints, and scoped selectors. - Core File Changes: Guidance for safely modifying src/app/scripts.ts, global styles, and src/app/delayed.ts with minimal blast radius. - Use Case: A developer asks the AI to build a new hero block; the Skill walks through creating src/blocks/hero/hero.ts and hero.css, reusing existing <picture> elements, applying design tokens, and handing off to the testing skill. ## Quick Start Use the aem-skill-building-blocks skill to create a new cards block in src/blocks with TypeScript decoration and responsive CSS.

Frequently Asked Questions about aem-skill-building-blocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new AEM Edge Delivery Services block in TypeScript?▼

Create a folder under src/blocks/{block-name}/ containing {block-name}.ts and {block-name}.css. Export an async decorate function taking block: HTMLElement, and Vite auto-discovers the entry with no build config changes needed.

How do I handle DOM manipulation safely in AEM EDS blocks?▼

Build new elements first, then call block.replaceChildren() once at the end instead of reassigning innerHTML. If innerHTML is unavoidable with external content, sanitize it with DOMPurify.sanitize() to prevent XSS.

Can I use relative import paths in AEM EDS block TypeScript files?▼

No, cross-module imports must use the @/* alias mapped to src/*, such as import { createOptimizedPicture } from '@/app/aem.js'. Relative paths are only allowed between files inside the same block folder.

Why does my block TypeScript fail with 'Object is possibly null' errors?▼

The project enables strictNullChecks, so every querySelector result must be null-guarded before use. Add an early return like if (!el) return; after querying, or use a type assertion only when the element is guaranteed to exist.

What CSS conventions apply to AEM EDS block styling?▼

All selectors must be scoped to the block (e.g., main .my-block), use design tokens like var(--text-color) instead of hardcoded values, follow mobile-first breakpoints at 600px and 900px, and avoid !important entirely.