There is no system prompt that can prevent this. If all you needed was some kind of rather short instruction we'd already have that baked into harnesses a long time ago. The problem is not that agents do not have the right instructions, they theoretically have everything there is to know about software architecture already in their training data.
I recognize that crafting a 'perfect' prompt is impossible, but neither is writing the perfect code, or even the 'perfect' code style guide. But it is 100% the kind of problem that can be iteratively improved to a point where it's much better than what you get by one-shotting everything without much consideration of these details.
I myself am maybe 5% sophisticated if 0 is I just discovered LLMs today, and 100 is the most skilled at using AI the world has seen. What I've learned so far is that I have a lot of room to improve.
Which is why I am actually not completely worried about the careers of current software engineers: If you brought in a bunch of non-engineers to prompt Claude to build and maintain an ERP system, or a social networking site, or an ad exchange, or even Shopify clone, I don't see those products being competitive with ones where engineers armed with the same LLMs are building them.
> I recognize that crafting a 'perfect' prompt is impossible, but neither is writing the perfect code, or even the 'perfect' code style guide
This is not about "perfect code" or style guides. For code styles we have linters, that does not require any instructions. I'm talking about software architecture for large complex web applications that dozens of people (that also change frequently) contribute to and that is spread across many different repos/services and an environment with constantly changing business requirements.
The terms that are relevant here are: coupling, cohesion, vertical slices, module boundaries and so on. This is software architecture and coding agents are terrible at this and there is no prompt and no instruction fixes this that could reasonably fit into a context window. I don't even think that coding agents fail because the lack the instructions and therefore adding instructions won't fix these failure modes.