agentleFS
Prorise-coolProrise-cool/claude-code-plugins/.cursor/rules/anti-duplication.mdc

claude-code-plugins / rules

Cursor rule1 starsChanged 11 months agoMITView on GitHub

Prevent content duplication in documentation, reports, and code. Check for existing content before creating new. Consolidate duplicates to single source of truth.

The file

We split this anti-duplication.mdc into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If truly new: Create in ONE canonical location, link from elsewhere

    line 16
  2. Distinctive:

    Before creating content, ask:

    line 46
  3. Distinctive:

    If YES to any: STOP, SEARCH, CONSOLIDATE

    line 53
  4. Distinctive:

    If information must appear in multiple places: store it ONCE, link from everywhere else.

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
anti-duplication.mdc
---
description: Prevent content duplication in documentation, reports, and code. Check for existing content before creating new. Consolidate duplicates to single source of truth.
alwaysApply: true
---

# Anti-Duplication Rule

## Core Principle

**Every piece of information should exist in EXACTLY ONE authoritative location.** All other references should link to that location.

## Before Creating Content

1. **Search first**: Does this content already exist?
2. **If similar content exists**: Link to it, update it, or consolidate - don't duplicate
3. **If truly new**: Create in ONE canonical location, link from elsewhere

## Common Scenarios

### Multiple Reports on Same Topic

**Wrong**: Separate files for findings, analysis, verification, summary

**Right**: ONE comprehensive report with sections for each

### Documentation in Multiple Files

**Wrong**: Same setup instructions in README.md and docs/setup.md

**Right**: Complete instructions in one file, link from the other

### Version/Config Info Scattered

**Wrong**: Version "2.0.0" mentioned in 4 different files

**Right**: Version in ONE canonical location, all others link to it

### Configuration Examples

**Wrong**: Same config example copied into 3+ files

**Right**: ONE canonical example, all others link to it

## Detection Questions

Before creating content, ask:

1. Have I seen this information before in this repo?
2. Is there an existing file covering this topic?
3. Am I about to copy-paste from another file?
4. Could this be a link instead of duplicate text?

If YES to any: **STOP, SEARCH, CONSOLIDATE**

## Progressive Disclosure Pattern

```text
main.md (Entry Point)
├─ Brief overview
├─ Quick reference
└─ Links to detailed guides

guide-1.md (Detail) - Complete details on topic 1
guide-2.md (Detail) - Complete details on topic 2
```

- Entry point: Overview + links (no duplicate content from details)
- Detail files: Complete information (each topic in exactly ONE file)

## When Duplication is Found

1. Identify all instances
2. Choose canonical location
3. Consolidate to that ONE location
4. Replace duplicates with links
5. Verify links work

## Golden Rule

**Link, don't duplicate.**

If information must appear in multiple places: store it ONCE, link from everywhere else.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.