- Home
- Skills
- Frontend & Web Apps
- CMS-Driven Single-Page Front End Playbook
More screenshots
Works with the AI Agents you already use
CMS-Driven Single-Page Front End Playbook
There is no framework, no build-time HTML generator and no component library.
$12
CMS-Driven Single-Page Front End Playbook
Example session with this skill installed
The public front end needs two changes. First, dragging the hanging-print gallery and then
tapping the play button on a print does nothing, because the click is swallowed after a drag;
fix it without breaking the drag itself. Second, add a ninth theme next to the existing eight:
the variables, the desktop switcher entry, the mobile switcher entry and the felt entry, with
contrast ratios computed for the new palette. Both changes have to pass the existing gates,
and the report has to quote the actual gate output rather than a summary. Use the
single-page-frontend skill.
- Read your context and instructions
- Compiled the cms-driven single-page front
- Generated the document
Delivered against that request, following the playbook in the package.
Summary. The click was lost because pointer events were retargeted after a drag. The
listeners moved to window, the drag now sets a suppressClick flag that a capture-phase
click handler consumes, and setPointerCapture is not used anywhere in the gallery. The
ninth theme was added in four places, which is the number the documentation states: the
variable block (including --primary-rgb), the desktop switcher, the mobile switcher, and the
FELTS list. Contrast was computed per token pair rather than assumed.
| Change | File | Gate that owns it | Result |
|---|---|---|---|
| Drag no longer swallows the following click | src/gallery/motion-gallery.ts | tests/motion-gallery.mjs | pass, tap after drag opens the media |
window listeners replace pointer capture | src/gallery/motion-gallery.ts | tests/render3d-gallery.mjs | pass, drag and arrow paths both hold |
Ninth theme variables and --primary-rgb | index.html theme block | npm run build | pass, no undefined token |
| Switcher entries, desktop and mobile | index.html switchers | node tests/public-smoke.mjs | pass, theme persists and dispatches themechange |
| Contrast table for the new palette | docs/ACCESSIBILITY.md | manual computation | recorded per pair, one pair below 4.5:1 and labelled |
npm run typecheck # tsc --noEmit
node --test tests/shape.test.mjs # 18 pure tests, no build needed
npm run build # build-cms.ts then vite build
node tests/public-smoke.mjs # puppeteer against dist/
node tests/render3d-gallery.mjs # needs TARGET=http://host:port of a served dist/
node tests/motion-gallery.mjs # self-hosts dist/, generates ffmpeg fixtures
// motion-gallery.ts - the shape of the fix
let suppressClick = false;
window.addEventListener('pointerup', () => {
if (dragMoved) suppressClick = true;
});
document.addEventListener('click', (e) => {
if (suppressClick) { suppressClick = false; e.stopPropagation(); }
}, true);
Next steps. Run the mapper tests first, because a caption or meta-line change is a mapper
bug and not a layout bug. Then the build, then the smoke test, then the two gallery gates
against a served dist/. Quote the gate output in the change note. If a gate fails on a
layout assertion, check whether the element being measured is rotated, because
getBoundingClientRect returns the rotated box and the layout number lives on
offsetWidth and offsetHeight. Before deploying, confirm the build emits four HTML entries
and that the custom domain serves the new build after the upload, since a non-production
branch updates the *.pages.dev alias and leaves the custom domain on the old build.
index.html
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
What the skill documents
One index.html holds the whole public page: markup, design tokens, a Tailwind CDN config
and the renderer that paints CMS content into named containers. Two TypeScript modules load
as ES modules: a content loader and a hanging-print media gallery. There is no framework, no
build-time HTML generator and no component library.
The package is the engineering documentation for that architecture, written so an agent can
change it without breaking it. Every behavioural claim names the file it comes from and the
identifier to search for. The reference tables go further: each row carries an anchor such
as A.3.7, and the appendix resolves it to the exact lines, quoted verbatim from the
source. A buyer can check a claim against the code that supports it without owning the
application; what the package does not do is let a buyer read the whole site source.
What the package contains
| Item | Count | Notes |
|---|---|---|
| Documents | 17 | 15 topic documents plus the source appendix and the text visual inventory |
| Reference tables | 3 | DOM hooks, CSS token table per theme, QA handles |
| Agent playbook | 1 | SKILL.md, written to be loaded as project instructions |
| Source excerpts | 98 | verbatim, across 7 application files, each with its range |
| Visual descriptions | 27 | 25 stills and 2 clips, described in text with layout sketches |
| Images in the archive | 0 | Agensi delivers text files only; the stills stay in the repository for listing media |
| Capture tool | 1 | tools/capture.mjs, regenerates the whole media set |
| Weight | about 127 KB | 28 files, 318 KB of text |
The five layers and the one direction of data flow
Content lives in PostgREST rows, or in api/*.json when the database is unreachable. A pure
mapper (src/cms/shape.js) converts rows into the legacy { textData, imgData, settingsData }
shape that three consumers already agree on: the renderer, the migration script and the test
suite. The renderer paints each section from that shape into #cms-* containers. The gallery
is a separate class with its own spring integrator. Themes are one variable layer under both.
Work does not move between layers: the renderer does not learn about database columns, and the mapper does not learn about CSS.
The invariants the playbook protects
- All CMS text is untrusted. Strings are escaped on the way into templates, markdown is
sanitised through a DOMParser walk, and
hrefandsrcvalues are scheme-checked. - Colour comes from
var(--color-*)only. A hardcoded hex is a theme that renders wrong. - A section with no published content hides itself; an empty state is not a layout bug.
- One gallery class serves both the video section and the stills section, selected by a data attribute. Behaviour is fixed in the class, never forked per section.
- Drag handling never uses
setPointerCapture, because the tap that follows a drag has to still reach the play button.
The gallery, in the terms that matter
Layout is computed, never hardcoded: stage height, print step, media height and the SVG line
path are derived from viewport height, scoped CSS custom properties and each print's aspect
ratio. Motion is spring integration with semi-implicit Euler, and the animation loop stops
when everything is at rest, so there are no setTimeout driven animations to fight. The
ambient breeze is bounded (2.2 degrees, 2.6 px, 2.0 px at the far edge) and exactly zero on
the active print. Reduced motion is a first-class mode, not a fallback.
Measured, not asserted
The documents report numbers rather than adjectives: the page document is 195,294 bytes raw and 46,104 bytes gzip; the main bundle is 35,163 bytes raw and 11,934 bytes gzip; seven of eight themes pass 4.5:1 for body text and one measures 1.94:1, with the gap and its fix written down; the content hold before first paint is 2,900 ms of timer chain; the deploy carries 36 MB of images and 11 MB of models that nothing references. Twenty-two numbered pitfalls are listed with symptom, cause and citation.
Verification
Six gates, matched to the kind of change: typecheck, 18 pure mapper tests, the production
build, a puppeteer smoke test against dist/, and two gallery gates that drive layout, drag
and rotation. The playbook states which gate owns which change, because two of the worst
regressions on this project (rotated media not filling its frame, drags swallowing clicks)
only appear in the browser gates.
Scope and limits
Documentation, reference tables, the source appendix, the text visual inventory and the capture tool. The application source is not included, and the appendix is excerpts rather than a copy of the tree. The image and clip files are not in the archive: they stay in the repository for listing media, and the text inventory is the delivered equivalent. The admin dashboard, database schema and migrations live in the companion CMS package. No credential, endpoint or account identifier is included.
Documents an architecture the buyer does not receive. Source excerpts are quoted for the most-cited files only; five long-range citations are given as file names without an excerpt.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago
Requires
Permissions
Allowed Hosts