wp-rest-api — Claude Code skill: what it does, how to install
A skill for WordPress REST API work: register routes, validate arguments, wire permission checks, and track down 401 or 404 responses.
npx skills add WordPress/agent-skills --skill wp-rest-api -a claude-codeWhat wp-rest-api does
The skill gives the agent a fixed route through REST API work in WordPress. It starts by finding what already exists: register_rest_route calls, controller classes, the rest_api_init hook. Then it picks an approach, either show_in_rest on a post type or taxonomy, or a custom endpoint built on a controller class.
Reference files cover routes, schemas, responses and fields, authentication, discovery and request params. Two details it flags early: per_page tops out at 100, and unfiltered post HTML sits behind ?context=edit with auth, best paired with _fields=content.raw. Debugging comes with it. A 404 usually means rest_api_init never fired, a typo in the route, or permalinks switched off.
It targets WordPress 7.0+ and PHP 7.4.0+. You need bash and node on the machine, and some workflows ask for WP-CLI. An older WordPress branch is a reason to check the version before installing.
What it helps with
- register a route with a real permission check
- debug a 401 on a cookie-authenticated endpoint
- add a computed field to the response
- expose a custom post type and taxonomy under
wp/v2 - define an args schema instead of reading superglobals
Example prompts for the agent
- Add a
my-plugin/v1/ordersroute withregister_rest_route, apermission_callbackand an args schema - Why does my endpoint return 401 when called from wp-admin?
- Expose the
portfoliopost type in REST and check it shows up underwp/v2
How to install wp-rest-api
1Skills CLI (Vercel)
npx skills add WordPress/agent-skills --skill wp-rest-api -a claude-code2Manually: put the files in place
~/.claude/skills/wp-rest-api/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/wp-rest-api/
1Skills CLI (Vercel)
npx skills add WordPress/agent-skills --skill wp-rest-api -a codex2Manually: put the files in place
.agents/skills/wp-rest-api/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add WordPress/agent-skills --skill wp-rest-api -a cursor2Manually: put the files in place
.cursor/skills/wp-rest-api/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install WordPress/agent-skills wp-rest-api2Manually: put the files in place
.github/skills/wp-rest-api/SKILL.md1Skills CLI (Vercel)
npx skills add WordPress/agent-skills --skill wp-rest-api -a gemini-cli2Platform CLI
gemini skills install https://github.com/WordPress/agent-skills --path skills/wp-rest-apiManually: put the files in place
.devin/skills/wp-rest-api/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add WordPress/agent-skills --skill wp-rest-api -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about wp-rest-api
How do I install wp-rest-api in Claude Code?
Run npx skills add WordPress/agent-skills --skill wp-rest-api -a claude-code. The skill file lands at ~/.claude/skills/wp-rest-api/SKILL.md.
What does wp-rest-api do?
It walks the agent through building and debugging WordPress endpoints: routes, argument schema, permission checks, response fields and meta, and turning on REST for post types.
Which WordPress version does it need?
It targets WordPress 7.0+ and PHP 7.4.0+. It needs bash and node, and some workflows rely on WP-CLI.