Better cross repo context in Cursor
I started building mobile apps for my webapp and it made me rethink the way context is shared across repos in my setup.
I have a backend in django and frontend in svelte. Two repos. And I have a shared file between these two where backend updates the API docs for frontend to consume. This worked quite well.
Now that I’m building native iOS and Android apps, I got two more repos each. Decided to go ahead with SwiftUI for iOS and Kotlin for Android.
First, got a document prepared to create a full feature-parity iOS app based on svelte frontend. Then started building the iOS app. But soon realized in iterations that I need better context sharing.
Like, “follow the same checkout flow as in svelte frontend, but ensure that it abides by Apple HIG”
This got annoying quickly as Cursor didn’t exactly know where to look and I was pasting frontend code and screenshots in the iOS repo.
So I explored a few options.
One giant monorepo
Great context. But now you have one Git history, more CI complexity, deployment considerations, large AGENTS.md files, etc.
Didn’t feel worth it.
Continue my separate repos structure
But AI loses a lot of product context unless you’re constantly copying links or opening multiple windows.
Here’s a nice solution though, use workspace file!
~/_code_/sc/
├── sc-backend/
├── spendcrypto-com/ # svelte frontend
├── ios-app/
├── android-app/
└── spendcrypto.code-workspace And spendcrypto.code-workspace is like this
{
"folders": [
{
"name": "sc-backend",
"path": "sc-backend"
},
{
"name": "spendcrypto.com",
"path": "spendcrypto.com"
},
{
"name": "ios-app",
"path": "ios-app"
},
{
"name": "android-app",
"path": "android-app"
}
],
"settings": {
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true
},
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/.svelte-kit": true,
"**/dist": true,
"**/.venv": true,
"**/__pycache__": true,
"**/DerivedData": true
}
}
} Each project is still its own Git repository.
Independent deployments.
Independent CI.
Independent history.
But I open one Cursor workspace that contains all of them.
Now AI can jump between backend, frontend and mobile naturally.
A prompt like: “Implement checkout flow in iOS exactly like web” now yields great results. It even goes on to check if android-app also needs the same change, and if it does, it makes changes there too.
For eg: I wanted to implement offline state in ios-app and prompted AI for it. And it went ahead and did it for android too.
It can:
- inspect the Django API
- understand response models
- see how the Svelte app renders the page
- reuse copy and UX
- follow the same business rules
The less friction there is in giving context to AI, the more useful it becomes.
I’m also considering creating one more repo which has a few markdown files like, product one-pager, business context, user persona context, design philosophy, etc.