From superpowers-sage
Creates custom WordPress Abilities for WP MCP Adapter (WP 6.9+): PHP classes with JSON schema and execute method, Acorn make:ability generation, AbilitiesServiceProvider registration, and MCP exposure via discover-abilities/execute-ability.
npx claudepluginhub codigodoleo/superpowers-sage --plugin superpowers-sageThis skill uses the workspace's default tool permissions.
An Ability exposes a callable MCP endpoint via the WordPress MCP Adapter. Claude calls it via `execute-ability` after `discover-abilities` lists it.
Registers and manages WordPress Abilities API: PHP abilities/categories with meta, REST exposure (/wp-abilities/v1), JS consumption (@wordpress/abilities), permission checks, and troubleshooting visibility issues.
Guides WordPress plugin development workflows: architecture, hooks, admin interfaces, REST API, security best practices, WP 7.0 RTC, AI connectors, Abilities API.
Guides WordPress capabilities, roles, and authorization in Sage/Acorn projects: add/remove roles/caps, custom CPTs, meta caps, current_user_can checks, ACF visibility.
Share bugs, ideas, or general feedback.
An Ability exposes a callable MCP endpoint via the WordPress MCP Adapter. Claude calls it via execute-ability after discover-abilities lists it.
class ListProjectsAbility extends Ability
{
public string $name = 'projects/list';
public string $description = 'Return all published Project CPT posts.';
public array $schema = [ /* JSON Schema for input */ ];
public function execute(array $args): array
{
// returns array — serialized as JSON by the adapter
}
}
lando wp acorn make:ability <Name>
# Example: lando wp acorn make:ability ListProjects
# Creates: app/Abilities/ListProjectsAbility.php
Use templates in assets/ability-*.php.tpl for query, CRUD, and search patterns.
In app/Providers/AbilitiesServiceProvider.php:
use App\Abilities\ListProjectsAbility;
public function boot(): void
{
$this->app->make(AbilityRegistry::class)->register([
new ListProjectsAbility(),
]);
}
See references/registration.md for full ServiceProvider setup.
The $schema array follows JSON Schema Draft-07. See references/schema.md.
For an Ability to appear in discover-abilities, the MCP Adapter must be running. See references/mcp-exposure.md.
See references/patterns.md for query, CRUD, search, ACF field groups, and Livewire components patterns.
bash scripts/list-abilities.sh
Then in your Claude Code session: call discover-abilities — the Ability should appear.
discover-abilitiesAbilitiesServiceProvider, or the service provider is not in config/app.php providers array.AbilityRegistry::register() in the service provider. Check that the provider is listed in config/app.php and is actually being booted. Claude Code caches discover-abilities — restart the editor after registration changes.execute() fails with "schema validation error"$schema definition. The MCP Adapter validates before calling your method.execute() method returns an object, resource, or value that cannot be JSON-serialized (e.g., a WP_Post object).array_map() and map each WP_Post to an associative array.references/schema.md.references/patterns.md.references/patterns.md.