/croftweaver:website-hero-carouselfrom Croftweaver
Adds an auto-rotating hero carousel with dots, pause controls, and fade/instant transitions. Includes tests for layout stability, dot readability, and accessibility. For home pages or any page with 2-5 photos.
Ships in Croftweaver. 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.
A photo place at the top of a page where two or more photos take turns every few seconds, with a dot for each. It looks easy and is not: a caption on one photo makes the page jump at every change; white dots disappear on a pale photo; a phone needs larger targets than a mouse; and moving content has an accessibility rule of its own. This skill ships the component and, more importantly, the tests that catch all of these.
And the honest weak spots, so the owner hears them from you first:
| File | From this skill's templates/ | What it is |
|---|---|---|
src/components/HeroCarousel.astro | HeroCarousel.astro | the markup, the dots, the styles |
src/components/hero-carousel-text.ts | hero-carousel-text.ts | the words it says, in English and German |
public/js/hero-carousel.js | hero-carousel.js | the script: puts the slides in one place, rotates, handles the controls |
tests/hero-carousel.spec.ts | hero-carousel.spec.ts | the carousel as a visitor meets it (list below) |
Install all four. The templates hold no image file: the photos are the site's own, passed in as props.
How it works, in one paragraph. The server sends every slide, one under the other, and the
controls hidden. The script, a file of the site's own under public/js/ rather than an inline script
(so a strict script-src 'self' lets it run), then puts the slides in one grid cell, shows the
controls and marks the slide on show. Which slide is on show is a data attribute; the CSS does the
rest, the one-second fade included. A slide is shown only when its image is complete, so a late or
failed photo never leaves a blank place.
What the spec checks (a visitor's view, on the page as built): the markup and every dot's name; the interval to the millisecond on a frozen clock; the Pause button or the dot stopping it, with the labels and the live region; keyboard focus (stops it, stays stopped, Resume); the pointer holding it and a fresh interval after leaving; reduced motion; a hidden tab; a late and a failed second image; the page without JavaScript; no height jump at 1280, 768 and 390 px; that a slide not on show cannot be reached by keyboard or in the accessibility tree; that a photo's link works and a dot never opens it; 32 px targets (44 on touch screens); the dots against the pill over every photo, read from rendered pixels; forced colours; axe in both themes; nothing stored or sent; the script is a file, not inline; the fade runs on a frame part-way and settles, and does not run under reduced motion.
AGENTS.md §2)mkdir -p public/js first).<Base>, near the top:
---
import HeroCarousel from '../components/HeroCarousel.astro';
import first from '../assets/hero-1.jpg';
import second from '../assets/hero-2.jpg';
---
<HeroCarousel label="Photos of our work" slides={[
{ image: first, alt: 'What the first photo shows', label: 'Short name', href: '/projects/one' },
{ image: second, alt: 'What the second shows', label: 'Another name' },
]} />
label: what the carousel is, for a screen reader. Required.image (an imported photo), alt (a sentence that says what is in it, at least 10
characters: the build stops on less), label (the dot's short name), href (optional).pause: "button" (default) or "dots". swap: "instant" (default) or "fade".
intervalMs: default 6000, never below 2000. ratio: default "16 / 9". lang: the page's own.
Photos: JPEG or PNG, about 2,400 px wide, kept to what the page needs (the build makes four sizes
of each, AVIF with a WebP fallback). The first photo loads first (high priority); the others load at low
priority and keep their place.Base.astro hands it down as Astro.locals.lang). Any other: "Add a language" below, first.tests/hero-carousel.spec.ts set PAGE (the page with the carousel), PAUSE and SWAP to what the
page passes (the component's defaults are button and instant; the spec needs them written out).
The spec fails while one is empty. LANG only if the page passes lang.
Photos for the contrast test: the spec reads the carousel's real photos, so it meets the owner's own.
If every one of them is dark, the "white dots on the pill" test cannot fail; to see it fail, check a pale
one in once by hand (the mutation check in §3 does).npm run check && npm test.Moving content that starts by itself, lasts more than five seconds and sits beside other content falls under WCAG 2.2.2, Level A, which asks for "a mechanism for the user to pause, stop, or hide it" (read at https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html). The same page defines pause as "stopped by user request and not resumed until requested by user", and does not say the mechanism must be visible. It does not discuss slide indicators.
pause="button" (the default). A Pause button beside the dots (Resume while stopped). Visible, named,
the reading nobody disputes, and the one a visitor finds. Its price: a small word on the photo.pause="dots". No button. Choosing a dot shows that photo and stops the rotation until the visitor
reloads; focus entering it from the keyboard stops it too, and reduced motion starts it stopped. That is
likely a mechanism in the sense of 2.2.2, but nothing tells a visitor that a dot stops it, and there is
no way to resume. The first site to use this mode chose it for the cleaner photo, knowing that.This skill draws no conformance conclusion: whether "dots" is accepted is for the site's own auditor. If the owner picks it, write one line in the site's docs saying so, with the date.
On a new site in that language, or when a site gains it later.
CONTENT_GUIDE.md; in German the register, "du" or "Sie"). The texts are
a handful of words: where the language allows, address nobody.src/components/hero-carousel-text.ts, copy the en entry of TEXT under the language's two-letter
code (fr, not fr-CA) and translate every value; npm run check fails while one is missing.After npm run build && npm run preview, or on the pull request's preview address, the owner:
The checks this skill was built with, so a change to a template can be judged: the spec carries one test for each of these, and each fails when the thing it guards is removed. Run once by hand when the templates change (the CI job installs them in a fresh site and runs the spec, in all three combinations of the settings it uses):
Remove this from HeroCarousel.astro | This test fails |
|---|---|
the grid rules (display: grid, grid-area) | "the slides share one place …" |
aspect-ratio on the photo | the same test (a 4:3 photo is taller) |
the pill's background | "rendered over every photo …" (white on a pale photo is about 1:1) |
border-width: 5px on the dot on show | the forced-colours test |
the transition rules | the fade test ("a frame part-way") |
pointer-events: none on slides not on show | "the photo links to its page …" (a fading slide takes the click) |
the inert and aria-hidden the script sets on slides not on show (hero-carousel.js) | the Tab-key and accessibility-tree tests (the link of the slide that is going stays reachable and readable while it fades) |
the script's recover() (a failed photo on show is replaced by the first other one that is there, now or when it arrives) | "a first image that fails …" |
The carousel stores nothing and sends nothing: nothing to add to the privacy page.
To remove it: delete the four files, the <HeroCarousel> block and the import HeroCarousel line (with the
photo imports only it used) from the page; put one photo back. Nothing else refers to it, apart from
PAGES-driven suites that only see the page.
Previous / next arrows, swipe gestures, captions on the photos, credits on the photos, video slides, more than one carousel on a page (its ids are fixed), lazy loading of the later photos. Each can be added later; none is needed for the first version.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub karero/croftweaver --plugin croftweaver40 skills in this plugin
/ai-seoWhen the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers. Also use when the user mentions 'AI SEO,' 'AEO,' 'GEO,' 'LLMO,' 'answer engine optimization,' 'generative engine optimization,' 'LLM optimization,' 'AI Overviews,' 'optimize for ChatGPT,' 'optimize for Perplexity,' 'AI citations,' 'AI visibility,' 'zero-click search,' 'how do I show up in AI answers,' 'LLM mentions,' or 'optimize for Claude/Gemini.' Use this whenever someone wants their content to be cited or surfaced by AI assistants and AI search engines. For traditional technical and on-page SEO audits, see seo-audit. For structured data implementation, see schema-markup./astro-i18n-setupTurn a new-website scaffold into a turnkey multi-language site: Astro i18n routing (clean default locale + prefixed others), self-referencing hreflang + x-default in the Base layout, i18n sitemap alternates, a language switcher, and the test-harness changes that keep the green-from-commit-1 gate honest across locales. Run at scaffold time when new-website Q4 = "two+ languages at launch", OR later to add a second language to a single-locale site whose default stays unprefixed (phased rollout). Trigger phrases: "multi-language site", "add i18n", "DE+EN site", "internationalization", "hreflang setup", "two languages at launch".
/business-listings-setupPost-launch: claim Google Business Profile, Bing Places, and category directories, then verify the `sameAs` profiles already in schema actually resolve. The action skill for E-E-A-T's Authoritativeness component (owned by `website-content-guide`): other pages linking to or citing you are one signal search and AI answer engines read as authority. Human-in-the-loop, same shape as `search-console-setup` — the agent drafts every value, the owner clicks. Trigger phrases: "claim my Google Business Profile", "Google Maps listing", "Bing Places", "business listings", "improve E-E-A-T", "authoritativeness is thin", "sameAs profiles".
/copywritingWhen the user wants to write, rewrite, or improve marketing copy for any page — including homepage, landing pages, pricing pages, feature pages, about pages, or product pages. Also use when the user says "write copy for," "improve this copy," "rewrite this page," "marketing copy," "headline help," "CTA copy," "value proposition," "tagline," "subheadline," "hero section copy," "above the fold," "this copy is weak," "make this more compelling," or "help me describe my product." Use this whenever someone is working on website text that needs to persuade or convert./customer-researchWhen the user wants to conduct, analyze, or synthesize customer research. Use when the user mentions "customer research," "ICP research," "talk to customers," "analyze transcripts," "customer interviews," "survey analysis," "support ticket analysis," "voice of customer," "VOC," "build personas," "customer personas," "jobs to be done," "JTBD," "what do customers say," "what are customers struggling with," "Reddit mining," "G2 reviews," "review mining," "digital watering holes," "community research," "forum research," "competitor reviews," "customer sentiment," or "find out why customers churn/convert/buy." Use for both analyzing existing research assets AND gathering new research from online sources. For writing copy informed by research, see copywriting./double-knuthGeneric two-pass "Double-Knuth" review for ANY repo or file set: Pass 1 = correctness/bugs on the change (delegates to /code-review when a git diff exists, agent-based otherwise), Pass 2 = completeness + cross-file/doc consistency — the defect class a diff reviewer structurally cannot see (stale counts/enumerations, docs contradicting changed behavior, dead paths, orphaned files, contract drift). Read-only: returns a ranked BUG/RISK/NIT list with file:line + concrete fixes. Specialized versions take precedence: websites → website-review; this skill covers everything else (skill suites, scripts, tools, configs). Trigger phrases: "double knuth this", "double knuth the code", "double knuth the repo", "two-pass review", "consistency review", "did the docs drift", "review the whole repo, not just the diff".
Other plugins' skills for the same job