The agent skills
The editlet package ships three agent skills for Claude Code and other agents that read .agents/skills/.
| Skill | Use it to |
|---|---|
editlet | Edit content and the schema, validate, show changes in ?editlet, publish through a pull request |
editlet-setup | Install Editlet in Next.js or Astro, set up the live site, upgrade, find what is broken |
editlet-migrate | Import 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 --hooksIt 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
- It reads
cms/schema.jsonand runsgit status, so it keeps your own edits. - It tells you which files it will change, and asks again before it deletes data.
- It edits, then runs
validateuntil it passes. Schema changes get a dry run first. - If a dev server runs, it opens the matching
?editletscreen. - When you ask to publish, it commits only its own files on an
editlet/<name>branch and opens a pull request. - 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.
| Script | What it does |
|---|---|
validate.mjs | Checks the schema and every entry, including references and images |
types.mjs | Writes .editlet/content.d.ts |
style.mjs | Prints branch names, commit messages and pull requests in your git style |
schema.mjs | json-schema <collection>, check <candidate.json>, rename-field, remove-field |
refs.mjs | used-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 mvon amigrate/<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 siteThe 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:
| Command | Result |
|---|---|
git push to the base branch, main or master, also --all, --mirror and deletes | Blocked |
git commit while validate fails | Blocked |
git commit of content on a branch outside your prefix | Asks you |
gh pr merge --admin, or a branch protection change with gh api | Blocked |
Any other gh pr merge | Asks 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