CU

cursor-multi-repo

Streamlines managing multiple repositories and monorepo structures within a single Cursor workspace.

Install

mkdir -p .claude/skills/cursor-multi-repo && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1692" && unzip -o skill.zip -d .claude/skills/cursor-multi-repo && rm skill.zip

Installs to .claude/skills/cursor-multi-repo

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Work with multiple repositories in Cursor: multi-root workspaces, monorepo
74 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Open multiple project roots in a single Cursor window
  • Configure selective indexing using .cursorignore files
  • Reference files across different project roots
  • Define and inherit rules for monorepos and multi-root workspaces
  • Optimize memory usage by minimizing open workspace roots

How it works

The skill configures Cursor to open multiple project roots, each indexed independently, and allows cross-project context through specific file referencing and rule inheritance.

Inputs & outputs

You give it
Project folders or a .code-workspace file
You get back
A Cursor window with multiple indexed project roots

When to use cursor-multi-repo

  • Setting up a multi-root workspace for backend and frontend
  • Indexing shared libraries alongside application code
  • Saving custom workspace layouts

About this skill

Cursor Multi-Repo

Work with multiple repositories and monorepo structures in Cursor. Covers multi-root workspaces, selective indexing, cross-project context, and rule inheritance patterns.

Multi-Root Workspaces

Open multiple project roots in a single Cursor window:

Creating a Workspace

  1. Open first project: File > Open Folder > select project A
  2. Add second project: File > Add Folder to Workspace... > select project B
  3. Save workspace: File > Save Workspace As... > mywork.code-workspace

Workspace File Structure

// mywork.code-workspace
{
  "folders": [
    { "path": "/home/dev/api-service" },
    { "path": "/home/dev/web-frontend" },
    { "path": "/home/dev/shared-lib" }
  ],
  "settings": {
    "editor.tabSize": 2,
    "files.exclude": {
      "**/node_modules": true,
      "**/dist": true
    }
  }
}

Open workspace: cursor mywork.code-workspace or double-click the file.

How Indexing Works with Multi-Root

  • Each folder root is indexed independently
  • @Codebase searches across all open roots
  • @Files paths include the root name: @api-service/src/routes/users.ts
  • Closing a folder removes it from the index

Monorepo Patterns

Opening Full Monorepo

cursor /path/to/monorepo

Pros: @Codebase searches everything, cross-package references work naturally Cons: Slow indexing on large monorepos, lots of irrelevant search results

Focused Opening (Recommended)

# Open just the package you're working on
cursor /path/to/monorepo/packages/api

Pros: Fast indexing, focused search results Cons: No automatic cross-package context

Hybrid: Focused + Selective .cursorignore

# Open the monorepo root but exclude what you don't need
cursor /path/to/monorepo
# .cursorignore at monorepo root
# Only index packages you're actively working on

# Exclude everything in packages/
packages/*/

# Except the ones you want indexed:
!packages/api/
!packages/shared/

# Always exclude
node_modules/
dist/
build/
.turbo/

This indexes only packages/api/ and packages/shared/, keeping search focused.

Cross-Project Context

Referencing Files Across Roots

In a multi-root workspace, use the root folder name as prefix:

@api-service/src/types/user.ts @web-frontend/src/hooks/useAuth.ts

The User type in the API doesn't match the frontend hook.
Show me the differences and suggest how to share the type.

Sharing Types Between Projects

Use project rules to guide cross-project imports:

# .cursor/rules/monorepo-imports.mdc (in monorepo root)
---
description: "Monorepo import conventions"
globs: ""
alwaysApply: true
---
# Import Rules
- Shared types: import from @myorg/shared (never relative paths across packages)
- Shared UI: import from @myorg/ui
- Never import directly from another app package (apps/api → apps/web is forbidden)
- Each package declares its own dependencies in package.json

Rules Inheritance

Monorepo: Root + Package Rules

monorepo/
├── .cursor/rules/
│   ├── global.mdc              # alwaysApply: true (applies everywhere)
│   └── security.mdc            # alwaysApply: true
├── packages/
│   ├── api/
│   │   └── .cursor/rules/
│   │       └── api-patterns.mdc  # Scoped to api/ files
│   ├── web/
│   │   └── .cursor/rules/
│   │       └── react-patterns.mdc  # Scoped to web/ files
│   └── shared/

Behavior:

  • Root rules apply to all files in the monorepo
  • Package-level rules apply only when editing files in that package
  • If both match, both are included in context

Multi-Root: Independent Rules

In a multi-root workspace, each root has its own .cursor/rules/:

# Workspace contains:
api-service/
  .cursor/rules/express-patterns.mdc    # Only applies to api-service files

web-frontend/
  .cursor/rules/react-patterns.mdc      # Only applies to web-frontend files

Rules do NOT cross workspace roots. Each project's rules are independent.

Selective Indexing Strategies

Strategy 1: Single Package Focus

cursor packages/api/
# Only indexes packages/api/
# Fast, focused, no cross-package noise

Strategy 2: Related Packages

# .cursorignore at monorepo root
packages/*/
!packages/api/
!packages/shared/
!packages/config/

Strategy 3: Full Monorepo with Heavy Exclusions

# .cursorignore
node_modules/
dist/
build/
.turbo/
.next/
coverage/
*.lock
*.min.js
**/*.test.ts       # Optional: exclude tests from indexing
**/fixtures/       # Test fixtures
**/migrations/     # Database migrations (reference via @Files)

Performance Optimization

Memory Management

Each open workspace root consumes memory for indexing. Minimize open roots:

# Instead of opening 5 repos:
cursor repo1/ repo2/ repo3/ repo4/ repo5/   # Heavy

# Open only what you need:
cursor repo1/                                # Light
# Add repo2/ only when needed via File > Add Folder

Large Monorepo Tips

1. Use .cursorignore aggressively
2. Open specific packages, not the root
3. Close workspace folders you're not actively editing
4. Start new chats when switching between packages
5. Use @Files for cross-package references instead of @Codebase

Enterprise Considerations

  • Repository access: Multi-root workspaces respect filesystem permissions. Cursor cannot index repos the user cannot read.
  • Indexing scope: Only open workspace folders are indexed. Opening a shared drive or network mount may be slow.
  • Rule governance: In monorepos, root-level rules serve as team-wide governance. Package-level rules add specificity.
  • CI alignment: .cursor/rules/ should be reviewed in PRs like any other configuration change.

Resources

When not to use it

  • When working with a single project that does not require cross-project context
  • When indexing a very large monorepo without specific exclusions

Limitations

  • Rules do not cross workspace roots in a multi-root setup
  • Opening a shared drive or network mount may be slow
  • Cursor cannot index repositories the user cannot read

How it compares

This approach allows working with multiple related projects in one environment, unlike opening each project in a separate instance.

Compared to similar skills

cursor-multi-repo side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cursor-multi-repo (this skill)527dReviewIntermediate
agentic-jujutsu34moReviewAdvanced
moai12moReviewAdvanced
build-with-agent-team16moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry