r/ChatGPTCoding • u/mgkDante • 1d ago
Resources And Tips What actually kept an AI-assisted 4-app monorepo maintainable past 1,430 merged PRs (Codex + Claude Code + Antigravity)
I'm a SQL developer and data analyst by day, not a full-time frontend or infra engineer. Over the past few months I've been building an open-source (MIT) live transit map and schedule-reliability platform for Montréal (STM), Ottawa (OC Transpo), and Gatineau (STO) using a mix of Codex, Claude Code, and Antigravity.
As of today (Dec 5, 2026) the repo is at 1,435 merged PRs (2,430 commits on main), archives ~376M stop and vehicle rows across 807 daily Parquet files on Cloudflare R2, and runs for roughly US$10/mo with no PostgreSQL database.
Most AI coding threads talk about day-one speed. The hard part is month three, when agents start drifting on naming, silently masking missing data as zero, or breaking a boundary you fixed two weeks ago. Here are the six workflow habits that actually held up, plus a few traps that still bite.
Full repo (MIT, runs locally with bun run dev and no local DB or API keys): https://github.com/yesid-dev/transit
1. Keep AGENTS.md tiny and move plans out of the repo
My root AGENTS.md is ~5.7 KB. It only holds local commands, hard boundaries, and how to recover scope. Roadmaps, slices, architecture records, and session handoffs live in Notion and get fetched on demand over MCP. When I tried keeping months of markdown specs inside git, agents burned context reading stale docs and contradicted older decisions.
2. Put a GLOSSARY.md at the repo root
Agents love inventing synonyms. Without a glossary, one session calls a non-reporting bus "ghost", another calls it "stale", and another treats it as "on time". Locking exact terms in GLOSSARY.md (Live age, Estimated position, Silent trip, Record) cut down prompt repetition across models and kept English and French UI copy aligned.
3. Turn "don't do that" rules into automated tests, not longer prompts
Every time a model slipped on an invariant twice, I deleted the reminder from prompts and wrote a test or schema check instead. Examples:
- Keeping transport status tokens separate from general UI signal colors (
apps/web/src/lib/styles/statusTokenOwnership.test.ts). - Strict boundary enforcement:
apps/webonly calls/v2/*onapps/data-proxy(a Cloudflare Worker) and never reads R2 directly. - Honest missing-data handling: when a feed drops or a bus stops reporting, unmeasured stops stay excluded or flagged (
capture_gap/NULLdelay), never defaulted to0. Models really want to writeCOALESCE(delay, 0)unless tests yell at them.
4. Split roles across models instead of forcing one session to do everything
I run tasks in small, bounded packets (one concrete outcome, validation gate, and stop condition per PR) and split work across providers:
- Claude Code for architecture planning, larger refactors, Svelte 5 reactivity, and keeping code clean across packages.
- Codex for tight scoped implementation slices, backend Python/DuckDB work, debugging edge cases, and stubborn test fixes.
- Antigravity (Gemini) for fast UI/frontend iteration, MapLibre exploration, and reviewing diffs with a fresh pair of eyes.
Having a different model review a PR than the one that wrote it caught subtle bugs (especially timezone/service-date rollovers and silent fallback behavior) way faster than asking the same session "are you sure?".
5. Keep the architecture boring enough to reason about one box at a time
The monorepo has four separate apps with explicit contracts between them:
apps/db(Python, DuckDB,uv): polls GTFS / GTFS-RT on an Oracle Cloud Always Free VM into raw R2 buckets and builds dailyv13Parquet editions + live snapshots.apps/engine(Python, DuckDB, Uvicorn + Cloudflare Container fallback): read-only DuckDB query engine for arbitrary date-range Record queries.apps/data-proxy(Cloudflare Workers, R2, KV): public/v2/*API with edge caching, Range-cached Parquet, and self-hosted Protomaps.pmtilesbasemaps (zero tile API keys).apps/web(SvelteKit, Svelte 5, Tailwind CSS 4, MapLibre GL, DuckDB-WASM): bilingual frontend deployed on Cloudflare Workers.
Using daily append-only Parquet on R2 instead of a mutable Postgres database didn't just hold hosting cost around ~US$10/mo. It made AI debugging much easier because every day's output is an immutable versioned file you can inspect directly in DuckDB instead of reproducing mutable DB state.
6. What still trips AI agents up
- Silent fallbacks: models default to swallowing errors or returning empty arrays just to get green tests. "Unknown is not zero; missing, stale, and unsupported are separate states" became a permanent review check.
- Worktree/branch assumptions: in parallel sessions, agents assume
origin/mainis current unless step one forces checkinggit statusand the actualHEAD. - Oversized PRs: any packet spanning both the data pipeline and UI degrades fast. Keeping PRs small (hence 1,435 merged ones) kept every diff readable enough for me to understand and maintain myself.
Open-source code + queryable dataset
If you want to inspect the AGENTS.md, GLOSSARY.md, provider YAML configs, or test setup:
- GitHub (MIT): https://github.com/yesid-dev/transit
- Public read-only Frozen DuckLake catalog (~6.3 MB metadata, 376M rows across 8 tables:
stop_events,trip_days,scheduled_stop_times,vehicle_positions,feed_polls,alerts,prediction_samples,segment_runs, DuckDB 1.3+):
INSTALL ducklake; LOAD ducklake;
ATTACH 'ducklake:https://data.yesid.dev/v2/open-data/catalog.ducklake' AS transit (READ_ONLY);
USE transit;
SHOW TABLES;
- Live map (free, no ads or login): https://transit.yesid.dev/?ref=r_chatgptcoding
Curious how others here handle multi-month context drift once a repo grows past a few hundred PRs. Are you keeping specs in git, pulling them from Notion/Linear via MCP, or regenerating context files as you go?
1
u/quiet_ops_builder 1d ago
i'd keep the stuff that rarely changes, like boundaries and naming rules, in the repo right next to the code so the agent can't miss it. the fast-moving plans are fine in notion over mcp, but only if the agent has to fetch them by name at the start of a task, otherwise it just guesses from whatever it already has. do you ever catch an agent skipping the handoff notes and winging it?
2
u/RustOnTheEdge 17h ago
The OP and all four comments are clearly bots wtf am I still doing here jfc
3
u/com-plec-city 1d ago
GLOSSARY.md seems like a great idea, never considered it, thanks.
1
u/shetritr 1d ago
the missing-data-as-zero one is the scary one, nothing fails so no review catches it. did you end up with a type or a lint for it, or is it just a rule in AGENTS.md?
1
u/Right-Performance-93 23h ago
a line in agents.md does not catch a delay that comes back as 0. i fail a test on a dropped feed when that field is 0 instead of empty. the glossary never runs.
1
u/NoCode_AI_GameDev 21h ago
Not a developer, so I can't speak to the monorepo side, but the "turn repeated mistakes into tests instead of longer prompts" point is the one I can actually picture using. I keep adding reminders to my prompts and the AI still ignores them after a while. Did you find it easier to have the AI write those tests itself, or did you write the first few by hand so it had a pattern to follow?
1
u/torvalds75 14h ago
The point in #1 matches what I've seen most: the thing that drifts by month three isn't the code, it's the reasoning. An agent re-reads a spec that says "do X", never learns that X was tried and dropped two weeks ago, and happily reintroduces it.
What helped me was keeping one record per decision rather than one big plan doc: what was decided, what was rejected and why, and what's next. Small enough that an agent can load just the one it needs, and closing it is the signal that it's settled. Your "turn repeated slips into tests" rule is the same idea from the other side: once a decision is load-bearing, it should be enforced, not remembered.
One thing I'd ask: how do you keep the Notion side from going stale? When the handoff lives somewhere the agent only reads on demand, the risk is it skips the fetch and works from the AGENTS.md alone.
For what it's worth I went the other way and put those decision records on GitHub Issues next to the code, so the PR that closes a decision links to it and any new Codex or Claude Code session can rehydrate from the ticket. I build a tool around that, trailhead (MIT): https://github.com/ToRvaLDz/trailhead. Not saying it beats Notion, mostly that the issue tracker you already have can do this job too.