Rules Catalog
30 rules automatically applied by file path
30
Rules
156
Patterns
What is a Rule?
Rules are conventions applied automatically:
- Apply by path: Activated according to the file path
- Code conventions: TypeScript, React, Flutter, etc.
- Best practices: Security, tests, API
- Transparency: Always visible in suggestions
List of rules
| Rule | Description | Paths |
|---|---|---|
accessibility | IMPORTANT: Every image must have an alt attribute.... | **/*.tsx, **/*.jsx... |
api | // Error { "success": false, "error": { "code": "V... | **/api/**, **/routes/**... |
astro | Astro renders zero JS by default. Components a... | **/*.astro, **/astro.config.*... |
base-maintenance | Any addition, removal or rename in .claude/ sile... | .claude/skills/**, .claude/agents/**... |
csharp | // 2. Private readonly fields private readonly IUs... | **/*.cs, **/*.csproj... |
deploy-safety | Every deployment must be validated before executio... | **/docker-compose*.yml, **/docker-compose*.yaml... |
design-style | The project's design direction is defined in CLAUD... | **/*.tsx, **/*.jsx... |
flutter | // State abstract class AuthState {} class AuthIni... | **/*.dart, **/lib/**... |
git | [optional body - details on the "what" and "why"] | - |
go | // Custom errors var ErrUserNotFound = errors.New(... | **/*.go, **/go.mod... |
java | // 2. Static fields private static final Logger lo... | **/*.java, **/pom.xml... |
lsp | LSP available via ENABLE_LSP_TOOL=1 or LSP plugi... | **/*.ts, **/*.tsx... |
migration-safety | Major framework or dependency migrations are risky... | **/package.json, **/tsconfig.json... |
nextjs | Next.js Rules | **/next.config.*, **/app/**... |
performance | IMPORTANT: LCP < 2.5s - Optimize above-the-fold im... | **/*.tsx, **/*.jsx... |
php | declare(strict_types=1); | **/*.php, **/composer.json |
python | import requests from pydantic import BaseModel | **/*.py, **/requirements*.txt... |
react | export function MyComponent({ title, onAction }: P... | **/*.tsx, **/components/**... |
research | Before implementing a custom solution, check wheth... | **/*.ts, **/*.tsx... |
ruby | users.each do | user |
rust | // 2. Constants const MAX_CONNECTIONS: usize = 100... | **/*.rs, **/Cargo.toml |
security | 3 attack vectors identified (Feb. 2026) when cloni... | **/auth/**, **/api/**... |
service-worker | The SW must NEVER cache `request.mode === "navigat... | **/sw.js, **/service-worker*... |
svelte | Svelte 5+ uses runes: $state, $derived, `$... | **/*.svelte, **/*.svelte.ts... |
tdd-enforcement | IMPORTANT: When the user asks to implement, add, c... | **/*.ts, **/*.tsx... |
testing | // Act - Execute the action const result = functio... | **/*.test.ts, **/*.test.tsx... |
typescript | TypeScript Rules | **/*.ts, **/*.tsx... |
verification | Any implementation must be verified BEFORE being c... | **/*.ts, **/*.tsx... |
vue | const count = ref(0) const double = computed(() =>... | **/*.vue, **/composables/**... |
workflow | Before starting work on an existing project: | - |
Categories
Languages
Frameworks
Practices
How to add a custom rule
Create a file .claude/rules/my-rule.md:
---
paths:
- "**/my-folder/**"
- "**/*.custom"
---
# My custom rules
- Rule 1
- Rule 2
See also
- Architecture - Understand the components
- Commands - Manual commands
- Skills - Auto-triggered skills