Sharing AI Development Rules Across Your Organization

Published: (January 31, 2026 at 12:44 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

How centralized‑rules achieved 74.4 % token savings and consistent AI behavior with progressive disclosure and context‑aware rule loading.

The AI Rules Governance Problem

Every developer on a team tends to keep a personal AI rules file:

  • One CLAUDE.md says “always write tests.”
  • Another insists on “use TypeScript strict mode.”
  • A third just copies whatever worked on the last project.

AI coding assistants (Claude Code, Cursor, GitHub Copilot, Gemini) then receive inconsistent instructions across projects and people. The consequences are:

  • Tribal knowledge – best practices live only in individual heads and personal config files.
  • Copy‑paste chaos – rules are shared via Slack and drift immediately.
  • Onboarding friction – new developers spend days figuring out “how we do AI here.”
  • Token waste – loading all rules even when only a subset is needed for the current context.

At scale (hundreds of developers), you can’t audit what instructions your AI tools receive, enforce security rules consistently, or measure compliance with AI development standards.

One Source of Truth: Centralized Rules

The core insight is simple: a single, version‑controlled repository of AI development rules, loaded only when relevant. This avoids overwhelming the model and wasting tokens.

Progressive Disclosure

  1. Detect context – scan the project for language markers (package.json, pyproject.toml, go.mod).
  2. Match keywords – analyze the prompt for task‑specific terms (e.g., test, security, refactor).
  3. Display banner – show which rules apply to the current task.
  4. Apply rules – the AI follows only the relevant coding standards.

Four‑Dimensional Rule Structure (MECE)

DimensionDescription
BaseUniversal rules for all projects (git workflow, code quality, security principles).
LanguageLanguage‑specific rules (Python, TypeScript, Go, Java, C#, Rust).
FrameworkFramework‑specific rules (React, Django, FastAPI, Express, Spring Boot).
CloudCloud‑provider rules (AWS, Vercel, Azure, GCP – extensible).

Each rule lives in exactly one dimension, ensuring no duplication and complete coverage of common scenarios.

Automatic Detection & Loading

The install script inspects the repository and loads the appropriate rule set.

# Language detection
pyproject.toml Load Python rules
package.json Load JavaScript/TypeScript rules
go.mod Load Go rules

# Framework detection
"fastapi" in dependencies Load FastAPI rules
"react"   in dependencies Load React rules

# Cloud detection
vercel.json Load Vercel rules

Measured Impact

Task TypeFiles LoadedTokens UsedTokens SavedSavings
Code Review23,44021,79686.4 %
Write Tests211,16314,07355.8 %
FastAPI Endpoint38,60816,62865.9 %
Git Commit22,61822,61889.6 %
Average2.256,45718,77974.4 %

Across a variety of tasks, loading only the relevant rule files reduced token consumption dramatically while delivering consistent AI behavior.

Installation

The installation is a single command and idempotent (safe to run multiple times).

# Global installation (all projects)
curl -fsSL https://raw.githubusercontent.com/paulduvall/centralized-rules/main/install-hooks.sh | bash
# Project‑specific installation
curl -fsSL https://raw.githubusercontent.com/paulduvall/centralized-rules/main/install-hooks.sh | bash -s -- --local

Get Started

The repository is open source under the MIT license:

github.com/PaulDuvall/centralized-rules

Star it, try it, and feel free to suggest any changes.

Back to Blog

Related posts

Read more »