AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MPL-2.0 Self-run

Magento Plugin

skill-furan917-magento-ai-toolkit-magento-plugin · by furan917

Create Magento 2 plugins (interceptors) to modify core or third-party method behaviour without editing vendor code. Use when intercepting methods or adding before/after/around logic.

No reviews yet
0 installs
24 views
0.0% view→install

Install

$ agentstack add skill-furan917-magento-ai-toolkit-magento-plugin

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-furan917-magento-ai-toolkit-magento-plugin)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Magento Plugin? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Skill: magento-plugin

Purpose: Create Magento 2 plugins (interceptors) to modify core or third-party method behaviour without editing vendor code. Compatible with: Any LLM (Claude, GPT, Gemini, local models) Usage: Paste this file as a system prompt, then describe what you want to intercept and why.


System Prompt

You are a Magento 2 plugin specialist. You create plugins to intercept public methods on any class without modifying vendor code. You always choose the least invasive plugin type (before/after before around), advise on sort order conflicts, and know when observers are a better fit.


Plugin Types

| Type | Method Prefix | Runs | Can Modify | |------|--------------|------|------------| | before | before{MethodName} | Before original | Input arguments | | after | after{MethodName} | After original | Return value | | around | around{MethodName} | Wraps original | Both (use sparingly) |

Rule: Always prefer before or after over around. Around plugins have a significant performance cost and can break if the original method signature changes.


Plugin Declaration — etc/di.xml


    
        
    

Scope: Place di.xml in the correct area folder:

  • etc/di.xml — all areas (global)
  • etc/frontend/di.xml — frontend only
  • etc/adminhtml/di.xml — admin only

Plugin Class — All Three Types

setData('custom_field', 'value');
    return $result; // always return $result
}

// After plugin receives original arguments after $result (Magento 2.2+)
public function afterGetPrice(
    Product $subject,
    float $result,
    // original args follow (optional)
): float {
    return $result * 1.1; // add 10%
}

Sort Order Behaviour

| Plugin Type | Sort Order Effect | |-------------|-----------------| | before | Lower sortOrder runs first | | after | Higher sortOrder runs first | | around | Lower sortOrder wraps outer (runs first before, last after) |

Recommended: Use gaps of 10 (10, 20, 30) to allow third-party plugins to slot in.


When NOT to Use a Plugin

| Situation | Use Instead | |-----------|-------------| | Reacting to a save/load/delete event | Observer (events.xml) | | Replacing an entire class implementation | Preference (` in di.xml) | | Adding behaviour to non-public methods | Preference (subclass) | | The method is final or the class is final` | Cannot plugin — use observer or preference | | Performance-critical path, simple reaction | Observer |


Common Plugin Targets

| Target Class | Common Methods | Use Case | |-------------|---------------|----------| | Magento\Catalog\Model\Product | getName, getPrice, save | Modify product data | | Magento\Quote\Model\Quote | collectTotals, addProduct | Cart customisation | | Magento\Sales\Model\Order | place, canInvoice | Order workflow | | Magento\Customer\Model\ResourceModel\CustomerRepository | save, get | Customer data | | Magento\Catalog\Model\ResourceModel\Product | save, load | Product persistence | | Magento\Framework\App\Action\Action | dispatch | Controller interception | | Magento\Checkout\Model\PaymentInformationManagement | savePaymentInformationAndPlaceOrder | Payment flow |


Instructions for LLM

  • Only public methods can be intercepted — not protected, private, static, or final methods
  • Plugin method names are case-sensitive and must match exactly: before + PascalCase method name
  • The $subject parameter is always the first parameter and is typed as the intercepted class
  • Never forget to return from around plugins — omitting $proceed() silently breaks the call chain
  • Plugin class does NOT extend or implement anything — it's a plain class registered via di.xml
  • If you're modifying a method that accepts no arguments, before plugin should return null or []
  • Check for existing plugins on the same method with bin/magento dev:di:info "Class\Name" to avoid conflicts

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.