npx skills add ...
npx skills add automattic/claude-woocommerce-toolkit --skill woocommerce-plugin-dev
npx skills add automattic/claude-woocommerce-toolkit --skill woocommerce-plugin-dev
Comprehensive WooCommerce plugin development skill that enforces WordPress and WooCommerce coding standards, security best practices, and end-to-end testing for every file created. Use this skill whenever the user wants to create, scaffold, build, or start a WooCommerce plugin, WooCommerce extension, or WordPress plugin that integrates with WooCommerce. Also trigger when the user mentions "WooCommerce plugin", "Woo extension", "WooCommerce add-on", "payment gateway plugin", "shipping method plugin", or any plugin that touches orders, products, carts, checkout, or the WooCommerce REST API. Even if the user just says "start a new plugin" in the context of a WooCommerce project, use this skill. This skill should be the first thing consulted before writing any code for a WooCommerce plugin project.
This skill ensures that every WooCommerce plugin you build meets professional, WooCommerce Marketplace-ready standards from day one. It covers architecture, coding standards, security, testing, and UX — drawing from the official WordPress Plugin Handbook, WooCommerce developer documentation, and fintech-grade security practices.
This skill operates in two phases:
Every coding decision, file structure choice, and architectural pattern is governed by the reference documents bundled with this skill. Read them before writing any code.
Before writing a single line of code, conduct a structured interview with the user. The goal is
to produce a PROJECT_BRIEF.md file that lives in the plugin's root directory and serves as the
single source of truth for all future development work.
Ask these questions conversationally, grouping related ones together. Don't dump them all at once — have a dialogue.
Market & Business Context:
Plugin Purpose & Scope:
Customer/User-Facing Features:
Admin/Merchant Features:
Technical Architecture:
Data & Compliance:
After the interview, compile all answers into a PROJECT_BRIEF.md file with this structure:
Save this file in the plugin root. Reference it before making any architectural decision.
Once the project brief is complete, follow these steps in order. For each step, consult the relevant reference file before proceeding.
Read references/plugin-architecture.md for the complete file structure template.
Every WooCommerce plugin follows this canonical structure:
The main plugin file (plugin-slug.php) must:
before_woocommerce_initplugins_loaded at an appropriate priorityRead references/coding-standards.md for PHP formatting rules and naming conventions.
For every class and function you write:
references/coding-standards.md — Follow WordPress PHP Coding Standards, use proper
naming conventions, document with PHPDoc blocksreferences/security.md — Sanitize all input, escape all output, verify nonces and
capabilities, use prepared statementswp_posts / wp_postmeta for orders; always use
WooCommerce CRUD methods and data storesRead references/testing.md for the complete testing strategy.
Every feature must have corresponding tests before it's considered complete:
For plugins that handle financial data, also include:
Set up GitHub Actions workflows that run:
references/marketplace-submission.md)These files contain detailed standards and patterns. Read the relevant file before working on that aspect of the plugin.
| File | When to Read |
|---|---|
references/coding-standards.md | Before writing any PHP, JS, CSS, or HTML |
references/security.md | Before handling any user input, database queries, or API calls |
references/testing.md | Before writing any test or configuring test infrastructure |
references/plugin-architecture.md | When scaffolding the plugin or adding new components |
references/woocommerce-apis.md | When integrating with WooCommerce data stores, hooks, or REST API |
references/ux-guidelines.md | When building admin UI, settings pages, or frontend components |
references/abilities-and-mcp.md | When exposing operations to AI agents (WordPress Abilities API + MCP) |
references/agentic-commerce.md | When the plugin should be discoverable or buyable by AI shopping agents |
references/pci-script-management.md | When the plugin handles payments (PCI DSS v4.0.1 payment-page scripts) |
references/marketplace-submission.md | Before submitting to the WooCommerce Marketplace or WordPress.org (QIT, distribution) |
These apply to every single file in the project, no exceptions:
HPOS compatibility is mandatory. Never use get_post_meta() / update_post_meta() for
order data. Use $order->get_meta() / $order->update_meta_data() and WooCommerce CRUD.
All user input is hostile. Sanitize on input (sanitize_text_field, absint,
sanitize_email, etc.), escape on output (esc_html, esc_attr, esc_url, wp_kses),
and use $wpdb->prepare() for all database queries.
Nonces and capability checks on every form and AJAX handler. No exceptions.
Every public function has a PHPDoc block. Include @since, @param, @return, and
@throws tags.
No direct database queries when WooCommerce or WordPress provides an API. Use data stores,
WC_Order, WC_Product, WP_Query, etc.
All strings are translatable. Use __(), _e(), esc_html__(), esc_attr__() with the
plugin's text domain.
Tests exist for every feature. No feature is complete without unit and integration tests. User-facing features also need E2E tests.
Prefix everything. All functions, classes, hooks, options, meta keys, and REST routes use the plugin's unique prefix to avoid conflicts.
Follow WordPress enqueue system. Never inline scripts or styles except when absolutely
necessary. Use wp_enqueue_script / wp_enqueue_style with proper dependencies.
Declare all WooCommerce feature compatibility. HPOS (custom_order_tables) and
Cart & Checkout Blocks (cart_checkout_blocks) — declare support for everything applicable via
before_woocommerce_init using FeaturesUtil::declare_compatibility(), and test thoroughly with
each feature enabled before declaring it. Do not declare product_block_editor: the block-based
Product Editor is being removed in WooCommerce 11.0 (build against the classic product editor).
plugin-slug/
├── plugin-slug.php # Main plugin file (bootstrap)
├── uninstall.php # Clean uninstall handler
├── readme.txt # WordPress.org readme
├── composer.json # PHP dependencies & autoloading
├── package.json # JS/CSS build tooling
├── phpcs.xml.dist # PHPCS configuration
├── phpunit.xml.dist # PHPUnit configuration
├── playwright.config.ts # Playwright E2E configuration
├── PROJECT_BRIEF.md # Project brief from Phase 1
├── .github/
│ └── workflows/
│ ├── ci.yml # Continuous integration
│ └── release.yml # Release automation
├── src/ # PSR-4 autoloaded PHP classes
│ ├── Plugin.php # Main plugin class
│ ├── Admin/ # Admin-only functionality
│ ├── Frontend/ # Frontend-only functionality
│ ├── API/ # REST API endpoints
│ ├── Data/ # Data stores and repositories
│ ├── Integrations/ # Third-party integrations
│ └── Utilities/ # Helper classes
├── includes/ # Legacy-style includes (if needed)
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
├── templates/ # Overridable templates
├── languages/ # Translation files
├── tests/
│ ├── Unit/ # PHPUnit unit tests
│ ├── Integration/ # PHPUnit integration tests
│ ├── E2E/ # Playwright end-to-end tests
│ └── bootstrap.php # Test bootstrap
└── vendor/ # Composer dependencies (gitignored)