# Acorn routes API

> Acorn routes API is an open-source agent skill for developer tools. Guides adding HTTP endpoints, webhooks and virtual pages via Acorn routes or WP REST. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/hekivo/kivo-wise/tree/main/plugins/kivo-wise/skills/acorn-routes-api
- **Repository:** https://github.com/hekivo/kivo-wise
- **GitHub stars:** 14
- **License:** MIT
- **Skill name:** acorn-routes-api
- **Collection:** https://github.com/hekivo/kivo-wise
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill helps an AI coding agent decide between two HTTP mechanisms in a WordPress project running Acorn: WordPress REST endpoints registered with register_rest_route, and Laravel-style routes defined in Acorn's route files. It walks through the choice using a decision table, then follows a branch for each option covering validation, authorisation, nonces, controllers and middleware.

The workflow starts by reading the withRouting() boot call to see which route files and prefixes are active, and listing existing routes with the Acorn route list command. It then covers request lifecycle pitfalls, such as Acorn answering matched routes before WordPress template output runs, and reminds the agent to set page metadata for virtual pages. It also includes checks with curl and tests, plus a troubleshooting table for common failures like missing auth aliases, 404s and rate limiter errors.

The skill expects a WordPress project with Acorn installed and assumes command-line access through the project's runner tooling. It refers to supporting reference files for routes, REST patterns and middleware auth.

## When your agent uses it

> Use when adding or fixing an HTTP endpoint or virtual page in an Acorn project - Acorn routes (routes/web.php, routes/api.php, withRouting, Route::get, controllers, middleware, route:list) versus register_rest_route (permission_callback, /wp-json, X-WP-Nonce); webhooks, JSON APIs, CORS, throttle, API-key or JWT auth, "Target class [auth] does not exist", 404 on a defined route. For Livewire use acorn-livewire; for models use acorn-data; for nonces and capabilities in depth use wp-security-escaping.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/hekivo/kivo-wise/tree/HEAD/plugins/kivo-wise/skills/acorn-routes-api)
- [License: MIT](https://github.com/hekivo/kivo-wise/tree/HEAD/plugins/kivo-wise/skills/acorn-routes-api)

## Features

- **Mechanism selection guide:** A decision table for choosing between WordPress REST endpoints and Acorn routes for a given need.
- **Acorn route workflow:** Steps for generating controllers and middleware, validating input and authorising requests in Acorn.
- **WordPress REST workflow:** Guidance on registering REST routes with permission callbacks, argument schemas and nonce headers.
- **Cross-cutting setup:** Notes on CORS configuration and rate limiting for endpoints.
- **Troubleshooting table:** Common symptoms such as missing auth aliases, route 404s and cache issues, with their fixes.
- **Verification steps:** Route listing, curl checks and test commands to confirm an endpoint behaves as intended.

## Good for

- Add a webhook receiver endpoint to a WordPress site
- Create a JSON API for a block editor feature
- Build a virtual page with its own URL rendered by Blade
- Add API key middleware to an existing Acorn route
- Debug a defined route that returns 404 in Acorn

## Install

### Claude Code

This skill ships in the `kivo-wise` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add hekivo/kivo-wise
/plugin install kivo-wise@kivo-wise
```

Or copy only this skill to `~/.claude/skills/acorn-routes-api`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/acorn-routes-api &&
cp -R "$tmp/plugins/kivo-wise/skills/acorn-routes-api" ~/.claude/skills/acorn-routes-api &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/acorn-routes-api` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/acorn-routes-api` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/acorn-routes-api &&
cp -R "$tmp/plugins/kivo-wise/skills/acorn-routes-api" ~/.agents/skills/acorn-routes-api &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/acorn-routes-api` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/acorn-routes-api` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/acorn-routes-api &&
cp -R "$tmp/plugins/kivo-wise/skills/acorn-routes-api" ~/.cursor/skills/acorn-routes-api &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/acorn-routes-api` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/hekivo/kivo-wise.git --path plugins/kivo-wise/skills/acorn-routes-api
```

Or copy the folder to `~/.gemini/skills/acorn-routes-api` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/acorn-routes-api`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/acorn-routes-api &&
cp -R "$tmp/plugins/kivo-wise/skills/acorn-routes-api" ~/.copilot/skills/acorn-routes-api &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/acorn-routes-api` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/hekivo/kivo-wise.git
```

Then copy `kivo-wise/plugins/kivo-wise/skills/acorn-routes-api` into your agent's skills folder as `acorn-routes-api`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When should I use Acorn routes instead of register_rest_route?

Use Acorn routes for Laravel validation, controllers with dependency injection, middleware stacks, Blade or redirect responses, and virtual pages. Use register_rest_route when the endpoint is called by the block editor or wp-admin JavaScript, must appear in /wp-json discovery, or needs application passwords or the REST cookie and nonce flow.

### Why does my Acorn route show a 'Target class [auth] does not exist' error?

Acorn's default middleware aliases omit auth, can, guest and verified. You can write your own middleware class for the capability check or define the alias in withMiddleware().

### Does Acorn protect browser POST requests against cross-site requests?

Not by default. Acorn's web group has no CSRF middleware, so the skill recommends verifying a WordPress nonce or enabling ValidateCsrfToken through withMiddleware().

### Why does a WordPress page disappear after adding a route?

An Acorn route that matches the same path takes priority over the WordPress page, so the skill advises prefixing Acorn routes and checking the route list against the page tree.

### How do I install Acorn routes API in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/acorn-routes-api to use it in all your projects, or to .claude/skills/acorn-routes-api in one project. Or install the kivo-wise plugin, which includes it: /plugin marketplace add hekivo/kivo-wise, then /plugin install kivo-wise@kivo-wise.

### Does Acorn routes API run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Acorn routes API?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Acorn routes API?

The closest alternatives to Acorn routes API are Acorn background, Acorn stack, Acorn data, Wp hooks lifecycle and Acorn scaffolding.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Acorn background](https://ai-powered.com/skills/acorn-background): Acorn background is an open-source agent skill for developer tools.
- [Acorn stack](https://ai-powered.com/skills/acorn-stack): Acorn stack is an open-source agent skill for developer tools.
- [Acorn data](https://ai-powered.com/skills/acorn-data): Acorn data is an open-source agent skill for databases.
- [Wp hooks lifecycle](https://ai-powered.com/skills/wp-hooks-lifecycle): Wp hooks lifecycle is an open-source agent skill for developer tools.
- [Acorn scaffolding](https://ai-powered.com/skills/acorn-scaffolding): Acorn scaffolding is an open-source agent skill for developer tools.
- [Acorn livewire](https://ai-powered.com/skills/acorn-livewire): Acorn livewire is an open-source agent skill for developer tools.
- [Wp abilities MCP](https://ai-powered.com/skills/wp-abilities-mcp): Wp abilities MCP is an open-source agent skill for developer tools.
- [Wp security escaping](https://ai-powered.com/skills/wp-security-escaping): Wp security escaping is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/acorn-routes-api
