Skip to content
AI CraftsmanSUPERPOWERS
Blog
  • AI
  • Craftsmanship
  • Claude

Why AI-Generated Code Needs Discipline

Claude is powerful. But power without discipline is chaos. Here's why AI Craftsman Superpowers exists.

Alexandre Mallet3 min read

Claude writes code fast. Impressively fast. Ask it to scaffold a Symfony controller, generate a React component, or wire up a Doctrine repository - it will do it in seconds. Clean syntax, proper structure, looks good at a glance.

Then three sessions later, the same task produces something completely different. Different naming conventions. Different error handling patterns. Setters where there should be behavioral methods. A new DateTime() instead of an injected Clock interface. Nothing broken, just... inconsistent. And inconsistency at scale is a slow-burning disaster.

The Core Problem: No Memory, No Standards

Claude is a stateless tool by design. Every session starts fresh. It has no memory of the decisions you made in the last sprint, no awareness of your team's conventions, no understanding that your domain forbids anemic models. Left unconstrained, it defaults to "reasonable" - which in practice means average, not excellent.

The problem isn't Claude's intelligence. It's the absence of guardrails.

Think about how a senior developer operates on your team. They don't just know how to write code - they know your codebase. They know you use private __construct() with a factory method. They know final classes are mandatory. They know the architecture layers and refuse to violate them. That institutional knowledge took months to build. Claude doesn't have it unless you give it to every single prompt, every single time.

Nobody does that. So standards drift.

What "Discipline" Actually Means

AI Craftsman Superpowers isn't a linter. Linters catch syntax. What the plugin enforces is architectural intent - the decisions that shape your codebase over months and years.

Three mechanisms make this work:

The Rules Engine loads before every generation. Your standards - PHP MUST rules, TypeScript conventions, domain invariants - are injected into context automatically. Claude doesn't have to guess what you want. It knows.

Quality Gates run after every write. Three validation levels in under three seconds: regex patterns catch surface violations, static analysis runs your actual tools (PHPStan, TypeScript compiler), architecture checks verify layer dependencies. If a file fails, it doesn't land in your codebase silently.

The Iron Law Pattern ensures that when Claude scaffolds something, it loads your canonical example first. Not a template from its training data - your actual production code. The diff between "what Claude would generate" and "what your codebase actually looks like" collapses to near zero.

The Real Cost of Drift

Drift is insidious because it's invisible until it isn't. A setter here, a missing final there, a service that quietly couples two bounded contexts. Each one is harmless in isolation. Together, over time, they erode the architecture you spent months building.

The developers who feel this most acutely are the ones who've invested in DDD, Clean Architecture, or strict coding standards. They know exactly what good looks like. They've argued for it in code reviews. And then they watch Claude undo it in a single generation, not out of malice but out of blissful ignorance.

The fix isn't to stop using Claude. The fix is to make Claude aware of your standards and hold it accountable.

Zero Drift Is a Choice

Every team that ships with AI assistance faces the same fork: accept drift as the cost of speed, or build the infrastructure to prevent it.

AI Craftsman Superpowers is that infrastructure. It's the difference between "Claude wrote some code" and "Claude wrote our code." Between a powerful tool used casually and a senior craftsman integrated into your workflow.

Power without discipline is chaos. Discipline without power is slow. The plugin gives you both.

*AI Craftsman Superpowers is open source (Apache 2.0). Install it with /plugin marketplace add BULDEE/ai-craftsman-superpowers then /plugin install craftsman@ai-craftsman-superpowers.*