ANTIGRAVITY LABJP
Articles/Antigravity Basics
Antigravity Basics/2026-05-31Advanced

Keeping Agent Behavior Consistent Across Separate Repositories: Notes on Multi-Repo Governance

How to keep Antigravity agents behaving consistently across several independent repositories when a monorepo isn't an option. A layered governance design with a working distribution script and drift audit, drawn from running four sites in parallel.

antigravity434AGENTS.md12multi-repo2governance2long-term-operationdesign14

Premium Article

I still remember the day I went from one repository to two. I carefully copied the AGENTS.md I had grown in the first repo and pasted it into the second. By the time I created the third, I could no longer tell which copy was the newest. The agents dutifully followed "the instructions" in each repo — but the instructions themselves had quietly diverged. At some point, the very same rule ("write in a polite register") had been updated in one repo and left stale in another.

I currently run four sites with similar tech stacks as independent, parallel repositories. Collapsing them into a monorepo would make sharing configuration trivial, but I deliberately keep them separate so that deployment units, release timing, and blast radius stay isolated. That requirement — "independent, yet I want the agents to operate under the same discipline" — is the design problem I call multi-repo governance.

This article lays out how to guarantee behavioral consistency when running Antigravity agents across multiple independent repositories, complete with the sync script and drift detection I actually use. The focus is a long-term operational problem the official docs don't touch: how conventions quietly rot over time.

Why separate repos instead of a monorepo?

Let me set the premise straight. "If you want to share config, just use a monorepo" is a fair point, and honestly the most natural solution. Put a single AGENTS.md at the root of a pnpm workspace or an Nx setup, and every project reads the same conventions.

Even so, there are sound reasons to choose independent repos. In my case there were three.

First, I wanted to physically isolate blast radius. A bad config or a broken build in one site should never drag the other three sites' CI down with it. Second, I wanted deployment permissions and tokens fully separated per site, so that a leaked token damages exactly one repository. Third, I wanted release timing and commit history to be independent. I grow each site as its own character, so mixing histories feels wrong — call it an indie developer's aesthetic.

In other words, multi-repo is the choice you make when you want isolation badly enough to sacrifice config sharing. And precisely because you sacrificed it, you need to win it back through some other mechanism. That mechanism is the governance layer.

Conventions start rotting the moment you copy them

Run agents across multiple repositories and drift is inevitable. The drift I observed fell into three kinds.

The first is rule version drift. You add a new rule to AGENTS.md in one repo and forget to copy it to the others. In the un-updated repos, the agent keeps running the old rule.

The second is gate script drift. You fix the quality-check Python script in one place, but the other N-1 copies stay stale. The same violation gets blocked in one repo and waved through in another.

The third is the nasty one: implicit convention drift. Rules that aren't written in AGENTS.md at all, but that the agent absorbs like "atmosphere" by reading a repo's commit history. You can't detect this with a file diff.

This article addresses the first two — drift you can make visible as files. The third I keep in check indirectly through "centralizing the source of truth," described below.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Implement a system that distributes AGENTS.md and quality gates from a single source across N independent repos, and detects drift
Design a layered architecture that keeps agent behavior aligned even when a monorepo isn't feasible
Take home the exact sync script and diff audit that actually prevented breakage across four parallel sites
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Antigravity2026-06-16
Collecting Guardrails Across Projects Into One Place — A Thin Wrapper Around the Antigravity SDK
When you copy the same safeguards into every project, you eventually fix one and leave the other stale. Here is a design that builds a single thin wrapper around the Antigravity SDK to centralize cost caps, allowed tools, and output validation — from someone running several apps in parallel.
Antigravity2026-06-15
Running Multiple Repositories in Parallel with Antigravity 2.0 Projects and Worktrees
Combining Antigravity 2.0 projects with git worktrees to run several repositories in parallel safely. From isolating agent workspaces to avoiding conflicts and connecting to scheduled execution, organized from real work.
Antigravity2026-07-11
Are You Actually Using Every Permission You Granted? Tightening Antigravity's Unified Permissions from Real Usage Logs
Once you flip a unified permission policy to 'allow everything,' unused grants quietly pile up. This is the grant-to-usage reconciliation loop: match granted permissions against your action logs, revoke what was never exercised, and narrow what's too broad — with working TypeScript and real numbers from solo operation.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →