/SKILL.md
WordPress performance optimization guidelines for plugin, theme, and custom code development. This skill should be used when writing, reviewing, or refactoring WordPress PHP code to ensure optimal performance patterns. Triggers on tasks involving WP_Query, database queries, caching, hooks, REST API, or WordPress theme/plugin development.
npx skillsauth add bartekmis/wordpress-performance-best-practises wordpress-performance-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive performance optimization guide for WordPress development, designed for AI agents and LLMs. Contains 34 rules across 8 categories, prioritized by impact to guide code review and generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Database Optimization | CRITICAL | db- |
| 2 | Caching Strategies | CRITICAL | cache- |
| 3 | Asset Management | HIGH | asset- |
| 4 | Theme Performance | HIGH | theme- |
| 5 | Plugin Architecture | MEDIUM-HIGH | plugin- |
| 6 | Media Optimization | MEDIUM | media- |
| 7 | API and AJAX | MEDIUM | api- |
| 8 | Advanced Patterns | LOW-MEDIUM | advanced- |
db-prepared-statements - Always use $wpdb->prepare() for queriesdb-avoid-post-not-in - Avoid post__not_in, filter in PHP insteaddb-use-wp-query - Use WP_Query/get_posts instead of direct DB queriesdb-limit-query-results - Never use posts_per_page => -1db-meta-query-indexing - Optimize meta queries, consider taxonomiesdb-fields-optimization - Use fields => 'ids' when only IDs neededcache-transients-proper-use - Use transients for external API callscache-object-cache - Use wp_cache_* with cache groupscache-remote-requests - Always cache wp_remote_get responsescache-invalidation - Implement precise, event-driven invalidationcache-fragment-caching - Cache expensive template fragmentsasset-proper-enqueue - Use wp_enqueue_script/style, never hardcodeasset-conditional-loading - Only load assets where neededasset-defer-async - Use defer/async for non-critical scriptsasset-dequeue-unused - Remove unused plugin assetsasset-minification - Minify assets, use critical CSStheme-avoid-queries-in-templates - Keep queries out of template filestheme-template-parts - Use get_template_part with data passingtheme-loop-optimization - Optimize loops, use meta/term cache primingtheme-hooks-placement - Use appropriate hook prioritiesplugin-conditional-loading - Load code only when neededplugin-autoloading - Use PSR-4 autoloadingplugin-activation-hooks - Use activation hooks for setup tasksplugin-hook-removal - Remove hooks properly with matching prioritymedia-responsive-images - Use srcset and sizes attributesmedia-lazy-loading - Lazy load below-fold, eager load LCPmedia-image-sizes - Define appropriate custom image sizesapi-rest-optimization - Optimize REST endpoints, add caching headersapi-admin-ajax - Use REST API for frontend, avoid admin-ajaxapi-nonce-validation - Implement proper nonce validationadvanced-autoload-optimization - Keep autoloaded options under 800KBadvanced-cron-optimization - Use system cron, batch long tasksadvanced-memory-management - Process in batches, clean up memoryadvanced-query-monitor - Profile before optimizingRead individual rule files for detailed explanations and code examples:
rules/db-prepared-statements.md
rules/cache-transients-proper-use.md
rules/_sections.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.