Wp Rest Api Development logo

Wp Rest Api Development

Community
jorgerosal
wp-rest-api-development

WordPress REST API review and development guidance. Use when reviewing custom REST routes, permission_callback logic, schema design, WP_REST_Request handling, response structure, versioning, controller classes, nonce or auth usage, or when user mentions "REST API review", "register_rest_route", "permission_callback", "WP_REST_Request", "REST endpoint", "custom API", "API schema", "REST controller", "headless WordPress", or "API auth". Detects route registration issues, authorization mistakes, schema drift, input validation gaps, and response design problems in WordPress REST API code.

Overview

Publisherjorgerosal
Repositorywordpress-skills
Skill namewp-rest-api-development
Stars
113
Forks
13
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jorgerosal on GitHub. Read the source before you install it.

Installation

Install the Wp Rest Api Development AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jorgerosal/wordpress-skills/tree/main/claude-skills/wp-rest-api-development
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jorgerosal/wordpress-skills.git /tmp/wordpress-skills
mkdir -p .claude/skills
cp -r /tmp/wordpress-skills/claude-skills/wp-rest-api-development .claude/skills/wp-rest-api-development
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wp Rest Api Development in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wp Rest Api Development on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wp Rest Api Development is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

WordPress REST API Development Skill

Overview

Systematic REST API review for WordPress plugins, themes, and custom code. Core principle: Every route needs a clear contract, explicit authorization, validated input, and predictable output. Review covers route registration, controller patterns, request parsing, schema and argument validation, response formatting, caching implications, and compatibility concerns. Report findings with line numbers, severity labels, and BAD/GOOD code pairs where helpful.

When to Use

Use when:

  • Reviewing register_rest_route() usage
  • Auditing custom API endpoints or controller classes
  • Checking permission_callback logic
  • Validating WP_REST_Request input handling
  • Reviewing response shape, status codes, and schema
  • Designing versioned endpoints for headless or block-driven apps

Don't use for:

  • General plugin architecture without REST focus (use wp-plugin-development)
  • Security-only review across the whole plugin (use wp-security-review)
  • Full WooCommerce endpoint review (use wp-woocommerce-dev when WC-specific)
  • GraphQL-specific guidance

Code Review Workflow

  1. Identify REST context

    • Route callbacks in plugin bootstrap
    • Controller classes extending WP_REST_Controller
    • Headless frontend integration
    • Internal admin-only API usage
  2. Check route registration first

    • Namespace and version format
    • HTTP methods match operation intent
    • permission_callback present and specific
    • args definitions for request validation
  3. Review request handling

    • Use $request->get_param() or typed getters instead of raw globals
    • Validate and sanitize all user input
    • Reject malformed input with meaningful WP_Error
  4. Review response design

    • Consistent response shape
    • Proper status codes
    • rest_ensure_response() where helpful
    • Avoid leaking internal details
  5. Check for CRITICAL/WARNING/INFO patterns

    • CRITICAL: Missing permission_callback, write routes with __return_true, raw globals, unsanitized DB queries
    • WARNING: Inconsistent schema, weak validation, mixed response shapes, missing pagination info
    • INFO: Could use controller class, schema reuse, versioning cleanup
  6. Report with cross-references

    • If auth or nonce issues dominate, suggest /wp-sec-review
    • If route logic is plugin-architecture-heavy, suggest /wp-plugin-review

File-Type Specific Checks

Route Registration (register_rest_route)

  • CRITICAL: Missing permission_callback
  • CRITICAL: 'permission_callback' => '__return_true' on write endpoints
  • WARNING: Namespace without version segment
  • WARNING: Route registered outside rest_api_init
  • INFO: Repeated inline callbacks that should use controller methods

Permission Callbacks

  • CRITICAL: Capability checks missing on private data
  • WARNING: Callback always returns true for admin-like actions
  • WARNING: No ownership check for user-specific resources
  • INFO: Could centralize repeated permission logic

Request Args and Validation

  • CRITICAL: Raw $_GET/$_POST used inside endpoint callback
  • WARNING: Missing sanitize_callback or validate_callback
  • WARNING: Missing enum/format constraints for known values
  • INFO: Could define reusable item schema

Response Handling

  • WARNING: Mixed success response shape across routes
  • WARNING: wp_send_json() inside REST callbacks instead of returning response data
  • INFO: Could use WP_REST_Response for headers/status control

Search Patterns for Quick Detection (API-21)

Use these rg commands for quick REST API scanning. Organized by severity.

CRITICAL Patterns

bash
# register_rest_route candidates
rg -n "register_rest_route\s*\(" . -g '*.php'

# permission_callback returning true
rg -n "permission_callback.*__return_true" . -g '*.php'

# Raw superglobals inside REST callbacks
rg -n "\$_GET|\$_POST|\$_REQUEST" . -g '*.php'

WARNING Patterns

bash
# WP_REST_Request usage without obvious validation helpers
rg -n "WP_REST_Request|get_param\s*\(" . -g '*.php'

# REST callbacks using wp_send_json
rg -n "wp_send_json|wp_send_json_success|wp_send_json_error" . -g '*.php'

# Route namespaces to inspect for versioning
rg -n "register_rest_route\s*\(\s*['\"][^'\"]+" . -g '*.php'

INFO Patterns

bash
# WP_REST_Controller classes
rg -n "extends\s+WP_REST_Controller" . -g '*.php'

# rest_ensure_response usage
rg -n "rest_ensure_response|new\s+WP_REST_Response" . -g '*.php'

Reference Files

  • references/route-patterns.md - Route registration, controller structure, and namespace design
  • references/schema-and-auth-guide.md - Args schema, permission callbacks, input validation, and response design

Output Format (API-23)

For each finding include:

  1. Severity: CRITICAL, WARNING, or INFO
  2. File and line number
  3. Issue summary
  4. Why it matters for WordPress REST API behavior
  5. Recommended fix

If no issues are found, say so clearly and mention any residual gaps such as missing tests, inconsistent schema documentation, or limited versioning strategy.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wp Rest Api Development AI skill do?

WordPress REST API review and development guidance. Use when reviewing custom REST routes, permission_callback logic, schema design, WP_REST_Request handling, response structure, versioning, controller classes, nonce or auth usage, or when user mentions "REST API review", "register_rest_route", "permission_callback", "WP_REST_Request", "REST endpoint", "custom API", "API schema", "REST controller", "headless WordPress", or "API auth". Detects route registration issues, authorization mistakes, schema drift, input validation gaps, and response design problems in WordPress REST API code.

Why use Wp Rest Api Development on TypingMind?

Because you install it once and use it with any model. Wp Rest Api Development is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wp Rest Api Development in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jorgerosal/wordpress-skills/tree/main/claude-skills/wp-rest-api-development. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wp Rest Api Development?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wp Rest Api Development?

As many as you like. As long as a model supports skills, you can use Wp Rest Api Development with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wp Rest Api Development AI skill free?

Yes. It is published on GitHub by jorgerosal under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