Building Blocks
Guide for creating new AEM Edge Delivery blocks or modifying existing blocks. Use this skill whenever you are creating a new block from scratch or making significant changes to existing blocks that involve JavaScript decoration, CSS styling, or content model changes.
Best use case
Building Blocks is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Guide for creating new AEM Edge Delivery blocks or modifying existing blocks. Use this skill whenever you are creating a new block from scratch or making significant changes to existing blocks that involve JavaScript decoration, CSS styling, or content model changes.
Teams using Building Blocks should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/building-blocks/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Building Blocks Compares
| Feature / Agent | Building Blocks | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Guide for creating new AEM Edge Delivery blocks or modifying existing blocks. Use this skill whenever you are creating a new block from scratch or making significant changes to existing blocks that involve JavaScript decoration, CSS styling, or content model changes.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Building Blocks
This skill guides you through creating new AEM Edge Delivery blocks or modifying existing ones, following Content Driven Development (CDD) principles. Blocks are the reusable building blocks of AEM sites - each transforms authored content into rich, interactive experiences through JavaScript decoration and CSS styling. This skill covers the complete development process: understanding content models, implementing decoration logic, applying styles, and maintaining code quality standards.
## Related Skills
- **content-driven-development**: MUST be invoked before using this skill to ensure content and content models are ready
- **block-collection-and-party**: Use to find similar blocks for patterns
- **testing-blocks**: Automatically invoked after implementation for comprehensive testing
## When to Use This Skill
This skill should ONLY be invoked from the **content-driven-development** skill during Phase 2 (Implementation).
If you are not already following the CDD process:
- **STOP** - Do not proceed with this skill
- **Invoke the content-driven-development skill first**
- The CDD skill will ensure test content and content models are ready before implementation
This skill handles:
- Creating new block files and structure
- Implementing JavaScript decoration
- Adding CSS styling
- Code quality and testing
## Prerequisites
**REQUIRED before using this skill:**
- ✅ Test content must exist (in CMS or local drafts)
- ✅ Content model must be defined
- ✅ Test content URL must be available
**Information needed:**
1. **Block name**: What should the block be called?
2. **Content model**: The defined structure authors will use
3. **Test content URL**: Path to test content for development
## Process Overview
1. Verify Prerequisites (CDD completed)
2. Find Similar Blocks (for patterns and reuse)
3. Create or Modify Block Structure (files and directories)
4. Implement JavaScript Decoration (DOM transformation)
5. Add CSS Styling (scoped, responsive styles)
6. Test the Implementation (local testing, linting)
7. Document Block (developer and author-facing docs)
## Detailed Process
### 1. Verify Prerequisites
**Before proceeding, confirm with the user:**
"Do you have:
- ✅ Test content created (URL or path)?
- ✅ Content model defined?
If not, we need to use the content-driven-development skill first."
If prerequisites are not met, STOP and invoke the **content-driven-development** skill.
If prerequisites are met, get the test content URL from the user and proceed to step 2.
### 2. Find Similar Blocks
**For new blocks or major modifications:**
1. Search the codebase for similar blocks that might provide useful patterns or code we can re-use
2. Use the **block-collection-and-party** skill to find relevant reference blocks
Review the implementation patterns in similar blocks to inform your approach.
**For minor modifications to existing blocks:** Skip to step 3.
### 3. Create or Modify Block Structure
**For new blocks:**
1. Create directory: `blocks/{block-name}/`
2. Create files: `{block-name}.js` and `{block-name}.css`
3. Use the boilerplate structure (or reference templates in `resources/` if helpful):
- JS file exports a default `decorate(block)` function (can be async if needed)
- CSS file targets the `.{block-name}` class
**For existing blocks:**
1. Locate the existing block directory in `blocks/{block-name}/`
2. Review the current implementation before making changes
3. Understand the existing decoration logic and styles
### 4. Implement JavaScript Decoration
Follow patterns and conventions in `resources/js-guidelines.md`:
- Use DOM APIs to transform the initial block HTML structure
- Keep decoration logic focused and single-purpose
- Handle variants appropriately (check block.classList for variant classes)
- Follow established patterns from similar blocks
**Read `resources/js-guidelines.md` for detailed examples, code standards, and best practices.**
### 5. Add CSS Styling
Follow patterns and conventions in `resources/css-guidelines.md`:
- All CSS selectors must be scoped to the block (start with `.{block-name}`)
- Use BEM-like naming within the block scope
- Leverage CSS custom properties for theming
- Write mobile-first responsive styles
- Keep specificity low
- Follow established patterns from similar blocks
**Read `resources/css-guidelines.md` for detailed examples, code standards, and best practices.**
### 6. Test the Implementation
**After implementation is complete, invoke the testing-blocks skill:**
The testing-blocks skill will guide you through:
- Writing unit tests for any logic-heavy utilities
- Browser testing to validate block behavior
- Taking screenshots for validation and PR documentation
- Running linting and fixing issues
- Verifying GitHub checks pass
Provide the testing-blocks skill with:
- Block name being tested
- Test content URL (from CDD process)
- Any variants that need testing
Return to this skill after testing is complete to proceed to step 7.
### 7. Document Block
Blocks require two types of documentation:
#### Developer Documentation
- Most blocks are simple and self-contained and only need code comments for documentation
- If a block is especially complex (has many variants, or especially complex code) consider adding a brief README.md in the block folder
- Keep any README documentation very brief so it can be consumed at a glance
#### Author-Facing Documentation
Author-facing documentation helps content authors understand how to use the block in the CMS. This documentation typically exists as draft/library content in the CMS itself, not in the codebase.
**When author documentation is needed:**
Almost all blocks should have author-facing documentation. The only exceptions are:
- Deprecated blocks that should no longer be used but can't be removed yet
- Special-purpose blocks used very infrequently on a need-to-know basis
- Auto-blocked blocks that shouldn't be used directly by authors
**Maintaining author documentation:**
Author documentation must be kept in sync with the block implementation:
- Update when variants are added, removed, or modified
- Update when the content structure changes
- Update when block behavior or functionality changes
**Where author documentation lives:**
Different projects use different approaches for author documentation:
1. **Sidekick Library** (Google Drive/SharePoint authoring):
- Uses https://github.com/adobe/franklin-sidekick-library
- Check for `/tools/sidekick/library.html` in the codebase
- If present, guide user to add/update block documentation in the library
2. **Document Authoring (DA) Library**:
- Uses https://docs.da.live/administrators/guides/setup-library
- Different implementation than Sidekick Library
- If in use, guide user to update block documentation in DA library
3. **Universal Editor (UE) projects**:
- Often skip dedicated author documentation libraries
- May use inline help or other mechanisms
4. **Simple documentation pages**:
- Some projects maintain documentation under `/drafts` or `/docs`
- Pages contain authoring guides and block examples
**What to include in author documentation:**
The specific content of author documentation varies by project. As an agent:
1. Identify that author documentation needs to be created or updated
2. Determine which documentation approach the project uses (check for `/tools/sidekick/library.html` as a signal)
3. Guide the user on what aspects of the block should be documented based on the changes made
4. Provide specific guidance based on the project's documentation approach
## Reference Materials
- `resources/js-guidelines.md`
- `resources/css-guidelines.md`Related Skills
Testing Blocks
Guide for testing code changes in AEM Edge Delivery projects including blocks, scripts, and styles. Use this skill after making code changes and before opening a pull request to validate functionality. Covers unit testing for utilities and logic, browser testing with Playwright/Puppeteer, linting, performance validation, and guidance on which tests to maintain vs use as throwaway validation.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
template-skill
Replace with description of the skill and when Claude should use it.
slack-gif-creator
Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".
skill-developer
Create and manage Claude Code skills following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns, file paths, content patterns), enforcement levels (block, suggest, warn), hook mechanisms (UserPromptSubmit, PreToolUse), session tracking, and the 500-line rule.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
scrape-webpage
Scrape webpage content, extract metadata, download images, and prepare for import/migration to AEM Edge Delivery Services. Returns analysis JSON with paths, metadata, cleaned HTML, and local images.
preview-import
Preview and verify imported content in local AEM Edge Delivery Services dev server. Validates rendering, compares with original page, and troubleshoots common issues.
page-import
Import a single webpage from any URL to structured HTML content for authoring in AEM Edge Delivery Services. Scrapes the page, analyzes structure, maps to existing blocks, and generates HTML for immediate local preview. Also triggered by terms like "migrate", "migration", or "migrating".
page-decomposition
Analyze content sequences within a section and provide neutral descriptions for AEM Edge Delivery Services. Invoked per section during page import to identify breaking points between default content and blocks.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).