skills/wp-rest-api/SKILL.md
Use when building, extending, or debugging WordPress REST API endpoints/routes: register_rest_route, WP_REST_Controller/controller classes, schema/argument validation, permission_callback/authentication, response shaping, register_rest_field/register_meta, or exposing CPTs/taxonomies via show_in_rest.
npx skillsauth add WordPress/agent-skills wp-rest-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need to:
my-plugin/v1) and routes.node skills/wp-project-triage/scripts/detect_wp_project.mjsregister_rest_routeWP_REST_Controllerrest_api_initshow_in_rest, rest_base, rest_controller_classIf this is a full site repo, pick the specific plugin/theme before changing code.
wp/v2:
show_in_rest => true + rest_base if needed.rest_controller_class.references/custom-content-types.md.register_rest_route() on rest_api_init.WP_REST_Controller subclass) for anything non-trivial.references/routes-and-endpoints.md and references/schema.md.vendor/v1; avoid wp/* unless core.permission_callback (use __return_true for public endpoints).WP_REST_Server::READABLE/CREATABLE/EDITABLE/DELETABLE constants.rest_ensure_response() or WP_REST_Response.WP_Error with an explicit status.Read references/routes-and-endpoints.md.
args with type, default, required, validate_callback, sanitize_callback.rest_validate_value_from_schema then rest_sanitize_value_from_schema.$_GET/$_POST directly inside endpoints; use WP_REST_Request.Read references/schema.md.
register_rest_field for computed fields; register_meta with show_in_rest for meta.object/array meta, define schema in show_in_rest.schema.?context=edit to access content.raw (auth required). Pair with _fields=content.raw to keep responses small.WP_REST_Response::add_link().Read references/responses-and-fields.md.
X-WP-Nonce (action wp_rest).permission_callback (authorization), not just “logged in”.Read references/authentication.md.
Link header or <link rel="https://api.w.org/">)._fields, _embed, _method, _envelope, pagination headers.per_page is capped at 100.Read references/discovery-and-params.md.
/wp-json/ index includes your namespace.OPTIONS on your route returns schema (when provided).wp/v2 when show_in_rest is true.rest_api_init not firing, route typo, or permalinks off (use ?rest_route=).permission_callback too strict._doing_it_wrong for missing permission_callback: add it (use __return_true if public).args schema or validation callbacks.show_in_rest false, meta not registered, or CPT lacks custom-fields support.If version support or behavior is unclear, consult the REST API Handbook and core docs before inventing patterns.
tools
Verify a WordPress plugin's Abilities API registrations: enumerate abilities, check that callback behavior matches each annotation's claim (the adversarial readonly-but-writes detection), validate permissions and schemas, and validate audit documents produced by wp-abilities-audit.
tools
Audit a WordPress plugin's REST surface and produce a standardized audit document proposing Abilities API registrations. Produces a markdown doc with a YAML schema and prose sections that humans and agents can both consume when planning a registration rollout. Works on any WP plugin.
tools
Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
tools
Use when reviewing WordPress plugins for GPL compliance, checking license headers or compatibility, evaluating upsell/freemium/trialware patterns, validating plugin naming or trademark rules, checking plugin slugs, understanding why a plugin was rejected from WordPress.org, or answering any question about the 18 WordPress.org Plugin Directory guidelines — even if the user doesn't mention 'guidelines' explicitly.