You're staring at a Rails schema with 47 tables. The foreign key relationships are a bowl of spaghetti — timestamps everywhere, no documentation, and three different conventions for the same concept. Your PM wants a new feature by Friday. You open Copilot, paste the entire schema, and ask for a migration.
The AI generates something that looks right. You ship it. Three weeks later, you find out it created a circular dependency that takes down the checkout flow every time order history gets queried.
This isn't a Copilot failure. This is a Context Composting failure — the moment you started designing your database schema not for your application's actual requirements, but for what an AI model could reason about in a single prompt window.
I found this pattern dissected in a Japanese developer's post on Qiita that broke down exactly how Japanese Rails teams are thinking about Copilot context strategy differently than Western devs. The post — "トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略" (Don't be stingy with tokens, design properly: A context strategy for using GitHub Copilot wisely) — describes an approach that's equal parts technical and philosophical.
What Japanese Rails Teams Are Doing Differently
The core argument from the Qiita post: most Western developers approach Copilot as a cost-saving tool. They're constantly trying to minimize tokens — give it less context, use shorter prompts, split everything into tiny chunks. The implicit assumption is that AI context is expensive and you should ration it.
Japanese Rails developers, according to this post, are flipping that script. They're treating Copilot context as an architectural asset. Instead of asking "how little context can I give Copilot?", they're asking "what context structure makes Copilot output actually useful for my codebase?"
This manifests in three concrete practices:
1. Schema documentation as context scaffolding
Rather than treating ERD diagrams as internal-only artifacts, Japanese teams are writing schema documentation specifically formatted for AI consumption. This means:
# == Schema Information
#
# Table name: orders
#
# id :bigint primary key
# user_id :bigint foreign_key: users.id, index: true
# status :string enum: [:pending, :processing, :shipped, :delivered]
# total_cents :integer NOT NULL, index: true
# created_at :datetime NOT NULL
# updated_at :datetime NOT NULL
#
# Indexes: [user_id, status], [user_id, created_at]
#
# Business rules:
# - status transitions: pending -> processing -> shipped -> delivered
# - total_cents must be positive
# - Soft delete via discarded_at column
This isn't documentation for humans. This is documentation for the AI model that will need to generate your next migration or query.
2. Design decisions as first-class context
The Japanese approach treats architectural decisions as context that must be preserved. When your team decides "we'll use soft deletes instead of hard deletes because of compliance requirements," that decision needs to be in a format Copilot can use — not buried in a Confluence page nobody reads.
3. MCP integration for context continuity
The post discusses using Model Context Protocol (MCP) to maintain conversation context across sessions. Instead of re-explaining your schema to Copilot every time, MCP allows the AI to maintain awareness of your specific design patterns, naming conventions, and architectural constraints.
The Skeptical Take
Here's where I push back on this approach: Context Composting solves the symptom while accelerating the disease.
The Qiita post's strategy assumes that better AI context leads to better outputs. But in my experience, this creates a subtle trap: you start designing your schema not for your application's actual requirements, but for what the AI can reason about.
I watched this happen at a startup where I was consulting. The team adopted a "Copilot-first" schema design philosophy. They restructured their database to use simpler relationships, avoided complex inheritance patterns, and added explicit indexes that AI models could easily scan — all in service of getting better Copilot suggestions.
The result: their schema became technically inferior to what a human architect would have designed. They had 30% more tables because the AI couldn't handle polymorphic associations well. Query performance tanked. And when they needed to do a complex analytics query that required JOINing across 7 tables, Copilot couldn't help anyway because the context window was too complex.
Trade-off: They optimized for AI readability and sacrificed human performance. The "better Copilot context" came at a cost of 40% slower analytical queries and a schema that any experienced DBA would look at sideways.
To be fair, I understand the pressure. When you're three weeks behind on a feature and the AI is generating usable code, it's hard to argue for "purer" architecture. But the debt is real, and it compounds in the queries you'll write in six months.
Anti-Atrophy Checklist
The risk here isn't that Copilot is bad. It's that Context Composting creates a feedback loop where you gradually stop designing for humans and start designing for AI context windows. Here's how to maintain the balance:
Document design decisions twice — once in the format Copilot needs, once in the format that explains why you made this choice. The "why" is what keeps you from making the same trade-off decisions in the future without realizing it.
Review one AI-generated migration per week manually — trace every foreign key, every index, every constraint. If you can't explain why it was designed that way without referencing the AI output, you have a Context Composting problem.
Track your "schema complexity per AI session" — measure how many tables you can reason about in a single Copilot session before outputs become unreliable. That number is your architecture's AI-ceiling. If your application needs to exceed that ceiling, you're flying blind.
One quarterly schema audit — ask: "Would a human architect design this schema this way if AI didn't exist?" If the answer is no, you've optimized for the wrong thing.
What This Means for the Next 12 Months
As AI coding tools get more capable, the pressure to design for AI context will increase. We'll see more frameworks shipping "AI-optimized" conventions, more documentation formats designed for model consumption, more architectural patterns chosen because they're easier to prompt-engineer.
The developers who maintain their edge won't be those who resist AI — they'll be those who keep their architectural thinking sharp enough to know when the AI is leading them astray.
The schema is still spaghetti. But now you know why — and you know who's really eating the cost.
What's your take?
Has your team started designing schemas or architecture around what AI tools can reason about? What's been the actual cost when the AI-optimized approach hit a real production scenario? I'd love to hear your experience — drop a comment below.
Based on insights from Japanese developer community approach to GitHub Copilot context strategy (Qiita, 2024)
Discussion: Has your team started designing schemas or architecture around what AI tools can reason about? What's been the actual cost when the AI-optimized approach hit a real production scenario?
Top comments (0)