magewire-best-practices

Enforce Magewire coding practices for Magento 2 component design and lifecycle hooks.

262|47|Updated Oct 8, 2021
One-click install
npx skills add https://github.com/magewirephp/magewire --skill magewire-best-practices
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: magewire-best-practices
Source: https://github.com/magewirephp/magewire/tree/main/.claude/skills/magewire-best-practices
Command: npx skills add https://github.com/magewirephp/magewire --skill magewire-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, repeatable guideline for writing, reviewing, and refactoring Magewire code in Magento 2 to improve consistency, security, and maintainability across projects.

Core Features & Use Cases

  • Establishes consistent component design, lifecycle hooks, templates, DI, and JS integration.
  • Guides code reviews and refactoring to enforce architecture decisions and avoid anti-patterns.
  • Serves as a reference when onboarding new Magewire developers on projects.

Quick Start

Review a Magewire component or feature and apply the best practices to ensure consistency and security.

Frequently Asked Questions about magewire-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for Magewire component design in Magento 2?▼

Magewire best practices enforce consistent component design, lifecycle hooks, templates, and dependency injection across Magento 2 projects to improve security and maintainability.

How do I review Magewire code for architecture and security issues?▼

Review Magewire code by checking component design, lifecycle hooks, serialization, and error handling against established architecture guides to avoid anti-patterns and ensure security.

Can I use Magewire best practices to onboard new Magento 2 developers?▼

Yes, these Magewire coding practices serve as a structured reference for onboarding new developers, guiding them on naming conventions, JavaScript integration, and performance standards.

What's the best way to standardize Magewire lifecycle hooks and templates?▼

Standardize Magewire lifecycle hooks and templates by applying consistent coding conventions during development and refactoring, ensuring alignment with Magewire architecture guides.

When should I refactor Magewire components to avoid anti-patterns?▼

Refactor Magewire components when code reviews reveal inconsistent naming, poor dependency injection, or non-standard JavaScript integration that violates established architecture decisions.