Why Your AI Coding Assistant Needs Rules: Introducing anma
Let's be honest: AI coding assistants are incredible. They write boilerplate faster than any human, suggest fixes on the fly, and sometimes come up with solutions you'd never have considered. But here's the thing—they also don't know when to stop. Left unchecked, they'll happily refactor your entire codebase, introduce breaking changes, or ignore the architectural decisions your team spent weeks deciding on.
This is the problem anma tackles head-on.
The Wild West of AI-Assisted Coding
When you hand an AI agent access to your repository, you're essentially giving it the keys to the kingdom. Most developers set some initial boundaries by writing CLAUDE.md or similar documentation files—instructions that tell the AI what to do and what to avoid. But here's the catch: those documents are easily forgotten, rarely enforced, and often ignored when the context window gets crowded.
I've seen this play out in real projects. A developer asks an AI to "clean up the auth module," and two hours later they've got a complete authentication rewrite that bypasses the existing session management entirely. The AI wasn't being malicious—it just didn't know where the lines were.
Enter YAML Contracts
anma takes a different approach. Instead of relying on static documentation that sits passively in your repo, it uses plain YAML contracts that define what your AI coding agents can and cannot do. These aren't complex configuration files—they're readable, human-friendly definitions of boundaries.
# Example anma contract
boundaries:
- scope: auth/
allow: [read, modify-session]
deny: [delete, bypass-auth]
- scope: migrations/
allow: [read]
deny: [write, delete]
The elegance here is in the simplicity. If you've ever written Docker Compose or GitHub Actions workflows, you'll feel right at home with the YAML syntax.
From Contract to Enforcement
Here's where it gets interesting. anma doesn't just create these contracts and leave them as suggestions. It compiles them into multiple enforcement mechanisms:
CLAUDE.md Generation: Your contract becomes part of the documentation that AI agents read when they enter your project. No more hunting for that outdated instruction file—it's generated fresh every time.
Pre-commit Hooks: Before any AI-assisted changes are committed, anma validates them against your contracts. If your coding agent tries to cross a boundary, the hook catches it and flags the violation.
CI/CD Integration: Your contracts run as part of your continuous integration pipeline. This means every PR gets checked against your defined rules, regardless of whether the changes came from AI, a junior developer, or a midnight coding session.
Why This Matters for Teams
For individual developers, anma is a sanity check. But for teams, it's a game-changer.
Imagine onboarding a new AI agent into your workflow. Instead of writing lengthy documentation that may or may not be followed, you define clear, enforceable boundaries. Your senior developers set the rules, and anma ensures everyone—human and AI alike—plays by them.
This is particularly valuable for:
- Startups moving fast: When you're iterating rapidly, the last thing you need is an AI undoing yesterday's decisions.
- Consulting teams: Define client-specific rules once and trust that every interaction respects them.
- Enterprise environments: Compliance and architectural consistency become automated, not aspirational.
The Bigger Picture
We're entering an era where AI coding assistants will be standard fixtures in development environments. The question isn't whether to use them—it's how to use them responsibly.
Tools like anma represent a mature approach to this challenge. Rather than treating AI as either fully trusted or completely avoided, they enable a middle ground: intelligent assistance within defined boundaries.
The YAML contract approach also signals something important: boundary definition shouldn't require a PhD or a custom DSL. The best constraints are the ones your whole team can read and understand.
Getting Started
If you're running AI coding agents in your workflow—even just for personal projects—spending an afternoon setting up anma contracts is worth the investment. You'll sleep better knowing that your AI assistant won't surprise you with a midnight refactor of your error handling.
Check out the project on GitHub at anma-labs/anma. The documentation is straightforward, and the learning curve is gentle. Think of it as setting up guardrails for your increasingly capable AI collaborators.
Because the future of coding isn't human-only or AI-only—it's both, working together within sensible limits.