/eds-content-ops:block-testingfrom eds-content-ops
Automated testing guidance for custom AEM Edge Delivery Services blocks. Analyzes block JavaScript and CSS for common issues including missing null checks, unscoped CSS selectors, accessibility violations, performance problems, and missing mobile breakpoints. Produces a comprehensive test plan with manual and automated test scenarios.
Ships in eds-content-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Analyze custom AEM Edge Delivery Services block JavaScript and CSS source code for defects, anti-patterns, and standards violations. Produces a structured test plan covering static analysis findings, accessibility compliance, performance characteristics, and manual/automated test scenarios. Helps teams ship blocks that work correctly across devices, browsers, and content variations.
This skill fetches external web pages for analysis. When fetching:
block-scaffolder instead).block-migration instead).content-audit instead).block-accessibility for deeper analysis).block-scaffolder — generate new blocks that pass these tests from the start.block-accessibility — deep-dive accessibility audit of rendered block DOM.block-migration — test compatibility when porting blocks between projects.performance-budget — broader performance analysis beyond individual blocks.An EDS block is a pair of files — blocks/{name}/{name}.js and blocks/{name}/{name}.css — that decorate a DOM subtree. The EDS pipeline transforms an authoring table into a DOM structure: a wrapper <div class="{name}"> containing child <div> elements for each row, each of which contains <div> elements for each column. The block's decorate(block) function receives this wrapper and can restructure, add classes, attach event listeners, or inject new elements.
The most frequent block bugs are: (1) unscoped CSS that leaks styles into surrounding content or other blocks, (2) missing null checks when author content is optional or cells are empty, (3) no mobile layout because the developer only tested at desktop width, (4) DOM thrashing from interleaved reads and writes causing synchronous layout recalculations, (5) inaccessible interactive elements lacking ARIA attributes or keyboard handlers, and (6) broken image handling from not using createOptimizedPicture.
Block CSS and JS are loaded lazily by default — only when the block scrolls into view (or is in the first section). This means a block's CSS can cause a flash of unstyled content if the decoration is heavy. The decorate() function should minimize visible layout shifts by working with the existing DOM structure rather than replacing it entirely.
Before starting, create a todo list to track progress through these steps:
Locate and read the block source code:
blocks/{block-name}/.blocks/{block-name}/{block-name}.js. If this file does not exist, the block is CSS-only (valid but unusual). Note this.blocks/{block-name}/{block-name}.css. If missing, the block relies on default styles or inherits from a parent. Flag as a potential issue.Analyze the JavaScript file for common defects:
decorate (or use export default function decorate(block)). A named export or missing export prevents the block from loading.block parameter. Additional parameters are ignored by the EDS loader.async, verify all await calls have error handling. An unhandled promise rejection in decorate() silently breaks the block.querySelector or children access, check that the code handles null results. Search for patterns like row.children[0].textContent without a preceding null check — this throws when the cell is empty.el?.querySelector('img') over el.querySelector('img') for optional content.children[N] by index, verify N is within bounds. Authors can add fewer or more rows than expected.innerHTML assignment. Setting innerHTML destroys event listeners and is an XSS vector if content contains user input. Use createElement and append instead.element.style.x = ... or element.classList.add(...) calls interleaved with reads (offsetHeight, getBoundingClientRect) cause synchronous layout. Flag any pattern where a read follows a write in a loop.DocumentFragment to batch insertions.createOptimizedPicture: If the block handles images, it should import createOptimizedPicture from ../../scripts/aem.js. Raw <img> tags miss EDS image optimization.delayed.js.../../scripts/...), not absolute paths.window or document event listeners, verify they are cleaned up or use { once: true } where appropriate. Blocks can be decorated multiple times on a single page.block.addEventListener('click', handler) over adding listeners to individual children. Delegation handles dynamic content and reduces memory.{ passive: true } to avoid blocking the main thread.Analyze the CSS file for scoping and quality issues:
.{block-name}. Bare selectors like p { }, img { }, or .button { } will leak outside the block. This is a P0 defect.!important declarations. These are almost always a sign of a specificity problem. Flag each instance.#id selectors — IDs are not stable across page renders.#fff, rgb(...), hsl(...)). These should reference CSS custom properties from styles/styles.css.--cards-gap not --gap.@media (min-width: 900px). The 900px breakpoint is the EDS standard.@media query at all, flag this — the block likely has not been tested on mobile.min-height and min-width on clickable elements..block > div > div > div > p span), universal selectors (*), or attribute selectors in hot paths.transform and opacity — other properties trigger layout or paint. Check transition and @keyframes declarations.@import or @font-face. Fonts are a project-level concern managed in styles/styles.css.Analyze the JavaScript to determine what DOM the block produces, then audit for accessibility:
<ul> / <li> or another semantic list structure, not bare <div> elements.<a>) are used for navigation and buttons (<button>) are used for actions. An <a> with an onclick handler and no href should be a <button>.role="tablist" on the container, role="tab" on each tab, role="tabpanel" on each panel, and aria-selected / aria-controls / aria-labelledby cross-references.aria-expanded on triggers and aria-controls linking to the expandable content. Regions should have role="region" with aria-labelledby.aria-live="polite" on the slide container, aria-roledescription="carousel" on the wrapper, and aria-roledescription="slide" on each slide.role="dialog", aria-modal="true", and aria-labelledby referencing the dialog title.tabindex if they are not natively focusable (<a>, <button>, <input>).Escape.Evaluate the block's runtime performance impact:
decorate() function creates. Blocks generating more than 50 new nodes may slow First Input Delay. Flag any block that creates nodes in a loop without a bound.offsetHeight, offsetWidth, getBoundingClientRect, getComputedStyle, scrollTop, or clientHeight following a DOM write (class change, style change, append). Each instance forces the browser to recalculate layout.loading="lazy" for below-fold blocks. The LCP image (first section) should have loading="eager" and fetchpriority="high".<script> injection is P0.window or document without cleanup, setInterval without clearInterval, or closures that reference the block element preventing garbage collection.width, height, top, left, margin, or padding trigger layout. Only transform and opacity are compositor-only and safe for 60fps.Evaluate the block for mobile and touch device compatibility:
width: 500px) or wide content (tables, code blocks, wide images) that could cause horizontal scrolling on mobile.padding, min-height, and min-width.aspect-ratio or explicit width/height attributes to prevent Cumulative Layout Shift on mobile where images load later.touch-action CSS property.Produce a structured test plan covering both automated and manual scenarios:
| Test ID | Description | Input | Expected Output | Priority |
|---|---|---|---|---|
| A1 | Block renders with minimum content | Single row, required fields only | Block visible, no JS errors | P0 |
| A2 | Block renders with all fields populated | Full content in all cells | All content visible and styled | P0 |
| A3 | Block handles empty cells | Rows with blank cells | No JS errors, graceful fallback | P0 |
| A4 | Block handles excess content | 20+ rows of content | Block renders, no overflow | P1 |
| A5 | Block variant renders correctly | Each variant class applied | Variant styles applied | P1 |
| A6 | CSS does not leak | Block on page with default content | Default content unchanged | P0 |
| A7 | No console errors | Block on a clean page | Zero JS errors in console | P0 |
| Test ID | Description | Steps | Expected Result | Priority |
|---|---|---|---|---|
| M1 | Mobile layout | Resize to 375px width | Content stacks, no overflow | P0 |
| M2 | Keyboard navigation | Tab through all interactive elements | All elements reachable, focus visible | P0 |
| M3 | Screen reader | Navigate block with VoiceOver/NVDA | All content announced, roles correct | P1 |
| M4 | Slow network | Throttle to Slow 3G | Block loads, images lazy-load | P1 |
| M5 | Content authoring | Add block in Google Docs, preview | Block renders from authored table | P1 |
| M6 | Browser compatibility | Test in Chrome, Firefox, Safari, Edge | Consistent rendering | P1 |
Compile all findings into a structured report:
| Severity | Category | Issue | Location | Fix |
|---|---|---|---|---|
| P0 (Critical) | ... | ... | Line/selector | ... |
| P1 (High) | ... | ... | Line/selector | ... |
| P2 (Medium) | ... | ... | Line/selector | ... |
| P3 (Low) | ... | ... | Line/selector | ... |
After the findings table, provide:
| Symptom | Cause | Fix |
|---|---|---|
| Block JS file cannot be read | Path mismatch or file not committed | Verify the file exists at blocks/{name}/{name}.js |
| CSS appears scoped but still leaks | Selector specificity issue — a class name like .button collides with site-level styles | Prefix all class names with the block name: .cards-button |
| Block works locally but fails on live site | Development vs. production path differences | Check for hardcoded localhost URLs or absolute file paths |
| Intermittent JS errors in production | Race condition in async decorate function | Add null checks after every await — the DOM may change while waiting |
| Block looks correct but Lighthouse flags it | Accessibility or performance issue not visible to the eye | Run the full audit from Step 2-6 to identify hidden issues |
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (focus-gts/eds-content-ops-skills) — no native marketplace selected
npx claudepluginhub p/focus-gts-eds-content-ops42 skills in this plugin
/accessibility-fixScan an AEM Edge Delivery Services page for WCAG 2.1 AA accessibility violations and generate specific fixes. Identifies missing alt text, heading hierarchy issues, link text problems, color contrast concerns, and EDS-specific accessibility patterns. Use when fixing accessibility issues, preparing for compliance audits, or remediating WCAG violations./aem-to-eds-migrationAssess and plan a migration from traditional AEM Sites to AEM Edge Delivery Services. Analyzes the source AEM site to inventory components, templates, content types, and integrations, then maps them to EDS equivalents and produces a migration feasibility report with effort estimates, risk areas, and a phased plan./Other plugins' skills for the same job