Intelligent documentation system for the WordPress Abilities API...
Provide intelligent documentation retrieval for the WordPress Abilities API when building WordPress plugins and applications. The WordPress Abilities API provides a standardized framework for registering, discovering, and executing discrete units of functionality (abilities) in WordPress, with built-in support for REST API exposure, JavaScript client integration, permissions, validation, and extensibility.
This skill automatically fetches relevant documentation from bundled markdown files and provides context-aware routing to ensure users get the right information format for their query.
WordPress Abilities API Functions Mentioned:
WordPress Abilities API Terms:
File Context Detection:
Implementation Queries:
Route queries intelligently based on intent to provide the most useful documentation format:
Triggers:
Action:
references/getting-started/[guide].mdreferences/[api-type]/[topic].mdreferences/overview/intro.mdExample Query: "How do I register an ability with input validation?" Fetch:
references/getting-started/basic-usage.mdreferences/php-api/registering-abilities.mdreferences/php-api/error-handling.mdTriggers:
Action:
references/[api-type]/[topic].mdExample Query: "What parameters does wp_register_ability accept?" Fetch:
references/php-api/registering-abilities.md
Suggest: Using abilities, Categories, Error handling (same category)Triggers:
Action:
references/getting-started/installation.mdreferences/getting-started/basic-usage.mdreferences/overview/intro.md for contextExample Query: "I'm new to the Abilities API, how do I get started?" Fetch:
references/getting-started/installation.mdreferences/getting-started/basic-usage.mdreferences/overview/intro.mdTriggers:
Action:
references/README.md (contains categorized function/endpoint lists)Example Query: "What JavaScript functions are available for abilities?" Fetch:
references/README.mdreferences/javascript-client/overview.mdreferences/javascript-client/abilities.mdTriggers:
Action:
Example Query: "How do I register a PHP ability and execute it from JavaScript?" Fetch:
references/php-api/registering-abilities.mdreferences/javascript-client/abilities.mdreferences/rest-api/execution.mdTriggers:
Action:
Example Query: "Why am I getting a permission denied error?" Fetch:
references/php-api/error-handling.mdreferences/php-api/using-abilities.mdreferences/rest-api/execution.mdFetch Multiple Pages (2-4 total) When:
Fetch Single Page When:
Stop Fetching When:
After fetching documentation, always suggest 2-3 related topics using these category groupings:
Overview:
Getting Started:
PHP API:
JavaScript Client:
REST API:
Hooks:
Common Feature Pairings:
Suggest topics from:
Always include relevant code examples in responses:
PHP Registration:
wp_register_ability( 'my-plugin/get-site-info', array(
'label' => 'Get Site Information',
'description' => 'Returns basic site information',
'category' => 'my-plugin-site-management', // Dashes only
'execute_callback' => function( $input ) {
return array(
'name' => get_bloginfo( 'name' ),
'url' => get_site_url(),
);
},
'permission_callback' => function() {
return current_user_can( 'manage_options' );
},
'meta' => array(
'show_in_rest' => true, // Inside meta array
'mcp' => array(
'public' => true, // Required for MCP discovery
'type' => 'tool',
),
),
) );
JavaScript Execution:
import { executeAbility } from '@wordpress/abilities';
const result = await executeAbility( 'my-plugin/get-site-info', {
// input parameters
} );
REST API Call:
GET /wp-json/wp-abilities/v1/my-plugin/get-site-info/run
Prerequisites:
references/getting-started/installation.md for setupI've fetched the [Topic Name] documentation from the WordPress Abilities API.
**Quick Setup:**
[Include installation/setup if relevant to query]
[Full documentation content from file]
---
**Related Topics:**
- **[Topic 1]** - [Brief description of relationship]
- **[Topic 2]** - [Brief description of relationship]
- **[Topic 3]** - [Brief description of relationship]
**Code Example:**
[Include relevant code snippet if applicable]
This requires understanding multiple aspects of the Abilities API. I've fetched:
---
## [Topic 1 Name]
**Quick Setup:**
[Include setup code if relevant]
[Full content from file]
---
## [Topic 2 Name]
[Full content from file]
---
## [Topic 3 Name] (if needed)
[Full content from file]
---
**Integration Pattern:**
[2-3 sentences explaining how these concepts work together, referencing examples from the documentation]
**Related Topics:**
- **[Additional Topic]** - [Description]
- **[Tutorial/Guide]** - [Description]
**Complete Example:**
[Include comprehensive code example showing integration]
Code Examples from Documentation
Feature Integration Patterns
Best Practices from Docs
Setup and Configuration
Common Patterns
API Integration Guidance
All documentation is bundled in the skill at:
.claude/skills/wp-abilities-api/
├── SKILL.md (this file)
└── references/
├── INDEX.md (searchable keyword reference)
├── README.md (overview and quick reference)
├── overview/
│ └── intro.md
├── getting-started/
│ ├── installation.md
│ └── basic-usage.md
├── php-api/
│ ├── categories.md
│ ├── registering-abilities.md
│ ├── using-abilities.md
│ └── error-handling.md
├── javascript-client/
│ ├── overview.md
│ ├── abilities.md
│ ├── categories.md
│ ├── registration.md
│ └── error-handling.md
├── rest-api/
│ ├── overview.md
│ ├── abilities-endpoints.md
│ ├── categories-endpoints.md
│ └── execution.md
└── hooks/
├── actions.md
└── filters.md
.claude/skills/wp-abilities-api/references/php-api/[topic].md.claude/skills/wp-abilities-api/references/javascript-client/[topic].md.claude/skills/wp-abilities-api/references/rest-api/[topic].md.claude/skills/wp-abilities-api/references/getting-started/[topic].md.claude/skills/wp-abilities-api/references/hooks/[type].mdQuery: "How do I register an ability with input validation?"
Routing: Implementation query → Getting Started + PHP API
Process:
references/getting-started/basic-usage.mdreferences/php-api/registering-abilities.mdResponse includes:
Query: "What parameters does wp_register_ability accept?"
Routing: API reference query → PHP API only
Process:
references/php-api/registering-abilities.mdResponse includes:
Query: "I'm new to the Abilities API, how do I get started?"
Routing: General guidance → Getting started docs
Process:
references/overview/intro.mdreferences/getting-started/installation.mdreferences/getting-started/basic-usage.mdResponse includes:
Query: "How do I execute a PHP ability from JavaScript?"
Routing: Integration query → Multiple APIs
Process:
references/php-api/registering-abilities.md (show_in_rest)references/javascript-client/abilities.md (executeAbility)references/rest-api/execution.mdResponse includes:
Query: "Why am I getting a WP_Error when executing an ability?"
Routing: Troubleshooting → Error handling + Execution
Process:
references/php-api/error-handling.mdreferences/php-api/using-abilities.mdResponse includes:
Issue: Ability not found / "category must contain only lowercase alphanumeric characters and dashes"
Fix: Category slug uses slashes → Change to dashes only (my-plugin-content not my-plugin/content)
Issue: "Property 'show_in_rest' is not a valid property"
Fix: Move show_in_rest inside meta array, not top-level
Issue: Ability not discoverable via MCP
Fix: Add 'mcp' => array('public' => true) inside meta array
Issue: Output validation fails with "field is not of type X" when field is null
Fix: Use array type syntax to allow null: 'type' => array('object', 'null')
Issue: Enum validation fails when field value is empty string
Fix: Include empty string in enum: 'enum' => array('option1', 'option2', '')
Issue: GET request input param not being parsed correctly
Fix: Use array-style params (input[post_id]=1) instead of JSON string. POST with JSON body works normally.
Issue: ability_invalid_permissions error when testing via WP-CLI
Fix: Pass --user=admin flag to provide user context for permission checks
When integrating with external plugins, always check availability first:
'execute_callback' => function( $input ) {
if ( ! class_exists( 'PluginNamespace\Class' ) ) {
return new WP_Error( 'plugin_not_active', 'Required plugin not active', array( 'status' => 503 ) );
}
// Use plugin functionality
},
'meta' => array(
'show_in_rest' => true, // REST API exposure
'mcp' => array(
'public' => true, // MCP discoverability
'type' => 'tool', // 'tool', 'resource', or 'prompt'
),
),
Always mention:
plugin-name/ability-name (forward slash after prefix)plugin-name-category-name (dashes only, NO slashes)CRITICAL: Category slugs must use dashes only. Forward slashes cause validation errors.
Reference security when appropriate:
wp_abilities_api_init or init hookswp_abilities_api_categories_init for categoriesclass_exists( 'WP_Abilities_Registry' )REST API:
show_in_rest: true (inside meta array) to expose via REST APIMCP (Model Context Protocol):
mcp.public: true (inside meta array) to make discoverable by AI assistants'tool' (default), 'resource', 'prompt'mcp.public = true are exposed via MCP adapterFor every query:
Keep responses: