Headline

This guide walks PD Lab engineers through the first hour of working in our Edge Delivery Services repository — from cloning the project, to running the live preview against AEM author, to landing your first commit. Use the tabs below to find the workflow that matches what you are trying to do, then copy the quickstart commands into your terminal.

Local Setup

Install the AEM CLI globally and point the local dev server at the PD Lab preview origin. This gives you a hot-reload preview at http://localhost:3000 that pulls content from AEM author while serving block code straight from your working copy.

Confirm your Node version is on the LTS track before installing — the CLI uses native ESM and assumes Node 20+. Once aem up is running, edits to any file under /blocks, /scripts, or /styles reload the browser within a second.

Block Anatomy

Every PD Lab block lives in its own folder under /blocks with three companion files: a JavaScript decorator, a CSS file scoped to the block, and an optional _blockname.json that describes the component model authors will see in Universal Editor.

The decorator function receives the block element as its only argument. Use the moveInstrumentation helper to carry author data attributes onto any new DOM you build, and reach for semantic tokens from styles/tokens/semantic.css instead of hard-coded values.

Commit Hooks

PD Lab uses a Husky pre-commit hook that runs whenever you stage a partial component JSON. The hook merges every _*.json under /models and /blocks into the three root files (component-models.json, component-definition.json, component-filters.json) and re-stages the result automatically.

You almost never need to run npm run build:json yourself — but it is safe to run during development if you want to verify what Universal Editor will see before you commit. Linting is not automatic; remember to run npm run lint before pushing.

bash
# Clone the PD Lab repository and install dependencies
git clone git@github.com:protiviti-it/pdlab.git
cd pdlab
npm install

# Start the local dev server against the AEM author preview origin
aem up --url https://main--pdlab--protiviti-it.aem.page

# Before pushing, lint your changes
npm run lint

Headline

Once the dev server is running, the natural next step is to open the block library at /tools/automation/block-library and use one of the reference blocks as a starting point. From there, lean on the building-blocks, content-modeling, and testing-blocks skills inside Claude Code — each one wraps the PD Lab conventions covered above into a step-by-step workflow you can invoke directly from your editor.