Rules
Rules are path-specific instructions that apply to certain files or directories.
Location
Section titled “Location”.ai/rules/*.mdFormat
Section titled “Format”Rules require YAML frontmatter with a paths array:
---paths: - "src/components/**/*.tsx"---
# Component Guidelines
Components in this directory should:
- Use functional components with hooks- Export a default component- Include TypeScript interfacesSchema
Section titled “Schema”{ paths: string[] // Required, minimum 1 path}Path Patterns
Section titled “Path Patterns”| Pattern | Matches |
|---|---|
src/**/*.ts | All .ts files in src/ |
*.config.js | Config files in root |
**/*.test.ts | All test files |
Export Mapping
Section titled “Export Mapping”| Tool | Output |
|---|---|
| Claude Code | .claude/rules/ (symlink to directory) |
| OpenCode | .opencode/rules/ (symlink to directory) |