From magento2-commerce
Implements Magento 2 plugins (interceptors) with before, after, and around methods to modify class behavior without inheritance. Use for extending core or third-party modules.
How this skill is triggered — by the user, by Claude, or both
Slash command
/magento2-commerce:magento-plugins-interceptorsThis 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**: Fetch `https://developer.adobe.com/commerce/php/development/components/plugins/` for the official plugins guide with exact method signatures and limitations.
Fetch live docs: Fetch https://developer.adobe.com/commerce/php/development/components/plugins/ for the official plugins guide with exact method signatures and limitations.
Plugins intercept public method calls on any non-final class, allowing you to modify arguments, return values, or wrap entire method execution — without modifying the original class or using inheritance.
| Type | Method Prefix | Purpose | Receives |
|---|---|---|---|
| Before | before<MethodName> | Modify input arguments | Subject + original args |
| After | after<MethodName> | Modify return value | Subject + result (+ original args) |
| Around | around<MethodName> | Wrap entire execution | Subject + $proceed callable + original args |
beforeOriginalMethod($subject, $arg1, $arg2, ...)null to keep originalsafterOriginalMethod($subject, $result, ...$args)$resultaroundOriginalMethod($subject, callable $proceed, $arg1, $arg2, ...)$proceed($arg1, $arg2) to invoke the original (or skip it)Plugins are declared as children of a <type> element:
name — unique plugin identifiertype — fully qualified plugin class namesortOrder — execution priority (lower runs first)disabled — true to disable$proceed code$proceed)$proceed codefinal classes or final methods__construct() (constructor)static methodsprotected, private)Place plugin classes in the Plugin/ directory of your module:
VendorName/ModuleName/Plugin/SomePlugin.php
$proceed in around plugins unless intentionally skippingFetch the plugins documentation for exact method signatures, the latest limitations list, and any changes in recent Magento versions before implementing.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin magento2-commerceCreates Marko plugins — classes that intercept method arguments or return values via #[Before] and #[After] attributes, without subclassing. Auto-discovered from src/.
Configures Magento 2 dependency injection via di.xml: types, virtual types, preferences, argument replacement, Object Manager. Use for wiring dependencies, class variations, module integrations.
Guides Moodle plugin development: version.php, DB install/upgrade, capabilities, web services, PSR-4 autoloading, hooks, settings, privacy provider, and coding standards.