agentleFS
PaulDuvallPaulDuvall/centralized-rules/.claude/AGENTS.md

centralized-rules

AGENTS.md31 starsChanged 11 months agoMITView on GitHub

Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC") This directory contains development rules organized hierarchically for on-demand loading. DO NOT load all rule files at once. Use progressive disclosure to load only relevant rules. Identify from the user's question: - Language: Python (.py), TypeScript (.ts/.tsx), Go (.go), etc. - Framework: React, FastAPI, Django, Express, etc. - Task type: Testing, refactoring, code review, new feature, etc. Use the Read tool to load specific rule files: For every task: For language-specific tasks: For…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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:

    DO NOT load all rule files at once: Use progressive disclosure to load only relevant rules.

    line 9
  2. Distinctive:

    Use the Read tool to load specific rule files:

    line 37
  3. Distinctive:

    All rules loaded: ~45K tokens

    line 171
  4. Distinctive:

    Expand as Needed: Add more if task requires

    line 201
  5. Distinctive:

    Stay Focused: Don't load unrelated rules

    line 204

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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
AGENTS.md

Development Agent Configuration

Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")

🎯 Progressive Disclosure Rule System

This directory contains development rules organized hierarchically for on-demand loading.

DO NOT load all rule files at once. Use progressive disclosure to load only relevant rules.


📁 Directory Structure

.claude/rules/
├── base/              # Universal rules (language-agnostic)
├── languages/         # Language-specific rules
├── frameworks/        # Framework-specific rules
├── cloud/             # Cloud provider rules
└── index.json         # Machine-readable rule index

🔍 Discovery Process

Step 1: Analyze User Request

Identify from the user's question:

  • Language: Python (.py), TypeScript (.ts/.tsx), Go (.go), etc.
  • Framework: React, FastAPI, Django, Express, etc.
  • Task type: Testing, refactoring, code review, new feature, etc.

Step 2: Load Relevant Rules

Use the Read tool to load specific rule files:

For every task:

Read .claude/rules/base/code-quality.md

For language-specific tasks:

Python code → Read .claude/rules/languages/python/coding-standards.md
TypeScript  → Read .claude/rules/languages/typescript/coding-standards.md
Go code     → Read .claude/rules/languages/go/coding-standards.md

For framework-specific tasks:

FastAPI → Read .claude/rules/frameworks/fastapi/best-practices.md
React   → Read .claude/rules/frameworks/react/best-practices.md
Django  → Read .claude/rules/frameworks/django/best-practices.md

For testing tasks:

Read .claude/rules/base/testing-philosophy.md
Read .claude/rules/languages/{language}/testing.md

Step 3: Announce What You Loaded

Show visual feedback:

📚 **Rules Loaded for This Task:**
✓ Code Quality (.claude/rules/base/code-quality.md)
✓ Python Coding Standards (.claude/rules/languages/python/coding-standards.md)
✓ FastAPI Best Practices (.claude/rules/frameworks/fastapi/best-practices.md)

📋 Rule Index - This Project

Detected Configuration:

  • Languages:

Available Rules:

Base Rules (Always Available)

RuleFileWhen to Use
Code Qualitybase/code-quality.mdEvery task
Testing Philosophybase/testing-philosophy.mdTesting tasks
Security Principlesbase/security-principles.mdSecurity-relevant tasks
Git Workflowbase/git-workflow.mdCommits/PRs
Architecture Principlesbase/architecture-principles.mdArchitecture discussions
12-Factor Appbase/12-factor-app.mdDeployment/SaaS
Refactoring Patternsbase/refactoring-patterns.mdRefactoring tasks

Language-Specific Rules


💡 Usage Examples

Example 1: Python Testing Task

User: "Write pytest tests for this function"

Your workflow:

  1. Identify: Python + Testing task
  2. Load rules:
    Read .claude/rules/base/testing-philosophy.md
    Read .claude/rules/languages/python/testing.md
  3. Announce:
    📚 Rules Loaded: Testing Philosophy + Python Testing
  4. Apply rules and write tests

Token usage: ~15K (vs 45K if loading all rules)


Example 2: React Component Review

User: "Review this React component"

Your workflow:

  1. Identify: TypeScript + React + Code Review
  2. Load rules:
    Read .claude/rules/base/code-quality.md
    Read .claude/rules/languages/typescript/coding-standards.md
    Read .claude/rules/frameworks/react/best-practices.md
  3. Announce:
    📚 Rules Loaded: Code Quality + TypeScript Standards + React Best Practices
  4. Review against loaded rules

Token usage: ~18K (60% savings)


Example 3: Multi-Language Project

User: "Review the Python API and React frontend"

Your workflow:

  1. Identify: Python + TypeScript + FastAPI + React
  2. Load rules:
    # Backend
    Read .claude/rules/base/code-quality.md
    Read .claude/rules/languages/python/coding-standards.md
    Read .claude/rules/frameworks/fastapi/best-practices.md
    
    # Frontend
    Read .claude/rules/languages/typescript/coding-standards.md
    Read .claude/rules/frameworks/react/best-practices.md
  3. Announce what's loaded for each part
  4. Apply appropriate rules to each codebase

📊 Token Efficiency

Before (monolithic .claude/RULES.md):

  • All rules loaded: ~45K tokens
  • Available for code: ~55K tokens

After (hierarchical .claude/rules/):

  • Selective loading: ~12-18K tokens (2-3 files)
  • Available for code: ~82-88K tokens
  • Improvement: 60-80% more context for code!

🔧 Advanced: Using index.json

For programmatic rule discovery:

# See all available rules
cat .claude/rules/index.json | jq '.rules'

# Find rules for a specific language
cat .claude/rules/index.json | jq '.rules.languages.python'

# List all base rules
cat .claude/rules/index.json | jq '.rules.base[] | .name'

⚠️ Important Guidelines

  1. Start Narrow: Load base + 1-2 specific rules
  2. Expand as Needed: Add more if task requires
  3. Always Announce: Show which rules you loaded
  4. Cite Sources: Reference specific rules when making recommendations
  5. Stay Focused: Don't load unrelated rules

Goal: Load ~10-15K of relevant rules, leaving 85-90K for code analysis.


🆘 Troubleshooting

Q: What if no rules match the task? A: Load base/code-quality.md as a safe default.

Q: Should I load all base rules? A: No! Only load relevant base rules for the task type.

Q: What about commits/git tasks? A: Load base/git-workflow.md specifically for those tasks.

Q: Can I load multiple language rules? A: Yes, for multi-language projects, load rules for each language used.


Generated by progressive disclosure sync system

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.