본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #6193

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/woo-guard/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 코드가 최신 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

  1. Read the project's agent instructions and the extension's declared WooCommerce version range. Project conventions win on conflict.
  2. Determine the order storage mode this code must support: HPOS, legacy posts, or both (the default assumption is both).
  3. Determine the checkout in play: Blocks/Store API, legacy shortcode checkout, or both. Hooks for one do not fire in the other.
  4. Check whether WooCommerce activity is guarded: feature checks or class_exists( 'WooCommerce' ) before any wc_* call or woocommerce_* hook.

The Rules

Order and product data — must fix

  1. 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() with post_type => shop_order, and direct $wpdb joins on postmeta. These work on legacy stores and silently break on HPOS stores. Details: references/hpos-and-crud.md.

  2. 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 through wc_update_product_stock() semantics; order state changes through $order->update_status() — which fire the emails and hooks the store expects.

  3. Declare feature compatibility. Any extension touching orders declares HPOS compatibility (FeaturesUtil::declare_compatibility( 'custom_order_tables', … )); any extension touching checkout declares cart_checkout_blocks compatibility (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

  1. 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.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#6193
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