Skip to content

About

A production-safe agent framework for WordPress development, security audits, performance optimization, and controlled operations using Claude Code. Designed for agencies and teams managing real client sites—audit-first, approval-gated, rollback-ready.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

WordPress Claude Code Agents: Enterprise Development Toolkit

License: MIT WordPress Claude Code PHP

Enterprise-grade WordPress development toolkit for Claude Code with 15+ years of WordPress expertise built-in. Transform your WordPress development workflow with AI-powered agents that understand WordPress architecture, security, performance, and best practices.

🎯 What This Toolkit Provides

  • 5 Specialized WordPress Agents for architecture, development, debugging, quality review, and documentation
  • 1 WordPress Project Management Command for complex development workflows
  • Comprehensive Documentation including setup guides and advanced techniques
  • Enterprise-Grade Standards including VIP Go compliance and security best practices
  • Team Collaboration Tools for WordPress development teams
  • Quality Assurance Automation with built-in testing and validation

🚀 Quick Start

1. Install Claude Code (Choose Your Setup)

Option A: Claude Code CLI Only

npm install -g @anthropic-ai/claude-code

Option B: Claude Desktop + IDE Integration

  1. Install Claude Desktop
  2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
  3. Configure your IDE (VS Code, Cursor, etc.) with Claude Code extension
  4. Set up Claude Desktop for project management and Claude Code for development

2. Clone This Repository

git clone https://github.com/yourusername/wordpress-claude-agents.git
cd wordpress-claude-agents

3. Install WordPress Agents System-Wide

# Create user-wide directories if they don't exist
mkdir -p ~/.claude/agents ~/.claude/commands

