keystatic
How the site's content is set up for Keystatic, an editing UI on the content files of the repository. Use only when migration/decisions.md chooses Keystatic…
by openfabriq★ 40 GitHub stars
Install keystatic in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Keystatic
Keystatic is an admin UI, at /keystatic, that edits the content files of the repository: an editor writes in a form, and Keystatic commits the file. The content stays files, read by Astro's content collections as before; Keystatic only adds a way to edit them without Git. Follow this skill only when migration/decisions.md chooses it for editing; otherwise the content is plain Markdown and nothing below applies.
In the plan
- The editing decision says who edits after the switch, and how: with a GitHub account each (Keystatic's GitHub mode, free, through a GitHub App of the team) or without one (Keystatic Cloud, a paid account past 3 editors). The choice of the two is a person's: put it under
Still open, and the switch waits for it. - The hosting decision accounts for it: the pages stay static, but
/keystaticand/api/keystaticrun on a server, so the host must run Node (or the adapter's runtime). A host that only serves files does not fit. - T01 sets Keystatic up; each
content-typeticket declares its collection; theswitchlists what a person does to turn it on, below.
In the build
- Packages:
pnpm astro add react markdoc, thenpnpm add @keystatic/core @keystatic/astro;astro.config.mjsaddskeystatic()tointegrations, afterreact()andmarkdoc(). - An adapter for the host of the hosting decision (
@astrojs/nodeinstandalonemode when it runs Node). The output staysstatic: every page is prerendered, and only Keystatic's routes run on the server. With an adapter, the prerendered pages land indist/client/:pnpm parityserves that folder. keystatic.config.ts, at the root, withstorage: { kind: 'local' }until the switch. Onecollectionper collection ofsrc/content.config.ts, with the same fields:path: 'src/content/<collection>/*',slugFieldon the field that gives the URL,format: { contentField: 'content' }, the body asfields.markdoc, images asfields.imagestored whereastro:assetsreads them. The entries are.mdocfiles, and the collection's loader insrc/content.config.tsreads**/*.mdoc.- The mappers write what Keystatic writes: the same frontmatter keys, in the same order and format, and a body in Markdoc (Markdown, no raw HTML). Opening an imported entry in
/keystaticand saving it unchanged leavesgit diffempty. - A test reads every imported entry through Keystatic's reader (
createReaderfrom@keystatic/core/reader, withkeystatic.config.ts), so an entry the admin UI could not open fails the build, not an editor. - Until the switch, editors still write in Webflow and the weekly sync overwrites the entries: nobody edits them in
/keystaticyet.
At the switch, what a person does
- GitHub mode: set
storageto{ kind: 'github', repo: '<owner>/<name>' }, runpnpm dev, openhttp://127.0.0.1:4321/keystaticand create the GitHub App it offers, installed on this repository only. It writesKEYSTATIC_GITHUB_CLIENT_ID,KEYSTATIC_GITHUB_CLIENT_SECRET,KEYSTATIC_SECRETandPUBLIC_KEYSTATIC_GITHUB_APP_SLUGinto.env: copy them to the host, never to the repository, and add the production address's callback URL to the GitHub App. Each editor needs write access to the repository. - Or Keystatic Cloud:
storage: { kind: 'cloud' }andcloud: { project: '<team>/<project>' }, from the project's settings on keystatic.cloud. - Stop the weekly sync, then remove the migration's factory: each save in
/keystaticis a commit on the default branch, and would start the planner for nothing.
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the keystatic skill do?
How the site's content is set up for Keystatic, an editing UI on the content files of the repository. Use only when migration/decisions.md chooses Keystatic for editing, to plan, build or review it.
How do I install the keystatic skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the keystatic skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…