rules-directory-patterns

Best practices for organizing `.claude/rules/` files — the scoped instruction system that loads rules only when relevant files are open.

Content Preview
# Rules Directory Patterns

Best practices for organizing `.claude/rules/` files — the scoped instruction system that loads rules only when relevant files are open.

## Directory Structure

```
.claude/
├── CLAUDE.md              # Main project instructions (always loaded)
└── rules/
    ├── code-style.md      # No paths → loads always (like CLAUDE.md)
    ├── testing.md          # Scoped to test files
    ├── api-design.md       # Scoped to API source files
    ├── database.md         # Scoped 
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/rules-directory-patterns.md \
  https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/engineering-team/self-improving-agent/reference/rules-directory-patterns.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/alirezarezvani/claude-skills

Then reference at engineering-team/self-improving-agent/reference/rules-directory-patterns.md

Related Skills