/croftweaver:keystatic-setupfrom Croftweaver
Adds Keystatic git-based CMS to an Astro scaffold so non-technical editors can edit Markdown content through a UI. Wires local dev-server mode; documents GitHub cloud-mode upgrade.
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.
None: SKILL.md is the whole skill.
Adds an optional editor UI to the new-website Astro overlay. Opt-in: the default
scaffold is CMS-free (Markdown-in-git is the workflow). Run this only when new-website
§1 Q3 says a non-technical person edits after launch. Keystatic is git-based — it writes
Markdown/Markdoc into the repo, so "data rests in your GitHub" stays literally true and
the site stays free + static. (Keystatic is built by Thinkmill, the Keystone team.)
Prereq: the site uses Content Collections (new-website Q1) — Keystatic edits the files those collections read. If the site is flat pages only, add a collection first.
Edit via the dev server; Keystatic commits nothing on its own — you review and git commit/push, Cloudflare deploys. The admin runs in astro dev only; the production
build stays fully static (no adapter, no auth, no server). Steps applied to the project:
npm install @keystatic/core @keystatic/astro
npx astro add react markdoc # admin UI (React) + content format (Markdoc)
astro.config.mjs — add the integrations. The keystatic() integration injects a
server-rendered /keystatic admin route, so adding it unconditionally fails the static
build with [NoAdapterInstalled] (verified). For local mode, gate it to astro dev —
the admin runs locally, production stays fully static, no adapter needed:
import react from '@astrojs/react';
import markdoc from '@astrojs/markdoc';
import keystatic from '@keystatic/astro';
const isDev = process.argv.includes('dev'); // keystatic admin = dev-only
export default defineConfig({
// …existing site/trailingSlash/build…
integrations: [/* existing */ react(), markdoc(), ...(isDev ? [keystatic()] : [])],
output: 'static',
});
The keystatic() integration auto-injects the /keystatic admin route + its API —
you do NOT hand-write route files. (Verified deps on Astro 7 — each checked via
npm view <pkg>, not assumed: @astrojs/markdoc@^2 (peer astro: ^7.0.0 — the ^1
line stays capped at astro: ^6.0.0 and will NOT install against an Astro 7 site);
@keystatic/astro@^5 (peer range explicitly covers astro: 2 || 3 || 4 || 5 || 6 || 7);
@astrojs/react@^6, NOT ^5 — ^5 declares no astro peer so it installs against
Astro 7, but its own vite dependency is ^7.3.2 against astro 7's vite@^8.0.13,
producing a duplicate non-deduped vite tree and real build-time deprecation warnings;
^6.0.1's vite dependency (^8.0.13) matches astro 7 exactly, confirmed via
npm view @astrojs/react@6 dependencies.vite; @keystatic/core@^0.5 declares no astro
peer and has no such transitive mismatch either, so it's fine as-is; react@19.
npx astro add react markdoc (the Install step above) resolves the right majors
automatically — this parenthetical is for anyone tempted to hand-pin an older note.)keystatic.config.ts at the repo root — one collection per repeating content type,
each path pointing into src/content/:
import { config, fields, collection } from '@keystatic/core';
export default config({
storage: { kind: 'local' },
collections: {
posts: collection({
label: 'Posts',
slugField: 'title',
path: 'src/content/posts/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: 'Title' } }),
content: fields.markdoc({ label: 'Content' }),
},
}),
},
});
The label: strings ARE the CMS UI the owner sees daily — write them in the
owner's language, not English (a German owner gets label: 'Beiträge' / 'Titel' /
'Inhalt'). For a multilingual site built with astro-i18n-setup: per-locale
entry dirs → mirror them as separate collections (one per locale directory — a single
path glob can't span locale subdirectories, and a mis-scoped path leaves the other
locale uneditable); a locale frontmatter field → keep ONE collection and add that
field to the Keystatic schema.
Mirror the site's real Content Collections (the same path/schema the Astro
src/content.config.ts reads), so the CMS and the site agree on shape.Bash(npx keystatic:*) + WebFetch(domain:keystatic.com) already ship
in the template settings.json; just confirm they're present in the project's copy
(don't re-add — avoid duplicates).npm run dev → open /keystatic → edit → the files
under src/content/ change → git commit && git push → Cloudflare deploys.Local mode needs the editor to run a dev server. For a truly non-technical editor who should edit in the browser, upgrade to GitHub mode (commits straight to the repo from a hosted admin):
keystatic.config.ts: storage: { kind: 'github', repo: 'owner/name' }.@astrojs/cloudflare) and switch the relevant routes to server output; add the
KEYSTATIC_GITHUB_* env vars + OAuth callback. Follow the current keystatic.com docs..mdoc), not plain .md — pick
fields.markdoc/fields.mdx/fields.text to match what the site renders.new-website/SKILL.md §1 Q3 → "if non-technical editor: run keystatic-setup"; add
the skill to the §3 bundled-skills copy list (conditional — only for CMS sites).references/WEBSITE_ARCHITECTURE.md Part 4 (Keystatic) → point at this skill.npm install && npm run build # static prod build succeeds (keystatic gated off in build)
npm run dev # open http://localhost:4321/keystatic → admin loads (200)
# create an entry in the UI → a Markdown/Markdoc file appears under src/content/<collection>/
npm test # suite stays green
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
keystatic, cms, astro-cms, git-based-cms, content-management
40 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".
npx claudepluginhub karero/croftweaver --plugin croftweaverOther plugins' skills for the same job