201-no-version-bloat

Eine Regel für eine übersichtliche Projektstruktur, die doppelte Dateien und Namen wie „v2“ oder „_new“ vermeiden soll.

In plain words
What is it for?
Zum Einordnen von Hauptcode, Tests, Skripten, Hilfsfunktionen, Geschäftslogik, Datendefinitionen und Dokumentation in klar getrennte Ordner.
Why use it?
Sie verhindert, dass mehrere ähnliche Versionen derselben Funktion entstehen und dadurch Wartung und Einarbeitung schwieriger werden.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/hamzaamjad/cursor-rules/201-no-version-bloat
Clone the repo
git clone --depth 1 https://github.com/hamzaamjad/cursor-rules
Per session 2,928 This file is loaded in full into every session.
When invoked 2,928 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02928 $0.02928
Opus 5 $0.01464 $0.01464
Sonnet 5 $0.00586 $0.00586
Haiku 4.5 $0.00293 $0.00293

Measured 2d ago against content hash da6d19a9ccc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

201-no-version-bloat scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/200-engineering/201-no-version-bloat.mdc · 231 lines

How it starts

The opening of the file, as written. The whole thing — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.

No Version Bloat Rule

  • Purpose: Maintain clean architecture by preventing creation of duplicate "enhanced", "v2", or "_new" versions of existing files. Empirical Impact: Projects with version bloat show 45% higher maintenance costs and 3x longer onboarding time.

  • Principle: Integrate improvements into existing files rather than creating parallel versions.

  • Requirements:

    1. Before Creating New Files: Check if functionality belongs in existing file
    2. Naming Convention: Never use suffixes like "_enhanced", "_v2", "_new", "_improved"
    3. Consolidation First: If prototyping created temporary versions, consolidate immediately
    4. Git Strategy: Use branches for experimental features, not duplicate files
    5. Directory Organization: Enforce logical grouping to prevent file scatter:
      /project/
      ├── core_files.py          # Main functionality
      ├── /tests/                # All testing files
      ├── /scripts/              # Deployment & utilities  
      ├── /utils/                # Helper functions
      ├── /services/             # Business logic
      ├── /schemas/              # Data definitions
      └── /docs/                 # Documentation
      
    6. Stigmergic Version Tracking: Leave evolution markers in files:
      # EVOLUTION_TRAIL: basic_impl.v1 -> optimized.v2 -> current
      # DEPRECATED_FEATURES: old_method (removed 2025-01-02)
      # ENHANCEMENT_MARKER: Added caching support - 30% faster
      
    7. Version Decay Pattern: Temporary files auto-expire after 7 days:
      # TEMPORARY_FILE: expires 2025-01-09
      # PURPOSE: Testing new algorithm approach
      # MERGE_TARGET: main_module.py
      
    8. Duplicate Detection: Regularly scan for similar files:
      find . -name "*webhook*" | sort  # Find potential duplicates
      wc -l file1.py file2.py          # Compare file sizes
      
  • Debugging Scenario Protocol (NEW):

    1. Temporary File Naming: Use debug_*, temp_*, or test_* prefixes for debugging files
    2. Immediate Cleanup Strategy: Set cleanup reminder when creating debugging files
    3. Consolidation Timeline: Consolidate within 24 hours of debugging completion
    4. Purpose-Specific Naming: test_official_spec.py > test_v2.py
    5. Test File Organization:
      /tests/
      ├── test_component_name.py     # Main component tests
      ├── test_integration.py        # Integration tests
      ├── test_debug_specific.py     # Specific debugging (temporary)
      └── conftest.py               # Shared fixtures
      
  • Cleanup Protocol:

    1. Identify Duplicates: Use file size comparison and naming patterns
    2. Determine Primary: Choose most recent, feature-complete version
    3. Move Supporting Files: Organize tests, utils, scripts to proper directories
    4. Remove Obsolete: Delete older versions after verification
    5. Update Documentation: Reflect new organization in README/docs
    6. Test Consolidation: Merge related test files into comprehensive suites
  • Validation:

    • Check: Are there any duplicate versions of core files?
    • Check: Do new features extend existing infrastructure?
    • Check: Is the codebase free of abandoned prototype files?
    • Check: Are files organized in logical directories?
    • Check: Do similar-named files serve distinct purposes?
    • Check: Are debugging/test files consolidated after completion?
  • Examples:

    • ❌ BAD: Creating safir_enhanced.py alongside safir.py
    • ✅ GOOD: Adding enhanced methods to existing safir.py
    • ❌ BAD: llm_service_v2.py for new features
    • ✅ GOOD: Extending llm_service.py with new capabilities
    • ❌ BAD: webhooks/webhook_handler.py + webhook_handler.py (duplicates)
    • ✅ GOOD: Single webhook_handler.py with all functionality
    • ❌ BAD: test_webhook.py, test_webhook_v2.py, webhook_test_focused.py
    • ✅ GOOD: test_official_specification.py, test_production_integration.py (distinct purposes)

Read the full file on GitHub · 231 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 231 lines · 2,928 tokens per session scan A da6d19a9ccc9

Subscribe to this mod's changes

201-no-version-bloat is a cursor rule published in the GitHub repository hamzaamjad/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 2,928 tokens to every session, about $0.0146 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.