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.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin magento2-commerceThis skill is limited to using the following tools:
**Fetch live docs**: Fetch `https://developer.adobe.com/commerce/php/development/components/plugins/` for the official plugins guide with exact method signatures and limitations.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
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.