WordPress development mastery - themes, plugins, Gutenberg blocks, and REST API
Provides expert WordPress development guidance for themes, plugins, Gutenberg blocks, and REST API. Activates when you're building WordPress projects or asking about hooks, security practices, or modern 6.x features.
/plugin marketplace add pluginagentmarketplace/custom-plugin-php/plugin install php-assistant@pluginagentmarketplace-phpThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyAtomic skill for mastering WordPress theme and plugin development
Comprehensive skill for building WordPress themes, plugins, and Gutenberg blocks. Covers WordPress 6.x with focus on modern development practices and security.
interface SkillParams {
topic:
| "themes" // Classic, block, FSE
| "plugins" // Architecture, hooks, settings
| "gutenberg" // Blocks, patterns, InnerBlocks
| "rest-api" // Custom endpoints, authentication
| "security" // Nonces, sanitization, escaping
| "woocommerce"; // Store extensions
level: "beginner" | "intermediate" | "advanced";
wp_version?: "6.4" | "6.5" | "6.6" | "6.7";
theme_type?: "classic" | "block" | "hybrid";
}
validation:
topic:
required: true
allowed: [themes, plugins, gutenberg, rest-api, security, woocommerce]
level:
required: true
wp_version:
default: "6.6"
beginner:
- Theme structure and files
- Template hierarchy
- Enqueuing styles/scripts
intermediate:
- Custom post types
- Theme customizer
- Block theme basics
advanced:
- Full Site Editing
- theme.json deep dive
- Performance optimization
beginner:
- Plugin structure
- Actions and filters
- Shortcodes
intermediate:
- Settings API
- Custom database tables
- AJAX handling
advanced:
- Plugin architecture patterns
- WP-CLI commands
- Multisite support
beginner:
- Block basics and block.json
- Edit and save functions
- Block attributes
intermediate:
- InnerBlocks
- Block variations
- Server-side rendering
advanced:
- Interactivity API
- Block Bindings
- Custom block categories
errors:
HOOK_ERROR:
code: "WP_001"
recovery: "Check hook name and timing"
SECURITY_ERROR:
code: "WP_002"
recovery: "Add proper escaping/sanitization"
retry:
max_attempts: 3
backoff:
type: exponential
initial_delay_ms: 100
<?php
/**
* Plugin Name: My Custom Plugin
* Description: A custom WordPress plugin
* Version: 1.0.0
* Requires PHP: 8.0
* Author: Developer
*/
declare(strict_types=1);
defined('ABSPATH') || exit;
final class MyCustomPlugin
{
public function __construct()
{
add_action('init', [$this, 'registerPostType']);
add_action('rest_api_init', [$this, 'registerRoutes']);
}
public function registerPostType(): void
{
register_post_type('portfolio', [
'labels' => ['name' => __('Portfolio')],
'public' => true,
'show_in_rest' => true,
'supports' => ['title', 'editor', 'thumbnail'],
]);
}
public function registerRoutes(): void
{
register_rest_route('myplugin/v1', '/items', [
'methods' => 'GET',
'callback' => [$this, 'getItems'],
'permission_callback' => '__return_true',
]);
}
public function getItems(\WP_REST_Request $request): \WP_REST_Response
{
$items = get_posts(['post_type' => 'portfolio']);
return new \WP_REST_Response($items, 200);
}
}
new MyCustomPlugin();
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "myplugin/testimonial",
"title": "Testimonial",
"category": "widgets",
"icon": "format-quote",
"description": "Display a testimonial",
"supports": {
"html": false,
"align": ["wide", "full"]
},
"attributes": {
"content": { "type": "string" },
"author": { "type": "string" }
},
"textdomain": "myplugin",
"editorScript": "file:./index.js",
"style": "file:./style-index.css"
}
<?php
// Input sanitization
$title = sanitize_text_field($_POST['title'] ?? '');
$content = wp_kses_post($_POST['content'] ?? '');
$id = absint($_POST['id'] ?? 0);
// Output escaping
echo esc_html($title);
echo esc_attr($attribute);
echo esc_url($url);
echo wp_kses_post($content);
// Nonce verification
if (!wp_verify_nonce($_POST['_wpnonce'], 'my_action')) {
wp_die('Security check failed');
}
// Capability check
if (!current_user_can('edit_posts')) {
wp_die('Unauthorized');
}
// Database queries
global $wpdb;
$results = $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}custom_table WHERE id = %d",
$id
)
);
| Problem | Solution |
|---|---|
| Hook not firing | Check hook name spelling and timing |
| Block not appearing | Verify block.json, run npm build |
| REST API 403 | Check permission_callback |
| White screen | Enable WP_DEBUG, check error.log |
// wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
| Metric | Target |
|---|---|
| Security compliance | 100% |
| Hook correctness | 100% |
| WPCS compliance | 100% |
Skill("php-wordpress", {topic: "gutenberg", level: "intermediate"})
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.