/building-blocks
Use this when implementing code changes in AEM Edge Delivery Services (EDS, Franklin, Helix), whether new or modified blocks, core functionality (scripts.js, styles, delayed.js, etc.), or both. Creates and modifies block folders and decorate functions, updates core scripts,
$ npx -y skills add adobe/skills --skill building-blocks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/building-blocks
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use this when implementing code changes in AEM Edge Delivery Services (EDS, Franklin, Helix), whether new or modified blocks, core functionality (scripts.js, styles, delayed.js, etc.), or both. Creates and modifies block folders and decorate functions, updates core scripts,
SKILL.md
building-blocks.SKILL.mdname: building-blocks
description: "Use this when implementing code changes in AEM Edge Delivery Services (EDS, Franklin, Helix), whether new or modified blocks, core functionality (scripts.js, styles, delayed.js, etc.), or both. Creates and modifies block folders and decorate functions, updates core scripts, scopes CSS, and wires up delayed loading. For the overall development process use content-driven-development."
license: Apache-2.0
metadata:
version: "2.0.1"
Building Blocks
This skill guides you through implementing AEM Edge Delivery blocks following established patterns and best practices. Blocks transform authored content into rich, interactive experiences through JavaScript decoration and CSS styling.
**IMPORTANT: This skill should ONLY be invoked from the content-driven-development skill during Step 5 (Implementation).**
If you are not already following the CDD process, STOP and invoke the **content-driven-development** skill first.
Related Skills
- **content-driven-development**: MUST be invoked before using this skill to ensure content and content models are ready
- **da-auth**: Obtain a valid Adobe IMS token if test content needs to be pushed to DA before implementation can begin
- **block-collection-and-party**: Use to find similar blocks for patterns
- **testing-blocks**: Automatically invoked during Step 5 for comprehensive testing
When to Use This Skill
This skill is invoked automatically by **content-driven-development** during Step 5 (Implementation). It handles:
**Block Development:**
- Creating new block files and structure
- Implementing JavaScript decoration
- Adding CSS styling
**Core Functionality:**
- Scripts.js modifications (decoration, utilities, auto-blocking)
- Global styles (styles.css, lazy-styles.css)
- Delayed functionality (delayed.js)
- Configuration changes
**Combined:**
- Blocks with supporting core changes (utilities, global styles, etc.)
Prerequisites (verified by CDD):
- ✅ Test content exists (in CMS or local drafts)
- ✅ Content model is defined/documented (if applicable)
- ✅ Test content URL is available
- ✅ Dev server is running
Block Implementation Workflow
Track your progress:
- [ ] Step 1: Find similar blocks for patterns (if new block or major changes)
- [ ] Step 2: Create or modify block structure (files and directories)
- [ ] Step 3: Implement JavaScript decoration (skip if CSS-only)
- [ ] Step 4: Add CSS styling
- [ ] Step 5: Test implementation (invokes testing-blocks skill)
**Note:** If your changes require core modifications (utilities in scripts.js, global styles, etc.), make those changes first, test them, then return to this workflow. See "When Modifying Core Files" below.
Step 1: Find Similar Blocks
**When to use:** Creating new blocks or making major structural modifications
**Skip this step when:** Making minor modifications to existing blocks (CSS tweaks, small decoration changes)
**Quick start:**
1. Search the codebase for similar blocks:
ls blocks/
2. Use the **block-collection-and-party** skill to find reference implementations
3. Review patterns from similar blocks:
- DOM manipulation strategies
- CSS architecture
- Variant handling
- Performance optimizations
Step 2: Create or Modify Block Structure
For New Blocks:
1. Create the block directory and files:
mkdir -p blocks/{block-name}
touch blocks/{block-name}/{block-name}.js
touch blocks/{block-name}/{block-name}.css2. Basic JavaScript structure:
/**
* decorate the block
* @param {Element} block the block
*/
export default async function decorate(block) {
// Your decoration logic here
}3. Basic CSS structure:
/* All selectors scoped to block */
main .{block-name} {
/* block styles */
}For Existing Blocks:
1. Locate the block directory: `blocks/{block-name}/` 2. Review current implementation:
# View the initial HTML structure from the server
curl http://localhost:3000/{test-content-path}3. Understand existing decoration logic and styles
Step 3: Implement JavaScript Decoration
**Essential pattern - re-use existing DOM elements:**
export default async function decorate(block) {
// Platform delivers images as <picture> elements with <source> tags
const picture = block.querySelector('picture');
const heading = block.querySelector('h2');
// Create new structure, re-using existing elements
const figure = document.createElement('figure');
figure.append(picture); // Re-uses picture element
const wrapper = document.createElement('div');
wrapper.className = 'content-wrapper';
wrapper.append(heading, figure);
block.replaceChildren(wrapper);
// Only check variants when they affect decoration logic
// CSS-only variants like 'dark', 'wide' don't need JS
if (block.classList.contains('carousel')) {
// Carousel variant needs different DOM structure/behavior
setupCarousel(block);
}
}**For complete JavaScript guidelines including:**
- Advanced DOM manipulation patterns
- Fetching data and loading modules
- Performance optimization techniques
- Helper functions from aem.js
- Code style and linting rules
**Read [references/js-guidelines.md](references/js-guidelines.md)**
Step 4: Add CSS Styling
**Essential patterns - scoped, responsive, using custom properties:**
/* All selectors MUST be scoped to block */
main .my-block {
/* Use CSS custom properties for consistency */
background-color: var(--background-color);
color: var(--text-color);
font-family: var(--body-font-family);
max-width: var(--max-content-width);
/* Mobile-first styles (default) */
padding: 1rem;
flex-direction: column;
}
main .my-block h2 {
font-family: var(--heading-font-family);
font-size: var(--heading-font-size-m);
}
main .my-block .item {
display: flex;
gap: 1rem;
}
/* Tablet and up */
@mRead more
name: building-blocks description: "Use this when implementing code changes in AEM Edge Delivery Services (EDS, Franklin, Helix), whether new or modified blocks, core functionality (scripts.js, styles, delayed.js, etc.), or both. Creates and modifies block folders and decorate functions, updates core scripts, scopes CSS, and wires up delayed loading. For the overall development process use content-driven-development." license: Apache-2.0 metadata: version: "2.0.1"
Building Blocks
This skill guides you through implementing AEM Edge Delivery blocks following established patterns and best practices. Blocks transform authored content into rich, interactive experiences through JavaScript decoration and CSS styling.
**IMPORTANT: This skill should ONLY be invoked from the content-driven-development skill during Step 5 (Implementation).**
If you are not already following the CDD process, STOP and invoke the **content-driven-development** skill first.
Related Skills
- **content-driven-development**: MUST be invoked before using this skill to ensure content and content models are ready
- **da-auth**: Obtain a valid Adobe IMS token if test content needs to be pushed to DA before implementation can begin
- **block-collection-and-party**: Use to find similar blocks for patterns
- **testing-blocks**: Automatically invoked during Step 5 for comprehensive testing
When to Use This Skill
This skill is invoked automatically by **content-driven-development** during Step 5 (Implementation). It handles:
**Block Development:**
- Creating new block files and structure
- Implementing JavaScript decoration
- Adding CSS styling
**Core Functionality:**
- Scripts.js modifications (decoration, utilities, auto-blocking)
- Global styles (styles.css, lazy-styles.css)
- Delayed functionality (delayed.js)
- Configuration changes
**Combined:**
- Blocks with supporting core changes (utilities, global styles, etc.)
Prerequisites (verified by CDD):
- ✅ Test content exists (in CMS or local drafts)
- ✅ Content model is defined/documented (if applicable)
- ✅ Test content URL is available
- ✅ Dev server is running
Block Implementation Workflow
Track your progress:
- [ ] Step 1: Find similar blocks for patterns (if new block or major changes)
- [ ] Step 2: Create or modify block structure (files and directories)
- [ ] Step 3: Implement JavaScript decoration (skip if CSS-only)
- [ ] Step 4: Add CSS styling
- [ ] Step 5: Test implementation (invokes testing-blocks skill)
**Note:** If your changes require core modifications (utilities in scripts.js, global styles, etc.), make those changes first, test them, then return to this workflow. See "When Modifying Core Files" below.
Step 1: Find Similar Blocks
**When to use:** Creating new blocks or making major structural modifications
**Skip this step when:** Making minor modifications to existing blocks (CSS tweaks, small decoration changes)
**Quick start:**
1. Search the codebase for similar blocks:
ls blocks/
2. Use the **block-collection-and-party** skill to find reference implementations
3. Review patterns from similar blocks:
- DOM manipulation strategies
- CSS architecture
- Variant handling
- Performance optimizations
Step 2: Create or Modify Block Structure
For New Blocks:
1. Create the block directory and files:
mkdir -p blocks/{block-name}
touch blocks/{block-name}/{block-name}.js
touch blocks/{block-name}/{block-name}.css2. Basic JavaScript structure:
/**
* decorate the block
* @param {Element} block the block
*/
export default async function decorate(block) {
// Your decoration logic here
}3. Basic CSS structure:
/* All selectors scoped to block */
main .{block-name} {
/* block styles */
}For Existing Blocks:
1. Locate the block directory: `blocks/{block-name}/` 2. Review current implementation:
# View the initial HTML structure from the server
curl http://localhost:3000/{test-content-path}3. Understand existing decoration logic and styles
Step 3: Implement JavaScript Decoration
**Essential pattern - re-use existing DOM elements:**
export default async function decorate(block) {
// Platform delivers images as <picture> elements with <source> tags
const picture = block.querySelector('picture');
const heading = block.querySelector('h2');
// Create new structure, re-using existing elements
const figure = document.createElement('figure');
figure.append(picture); // Re-uses picture element
const wrapper = document.createElement('div');
wrapper.className = 'content-wrapper';
wrapper.append(heading, figure);
block.replaceChildren(wrapper);
// Only check variants when they affect decoration logic
// CSS-only variants like 'dark', 'wide' don't need JS
if (block.classList.contains('carousel')) {
// Carousel variant needs different DOM structure/behavior
setupCarousel(block);
}
}**For complete JavaScript guidelines including:**
- Advanced DOM manipulation patterns
- Fetching data and loading modules
- Performance optimization techniques
- Helper functions from aem.js
- Code style and linting rules
**Read [references/js-guidelines.md](references/js-guidelines.md)**
Step 4: Add CSS Styling
**Essential patterns - scoped, responsive, using custom properties:**
/* All selectors MUST be scoped to block */
main .my-block {
/* Use CSS custom properties for consistency */
background-color: var(--background-color);
color: var(--text-color);
font-family: var(--body-font-family);
max-width: var(--max-content-width);
/* Mobile-first styles (default) */
padding: 1rem;
flex-direction: column;
}
main .my-block h2 {
font-family: var(--heading-font-family);
font-size: var(--heading-font-size-m);
}
main .my-block .item {
display: flex;
gap: 1rem;
}
/* Tablet and up */
@mRepo: adobe/skills
Other skills on adobe-skills.
- /aa-conversion-funnel-analysis
Analyzes a multi-step conversion funnel to find where visitors drop off and which steps have the worst leakage. Use this skill when someone describes a journey and asks about conversion rates, drop-off, fallout, or step completion. Trigger for "analyze our checkout funnel,"
Open skill - /aa-executive-briefing
Generates a concise, executive-ready performance summary covering key metrics, trends, and what's driving movement. Use this skill when someone needs to produce a briefing, executive summary, performance narrative, or stakeholder readout — for example, "write an exec summary of
Open skill - /aa-kpi-pulse
Produces a compact KPI digest showing how key metrics changed over a period and what's driving the movement. Use this skill when someone asks for a performance summary, a weekly recap, a morning briefing, a KPI update, or any variation of "how did we do this week/month." Also
Open skill - /aa-segment-performance-comparator
Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences or visitor groups — for example, "how do mobile visitors compare to desktop on conversion," "compare new vs. returning visitors,"
Open skill - /aa-top-movers-watchlist
Identifies which items (pages, campaigns, products, channels, regions) had the biggest increases or decreases for a key metric between two time periods. Use this skill when someone asks "what's up and what's down," "which campaigns moved the most," "top gainers and losers,"
Open skill - /cja-dimension-analysis
Comprehensive dimension analysis and reporting for CJA. Use this skill whenever the user wants to analyze one or more dimensions — including cardinality, distribution/skew, trends, anomalies, data quality errors, comparisons, and forecasting. Also trigger when someone asks "what
Open skill

