# woocommerce-performance

Flags database and caching bottlenecks in WooCommerce PHP code. Useful when writing custom SQL queries or rendering catalog lists.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 325 installs · ★ 10568
- Author: woocommerce
- License: GPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/woocommerce/woocommerce/tree/HEAD/.ai/skills/woocommerce-performance/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/woocommerce-performance

## What it does

The skill inspects WooCommerce PHP code to catch database bottlenecks and missing cache warmups. It validates data retrieval logic. The guidelines assist during code reviews and while writing new routines for the product catalog.

The instructions focus on two areas. Cache priming covers post objects via `_prime_post_caches()` alongside non-autoloaded options using `wp_prime_option_caches()`. Query analysis flags repetitive database lookups, steering queries toward lookup tables like `wc_product_meta_lookup`.

The rule set targets WordPress database architecture directly. Skipping these checks causes MySQL to execute heavy table scans across unindexed postmeta records.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add woocommerce/woocommerce --skill woocommerce-performance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/woocommerce-performance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/woocommerce-performance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add woocommerce/woocommerce --skill woocommerce-performance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/woocommerce-performance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add woocommerce/woocommerce --skill woocommerce-performance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/woocommerce-performance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install woocommerce/woocommerce woocommerce-performance
```

2. **Manually: put the files in place**
- File: `.github/skills/woocommerce-performance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add woocommerce/woocommerce --skill woocommerce-performance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/woocommerce/woocommerce --path .ai/skills/woocommerce-performance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/woocommerce-performance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add woocommerce/woocommerce --skill woocommerce-performance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/woocommerce/woocommerce/tree/HEAD/.ai/skills/woocommerce-performance/SKILL.md

## When to use it
- prevent redundant SQL queries when loading products
- prime post caches using `_prime_post_caches()`
- batch load non-autoloaded options with `wp_prime_option_caches()`
- replace expensive `postmeta` joins with WooCommerce lookup tables

## Example prompts
- Review this WooCommerce order query method for missing cache priming
- Optimize this custom SQL query to use wc_product_meta_lookup instead of postmeta
- Check this options loop and add wp_prime_option_caches

## Similar
- [wordpress-performance-best-practices](https://affpapa.org/en/nevibecode/skills/wordpress-performance-best-practices.md) — skill · 708 installs
- [woocommerce-dev-cycle](https://affpapa.org/en/nevibecode/skills/woocommerce-dev-cycle.md) — skill · 361 installs
- [wp-performance](https://affpapa.org/en/nevibecode/skills/wp-performance.md) — skill · 6100 installs
- [woocommerce](https://affpapa.org/en/nevibecode/skills/alinaqi-woocommerce.md) — skill · 390 installs
- [WooCommerce Automation](https://affpapa.org/en/nevibecode/skills/woocommerce-automation.md) — skill · 4700 installs
- [woo-guard](https://affpapa.org/en/nevibecode/skills/woo-guard.md) — skill · 2500 installs

From the same set: [woocommerce/woocommerce](https://affpapa.org/en/nevibecode/by/woocommerce/woocommerce.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
