magento-observer

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

A guide for making Magento 2 react to events, such as saving a product or placing an order, through separate observer classes.

In plain words
What is it for?
Use it to connect events in events.xml, receive their data, run custom actions, and decide when an observer is more suitable than a plugin.
Why use it?
It lets you add behaviour around Magento actions without editing the platform's core code.

Skill for Claude CodeCodex

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

Good fit Use it to connect events in events.xml, receive their data, run custom actions, and decide when an observer is more suitable than a plugin.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furan917/magento-ai-toolkit/magento-observer
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-observer
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-observer

README.md
[![agentmods](https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-observer/github.svg)](https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-observer)
Your own site
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-observer"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-observer/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-observer

Your own site · 80×15
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-observer"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-observer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,607 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.00032 $0.01607
Opus 5 $0.00016 $0.00804
Sonnet 5 $0.00006 $0.00321
Haiku 4.5 $0.00003 $0.00161

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

Security

Grade A, and why

magento-observer 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 11d 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-observer/SKILL.md · 199 lines

How it starts

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

Skill: magento-observer

Purpose: Create Magento 2 event observers to react to system events without modifying core code. Compatible with: Any LLM (Claude, GPT, Gemini, local models) Usage: Paste this file as a system prompt, then describe the event you want to observe and what you want to do.


System Prompt

You are a Magento 2 event/observer specialist. You wire observers to events using events.xml and implement ObserverInterface. You know the common events and their data payloads, when to prefer observers over plugins, and how to dispatch custom events.


Observer Declaration — etc/events.xml

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

    <event name="sales_order_place_after">
        <observer name="vendor_module_order_place_after"
                  instance="Vendor\Module\Observer\OrderPlaceAfter"
                  disabled="false"
                  shared="false"/>
    </event>

</config>

Scope: Place events.xml in the correct area:

  • etc/events.xml — all areas
  • etc/frontend/events.xml — frontend only
  • etc/adminhtml/events.xml — admin only

shared="false" creates a new instance per dispatch (recommended for observers that store state).


Observer Class — Observer/OrderPlaceAfter.php

<?php
declare(strict_types=1);

namespace Vendor\Module\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Sales\Model\Order;
use Psr\Log\LoggerInterface;

class OrderPlaceAfter implements ObserverInterface
{
    public function __construct(
        private readonly LoggerInterface $logger
    ) {
    }

    public function execute(Observer $observer): void
    {
        /** @var Order $order */
        $order = $observer->getEvent()->getData('order');

        if (!$order) {
            return;
        }

        $this->logger->info(sprintf(
            'Order placed: #%s, Total: %s',
            $order->getIncrementId(),
            $order->getGrandTotal()
        ));

        // Your logic here
    }
}

Read the full file on GitHub · 199 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. 11d ago First seen · 199 lines · 32 tokens per session scan A a900fa223fc7

Subscribe to this mod's changes

magento-observer is a skill published in the GitHub repository furan917/magento-ai-toolkit (34 stars, last pushed 4mo ago), licensed MPL-2.0. It adds 32 tokens to every session and 1,607 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

magento-module-development

Build custom Magento 2 modules using dependency injection, plugins, observers, and service contracts to extend core functionality cleanly.

finsilabs/awesome-ecommerce-skills · 28 tokens

magento-cronjob-developer

Implements scheduled tasks and background processing for Magento 2. Use when creating cron jobs, scheduling automated tasks, implementing background processing, or automating system operations. Masters cron configuration, job scheduling, error handling, and performance optimization.

maxnorm/magento2-agent-skills · 54 tokens

magento-module-developer

Creates robust, maintainable, and extensible Magento 2 modules following enterprise architecture patterns. Use when developing custom modules, implementing new functionality, creating extensions, or building Magento 2 components. Masters dependency injection, service contracts, repository patterns, and module…

maxnorm/magento2-agent-skills · 58 tokens

magento-api-developer

Designs and implements REST and GraphQL APIs for Magento 2. Use when developing APIs, creating service contracts, building headless commerce solutions, or integrating with external systems. Masters service contracts, data transfer objects, authentication, and enterprise-grade API architecture.

maxnorm/magento2-agent-skills · 57 tokens

magento-feature-developer

Implements business requirements as scalable, maintainable Magento 2 features. Use when developing custom functionality, implementing business logic, creating integrations, or building complex features. Masters service contracts, repository patterns, and enterprise-grade feature implementation.

maxnorm/magento2-agent-skills · 51 tokens