Back to Skills

woo-guard

Review generated or changed WooCommerce code — extensions, payment and shipping integrations, checkout customizations, and order/product logic — before it ships. Best used reactively after an agent writes, edits, or reviews code touching WooCommerce APIs: wc_get_order, wc_get_orders, wc_get_product, WC() cart or session, woocommerce_* hooks, Store API endpoints, payment gateways, order or product meta, HPOS, subscriptions, or bookings. Use on 'review this Woo plugin', 'is this HPOS compatible',

1,174stars137forksUpdated 8/17/2026

Security Assessment

Safe(95/100)
Security Score95/100

About woo-guard

Woo Guard is a defensive code-review skill that vets generated or changed WooCommerce code — extensions, payment and shipping integrations, checkout customizations, and order/product logic — before it ships. It exists because AI-generated WooCommerce code systematically targets an outdated platform: reading order meta through `get_post_meta()` (which breaks on High-Performance Order Storage), updating products via direct meta writes that skip lookup tables and hooks, validating checkout only in JavaScript, computing prices in floats, and registering hooks before confirming WooCommerce is active. With money on the line, the skill treats "works on my demo store" as insufficient.

It operates in three modes — a guard pass over a diff after code is written, a live mode while writing, and a review mode that walks a checklist to produce a structured findings report. Its rules enforce HPOS-safe order access through the CRUD API, CRUD objects and setters over direct meta writes, feature-compatibility declarations, server-side checkout validation across both the Blocks/Store API and legacy shortcode surfaces, disciplined money handling (`wc_format_decimal`, `wc_price`, integer minor units, webhook idempotency and signature verification), and hooks over template overrides. A security floor mandates output escaping, unslashing and sanitizing request data, capability-plus-nonce checks on state changes, and prepared database queries. Reference files cover HPOS/CRUD, checkout/money, a review checklist, and sources.

It targets WordPress/WooCommerce plugin developers and AI agents producing store code who need a compatibility and security safety net. This is defensive, security-conscious guidance — it hardens code rather than attacking anything.

FAQ

When should I use Woo Guard?

After an agent writes or edits WooCommerce code touching orders, products, checkout, payments, or hooks — as a guard pass on the diff — or when you explicitly ask for a review or audit of Woo code.

What is the main compatibility problem it catches?

Code that treats orders as posts (via `get_post_meta`/`WP_Query`), which silently breaks on High-Performance Order Storage; it pushes storage-agnostic CRUD access instead.

Does it edit my code?

In guard-pass and live modes it applies rules and fixes violations before delivery; in review mode it only reports findings and does not edit unless asked.

What about security?

It enforces a non-negotiable floor: escape output, unslash then sanitize request data, capability check plus nonce on every state change, and prepared statements for queries with variables — plus webhook signature verification and idempotency for gateways.

When is it not the right tool?

For plain WordPress code without WooCommerce APIs (use wp-guard), generic code quality, test review, or store configuration and admin-screen questions.

All Files

6 files
references/sources.md0.9 KB
View
references/checkout-and-money.md3.4 KB
View
references/hpos-and-crud.md3.8 KB
View
SKILL.md8.4 KB
View
agents/openai.yaml0.2 KB
View
references/review-checklist.md2.4 KB
View

Install woo-guard

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill