get_magento_pattern
Retrieve Magento 2 coding patterns and examples for specific tasks, showing correct implementations and common pitfalls to avoid.
Instructions
Get the correct Magento 2 way to accomplish a task. Returns the proper pattern, code example, and what to avoid. Use this for "vibe coding" - writing Magento-compliant code naturally.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The task you want to accomplish (e.g., "read a file", "escape HTML", "validate email", "create viewmodel") |