ai newsDi., 1. Dez.

Cursor und Claude Code auf gemeinsame Team-Regeln bringen

Arbeitet ein Team verteilt mit Cursor, Claude Code, Copilot und nächtlichen Codex-Jobs, liest jeder Agent eine eigene Regel-Datei, die verschiedene Personen zu verschiedenen Zeiten geschrieben haben. Das führt zu widersprüchlichen Vorgaben wie unterschiedlichen Umgang mit Fehlern.

dev.toSonntag 11:42 · 29.11.DE3 Min. Lesezeit
Bild: dev.to

Half the team works in Cursor and the other half in Claude Code. Someone uses Copilot in the editor, and a Codex job runs at night. Each agent reads its own instruction file, and each file was written by a different person on a different day. The Cursor rules say errors are never swallowed. CLAUDE.md says nothing about errors, and has a paragraph about a queue that was deleted in March. The same ticket, given to two agents, comes back as two designs.

You notice this at review. One pull request extends the existing module and the other builds a second one beside it, and both authors followed the rules their agent was given. The rules were different.

The fix is plain: keep the rules once, in the repository, and make every agent's instruction file a short pointer to them.

Put the rules in one directory at the root of the repository. Ours is.ai-lint/. It holds a checklist, the principles for each language, and a list of rejected patterns, each with an ID.

Then each agent gets the file it already reads, and that file says the same few things:

Before producing code: - Read.ai-lint/CHECKLIST.md - Read the doctrine and rejects for the language in hand Rejects outrank preferences. Do not use a rejected pattern unless an override is explicitly requested. Enter fullscreen mode Exit fullscreen mode For Claude Code that file is CLAUDE.md. For Cursor it is.cursor/AGENTS.md. For Copilot it is.github/copilot-instructions.md. The pointer files are ten or twenty lines each and they almost never change. Everything that does change lives in one place, so a rule is edited in one commit and every agent picks it up on the next prompt.

Do not paste the rules themselves into each agent's file. Three copies of a rule are three things to keep in step, and they will drift apart within a month.

"Follow our architecture conventions" cannot be checked. A rule with an ID can. When an agent refuses a plan, it should say which rule it refused under, and a reviewer should be able to open that rule and read it.

This is what makes two agents comparable. If Cursor cites AR-R2 for a change and Claude Code writes the same change without comment, the wiring on the Claude side is broken, and you know it in one prompt.

Test it that way after setup. Give each agent the same request that breaks a rule, for example a module that tracks sessions in a global variable. A wired agent names the reject, says why it exists, and offers the aligned version or asks whether you want an override. An agent that writes the code without a word is not reading the rules.

Rules that can never be broken get ignored quietly. Give the team one way to break a rule on purpose: an override block with four fields, Override, Reason, Risk and Mitigation. The agent proposes it, a person accepts it, and it lands in the diff where the next reader finds it.

Then there is a record. When the same override shows up three times, the rule is wrong for your codebase and you change the rule.

Stale rules do more harm than missing ones, because the agent follows them. Three habits hold up:

Since the rules are ordinary files in the repository, they get the same review as code. That is the whole mechanism. Nothing has to be synced and there is no service to run.

AI Lint is that directory, already written. It is a.ai-lint/ folder with a pre-code checklist, an override protocol, architecture and security doctrine, and named rejects such as AR-R2: Parallel Solutions and SEC-R1: Radioactive Secrets, plus wiring files for Cursor, Claude Code, Copilot and other agents. It ships as a ZIP that works offline in a private repository. It is guidance for the agent: a linter or type checker still does the mechanical checks, and a person still reads the diff.

Originaltitel: Make Cursor and Claude Code follow the same team rulesQuelle: dev.to (dev.to). Original öffnen