AI Engineers Need Culture Too
How .cursor/rules saved my pet project (and my sanity)
TL;DR:
AI coding assistants can feel like magic… until they go off the rails and rewrite your repo just for a sake of having some unit test passing.
My AI pair programmer started refactoring my project unprompted and hallucinating frameworks – chaos ensued.
The solution was writing a
.cursor/rulesfile: essentially an AI rulebook to enforce the coding standards and stop the madness.With a custom rulebook in place, the Coding Assistant became a helpful( finger crossed) teammate again – smaller diffs, relevant suggestions, and far fewer “WTF?” moments in code review.
AI assistants need onboarding and culture too; we can’t just unleash them without guidance. Here’s how a few YAML guidelines turned my AI from rogue to rockstar.
The Honeymoon Phase (AI Feels Magical)
Guilty: the first few times with an AI pair programmer my pet project ( check it out - https://github.com/dativo-io/dativo-ingest , the headless data ingestion platform) felt like living in the “Ghost in the shell”. I’d type a command, and poof! the solution appeared as if my Cursor had a mind of the senior engineer. Functions that used to take an afternoon to debug practically wrote themselves while I sipped coffee. I was giddy with power – code reviews came back with fewer nitpicks, and I was closing tickets faster than ever. It was the honeymoon phase, when the AI could do no wrong( I prefer to keep my eyes closed). At first, coding with AI felt like unlocking cheat mode on reality. I bragged to my friends that I had a tireless junior dev who never sleeps and never complains, ready to do the grunt work at 3 AM. What could possibly go wrong?
The Hangover (When the AI Goes Rogue)
One night, I asked the AI to add a single field to the some class. The PR? 38 files changed. It rewrote our CLI, abstracted config loaders, and migrated connectors to a fictional framework. It was confident. It was wrong. I went from AI-enhanced to AI-endangered.
Another real example: before I wrote .cursor/rules, the AI submitted a commit titled “Major CLI Refactoring” and wasn’t kidding. It blew up our cli.py into cli_commands.py, startup.py, job_executor.py, connectors/factory.py, and more – 9 files touched, 2,000+ LOC rewritten. All this… when I just wanted a new job flag. LOL(
In another masterpiece, I asked for incremental sync support. The AI replied with a “Unified Incremental Strategy Framework” – complete with file sync, cursor DB sync, Airbyte catalog support, state JSONs, and a cloud deployment story. Impressive. Also: completely unified overkill.
I definetly needed to tame the beast.
Writing The Rulebook (What .cursor/rules Is and How It Works)
Enter .cursor/rules, a Markdown YAML-adjacent file I dropped into our repo. Cursor reads it. It learns(at least claims so). It stops trying to redesign the system every time I blink.
I tried to define law like:
# .cursor/rules
- “Every patch MUST reduce entropy.”
- “Implement only what is requested and stop once acceptance criteria are met.”
- “No refactoring outside scope.”
- “No new platforms, frameworks, or reports.”
- “Use YAML config over hardcoded logic.”Basically, It’s policy-as-code for your AI coworker.
How LLMs changed the behaviour
Before: The Chaos Commits
“Connector Registry V2” introduced external catalog loading, CLI support, schema changes, doc rewrites – all in one commit.
Schema validation? Ignored. New YAML fields like
streams_defaultshowed up unannounced, breaking CI.Env vars as feature toggles? Oh yeah. I found
ENABLE_FANCY_MODE=trueburied in a helper.
After .cursor/rules: The Calm
Mimesis connector PR: 5 files, clean logic, test included, YAML-configured, schema-valid – no chaos.
Metrics Export: Added
metrics.py, config toggles inrunner.yaml, schema updated, validation green.Schema Guardrails: When adding
external_id, the AI updatedconnectors.schema.jsonin the same commit – no CI surprises.
The AI learned. No more feature-farming. Just real hardcore engineering.
Before vs After: Diff Deltas
# Before `cursor/rules`
Commit: “Unified Incremental Sync”
Files changed: 15
Includes: new abstractions, plugin system, state management# After `.cursor/rules`
Commit: “Add external_id to connector schema”
Files changed: 2
Includes: YAML field + validation schemaThis shift was no accident – it was enforcement.
Additional Advice from .cursor/rules and the Field
Here are more rules and tips pulled from the real-world dativo-ingest’s rules file and other engineers who’ve fought the same fight:
✅ Be Patch-Scoped
“A patch MUST only satisfy the requested acceptance criteria. All other behavior is out of scope.”
Avoid change creep. Don’t sneak in that “quick cleanup” or bonus refactor.
✅ Respect the Interface
“Never change interfaces or filenames unless explicitly asked.”
Humans memorize file paths and function names. AI must not rename them casually.
✅ Just Enough Testing
“Do not write tests for unchanged or unrelated components.”
No 400-line test diffs when one new function was added.
✅ Always Validate Config
“New config fields MUST be described in
*.schema.jsonand tested against examples.”
YAML-only is sacred. Forgetting the schema? Expect the wrath of CI.
✅ Prefer Simplicity
Inspired by Addy Osmani’s 70% Rule: “AI gets you 70% of the way fast, but that last 30% is where bugs hide.”
AI should avoid cleverness. If a simpler solution exists, pick it.
✅ Don’t Narrate, Ship
“Avoid over-documenting implementation details or rationale unless explicitly required.”
AI-generated README essays? Save it. We want user-facing docs, not ChatGPT’s inner monologue.
The Bigger Picture
Now, every AI task respects my GitOps-first, config-driven architecture. New flags go in runner.yaml, not os.getenv. Every schema change comes with a schema update and test. Our platform evolved. Our AI did too.
.cursor/rules isn’t just instructions – it’s culture.
AI Engineers Need Culture Too
We wouldn’t onboard a junior dev by saying “just read the codebase.” We give them docs, a buddy, some rules. We didn’t do that for our AI… until it started acting like a junior dev with caffeine poisoning.
.cursor/rules became my AI onboarding playbook. It cut entropy, limited scope creep, and gave the AI the same values we hold. And when your AI shares your values? It becomes a real teammate.




