woo-guard
Что он делает
Этот агент проверяет, безопасен ли и актуален код для интернет-магазинов на WooCommerce. Он следит, чтобы код корректно работал с последними версиями WooCommerce, особенно в части оплаты, доставки и обработки заказов.
Когда использовать
- ✓Когда вы проверяете новый или изменённый код для магазина на WooCommerce.
- ✓Перед публикацией новой функции или обновления для магазина на WooCommerce.
- ✓Когда код работает с системой заказов, оплаты или оформления покупки.
Ссылка на скилл
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/woo-guard/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Проверь этот код, чтобы убедиться, что он совместим с последними версиями WooCommerce и соответствует лучшим практикам безопасности.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент анализирует код и проверяет, используются ли правильные функции для чтения и сохранения данных о заказах и товарах, а также выполняются ли проверки оплаты и оформления покупки на стороне сервера.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Woo Guard
You are reviewing generated or changed WooCommerce code before it ships. Apply the rules below as a guard pass after the first implementation pass. WooCommerce is a moving platform — order storage changed engines, checkout changed frameworks — and code written from memory targets the WooCommerce of three years ago. With money on the line, "works on my demo store" is not a standard.
These rules exist because AI agents produce WooCommerce code with systematic failures: order meta read through get_post_meta() (broken on HPOS stores), products updated by direct meta writes that skip lookup tables and hooks, checkout validated only in JavaScript, prices computed in floats, and woocommerce_* hooks registered before confirming WooCommerce is active.
When to Use
Use this skill when reviewing generated or changed WooCommerce code — extensions, payment and shipping integrations, checkout customizations, and order/product logic — before it ships. Activate it reactively after an agent writes or modifies WooCommerce hooks, HPOS logic, or checkout flows.
How to use this skill
Guard-pass mode (recommended): after WooCommerce code has been generated or edited, apply the rules to the diff or target files, then run the self-check before delivery.
Live mode (explicit): when the user invokes this skill before writing WooCommerce code, apply the same rules while writing, then run the self-check before delivery.
Review mode (the user asks you to review or audit WooCommerce code): walk references/review-checklist.md and produce a structured findings report. Do not edit code in review mode unless asked.
Security floor — these hold in all WooCommerce code, at maximum severity, because money is on the line:
- Escape all output with the context-correct
esc_*function. wp_unslash()then sanitize all request data before it touches logic.- Capability check plus nonce on every state change.
$wpdb->prepare()for every query containing a variable.
If wp-guard is installed, run it alongside for the full WordPress layer.
Adapt to the project first
- Read the project's agent instructions and the extension's declared WooCommerce version range. Project conventions win on conflict.
- Determine the order storage mode this code must support: HPOS, legacy posts, or both (the default assumption is both).
- Determine the checkout in play: Blocks/Store API, legacy shortcode checkout, or both. Hooks for one do not fire in the other.
- Check whether WooCommerce activity is guarded: feature checks or
class_exists( 'WooCommerce' )before anywc_*call orwoocommerce_*hook.
The Rules
Order and product data — must fix
Orders are not posts. Access orders only through the CRUD API:
wc_get_order(),wc_get_orders(),$order->get_meta(),$order->update_meta_data()+$order->save(). Forbidden on order data:get_post_meta(),update_post_meta(),WP_Query/get_posts()withpost_type => shop_order, and direct$wpdbjoins on postmeta. These work on legacy stores and silently break on HPOS stores. Details: references/hpos-and-crud.md.CRUD objects, getters/setters, then save. Products, customers, and coupons go through their CRUD objects (
wc_get_product(), setters,->save()). Direct meta writes skip lookup-table sync, skip the hooks other extensions rely on, and skip cache invalidation. Stock changes go throughwc_update_product_stock()semantics; order state changes through$order->update_status()— which fire the emails and hooks the store expects.Declare feature compatibility. Any extension touching orders declares HPOS compatibility (
FeaturesUtil::declare_compatibility( 'custom_order_tables', … )); any extension touching checkout declarescart_checkout_blockscompatibility (or incompatibility, honestly). A missing declaration shows every store owner a warning banner with your plugin's name on it.
Checkout and money — must fix
- Checkout validation is server-side. Validate at
woocommerce_checkout_process(legacy) or through Store API extension schemas (Blocks). JavaScript validation is UX, never security. Know which checkout the store runs and wire both when the extension claims general compatibility.
…
Частые вопросы
Почему не стоит использовать `get_post_meta()` для получения данных о заказах?
В новых версиях WooCommerce (HPOS) заказы больше не хранятся как обычные записи. Использование `get_post_meta()` может привести к тому, что код перестанет корректно работать в таких магазинах.
Что значит «проверять оформление покупки на стороне сервера»?
Это значит, что важные проверки, необходимые для завершения заказа (например, наличие товара на складе или данные об оплате), должны выполняться на сервере, а не только в браузере клиента. Это важно для безопасности.
Зачем коду объявлять совместимость с HPOS и блочным оформлением покупки?
Объявление совместимости сообщает WooCommerce и другим разработчикам, что ваш код протестирован и работает с новыми способами управления заказами (HPOS) и современной системой оформления покупки (блоки). Это помогает избежать предупреждений и проблем у владельца магазина.
Подробности
Оригинальное описание автора
Review generated or changed WooCommerce extensions, payment and shipping integrations, checkout customizations, and order or product logic.
Популярность
- Звёзды на GitHub
- 48k
- Место в рейтинге
- #6193
- Лицензия
- MIT
- Обновлён
- 15.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
00-andruia-consultant
48kПомогает агенту начинать или улучшать ИИ-проекты: анализирует код, подбирает инструменты и составляет план на испанском.
007
48kАгент проводит аудит безопасности и моделирование угроз для защиты проектов.
10-andruia-skill-smith
48kПомогает агенту создавать и улучшать ИИ-инструменты: описание работы, документация и проверка структуры.
20-andruia-niche-intelligence
48kАгент составляет обзор отрасли: контекст, правила, паттерны использования и риски по надёжным источникам.
Похожие скиллы
api-connector-builder
280kАгент создаёт новые подключения к API по существующему шаблону. Используйте, когда нужна ещё одна интеграция без нового способа делать то же самое.
api-design
280kПомогает агенту проектировать REST API по лучшим практикам: как API общаются, как показываются ошибки и как организовать данные.
backend-patterns
280kПомогает агенту с архитектурными паттернами серверной части и оптимизацией баз данных. Полезен при создании и проверке серверного кода.