Regions
After each build, editlayer annotate marks every page’s <main> as editable, plus the header and footer when they’re the same on every page. Each region carries a hash of your version.
For developers
Editlayer is a Claude Code plugin and a small Cloudflare Worker. You keep building the way you do; your client gets a visual editor on the live site.
Install
Add the marketplace, install the plugin, then ask in plain words. The editlayer skill checks the site, sets everything up and hands you the owner’s invite link.
npx wrangler logineditlayer, invite-editor, connect-ai, cms-statusClaude Code
> /plugin marketplace add BrennenHodge/editlayer > /plugin install editlayer@editlayer > /editlayer:editlayer
Or from a terminal
$ claude plugin marketplace add BrennenHodge/editlayer $ claude plugin install editlayer@editlayer
How it works
After each build, editlayer annotate marks every page’s <main> as editable, plus the header and footer when they’re the same on every page. Each region carries a hash of your version.
Edited regions are stored whole, as sanitized HTML, in D1, with draft and live copies and a full publish history. Images go to R2 and are served from /_cms/media/.
The Worker fetches the static page and swaps in edited regions with HTMLRewriter as it streams. Untouched pages pass through. If Editlayer errors, the static page is served.
Signed-in editors add ?edit. Drafts are applied, your scripts are paused so menus don’t fight the editor, and the editor loads in a shadow root so your CSS and its CSS never mix.
If you rebuild a region an editor also changed, their version keeps showing and they get a banner: keep theirs, or use yours. editlayer status lists every edited region.
PBKDF2 passwords, HttpOnly 30-day sessions, lockout after 8 failed sign-ins, a custom header plus same-origin check on every write, and sanitized HTML.
wrangler.jsonc). The skill creates one if the site isn’t on Cloudflare yet.<main>, and a sitemap.xml for the page list.data-cms-lock.The plugin runs these for you. Run them from the site folder; add --local for wrangler dev.
| Command | Does |
|---|---|
editlayer init | Creates the D1 database and R2 bucket, copies the engine into _editlayer/, writes cms.worker.js, updates wrangler.jsonc, applies migrations and marks the pages. |
editlayer annotate [dir] | Marks editable regions in built HTML. Add it to the end of your build. |
editlayer user add <email> | Creates an editor (--admin for admins) and prints a one-time invite link, valid 7 days. |
editlayer connect <name> | Creates an AI connection and prints its MCP address. --publish lets it publish. |
editlayer status | Every edited region, draft or live, and which ones you have since rebuilt. |
editlayer update | Copies the plugin’s newer engine into the site and applies new migrations. |
Tune cms.worker.js to the site: which colours and fonts editors may change (with readability checks), the section backgrounds they can pick, the layout for new pages, and whether forms go to the inbox. Optional bindings add scheduled publishing (a cron trigger), writing help (Workers AI) and emailed invites (Resend).
export default createCms({
siteName: 'Juniper Café',
accent: '#b4532a',
styles: { groups: [ /* the CSS custom properties editors may change */ ] },
sections: { backgrounds: [{ label: 'Light', class: '' }, { label: 'Dark', class: 'dark' }] },
});
Everything beyond core editing is a feature plug-in: a client file for the editor and an optional Worker file with API routes, render hooks, cron jobs and data keys. The plugin ships the full reference in engine/docs/features.md.
Editlayer is in early access for developers and agencies building with AI. Join now to lock in founding pricing.