/magento2-commerce:magento-difrom magento2-commerce
Configure Magento 2 dependency injection — di.xml, types, virtual types, preferences, argument replacement, and Object Manager. Use when wiring dependencies, creating class variations, or configuring module integrations.
Ships in magento2-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
site:developer.adobe.com commerce php development components dependency-injection for the DI guidehttps://developer.adobe.com/commerce/php/development/ and navigate to DI documentationsite:developer.adobe.com commerce php development build di-xml for di.xml referenceMagento's Object Manager reads di.xml configurations and automatically injects dependencies into class constructors. You declare what you need; the framework provides it.
Constructor injection is the primary pattern — declare dependencies as constructor parameters with type hints.
di.xml files are area-scoped:
etc/di.xml — global (all areas)etc/frontend/di.xml — storefront onlyetc/adminhtml/di.xml — admin panel onlyetc/webapi_rest/di.xml — REST API onlyetc/webapi_soap/di.xml — SOAP API onlyConfigure constructor arguments for a specific class:
string, boolean, number, const, null, object, array, init_parameterCreate class variations without writing new PHP files:
type attribute value)Map an interface to a concrete implementation:
<preference for="InterfaceName" type="ConcreteClassName" />| Type | Description |
|---|---|
string | String value |
boolean | true or false |
number | Integer or float |
const | PHP constant value |
null | Null value |
object | Another class instance (injected) |
array | Array of mixed argument types |
init_parameter | Value from Magento\Framework\App\DeploymentConfig |
shared="false" on a type to get a new instance each timeSomeClassFactory) always create new instancesinit_parameter type reads from app/etc/env.php — use for environment-specific values that shouldn't be in di.xml.
shared="false" sparingly — most dependencies should be sharedFetch the DI documentation for exact XML schema, element attributes, and current best practices before configuring.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
19 skills in this plugin
/magento-admin-uiBuild Magento 2 admin interfaces — UI component grids, forms, system configuration, ACL, and admin controllers. Use when creating admin panels, data grids, edit forms, or system settings./magento-apiBuild Magento 2 REST and GraphQL APIs — webapi.xml, schema.graphqls, resolvers, authentication, and ACL. Use when creating custom API endpoints, extending the GraphQL schema, or integrating external systems./magento-catalogWork with Magento 2 catalog — product types, categories, attributes, indexing, and search integration. Use when building catalog features, customizing product types, or working with the catalog architecture.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin magento2-commerceOther plugins' skills for the same job