Help us improve
Share bugs, ideas, or general feedback.
From woocommerce-commerce
Creates WooCommerce plugins with file structure, headers, activation/deactivation hooks, custom DB tables via dbDelta, and Composer PSR-4 autoloading. Use for new extensions.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/woocommerce-commerce:woo-plugin-devThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Sets up WooCommerce local dev environments with wp-env, Docker Compose, or WP-CLI. Installs WooCommerce, checks requirements, scaffolds plugins, and runs essential commands.
Adds or modifies WooCommerce backend PHP code following project conventions for classes, methods, hooks, dependency injection, data integrity, and unit tests.
Builds custom WordPress themes, plugins, Gutenberg blocks, and WooCommerce stores with security hardening and performance optimization.
Share bugs, ideas, or general feedback.
Fetch live docs:
https://developer.wordpress.org/plugins/ for WordPress Plugin Handbookhttps://developer.woocommerce.com/docs/extension-guidelines/ for WooCommerce extension guidelinessite:developer.woocommerce.com extension development best practices for current patterns<?php
/**
* Plugin Name: My WooCommerce Extension
* Plugin URI: https://example.com/my-extension
* Description: A WooCommerce extension that does X.
* Version: 1.0.0
* Author: Your Name
* Author URI: https://example.com
* License: GPL-2.0-or-later
* Text Domain: my-woo-extension
* Domain Path: /languages
* Requires at least: 6.4
* Requires PHP: 8.0
* Requires Plugins: woocommerce
* WC requires at least: 8.0
* WC tested up to: 9.5
*/
Every PHP file starts with: defined( 'ABSPATH' ) || exit;
Before initializing, verify WooCommerce is active:
class_exists( 'WooCommerce' ) in a plugins_loaded hookRequires Plugins: woocommerce header (WordPress 6.5+)register_activation_hook( __FILE__, 'my_plugin_activate' ) — runs on first activation:
dbDelta())add_option())register_deactivation_hook( __FILE__, 'my_plugin_deactivate' ) — runs when deactivated:
Use uninstall.php (preferred) or register_uninstall_hook():
$wpdb and dbDelta()Create tables on activation:
$wpdb->prefix for table name prefixdbDelta() from wp-admin/includes/upgrade.phpdbDelta() is idempotent — handles CREATE and ALTERConvention: {$wpdb->prefix}wc_my_extension_tablename
Standard approach for namespaced classes:
autoload.psr-4 in composer.jsonrequire __DIR__ . '/vendor/autoload.php' in main plugin fileMyVendor\MyExtension\Legacy approach: require_once individual files in an includes/ directory. Still common in WooCommerce core.
Common WooCommerce extension pattern:
instance() methodinit() method that registers all hooksmy_extension())For larger extensions, use a lightweight DI container or service provider pattern with constructor injection.
Use WooCommerce's FeaturesUtil to declare compatibility:
custom_order_tables — HPOS supportcart_checkout_blocks — Block checkout supportif ( 'value' === $var )if ( $condition )esc_html(), esc_attr(), esc_url(), wp_kses()sanitize_text_field(), absint(), wp_unslash()Requires Plugins: woocommerce header (WordPress 6.5+)__(), _e(), esc_html__()load_plugin_textdomain()wp_remote_get() vs curl)Fetch the WordPress Plugin Handbook and WooCommerce extension guidelines for exact patterns and current requirements before implementing.