profile

M bytes

AI struggles with Magento's generated code (September at M.academy)


Hey Reader,

I spent most of the month of August refreshing the Crack the Claude Code course from scratch. Claude Code has changed so much over the past year, so this course needed to get updated along with it. All lessons will be new, and I am also reorganizing and writing out new lessons where it makes sense. You can see a few of the lessons from it below.

When working with the AI on Magento code, I often get a result back that doesn't look quite right, and I'm not sure why until I dig into the code. A good example of where it has been struggling is with writing code that doesn't take generated code into account. Sometimes it would inject the wrong dependency for what it was trying to build, and other times it would not know exactly how interceptors are generated.

You can't really catch any of this though unless you also understand how the DI process works with generated code.


Spend 16 minutes on this month's focus lessons from the Magento 2 Coding Kickstart course about Dependency Injection:

Dependency injection with Object Manager (free preview)

Incorrect way to create objects with new keyword (free preview)

Create a new object using Object Manager (free preview)

Create a singleton object with dependency injection

Interceptors with generated code

Map interfaces to concrete classes with XML


I also published some new lessons for the Crack the Claude Code refresh last month, starting with the basics and working up through CLAUDE.md files, permission modes, and configuration hierarchy.

Start Crack the Claude Code (13 new lessons)


If you get stuck on anything above or are stuck on something else, lmk as I read all replies!

Happy September,

Mark Shust

Teacher / M.academy

Say hi 👋 on LinkedIn & YouTube

M bytes

PHP → MySQL → AI → Docker → more. One topic every other week.

Share this page