Skip to content

Team Collaboration

Team collaboration in Cursor rests on shared configuration rather than individual skill: project rules, MCP settings, prompt files, and slash commands committed to version control, plus dashboard-managed Team Rules that outrank both project and personal rules. The result is that a new developer’s agent output matches a veteran’s on day one.

Eight engineers all use Cursor and the output quality varies wildly. One developer’s AI-generated API routes include error handling, validation, and logging. Another’s are missing error handling entirely. A third keeps getting var instead of const because their personal rules override the project settings. One agent writes semicolons, another does not; one scatters any types, another writes strict TypeScript.

The AI-generated code looks like it was written by five different people because it was configured by five different people. The fix is not better prompting on each machine — it is moving the configuration into the repository, where it is reviewed, versioned, and identical for everyone.

What a coordinated Cursor team setup gives you

Section titled “What a coordinated Cursor team setup gives you”
  • A committed .cursor/rules/ directory that makes AI-generated code consistent across the whole team
  • Team Rules configuration for Cursor’s Team and Enterprise plans, and the precedence order that decides which rule wins
  • Shared MCP configuration so every developer’s agent has the same tools
  • Reusable prompt files and slash commands that encode your team’s best practices
  • An onboarding checklist that gets a new developer productive with Cursor in a day
  • An AI-assisted pre-review process that spends human review time on judgment instead of checklists
  • A security policy that balances productivity with compliance

This is the single most important team practice: project rules belong in the repository, not in individual developer settings. Every rule in .cursor/rules/ is available to every developer who clones the repo, and every agent conversation runs under the same constraints.

Terminal window
mkdir -p .cursor/rules

Begin with one always-applied rule that names the stack and the non-negotiables:

The starter rule stays short because it is always applied. Everything longer belongs in its own file, so the agent loads it when it is relevant instead of on every message:

.cursor/rules/code-style.md
## Code Style
- TypeScript strict mode. No 'any' types except where explicitly documented.
- Named exports only. No default exports.
- Functional components with hooks for React.
- camelCase for variables and functions. PascalCase for types, interfaces, and components.
- Use async/await. Never use .then() chains.
- All async functions must have try-catch error handling.
- Prefer fetch over axios for HTTP requests.
- Use pnpm for all package manager commands.
.cursor/rules/testing.md
## Testing Conventions
- Use vitest for all unit and integration tests.
- Test files live next to the code they test: src/services/__tests__/user.test.ts
- Use descriptive test names that explain the scenario: "should return 404 when user does not exist"
- Mock external dependencies (database, APIs) but not internal modules.
- Aim for 80% code coverage on new code.
- Always test error cases, not just happy paths.
.cursor/rules/architecture.md
## Architecture Rules
- API routes in src/api/ handle HTTP concerns only (parsing, validation, response formatting).
- Business logic goes in src/services/. Services never import from src/api/.
- Database operations go in src/repositories/. Services use repositories, never raw queries.
- Shared types go in src/types/. Types are the only thing that every layer can import.
- Do not create circular dependencies. If service A needs service B, inject it as a parameter.

Treat rules like code, because they rot like code:

  • Rule reviews in PRs: adding or modifying a rule goes through the same review as any other change
  • Rules updated from mistakes: when a human review catches a pattern the agent got wrong, update the rule in the same PR so it cannot recur
  • A quarterly audit: remove outdated references and add the patterns the team started using since

Cursor’s Team and Enterprise plans add Team Rules, managed centrally from the Cursor dashboard and applied to all team members across all projects.

Use CaseTeam RulesProject Rules
Organization-wide coding standardsYesNo
Security and compliance requirementsYesNo
Project-specific architecture patternsNoYes
Technology-specific conventionsNoYes
Communication style preferencesYesNo
  1. Open the Cursor dashboard at cursor.com/dashboard
  2. Navigate to the team content tab
  3. Click “Add Rule” to create a new team rule
  4. Write the rule as free-form plain text (Team Rules do not support globs, alwaysApply, or rule types)
  5. Choose whether to enforce the rule (prevents team members from disabling it)
  6. Enable the rule to make it active

