What is an AI harness & why does Magento need one?

Mark Shust explains why Magento developers need an AI harness: a structured system of skills, commands, hooks, and plugins that gives Claude a deterministic workflow instead of free-form generation. Without one, accumulated custom tools and massive files create unfocused prompts that confuse the AI and risk architectural mistakes in enterprise frameworks.
Chapters
A developer asked me over on MageChat, when you talk about custom harness workflows, is that a combination of skills, hooks, cloud.md files, or something else? And this is a fair question. I talk about AI harnesses a lot in real life, but not too much online describing actually what they are and how they apply to Magento, which is a framework that I believe specifically needs a harness built for it. If you've been working in Claude code a lot lately, as I have been, you'll probably wind up with a random collection of skills, MCP servers, and a cloud.md file that has ballooned massively in size. You'll probably wind up with a few other plugins and hooks that are installed that you don't quite know what they even do or how they work. I just audited my own platform, even though I do use an AI harness, and I had something like 30 skills installed that were all custom, multiple MCP servers installed that were available and polluting the context. Tons of hooks that were going on that I really didn't understand. It's just a mess of spaghetti. And in one of my projects, I had a Claude.md file that was something like 2,000 lines of code, which when you have that much context in the Claude.md file, Claude won't make heads or tails of anything because it's not focused on a specific target of things. It just throws a mess of context into the system prompt and Claude just won't know what to do with it. In this video, I'd like to go over the 5 main parts that make up an AI harness and explain each one of them in their specific context so you understand actually what they do and what makes a harness complete. And since I use Claude Code every day, I will use that as the main tool example to build off of because it also provides all these primitives that make it available to actually build a harness. The first is a skill, which is a directory that can contain a Markdown file which contains all of the instructions and description of the skill and how it can be invoked. And this is really just one main task that can be carried out within a Cloud Code execution. And within that directory can also be contained a script and other assets that the instructions can reference and use to carry out that specific task. The second is a command. This is actually how skills started in Claude Code. It used to be just a markdown file and you couldn't call any external scripts or assets. So commands sort of morphed into skills over time, and you can still manually invoke a skill if you want with a command, which could be useful inside your instruction set or when it comes time to actually pulling all of the harness pieces together. So skills are automatically invoked in Cloud Code's context when you ask it to do a certain thing based on the description within the skill, but a command is manually invoked. So there is a difference between the two. A hook is a script that runs before or after a certain action in Cloud Code. So you can have something like a pre-read hook, which executes before Cloud Code reads a specific file. You can think of these as small programs or functions. So they are completely deterministic, which is the complete opposite of how LLMs work. This is extremely useful if you want the same action to always carry it out on a certain action when a certain thing happens. A plugin is any combination of skills, commands, hooks, and anything else that gets bundled together and shipped as a unit. So when you're installing a plugin in Claude Code, it installs a collection of skills and hooks and whatever else. And a plugin can actually also be a harness. And a harness is that full collection of skills, commands, and tools that run in a specific order that's deterministic and gives some architecture to your agentic programming. It defines what runs and in what order and what has to be true for a certain step to pass through to another step. So a harness provides a shape around all of these different aspects of agentic programming. If I had to sum up the harness in one specific sentence though, it's that it's the system that makes an AI follow a specific process rather than just making something up on its own. Again, a harness is really a deterministic way to carry out a specific action plan. So rather than the AI making something up and doing something different every single time, a harness provides that level of structure and stability. So every time that you make an ask to it, it will always follow the same process and the same steps. Now I've personally just about always had better results using a harness. Some of the very higher-end Frontier models may not need it depending on what you're doing, if you're like editing a single file or a smaller program, but anytime you're working within a larger framework or something that has some level of complexity, you'll always want to use a harness. Now I've built my entire course platform actually using a harness and that course platform under the hood is using Laravel. And even though AI understands Laravel code really well, you won't have that level of deterministicism when you go ahead and ask it to build something out. So every time you go and ask it to build something, it'll build it completely differently. It may not write unit tests, or it may not, uh, do a security review after it writes code. So when you have a harness, you can actually direct the AI to use those specific steps that you use in your specific workflows. And of course, if you are using more complex frameworks or platforms such as Magento, which is inherently complex and messy, you will absolutely have to use a harness because the AI doesn't really know how to carry out a specific action and follow certain steps so you can get more deterministic results. Magento is a very layered enterprise-level architecture, and it's very unforgiving even for humans. Uh, there seem to be 5 different ways to carry out every single task, and what you choose to implement really will affect your decisions down the line. And when the AI doesn't have a certain process or steps to follow, it'll just fall flat on its face. So out of those 5 plausible different ways to do something in Magento, the AI might just pick the first one because it doesn't really understand the full context of what you're asking and what the ramifications are of choosing one option over another. AI is very good at just taking something and running with it, but if it's not instructed how to run a specific action or do something, it will just burn down the whole house. AI is very good at building plausible code. That looks good, works, but may not be the correct architectural choice. A few minutes ago I mentioned that plugins can also be AI harnesses, and I actually built one myself called HCF, which stands for Halt and Catch Fire. It's fully open source. You can grab a link to it in the description below this video, but you can install it directly in Cloud Code and start working with it right away. If you've been working with a platform like Magento or or Magento itself, uh, what areas of that platform have you found to completely choke with AI or LLMs? Please let me know in the comments below. I'd love to hear all of your problems and see how we can actually fix them. If you'd like to see some of the areas that I found Magento completely break down with AI, be sure to check out this next video, which goes into it in great detail. Thanks so much for watching. If you'd like to learn more about Magento and AI and where all this is heading, Be sure to subscribe to my channel for more content just like this and give this video a thumbs up to spread the word throughout the Magento community. And until next time, keep shipping.










