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.
- .github/copilot-instructions.mdCopilot instructions
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
- Distinctive: line 9
DO NOT load all rule files at once: Use progressive disclosure to load only relevant rules.
- Distinctive: line 37
Use the Read tool to load specific rule files:
- Distinctive: line 171
All rules loaded: ~45K tokens
- Distinctive: line 201
Expand as Needed: Add more if task requires
- Distinctive: line 204
Stay Focused: Don't load unrelated rules
≈ “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.
Files
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.mdFor 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.mdFor 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.mdFor testing tasks:
Read .claude/rules/base/testing-philosophy.md
Read .claude/rules/languages/{language}/testing.mdStep 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)
| Rule | File | When to Use |
| Code Quality | base/code-quality.md | Every task |
| Testing Philosophy | base/testing-philosophy.md | Testing tasks |
| Security Principles | base/security-principles.md | Security-relevant tasks |
| Git Workflow | base/git-workflow.md | Commits/PRs |
| Architecture Principles | base/architecture-principles.md | Architecture discussions |
| 12-Factor App | base/12-factor-app.md | Deployment/SaaS |
| Refactoring Patterns | base/refactoring-patterns.md | Refactoring tasks |
Language-Specific Rules
💡 Usage Examples
Example 1: Python Testing Task
User: "Write pytest tests for this function"
Your workflow:
- Identify: Python + Testing task
- Load rules:
Read .claude/rules/base/testing-philosophy.md Read .claude/rules/languages/python/testing.md - Announce:
📚 Rules Loaded: Testing Philosophy + Python Testing - 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:
- Identify: TypeScript + React + Code Review
- 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 - Announce:
📚 Rules Loaded: Code Quality + TypeScript Standards + React Best Practices - Review against loaded rules
Token usage: ~18K (60% savings)
Example 3: Multi-Language Project
User: "Review the Python API and React frontend"
Your workflow:
- Identify: Python + TypeScript + FastAPI + React
- 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 - Announce what's loaded for each part
- 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
- Start Narrow: Load base + 1-2 specific rules
- Expand as Needed: Add more if task requires
- Always Announce: Show which rules you loaded
- Cite Sources: Reference specific rules when making recommendations
- 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
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
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.

