magento-plugin

magento-plugin is a skill for Claude Code, Codex from furan917/magento-ai-toolkit. It costs 40 tokens per session (1,633 once invoked), scanned A, original, MPL-2.0.

A guide for Magento 2 plugins, which let custom code run before, after, or around a method without changing the original vendor code. Vendor code is code supplied by Magento or another package.

In plain words
What is it for?
Use it to alter method inputs or return values, add behavior around existing methods, and handle conflicts when several plugins affect the same method.
Why use it?
It helps change existing behavior while keeping third-party files untouched, making upgrades safer. It also helps choose the least intrusive way to intercept a method.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to alter method inputs or return values, add behavior around existing methods, and handle conflicts when several plugins affect the same method.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furan917/magento-ai-toolkit/magento-plugin
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add furan917/magento-ai-toolkit --skill magento-plugin
Clone the repo
git clone --depth 1 https://github.com/furan917/magento-ai-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for magento-plugin

README.md
[![agentmods](https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-plugin/github.svg)](https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-plugin)
Your own site
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-plugin"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-plugin/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for magento-plugin

Your own site · 80×15
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-plugin"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-plugin.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01633
Opus 5 $0.00020 $0.00816
Sonnet 5 $0.00008 $0.00327
Haiku 4.5 $0.00004 $0.00163

Measured 9d ago against content hash bdd167acf623, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

magento-plugin scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/magento-plugin/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="Magento\Catalog\Model\Product">
        <plugin name="vendor_module_product_plugin"
                type="Vendor\Module\Plugin\ProductPlugin"
                sortOrder="10"
                disabled="false"/>
    </type>

</config>

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

<?php
declare(strict_types=1);

namespace Vendor\Module\Plugin;

use Magento\Catalog\Model\Product;

class ProductPlugin
{
    /**
     * BEFORE: modify input arguments
     * Return array of modified arguments, or null to leave unchanged
     */
    public function beforeSetName(Product $subject, string $name): array
    {
        return [trim($name)]; // return array of args in order
    }

    /**
     * AFTER: modify the return value
     * $result is whatever the original method returned
     */
    public function afterGetName(Product $subject, string $result): string
    {
        return strtoupper($result);
    }

    /**
     * AROUND: full control — call $proceed() to invoke the original
     * Use sparingly — performance impact, breaks chain if $proceed not called
     */
    public function aroundSave(
        Product $subject,
        callable $proceed,
        ...$args
    ): Product {
        // Logic before original
        $result = $proceed(...$args); // calls original (or next plugin in chain)
        // Logic after original
        return $result;
    }
}

Read the full file on GitHub · 219 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 219 lines · 40 tokens per session scan A bdd167acf623

Subscribe to this mod's changes

magento-plugin is a skill published in the GitHub repository furan917/magento-ai-toolkit (34 stars, last pushed 4mo ago), licensed MPL-2.0. It adds 40 tokens to every session and 1,633 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

magento2-backend-dev

This skill should be used when the user asks to "create an API endpoint", "build a REST API", "add a GraphQL resolver", "create a CLI command", "add a cron job", "set up a message queue", "implement a web API", "add a SOAP service", or "create a data provider". Covers Magento 2 backend development: REST/SOAP/GraphQL…

ddtcorex/maestro-skills · 114 tokens

magento2-dev-core

This skill should be used when the user is creating new Magento 2 modules or customizations, implementing features following Magento architecture, working with Dependency Injection, Repositories, or Plugins, writing secure Magento code, or building backend logic, CLI commands, or cron jobs. Foundation skill for…

ddtcorex/maestro-skills · 89 tokens

magento2-frontend-dev

This skill should be used when the user asks to "create a Knockout.js component", "add a UI Component", "modify layout XML", "customize a template", "write LESS CSS", "style with the Magento UI library", "add a RequireJS module", "extend JavaScript", "customize checkout", or "modify the cart page". Covers Magento 2…

ddtcorex/maestro-skills · 110 tokens

govard-magento

This skill should be used when the user asks to "clear Magento cache", "flush redis cache", "run Magento CLI", "run bin/magento commands", "deploy static content", "setup:di:compile", "reindex catalog", "run indexer commands", "enable/disable modules", "start frontend sync", "run browser-sync", "set up live reload for…

ddtcorex/maestro-skills · 116 tokens

magento2-code-review

This skill should be used when the user asks to "review this PR/MR", "review this merge request", "review this module", "audit this module before merge", "review this theme", "audit this theme PR", or wants a "full review before release". Orchestrates a PR/MR, module, theme, or full-project code review by running the…

ddtcorex/maestro-skills · 181 tokens

magento2-security-scan

This skill should be used when the user asks to "run a security audit", "find vulnerabilities", "check for XSS", "check CSRF protection", "validate form security", "run a dependency audit", "check for outdated packages", "run a PCI compliance check", or "do a security review before deploy". Scans Magento 2 code for…

ddtcorex/maestro-skills · 105 tokens