plugin-observer-recipes

plugin-observer-recipes is a skill for Claude Code, Codex from gabrielgts/magento-boost. It costs 22 tokens per session (552 once invoked), scanned A, original, MIT.

A decision guide for changing Magento 2 behavior, responding to events, replacing classes, or extending APIs. Magento 2 is an e-commerce software platform.

In plain words
What is it for?
Use it to decide between plugins, observers, preferences, and extension attributes, then generate starter configuration and PHP code.
Why use it?
It helps developers choose the appropriate change method instead of editing the wrong class or creating tightly connected code.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/gabrielgts/magento-boost/plugin-observer-recipes
Any agent
npx skills add gabrielgts/magento-boost --skill plugin-observer-recipes
Clone the repo
git clone --depth 1 https://github.com/gabrielgts/magento-boost

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 plugin-observer-recipes

README.md
[![agentmods](https://agentmods.dev/badge/skills/gabrielgts/magento-boost/plugin-observer-recipes.svg)](https://agentmods.dev/skills/gabrielgts/magento-boost/plugin-observer-recipes)
Your own site
<a href="https://agentmods.dev/skills/gabrielgts/magento-boost/plugin-observer-recipes"><img src="https://agentmods.dev/badge/skills/gabrielgts/magento-boost/plugin-observer-recipes.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 552 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00022 $0.00552
Opus 5 $0.00011 $0.00276
Sonnet 5 $0.00004 $0.00110
Haiku 4.5 $0.00002 $0.00055

Measured 5d ago against content hash 2b3a60ed5f6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plugin-observer-recipes 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 5d 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.

Resources/skills/plugin-observer-recipes/SKILL.md · 81 lines

How it starts

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

Skill: Plugin, Observer, and Preference Recipes

When to use

When a user asks to "intercept a method", "hook into X", "listen to an event", "extend class Y", or "modify the behavior of Z".

Decision guide

Goal Mechanism Reason
Modify method inputs or return value Plugin (before/after/around) Composable; multiple plugins can coexist
React to a business event Observer Decoupled; fire-and-forget
Replace the entire class Preference Last resort; use only when plugins cannot reach the target
Add new methods to an interface Extension attributes + extension_attributes.xml API-safe; does not break interfaces

Plugin boilerplate

etc/di.xml:

<type name="Magento\Catalog\Model\Product">
    <plugin name="{vendor}_{module}_product" type="{Vendor}\{Module}\Plugin\ProductPlugin" sortOrder="10"/>
</type>

Plugin/ProductPlugin.php:

<?php
declare(strict_types=1);
namespace {Vendor}\{Module}\Plugin;

class ProductPlugin
{
    public function afterGetName(\Magento\Catalog\Model\Product $subject, string $result): string
    {
        return $result . ' (modified)';
    }
}

Observer boilerplate

etc/frontend/events.xml:

<config>
    <event name="catalog_product_load_after">
        <observer name="{vendor}_{module}_product_load"
                  instance="{Vendor}\{Module}\Observer\AfterProductLoad"/>
    </event>
</config>

Observer/AfterProductLoad.php:

<?php
declare(strict_types=1);
namespace {Vendor}\{Module}\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class AfterProductLoad implements ObserverInterface
{
    public function execute(Observer $observer): void
    {
        $product = $observer->getEvent()->getProduct();
        // your logic here
    }
}

Notes

  • around plugins wrap the entire method call, including its own plugins below them. Use only when you must conditionally skip the original method.
  • Do not declare preferences for classes you do not own if a plugin can achieve the same result.
  • Observers cannot return values or modify arguments; they react to data via the event object.

Read the full file on GitHub · 81 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. 5d ago First seen · 81 lines · 22 tokens per session scan A 2b3a60ed5f6c

Subscribe to this mod's changes

plugin-observer-recipes is a skill published in the GitHub repository gabrielgts/magento-boost (9 stars, last pushed 3mo ago), licensed MIT. It adds 22 tokens to every session and 552 once invoked, about $0.0001 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-31.

Related

Other skills, from other repositories

nemoclaw-contributor-implement-issue

Implement an accepted NemoClaw GitHub issue in the current checkout. Use when a user asks to pick up an issue for implementation, implement or fix a named issue, or add the issue's tests. Confirm accepted scope, deliver the smallest independently valuable capability slice, and record validation and remaining gates…

NVIDIA/NemoClaw · 134 tokens

amazon-reviews-api-skill

This skill helps users automatically extract Amazon product reviews via the Amazon Reviews API. Agent should proactively apply this skill when users express needs like getting reviews for Amazon product with ASIN B07TS6R1SF, analyzing customer feedback for a specific Amazon item, getting ratings and comments for a…

browser-act/skills · 124 tokens

amazon-competitor-analyzer

Scrapes Amazon product data from ASINs using browseract.com automation API and performs surgical competitive analysis. Compares specifications, pricing, review quality, and visual strategies to identify competitor moats and vulnerabilities.

browser-act/skills · 48 tokens

shopify-functions

Shopify Functions allow developers to customize the backend logic that powers parts of Shopify. Available APIs: Discount, Cart and Checkout Validation, Cart Transform, Pickup Point Delivery Option Generator, Delivery Customization, Fulfillment Constraints, Local Pickup Delivery Option Generator, Order Routing Location…

Shopify/Shopify-AI-Toolkit · 61 tokens

food-order

Reorder previous Foodora orders, preview cart contents, and track delivery ETA/status with ordercli. Use when the user wants to reorder food, check delivery status, or browse recent Foodora order history. Never confirm an order without explicit user approval.

Bitterbot-AI/bitterbot-desktop · 53 tokens

product-description-generator

E-commerce product description generator for any platform. Generates optimized titles, bullet points, descriptions, and backend keywords using competitor research + keyword scoring + FABE copywriting. Two modes: (A) Create — generate listing from product specs with optional competitor analysis, (B) Optimize — improve…

nexscope-ai/eCommerce-Skills · 126 tokens