wcs-subscription-hooks
Installation
SKILL.md
WooCommerce Subscriptions: hook map
Use this when building or reviewing an integration that needs to react to WooCommerce Subscriptions events. This is not an exhaustive dump of the 800+ hook calls in the plugin. It is a decision map for the hooks that are usually correct and the older/noisy hooks that AI agents tend to choose incorrectly.
Misconception this skill corrects
"Subscriptions are just orders, so hook
woocommerce_order_status_changedor update_schedule_next_paymentmeta directly."
Subscriptions are WC_Subscription objects with their own lifecycle hooks, status transition hooks, date hooks, relation store, renewal order hooks, and scheduler bridge. Prefer WCS hooks and CRUD methods unless the task explicitly needs ordinary WC orders.
When to use this skill
Trigger when ANY of the following is true:
- The user asks for WooCommerce Subscriptions actions/filters, lifecycle hooks, renewal hooks, status hooks, payment retry hooks, switching hooks, or gifting hooks.
- You see
WC_Subscription,wcs_get_subscription(),wcs_create_subscription(),wcs_create_renewal_order(),woocommerce_scheduled_subscription_payment,wcs_renewal_order_created,payment_retry,wcsg_, orsubscription_switch. - You need to decide whether to hook at subscription creation, renewal order creation, gateway payment attempt, successful payment, failed payment, status change, or scheduled action time.