Aller au contenu principal

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

RuleDescriptionPaths
accessibilityIMPORTANT: Every image must have an alt attribute....**/*.tsx, **/*.jsx...
api// Error { "success": false, "error": { "code": "V...**/api/**, **/routes/**...
astroAstro renders zero JS by default. Components a...**/*.astro, **/astro.config.*...
base-maintenanceAny addition, removal or rename in .claude/ sile....claude/skills/**, .claude/agents/**...
csharp// 2. Private readonly fields private readonly IUs...**/*.cs, **/*.csproj...
deploy-safetyEvery deployment must be validated before executio...**/docker-compose*.yml, **/docker-compose*.yaml...
design-styleThe 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...
lspLSP available via ENABLE_LSP_TOOL=1 or LSP plugi...**/*.ts, **/*.tsx...
migration-safetyMajor framework or dependency migrations are risky...**/package.json, **/tsconfig.json...
nextjsNext.js Rules**/next.config.*, **/app/**...
performanceIMPORTANT: LCP < 2.5s - Optimize above-the-fold im...**/*.tsx, **/*.jsx...
phpdeclare(strict_types=1);**/*.php, **/composer.json
pythonimport requests from pydantic import BaseModel**/*.py, **/requirements*.txt...
reactexport function MyComponent({ title, onAction }: P...**/*.tsx, **/components/**...
researchBefore implementing a custom solution, check wheth...**/*.ts, **/*.tsx...
rubyusers.each douser
rust// 2. Constants const MAX_CONNECTIONS: usize = 100...**/*.rs, **/Cargo.toml
security3 attack vectors identified (Feb. 2026) when cloni...**/auth/**, **/api/**...
service-workerThe SW must NEVER cache `request.mode === "navigat...**/sw.js, **/service-worker*...
svelteSvelte 5+ uses runes: $state, $derived, `$...**/*.svelte, **/*.svelte.ts...
tdd-enforcementIMPORTANT: When the user asks to implement, add, c...**/*.ts, **/*.tsx...
testing// Act - Execute the action const result = functio...**/*.test.ts, **/*.test.tsx...
typescriptTypeScript Rules**/*.ts, **/*.tsx...
verificationAny implementation must be verified BEFORE being c...**/*.ts, **/*.tsx...
vueconst count = ref(0) const double = computed(() =>...**/*.vue, **/composables/**...
workflowBefore 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