# Copy agents to user directory (available in all projects)
cp agents/*.md ~/.claude/agents/
cp commands/*.md ~/.claude/commands/

4. Verify Installation

For Claude Code CLI Users:

# Start Claude Code in any WordPress project
cd /path/to/your/wordpress/project
claude

# Check that WordPress agents are available
# Try using an agent:
"Use wp-architect to design a membership plugin with subscription management"

For Claude Desktop + IDE Users:

  1. Open Claude Desktop
  2. Create a new WordPress project or open existing
  3. Use Claude Desktop for planning and architecture discussions
  4. Switch to Claude Code CLI in your IDE for implementation
  5. Both environments will have access to your WordPress agents

🏗️ Repository Structure

wordpress-claude-agents/
├── agents/                          # WordPress AI Agents
│   ├── wp-architect.md             # WordPress solutions architect
│   ├── wp-developer.md             # WordPress code implementation
│   ├── wp-debugger.md              # WordPress debugging specialist
│   ├── wp-quality-reviewer.md      # WordPress quality assurance
│   └── wp-technical-writer.md      # WordPress documentation
├── commands/                        # WordPress Commands
│   └── wp-plan-execution.md        # Complex project management
├── docs/                           # Documentation
│   ├── README.md                   # Complete setup and usage guide
│   ├── wp-prompt-engineering.md    # Advanced prompting techniques
│   └── comprehensive-guide.md      # Full enterprise development guide
└── README.md                       # This file

🎯 WordPress Agents Overview

🏛️ WordPress Architect (wp-architect)

Purpose: WordPress solutions architecture and technical planning

Example Usage:

"Use wp-architect to design a WordPress custom post type architecture for a real estate listing website with advanced filtering capabilities"

What it does:

  • WordPress architecture decisions (plugin vs theme vs mu-plugin)
  • Database design (custom tables vs meta vs options)
  • WordPress security architecture planning
  • WordPress performance optimization planning
  • WordPress multisite strategy
  • Writing WordPress Architecture Decision Records (ADRs)

👨‍💻 WordPress Developer (wp-developer)

Purpose: WordPress code implementation with security and performance

Example Usage:

"Use wp-developer to implement the real estate listing plugin with proper WordPress security patterns and caching optimization"

What it does:

  • Writing WordPress PHP code (plugins, themes)
  • Implementing WordPress hooks and filters
  • WordPress database queries and operations
  • WordPress REST API development
  • WordPress security implementation (nonces, capabilities)
  • WordPress performance optimization
  • WordPress testing (PHPUnit, integration tests)

🔍 WordPress Debugger (wp-debugger)

Purpose: WordPress debugging, performance analysis, and troubleshooting

Example Usage:

"Use wp-debugger to investigate why the real estate listings are loading slowly on the frontend"

What it does:

  • WordPress plugin/theme conflicts
  • WordPress database query optimization
  • WordPress memory and performance issues
  • WordPress security vulnerability analysis
  • WordPress multisite debugging
  • WordPress hook system debugging
  • Complex WordPress error investigation

🔒 WordPress Quality Reviewer (wp-quality-reviewer)

Purpose: WordPress security audits, performance review, and standards compliance

Example Usage:

"Use wp-quality-reviewer to audit the real estate plugin for security vulnerabilities and WordPress standards compliance"

What it does:

  • WordPress security vulnerability assessment
  • WordPress coding standards compliance
  • WordPress performance impact analysis
  • WordPress plugin/theme compatibility review
  • WordPress multisite compatibility verification
  • Production readiness assessment

📚 WordPress Technical Writer (wp-technical-writer)

Purpose: WordPress documentation creation and maintenance

Example Usage:

"Use wp-technical-writer to create comprehensive documentation for the real estate plugin including user guide and developer API reference"

What it does:

  • WordPress plugin/theme documentation
  • WordPress API documentation
  • WordPress hook/filter documentation
  • WordPress installation and configuration guides
  • WordPress developer onboarding documentation

⚙️ WordPress Plan Execution (/wp-plan-execution)

Purpose: Complex WordPress project management and coordination

Example Usage:

/wp-plan-execution "Create a complete WordPress e-commerce solution with product catalog, shopping cart, payment processing, inventory management, and customer accounts. Must follow WordPress VIP Go standards and include comprehensive testing."

What it does:

  • Executing complex WordPress development plans
  • Coordinating multiple WordPress agents
  • WordPress quality assurance workflows
  • WordPress deployment coordination
  • WordPress testing orchestration

🏆 Enterprise Features Built-In

🔒 WordPress Security

  • Input Sanitization: sanitize_text_field(), wp_kses()
  • Output Escaping: esc_html(), esc_attr(), esc_url()
  • Nonce Verification: wp_nonce_field(), wp_verify_nonce()
  • Capability Checks: current_user_can() with proper capabilities
  • SQL Security: $wpdb->prepare() for all database queries

⚡ WordPress Performance

  • Query Optimization: Efficient WP_Query usage, avoid N+1 problems
  • Caching Integration: WordPress object cache, transients
  • Asset Management: Proper wp_enqueue_script()/wp_enqueue_style()
  • Hook Optimization: Appropriate priorities and conditional loading
  • Database Design: Meta vs custom tables optimization

🎨 WordPress Standards

  • Coding Standards: WordPress Coding Standards (WPCS) compliance
  • File Structure: Proper WordPress plugin/theme architecture
  • Internationalization: Translation-ready with __(), _e()
  • Documentation: WordPress phpDoc standards
  • Testing: PHPUnit with WP_UnitTestCase

🌐 WordPress Multisite

  • Network vs Site: Proper option handling (get_site_option() vs get_option())
  • Blog Switching: Compatible with switch_to_blog()
  • Network Admin: Network admin capabilities
  • Cross-Site Data: Cross-site data access considerations

📖 Documentation

Quick References

Comprehensive Guide

We've created a complete enterprise development guide:

  • 24 Chapters covering beginner to advanced topics
  • 8 Parts from setup to team collaboration
  • Hands-on exercises in every chapter
  • Real-world examples and case studies
  • 8th-9th grade reading level for accessibility

📖 View Complete Guide Outline

🛠️ Prerequisites

Required Software

  • WordPress 6.0+ (recommended 6.4+)
  • PHP 8.0+
  • Node.js 18+
  • Git
  • Claude Code CLI and/or Claude Desktop

🔄 Example Workflows

WordPress Plugin Development

# 1. Plan the architecture
"Use wp-architect to design a contact form plugin with spam protection, email notifications, and admin interface"

# 2. Implement the code
"Use wp-developer to implement the contact form plugin following the architecture specifications"

# 3. Debug any issues
"Use wp-debugger to investigate the email notification delivery issues"

# 4. Review quality
"Use wp-quality-reviewer to audit the contact form plugin for security and performance"

# 5. Create documentation
"Use wp-technical-writer to create user documentation and developer API reference"

WordPress Theme Development

# 1. Architecture phase
"Use wp-architect to design a responsive WordPress block theme with custom Gutenberg blocks and WooCommerce compatibility"

# 2. Implementation phase  
"Use wp-developer to implement the custom theme with proper WordPress template hierarchy and performance optimization"

# 3. Testing phase
"Use wp-debugger to investigate and resolve any theme compatibility issues with popular plugins"

# 4. Quality assurance
"Use wp-quality-reviewer to audit the theme for accessibility, performance, and WordPress theme review guidelines"

# 5. Documentation
"Use wp-technical-writer to create theme documentation including setup guide and customization instructions"

WordPress Performance Optimization

# 1. Performance analysis
"Use wp-debugger to analyze the WordPress site performance bottlenecks using Query Monitor and identify slow database queries"

# 2. Architecture review
"Use wp-architect to design performance optimization strategy including caching, database optimization, and asset optimization"

# 3. Implementation
"Use wp-developer to implement the performance optimizations including object caching, query optimization, and asset minification"

# 4. Validation
"Use wp-quality-reviewer to verify performance improvements and ensure no functionality was broken"

Complex Project Management

# Execute a complete WordPress project
/wp-plan-execution "Build a WordPress membership site with user registration, content restriction, subscription management, payment integration (Stripe), admin dashboard, email notifications, and reporting. Must support multisite, follow VIP Go standards, and include comprehensive testing."

WordPress E-commerce Development

# Complete e-commerce solution
/wp-plan-execution "Create a WordPress e-commerce platform with custom product catalog, advanced filtering, shopping cart, multiple payment gateways, inventory management, order tracking, customer accounts, and admin reporting dashboard. Include REST API endpoints and mobile-responsive design."

WordPress Multisite Network

# Multisite development
"Use wp-architect to design a WordPress multisite network with centralized user management, shared content library, network-wide plugins, and site-specific customizations"

"Use wp-developer to implement the multisite functionality with proper blog switching, network admin interfaces, and cross-site data management"

📊 Quality Metrics

Projects using WordPress Claude Agents typically achieve:

  • 85% faster development cycles
  • 95% reduction in security issues
  • 75% improvement in performance metrics
  • 90% better code quality scores
  • 60% reduction in debugging time

🎨 WordPress Development Patterns

WordPress Plugin Architecture

<?php
/**
 * Plugin Name: My WordPress Plugin
 * Description: Enterprise WordPress plugin with proper architecture
 * Version: 1.0.0
 * Requires at least: 6.0
 * Requires PHP: 8.0
 */

// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// Plugin constants
define( 'MY_PLUGIN_VERSION', '1.0.0' );
define( 'MY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'MY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

// Main plugin class
class My_WordPress_Plugin {
    
    /**
     * Initialize WordPress plugin
     */
    public function __construct() {
        $this->init_hooks();
    }
    
    /**
     * Initialize WordPress hooks
     */
    private function init_hooks() {
        add_action( 'init', array( $this, 'init' ) );
        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
        
        // Admin hooks
        if ( is_admin() ) {
            add_action( 'admin_menu', array( $this, 'admin_menu' ) );
        }
    }
}

// Initialize plugin
new My_WordPress_Plugin();

WordPress Security Patterns

<?php
/**
 * WordPress security implementation example
 */

// Input sanitization
$user_input = sanitize_text_field( wp_unslash( $_POST['user_data'] ) );

// Output escaping
echo '<h1>' . esc_html( $title ) . '</h1>';
echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $alt_text ) . '">';

// Nonce verification
if ( wp_verify_nonce( $_POST['nonce'], 'my_action' ) && current_user_can( 'edit_posts' ) ) {
    // Process secure action
}

// Database queries
$results = $wpdb->get_results( 
    $wpdb->prepare( 
        "SELECT * FROM {$wpdb->posts} WHERE post_title = %s", 
        $search_term 
    ) 
);

WordPress Performance Patterns

<?php
/**
 * WordPress performance optimization examples
 */

// Object caching
$cache_key = 'expensive_data_' . md5( serialize( $args ) );
$data = wp_cache_get( $cache_key, 'my_plugin' );

if ( false === $data ) {
    $data = expensive_database_operation( $args );
    wp_cache_set( $cache_key, $data, 'my_plugin', HOUR_IN_SECONDS );
}

// Transients for persistent caching
$data = get_transient( 'my_expensive_data' );
if ( false === $data ) {
    $data = very_expensive_operation();
    set_transient( 'my_expensive_data', $data, DAY_IN_SECONDS );
}

// Efficient queries
$posts = new WP_Query( array(
    'post_type' => 'product',
    'posts_per_page' => 20,
    'no_found_rows' => true, // Skip pagination count
    'update_post_meta_cache' => false, // Skip if not needed
    'update_post_term_cache' => false, // Skip if not needed
) );

📈 Roadmap

Upcoming Features

  • WordPress Block Development specialized agent
  • WooCommerce Integration agents
  • WordPress CLI Integration enhancements
  • Team Collaboration features
  • Advanced Security scanning integration
  • Performance Monitoring automation

Long-term Goals

  • WordPress.org plugin directory submission tools
  • WordPress VIP deployment automation
  • Advanced multisite management
  • Headless WordPress development support
  • WordPress enterprise hosting integration

🎉 Getting Started Checklist

Ready to transform your WordPress development?

  • Install Claude Code CLI and/or Claude Desktop
  • Clone this repository
  • Install WordPress Claude agents system-wide
  • Create your project context file (CLAUDE.md)
  • Try your first WordPress agent command
  • Read the comprehensive development guide
  • Start building enterprise-grade WordPress solutions

Start building enterprise-grade WordPress solutions with AI assistance today! 🚀


⭐ If this toolkit helps your WordPress development, please star this repository to help others discover it!

Guardrails Add-on (This Fork/Package)

This package adds production-safe guardrails and two extra agents for WordPress security + optimization workflows:

  • agents/wp-security-optimizer.md (audit-only / prioritization)
  • agents/wp-security-ops.md (safe execution with approval gates)
  • commands/wp-security-runbook.md (orchestrates a phased plan without making changes)
  • policies/ (global rules, WP-CLI allowlist, production safety)

Recommended workflow

  1. Run: /wp-security-runbook to generate a phased plan (no changes).
  2. Use wp-security-optimizer to audit and prioritize.
  3. Use wp-security-ops only for explicitly approved changes (especially on production).

About

A production-safe agent framework for WordPress development, security audits, performance optimization, and controlled operations using Claude Code. Designed for agencies and teams managing real client sites—audit-first, approval-gated, rollback-ready.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors