Skip to content
Editlet

The agent skills

The editlet package ships three agent skills for Claude Code and other agents that read .agents/skills/.

SkillUse it to
editletEdit content and the schema, validate, show changes in ?editlet, publish through a pull request
editlet-setupInstall Editlet in Next.js or Astro, set up the live site, upgrade, find what is broken
editlet-migrateImport content from Markdown or MDX folders, Astro collections, Decap, TinaCMS, Keystatic and others

Install the skills

Give your agent this prompt in the project:

Install Editlet in this project: add the package `editlet` with the project's package manager, then read
node_modules/editlet/skills/editlet-setup/SKILL.md and follow it.

To link the skills by hand, run this from the project root after you install the package:

node node_modules/editlet/skills/editlet/scripts/link.mjs --hooks

It links each skill into .claude/skills/ and .agents/skills/ and adds the guard hook to .claude/settings.json. Add --check to only report what is missing. In a monorepo, run it where you start Claude Code.

What the agent does with content

  1. It reads cms/schema.json and runs git status, so it keeps your own edits.
  2. It tells you which files it will change, and asks again before it deletes data.
  3. It edits, then runs validate until it passes. Schema changes get a dry run first.
  4. If a dev server runs, it opens the matching ?editlet screen.
  5. When you ask to publish, it commits only its own files on an editlet/<name> branch and opens a pull request.
  6. It merges only after you approve that pull request in the conversation.

Run the scripts

Run them with node .claude/skills/editlet/scripts/<script> from the project root.

ScriptWhat it does
validate.mjsChecks the schema and every entry, including references and images
types.mjsWrites .editlet/content.d.ts
style.mjsPrints branch names, commit messages and pull requests in your git style
schema.mjsjson-schema <collection>, check <candidate.json>, rename-field, remove-field
refs.mjsused-by, rename and remove of an entry, with every reference to it

The commands that rename or remove are dry runs until you add --apply.

Set up and migrate

  • Setup lists the files it will change, never writes a secret into a file, and asks before it changes anything outside the repo. It does not convert existing content. For roles, see Roles for admins and editors.
  • A migration shows the field mapping and writes nothing until you say yes. It keeps every field and slug, moves files with git mv on a migrate/<source> branch, and keeps your old CMS config.

Check a setup

node .claude/skills/editlet-setup/scripts/doctor.mjs                            # the project
node .claude/skills/editlet-setup/scripts/doctor.mjs --url https://example.com  # also the live site

The doctor only reads, never prints a secret, and exits with 1 when a check fails. It checks the wiring, content, env names and skill links. With --url it also checks the live site and the auth handler. With --url, or when the config has admin, it checks the repository on GitHub: branch protection and branch deployments.

The guard hook

The hook checks each Bash command the agent runs:

CommandResult
git push to the base branch, main or master, also --all, --mirror and deletesBlocked
git commit while validate failsBlocked
git commit of content on a branch outside your prefixAsks you
gh pr merge --admin, or a branch protection change with gh apiBlocked
Any other gh pr mergeAsks you

The hook cannot see commands inside bash -c "…" or scripts, so protect the base branch on GitHub too.

For agents: this page as Markdown · llms.txt