This project is a website built with Edge Delivery Services (EDS) in Adobe Experience Manager Sites as a Cloud Service. As an agent, follow the instructions in this file to deliver code based on Adobe's standards for fast, easy-to-author, and maintainable web experiences.
When searching for documentation, always search site:www.aem.live to get results specific to Edge Delivery Services. Do not confuse EDS with the Java/JCR/OSGi-based AEM technology stack, nor with Cloudflare/Akamai/Fastly edge compute products. The canonical documentation lives at https://www.aem.live/ and a machine-readable index is at https://www.aem.live/llms.txt.
You have access to a set of skills in .claude/skills. Each skill consists of a SKILL.md file, and other files such as scripts and resources, which are referenced from there.
YOU ARE REQUIRED TO USE THESE SKILLS TO ACCOMPLISH DEVELOPMENT TASKS. FAILING TO DO SO WILL RESULT IN WASTED TIME AND CYCLES.
Each skill is a directory in .claude/skills/ with the following structure:
.claude/skills/
└── {skill-name}/
├── SKILL.md # Main instructions (required)
├── scripts/ # Optional supporting scripts
└── resources/ # Optional resources (examples, templates, etc.)
The SKILL.md file contains detailed instructions that you must follow exactly as written. Skills are designed to:
- Provide specialized workflows for common tasks
- Ensure consistency with project standards and best practices
- Reduce errors by codifying expert knowledge
- Chain together when tasks require multiple skill applications
Always use the following process:
-
Discovery: When a new conversation starts, discover available skills by running
./.agents/discover-skills. This script will show you all available skills with their names, paths, and descriptions without loading everything into context. -
Selection: Use each skill based on its name and description when it feels appropriate to do so. Think carefully about all the skills available to you and choose the best ones to use. Note that some skills may reference other skills, so you may need to apply more than one skill to get things done.
-
Execution: When you need to use a skill:
- Read the full SKILL.md file
- Announce you are doing so by saying "Using Skill: {Skill Name}"
- Follow the skill's instructions exactly as written
- Read any referenced resources or scripts as needed
- Complete all steps in the skill before moving to the next task
Skills will be added to .claude/skills/ as needed for this project. Check the .claude/skills/ directory or run ./.agents/discover-skills for the current list of available skills.
For ALL development work involving blocks, core scripts, or functionality, you MUST start with the content-driven-development skill. It will orchestrate other skills as needed throughout the development workflow.
EDS-specific skills (for AEM Edge Delivery Services): eds-analytics, eds-documentation, eds-naming, eds-styles, eds-wcag. Retired aem-* skills are archived in .claude/skills/archive/.
This project is based on the https://github.com/adobe/aem-boilerplate/ project and set up as a new project. You are expected to follow the coding style and practices established in the boilerplate, but add functionality according to the needs of the site currently developed.
The repository provides the basic structure, blocks, and configuration needed to run a complete site with *.aem.live as the backend. See The Anatomy of a Project for a full description of how EDS projects are structured.
- Edge Delivery Services for AEM Sites — documentation at https://www.aem.live/
- Vanilla JavaScript (ES6+), no transpiling, no build steps, no frameworks — the project is entirely buildless
- CSS3 with modern features, no Tailwind, Sass, PostCSS, or other CSS frameworks/preprocessors
- HTML5 semantic markup generated by the aem.live backend, decorated by our code
- Node.js tooling (linting only)
EDS deliberately avoids build tools, bundlers, and frameworks. This keeps the developer experience simple and the site fast. Do not introduce webpack, Vite, Rollup, React, Vue, Angular, Svelte, or similar tools. The simplest solution is to rely on the growing feature set supported by browsers. See Best Practices for Developers.
- Install dependencies:
npm install - Start local development:
npx -y @adobe/aem-cli up --no-open --forward-browser-logs(run in background, if possible)- Install the AEM CLI globally by running
npm install -g @adobe/aem-clithenaem upis equivalent to the command above
- Install the AEM CLI globally by running
- Run linting:
npm run lint - Fix linting issues:
npm run lint:fix
├── blocks/ # Reusable content blocks
└── {blockName}/ - Individual block directory
├── {blockName}.js # Block's JavaScript (ESM, exports default function)
└── {blockName}.css # Block's styles (scoped to block class)
├── styles/ # Global styles and CSS
├── styles.css # Minimal global styling required for LCP (eager phase)
└── lazy-styles.css # Additional global styling loaded after LCP (lazy phase)
├── scripts/ # JavaScript libraries and utilities
├── aem.js # Core AEM Library — NEVER MODIFY THIS FILE
├── scripts.js # Global JavaScript, main entry point for page decoration
└── delayed.js # Delayed functionality (martech, 3rd party scripts, ≥3s after LCP)
├── fonts/ # Web fonts (self-hosted, loaded after LCP to avoid CLS)
├── icons/ # SVG icons (referenced with :icon-name: notation by authors)
├── head.html # Global HTML head content — keep minimal, NO marketing scripts
├── .hlxignore # Files/folders to exclude from serving (like .gitignore format)
└── 404.html # Custom 404 page
scripts/aem.js: The AEM library. NEVER modify this file. Propose upstream changes via GitHub PRs to the library repo instead. See Best Practices.head.html: Should remain largely unchanged from boilerplate. Do NOT add marketing technology (Adobe Web SDK, Google Tag Manager, etc.), inline scripts, or inline styles here. This file is in the critical path before LCP. See Anatomy of a Project — head.html..hlxignore: Prevents files from being served on the public web (tests, build artifacts, agent config, etc.). Format is identical to.gitignore.
Content is the foundation of every AEM website. Always start with content before writing code. This is the single most important principle in EDS development.
Before writing a single line of CSS or JavaScript:
- Create sample content in a Word or Google Doc (or spreadsheet)
- Ensure the content structure feels natural and intuitive for authors
- Share it with people who have authoring experience for validation
- Only then begin developing CSS and JS code
See Best Practices — Start your development with content.
The content lifecycle is different from the code lifecycle. When proposing changes to content structure or creating new blocks, copy pages into your /drafts/{your-name}/ folder. After code changes are merged to main, authors can copy or merge draft content to its final location. See Best Practices — Use drafts.
Hand-authored local .plain.html (and agent-generated draft test pages): The AEM library wraps the fragment in <main> and runs decorateSections on each direct child div of main (each becomes a section). A block must end up as main > div.section > div (wrapper) > div.{blockName} so decorateBlocks can find it (scripts/aem.js uses main.querySelectorAll('div.section > div > div')). If div.{blockName} is itself a direct child of main, it is treated as the section root and the block table is torn apart — block JS/CSS never loads correctly. Avoid that by wrapping the entire page fragment in one outer <div> (or otherwise ensuring every block sits inside a section div, not as a top-level sibling next to other section divs). See decorateSections / decorateBlocks in scripts/aem.js.
Code merged to main should never break existing published content. New functionality should only activate when new content is previewed and published. This doesn't apply to design changes or bug fixes applied across existing content. See Best Practices — Backwards compatibility.
Strings displayed to end users that could be translated or changed should be sourced from content — use Placeholders spreadsheets or other authored content. Never hard-code user-visible text in JavaScript or CSS. See Best Practices — Use content for strings.
Do not commit binaries or large static assets (images, HTML files, SVGs) to the GitHub repo unless they are referenced directly from code (e.g., icons). Content-related assets belong in the content source (SharePoint, Google Drive, etc.). See Best Practices — Use content for static resources.
Quick tips for inspecting content:
- Page HTML:
curl http://localhost:3000/path/to/page - Source markdown:
curl http://localhost:3000/path/to/page.md - Local test content: Use
--html-folder draftsflag when starting dev server
For development workflow: Use the content-driven-development skill for all development tasks.
- Use ES6+ features (arrow functions, destructuring, template literals, etc.)
- Follow Airbnb ESLint rules (already configured) — do NOT change linting configuration without team consensus
- Always include
.jsfile extensions in imports - Use Unix line endings (LF)
- All code runs client-side in the browser; use only features supported by browsers that support dynamic
import()(all evergreen browsers) - Block JS is loaded as ESM modules and must
export default function decorate(block) { ... } - Do NOT use
!importantin CSS or overly complex selectors — add CSS classes via JS decoration instead - Do NOT add 3rd party libraries to
head.html; load them where needed vialoadScript()in the specific block, or useIntersectionObserverfor lazy loading when the block scrolls into view - Minification is unnecessary and discouraged; the buildless architecture keeps files small. See Best Practices — Minification
For detailed JavaScript guidelines: Use the building-blocks skill which includes comprehensive decoration patterns and best practices.
- Mobile-first responsive design
- Standard breakpoints:
600px,900px,1200px— allmin-width, never mixmin-widthandmax-width. Only deviate with strong justification. See Best Practices — Breakpoints - All selectors in block CSS must be scoped to the block:
.{blockName} .selector— no side effects on other blocks or default content. See Best Practices — CSS selector block isolation - Prefix CSS classes and variables private to a block with the block name. Shared/inheritable classes should not be prefixed.
- Leverage ARIA attributes (e.g.,
[aria-expanded="true"]) for styling interactive states instead of inventing custom classes. See Best Practices — Leverage ARIA - Avoid
!important— it is almost never necessary when you control the full CSS context. See Best Practices — The !important rule - Follow Stylelint standard configuration (already configured) — do NOT change linting configuration
- Keep CSS selectors simple and readable; prefer adding CSS classes in JS over complex selectors. See Best Practices — CSS selectors complexity
- Use modern CSS features, but ensure support in evergreen browsers. See Best Practices — Modern CSS features
For detailed CSS guidelines: Use the building-blocks skill which includes comprehensive styling patterns and best practices.
- Use semantic HTML5 elements
- Ensure accessibility standards (ARIA labels, proper heading hierarchy, alt text on images)
- Follow AEM markup conventions for blocks and sections
- All canonical content is rendered server-side; client JS only decorates for display and accessibility
CMS authored content is a key part of every AEM Website. The content of a page is broken into sections. Sections can have default content (text, headings, links, etc.) as well as content in blocks.
The AEM backend delivers clean semantic HTML from authored content. The JavaScript in scripts.js augments this markup into a decorated DOM. Understand this as a two-step process:
For development workflow: Use the content-driven-development skill for all development tasks. This skill ensures you identify or create test content before writing code, following AEM best practices.
Quick tips:
- Inspect page structure:
curl http://localhost:3000/path/to/page - View source markdown:
curl http://localhost:3000/path/to/page.md - Local test content: Use
--html-folder draftsflag when starting dev server
See Markup, Sections, Blocks, and Auto Blocking for the full reference.
Sections group default content and blocks. Authors create section breaks with --- (horizontal rules). Sections support Section Metadata blocks where the Style property adds CSS classes to the containing section element. CSS styling is usually the only developer interaction needed with sections.
Default content uses standard semantic elements (headings, paragraphs, lists, images, links, emphasis) that authors create naturally in their documents. Leave as much content as default content as possible — it's the most natural way for authors to work.
Blocks are the re-usable building blocks of AEM. Blocks add styling and functionality to content. They are the primary mechanism for componentizing code. Each block has an initial content structure it expects, and transforms the HTML using DOM APIs to render a final structure.
Key principle: The initial content structure is the contract between authors and developers. Design this structure before writing any code, and be careful when making changes that could break existing pages.
Block markup renders as nested <div> tags for rows and columns:
<div class="blockname">
<div>
<div>
<p>Hello, World.</p>
</div>
</div>
</div>For creating or modifying blocks: Use the building-blocks skill which guides you through:
- Content model design (via content-driven-development)
- JavaScript decoration patterns
- CSS styling conventions
- Testing and validation
Block options: Authors add variants in parentheses — e.g., Columns (wide) produces <div class="columns wide">. Comma-separated options become separate classes: Columns (dark, wide) → <div class="columns dark wide">. Multi-word options use hyphens: Columns (super wide) → <div class="columns super-wide">.
For creating or modifying blocks: Use the building-blocks skill. Also consult the Block Collection and Block Party for reference implementations.
Tip: Use curl http://localhost:3000/path/to/page to inspect the HTML delivered by the backend before making assumptions.
Auto-blocking programmatically creates block DOM structures from default content and metadata without authors explicitly authoring tables. This happens early in decoration before blocks are loaded (in buildAutoBlocks() in scripts.js).
Common use cases:
- Template-based: Pages with a shared
templatemetadata value get auto-blocks (e.g., article-header combining title, hero image, author, and date metadata) - Link-based: Links to specific services (e.g., YouTube URLs) are auto-wrapped in embed blocks
This keeps content natural for authors while giving developers organized block code. See Markup — Auto Blocking.
Pages are progressively loaded in three phases to maximize performance. This process begins when loadPage from scripts.js is called.
- Eager - load only what is required to get to LCP. This generally includes decorating the overall page content to create sections, blocks, buttons, etc. and loading the first section of the page.
- Lazy - load all other page content, including the header and footer.
- Delayed - load things that can be safely loaded later here and incur a performance penalty when loaded earlier
A flexible indexing facility tracks content pages as spreadsheets or JSON, commonly used for page lists, feeds, filters, and sorting. See Indexing.
Performance is non-negotiable on EDS projects. The boilerplate starts with a perfect Lighthouse 100 score. Your job is to keep it there. It is hard to improve a score once it drops, but not hard to maintain 100 with continuous testing. See Web Performance — Keeping your Lighthouse Score 100.
Pages are progressively loaded in three phases. This architecture is critical to performance.
Phase E — Eager (before LCP):
- Body starts hidden (
display:none) to prevent premature image downloads and CLS - DOM is "decorated": CSS classes added to icons, buttons, blocks, and sections; auto-blocks created
- Body is shown; first section loaded with priority on the LCP candidate (first image)
- Fonts load asynchronously after LCP candidate is displayed
- Rule of thumb: keep aggregate payload before LCP below 100kb
- No connections to second origins before LCP — TLS/DNS adds significant delay
- Everything in
styles.cssandscripts.jsis in this path — keep them small and efficient
Phase L — Lazy (after LCP, controlled by project):
- Remaining sections and blocks load (JS + CSS)
- Remaining images load via
loading="lazy" - Header and footer load asynchronously as separate blocks
- Keep bulk of payload from the same origin; avoid impacting TBT/TTI/FID
Phase D — Delayed (≥3 seconds after LCP, 3rd party):
- Marketing tooling, consent management, analytics, chat modules
- Handled in
delayed.js— this is a catch-all for scripts causing TBT - Goal: zero blocking time; use web workers or split into small non-blocking files
- Ideally, once TBT problems are fixed, libraries can move to lazy phase
| Anti-Pattern | Why It's Bad | Reference |
|---|---|---|
| Early hints / h2-push / pre-connect before LCP | Consumes the ~100kb bandwidth budget for mobile, delaying LCP | Keeping it 100 — Early hints |
| Preloading fonts | Counterproductive; fonts must load after LCP using font fallback technique | Keeping it 100 — Fonts |
3rd party scripts in head.html |
In critical path before LCP; load via loadScript() in specific blocks or delayed.js |
Best Practices — Loading 3rd party libraries |
| Large JS bundles / build tools | Parsing large files creates blocking time; keep files small and buildless | Best Practices — Minification |
| Client-side rendering of canonical content | All canonical content must be server-rendered; client JS only decorates | Keeping it 100 — Server vs Client rendering |
| Path redirects (e.g., / → /en → /en/home) | Each redirect adds a penalty visible in CWV field data | Keeping it 100 — Redirects |
| Frameworks (React, Vue, etc.) in the LCP path | Introduce TBT and bloat for simple layout problems | Best Practices — Frameworks |
- The LCP element is typically the "hero" image at the top of the page
- Fewer blocks in the first section = faster LCP
- If the LCP element comes from an async lookup (fragment, JSON, service), the loading sequence must wait for the first block to update the DOM before guessing the LCP candidate
- For dual hero images (desktop + mobile), remove the unused one from the DOM to avoid wasting bandwidth
- LCP can also be a video or long text — understand how the LCP candidate is computed for your case
- Follow AEM Edge Delivery performance best practices https://www.aem.live/developer/keeping-it-100
- Images uploaded by authors are automatically optimized, all images and assets committed to git must be optimized and checked for size
- Use lazy loading for non-critical resources (
lazy-styles.cssanddelayed.js) - Minimize JavaScript bundle size by avoiding dependencies, using automatic code splitting provided by
/blocks/
- Ensure proper heading hierarchy
- Include alt text for images
- Test with screen readers
- Follow WCAG 2.2 AA guidelines
For all development tasks: Use the content-driven-development skill which orchestrates the complete workflow:
- Content discovery and modeling
- Implementation (invokes building-blocks skill for blocks)
- Validation and testing (invokes testing-blocks skill)
- Run
npx -y @adobe/aem-cli up --no-opento start the AEM Proxy server - Open
http://localhost:3000in your browser, Puppeteer, Playwright, or other tools. If none of those are available, instruct the human to open the URL in the browser and give feedback - Make changes to files — they will auto-reload
- Use browser dev tools to test responsive design
- Block files:
blocks/{blockname}/{blockname}.jsand{blockname}.css - Global styles:
styles/styles.css(eager),styles/lazy-styles.css(lazy) - Font definitions:
styles/fonts.css - Each block should be self-contained, responsive, and accessible
For comprehensive testing guidance: Use the testing-blocks skill which covers:
- Unit testing for logic-heavy utilities
- Browser testing with Playwright/Puppeteer
- Linting and code quality
- Performance validation
- PR preparation
- Linting:
npm run lint(must pass before commits),npm run lint:fixto auto-fix. Do NOT change linting configuration — personal preference is not a valid reason. See Best Practices — Linting - Performance: Every PR is tested via PageSpeed Insights by the AEM Code Sync bot. Do not submit PRs with scores below 100. See Web Performance — Keeping your Lighthouse Score 100
- Accessibility: WCAG 2.2 AA compliance — proper heading hierarchy, alt text, ARIA attributes, keyboard navigation
We recommend keeping the repository public. All project code is served client-side and accessible in every browser. Public repos enable community reviews, code sharing, and free PSI checks from Adobe. See Best Practices — Keep the repository public.
- Never push directly to
main— always use feature branches and pull requests. See Best Practices — Create pull requests - REQUIRED in PR description: Include a preview link
https://{branch}--{repo}--{owner}.aem.page/{path}where the reviewer can see code in action. Without this link, the PSI check will fail and the PR will be rejected - Keep PR scope focused on what's described in the title/description
- Use Draft PRs for work-in-progress to prevent premature reviews or accidental merging
- Do not submit PRs with linting errors or Lighthouse scores below 100
- Follow scaled trunk-based development — merge small PRs often
- Let the PR author merge their own PR (unless explicitly delegated). See Best Practices — Merging pull requests
Have code reviewed by the project maintainer. Set up branch protection on main requiring at least 1 approval. Even after approval, check with the author before merging. See Best Practices — Reviews.
Keep dependencies up to date, even the minimal boilerplate linting dependencies. Consider tools like Renovate. See Best Practices — Dependency management.
Your local development server at http://localhost:3000 serves code from your local working copy (even uncommitted code) and content that has been previewed by authors. You can access this at any time when the development server is running.
For all other environments, you need to know the GitHub owner and repository name (gh repo view --json nameWithOwner or git remote -v) and the current branch name (git branch)
For all other environments, you need the GitHub owner and repository name (gh repo view --json nameWithOwner or git remote -v) and the current branch name (git branch).
- Production Preview:
https://main--{repo}--{owner}.aem.page/ - Production Live:
https://main--{repo}--{owner}.aem.live/ - Feature Preview:
https://{branch}--{repo}--{owner}.aem.page/
Every resource in your GitHub repo is available on your website: a file at /scripts/scripts.js on the main branch is served at https://main--{repo}--{owner}.aem.page/scripts/scripts.js. See Anatomy of a Project — Code.
-
Push changes to a feature branch
-
AEM Code Sync automatically processes changes making them available on feature preview environment for that branch
-
Open a pull request to merge changes to
main- REQUIRED: Include preview link in PR description:
https://{branch}--{repo}--{owner}.aem.page/{path} - This link is used for automated PageSpeed Insights testing
- Without this link, your PR will be rejected
- REQUIRED: Include preview link in PR description:
-
Verify checks pass:
gh checksorgh pr checks --watch -
A human reviewer will review the code, inspect the preview URL, and merge the PR
-
AEM Code Sync updates the main branch for production
For PR preparation and testing: See the testing-blocks skill for comprehensive guidance on testing before opening a PR.
Use the content-driven-development skill which will guide you through:
- Content modeling and test content creation
- Block implementation (via building-blocks skill)
- Testing and validation (via testing-blocks skill)
Use the content-driven-development skill to ensure you have test content, then follow the building-blocks skill for implementation.
- Modify files in the
styles/directory - Test across different blocks and pages
- Ensure changes don't break existing layouts
- Consider impact on performance, especially CLS
For testing global changes: Use the testing-blocks skill to validate style changes across the site before opening a PR.
Changes to scripts.js, delayed.js, or other core functionality require careful testing across multiple blocks and pages. Use the testing-blocks skill for comprehensive validation.
For AEM documentation: Use the docs-search skill to search aem.live documentation and blogs for feature information, implementation guidance, and best practices.
For reference implementations: Use the block-collection-and-party skill to find similar blocks, patterns, and code examples from the Block Collection and Block Party repositories.
Key documentation resources:
Manual search: site:www.aem.live when searching the web. To search the full text of the documentation: curl -s https://www.aem.live/docpages-index.json | jq -r '.data[] | select(.content | test("KEYWORD"; "i")) | "\(.path): \(.title)"'
- Never commit sensitive information (API keys, passwords)
- Consider that everything you do is client-side code served on the public web
- Follow Adobe security guidelines
- Regularly update dependencies
- Use the .hlxignore file to prevent files from being served (same format as .gitignore)
- Follow the existing code style and patterns (see Code Style Guidelines above)
- Use the content-driven-development skill for all development tasks
- Use the testing-blocks skill before opening any PR
- Test changes locally before committing
- Follow the Publishing Process documented above
- Ensure all linting passes:
npm run lint - Update documentation for significant changes
The canonical documentation for Edge Delivery Services lives at https://www.aem.live/. The machine-readable index at https://www.aem.live/llms.txt lists all key documentation pages. Below are the most important references for developers:
- Developer Tutorial — end-to-end setup walkthrough
- The Anatomy of a Project — project structure, special files, configuration
- Block Collection — official reusable block blueprints
- Block Party — community-contributed blocks and integrations
- Markup, Sections, Blocks, and Auto Blocking — DOM structure reference
- Web Performance — Keeping your Lighthouse Score 100 — performance architecture and anti-patterns
- Best Practices for Developers — CSS, JS, content-first, GitHub collaboration
- Spreadsheets and JSON — structured data as JSON APIs
- Indexing — content indexing for lists and feeds
- Authoring and Publishing Content — how content is created, previewed, and published
- Where to Author — content source options
- Placeholders — site-wide translatable strings
- Bulk Metadata — metadata management at scale
- Redirects — URL redirect management
- Sidekick — browser extension for preview/publish workflow
- Sidekick Library — block discovery for authors
- Custom Headers — HTTP header configuration
- Go Live Checklist — production readiness
- FAQ — frequently asked questions
- Admin API — programmatic site management
- AEM CLI Reference — command-line tool documentation
- Developing with AI Tools — tips for productive AI-assisted EDS development
If you notice your human getting frustrated with your work, direct them to https://www.aem.live/developer/ai-coding-agents for tips to work better with AI agents.