The precedence order is Team Rules > Project Rules > User Rules. An enforced Team Rule overrides any conflicting project or personal rule, which is what makes it the right home for the standards that must not vary: security practices, error handling patterns, compliance requirements.

If your team uses MCP servers (database, GitHub, Jira), commit the configuration so every developer has the same tools available. Use the maintained servers — the old @modelcontextprotocol/server-github and @modelcontextprotocol/server-postgres npm packages are both deprecated (“no longer supported”). GitHub’s first-party server now ships as a remote endpoint, and the reference Postgres server moved to the archive:

.cursor/mcp.json
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
},
"postgres": {
"command": "npx",
"args": ["-y", "@henkey/postgres-mcp-server", "--connection-string", "${DATABASE_URL}"]
}
}
}

The GitHub entry uses the hosted github/github-mcp-server (https://api.githubcopilot.com/mcp/); for an air-gapped or self-hosted team, swap it for the Docker stdio build from that same repo. For Postgres, @henkey/postgres-mcp-server (or crystaldba’s postgres-mcp) is maintained and read-aware. Document the required environment variables in your README or onboarding guide — each developer supplies their own tokens, but the server configuration is shared.

Save the prompts your team runs repeatedly as files in the repo:

Terminal window
mkdir -p .cursor/prompts
.cursor/prompts/new-endpoint.md
Create a new API endpoint following these project conventions:
1. Route handler in src/api/[resource]/route.ts using the pattern in @src/api/users/route.ts
2. Service layer in src/services/[resource].ts using the pattern in @src/services/user.ts
3. Type definitions in src/types/[resource].ts
4. Vitest tests in src/services/__tests__/[resource].test.ts
5. Zod validation schema for request body
6. Proper error handling using our AppError class from @src/lib/errors.ts
Run pnpm test after implementation to verify everything passes.
.cursor/prompts/pre-pr.md
Review and fix all issues before this PR is ready:
1. pnpm run typecheck -- fix TypeScript errors
2. pnpm run lint -- fix linting issues
3. pnpm run test -- fix test failures (do not modify assertions)
4. Remove any console.log/debug statements
5. Verify all new exports are added to index files
6. Check that no sensitive data (API keys, passwords) is committed
Summarize all changes made.

Team members pull these into any agent conversation with @.cursor/prompts/new-endpoint.md. The prompt encodes the team’s conventions, so the newest member produces the same shape of output as the longest-serving one.

Slash commands for the workflows everyone runs

Section titled “Slash commands for the workflows everyone runs”

Custom slash commands live in .cursor/commands/ and are invoked with a / prefix. They are the right form for a workflow with no arguments that everybody runs the same way.

Create .cursor/commands/review.md:

---
description: Review code changes for quality, security, and consistency
---
Review the current changes (use git diff to see them) and check for:
1. **Security**: SQL injection, XSS, hardcoded secrets, missing auth checks
2. **Error handling**: All async operations have try/catch, errors use AppError format
3. **Testing**: New logic has corresponding tests, edge cases are covered
4. **Patterns**: Code follows existing patterns in the codebase (check similar files)
5. **Performance**: No N+1 queries, no unnecessary re-renders, no blocking operations
For each issue found, provide:
- The file and line number
- What the issue is
- A specific fix
Use only search tools -- do not make any edits.

And .cursor/commands/pr-description.md:

---
description: Generate a PR description from current changes
---
Analyze the current branch changes (compare against main) and generate a PR description with:
1. **Summary**: 2-3 sentence overview of what changed and why
2. **Changes**: Bulleted list of specific changes, organized by area
3. **Testing**: How these changes were tested
4. **Migration notes**: Any database changes, environment variable additions, or breaking changes
Use git diff main...HEAD to see all changes. Do not make any edits.

Most of onboarding happens by cloning: .cursor/rules/, .cursor/commands/ and .cursor/prompts/ arrive with the repo, and dashboard Team Rules apply automatically. What is left is the machine setup and the first few hours of guided practice.

Two things are worth doing in person rather than on the checklist: have them run one task in Ask mode before touching Agent mode, so they build a model of the codebase first, and pair on their first Agent mode task to demonstrate what an effective prompt looks like in this repo.

Give five minutes of one weekly standup to Cursor. Each week, one person shares a prompt that worked unusually well, a workflow they found, a problem they could not solve (the team often can), or a suggestion for a new project rule.

That is the feedback loop that keeps the shared configuration from going stale: the best prompts land in .cursor/prompts/, the recurring corrections become rules, and the whole team moves rather than one enthusiast.

AI-generated code needs a different review lens. The agent follows patterns well but misses business logic, introduces security gaps, and over-engineers simple things.

  • Hallucinated imports: packages that are not in your dependencies
  • Inconsistent patterns: a different pattern than the one that exists, especially where rules are incomplete
  • Missing edge cases: the happy path handled well, the error paths not at all
  • Over-engineering: abstractions, caching, or error handling the feature does not need yet
  • Security blind spots: SQL injection through string concatenation, missing auth checks, hardcoded test credentials left in production code

Before requesting a human review, every team member runs the AI pass:

  1. The developer finishes the feature
  2. They run @.cursor/prompts/pre-pr.md to fix linting, types, and tests
  3. They run Bugbot on the branch or PR (Cursor’s automated bug detection)
  4. They run the team review prompt below
  5. They fix everything found in steps 2-4
  6. They open the PR for human review

This pre-review catches most of what a human reviewer would otherwise flag, which frees the human to look at architecture decisions, business logic correctness, and design trade-offs — exactly where AI is weakest.

The saved /review command above is what most people run day to day. Paste the longer prompt instead when you want the review to consult the committed rules explicitly and hunt for architecture violations such as circular dependencies:

The last check before submitting is narrower and mechanical — the things that are embarrassing rather than architectural:

Write the policy down as a rule so it is enforced by the same mechanism as everything else, and review it during onboarding:

.cursor/rules/security.md
## AI Security Policy
### What the AI Can Access
- All source code in the repository
- Development and staging databases via MCP (never production)
- Public documentation and APIs
- CI/CD logs and build artifacts
### What the AI Must Not Do
- Access production databases or servers
- Commit or push code without human review
- Store API keys, passwords, or secrets in code
- Disable security middleware or authentication checks
- Modify .env files or deployment configurations
### Privacy Requirements
- Enable Privacy Mode for all proprietary code
- Do not paste customer data into agent conversations
- Do not reference internal company documents by URL
- Review all AI-generated code for accidentally exposed credentials
### Auto-Run Restrictions
- Set Auto-Run Mode to Run in Sandbox or Ask Every Time. Never enable Run Everything.
- Restrict the Command Allowlist to test, build, lint, and file-creation commands only.
- Keep git push, deploy, npm publish, and any credential-touching commands off the allowlist so they always require approval.
- Do not rely on a denylist. Cursor deprecated the command denylist in 1.3 (it was trivially bypassable); the sandbox plus a tight allowlist is the supported safety model.

On a Team or Enterprise plan, promote the non-negotiable half of this to an enforced Team Rule. A security standard that an individual can disable in their own settings is a suggestion.

People get different output despite the shared rules. User Rules have the lowest precedence, so they cannot override Team or Project Rules — but uncommitted local rule files can still be in play. Check for rule files that never made it into the repo, and where a personal preference genuinely conflicts with a project rule, settle it as a team and update the rule rather than letting both exist.

Rules go stale as the codebase evolves. Make rule updates part of the change itself: when you refactor a pattern a rule references, update the rule in the same PR.

Too many rules slow the agent down. Rules consume context tokens. Thirty rules with alwaysApply: true means every conversation starts with significant overhead. Audit which ones truly need to be always-applied rather than glob-scoped or agent-decided.

The AI review is too noisy. Refine the prompt with your exceptions: “Our project intentionally uses ‘any’ types in the GraphQL resolver layer — do not flag these.” The more specific the prompt, the fewer false positives, and the more likely people keep running it.

Nobody knows which commands exist. The / prefix lists them in chat, but new team members do not know to look. Document them in the README or contributing guide alongside the prompt files.

The onboarding checklist goes out of date. Give one person the job of updating it whenever Cursor ships a significant release or the team changes a workflow, and review it quarterly at minimum.

MCP server tokens expire. Set calendar reminders for renewal and document the rotation process in the onboarding guide. Short-lived tokens from your organization’s secret management system are better than long-lived ones in a .env.