|
| 1 | +# yaml-language-server: $schema=https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json |
| 2 | + |
1 | 3 | language: en-US |
| 4 | +early_access: false |
| 5 | +enable_free_tier: true |
2 | 6 |
|
3 | 7 | reviews: |
4 | 8 | # Tone & automation |
5 | 9 | profile: assertive |
6 | 10 | auto_review: |
7 | 11 | base_branches: |
8 | | - - "dev" |
| 12 | + - 'dev' |
| 13 | + - 'master' |
9 | 14 | enabled: true |
10 | 15 | drafts: false |
11 | | - |
| 16 | + |
12 | 17 | # Reviewers & labels |
13 | 18 | suggested_reviewers: true |
14 | 19 | auto_assign_reviewers: true |
15 | 20 | suggested_labels: true |
16 | 21 | auto_apply_labels: true |
17 | 22 |
|
| 23 | + # Status handling |
| 24 | + fail_commit_status: true |
| 25 | + |
| 26 | + # Additional review features |
| 27 | + high_level_summary: true |
| 28 | + changed_files_summary: true |
| 29 | + sequence_diagrams: true |
| 30 | + |
18 | 31 | # Focus CR on the meaningful parts of the repo |
19 | 32 | path_filters: |
20 | | - - "src/**" |
21 | | - - "prisma/**" |
22 | | - - "docker/**" |
23 | | - - "scripts/**" |
24 | | - - "docs/**" |
25 | | - - "README.md" |
26 | | - - "!public/assets/**" |
27 | | - - "!.next/**" |
28 | | - - "!**/*.tsbuildinfo" |
| 33 | + - 'src/**' |
| 34 | + - 'prisma/**' |
| 35 | + - 'docker/**' |
| 36 | + - 'scripts/**' |
| 37 | + - 'docs/**' |
| 38 | + - 'README.md' |
| 39 | + - '!public/assets/**' |
| 40 | + - '!.next/**' |
| 41 | + - '!**/*.tsbuildinfo' |
29 | 42 |
|
30 | 43 | # Apply house rules per area |
31 | 44 | path_instructions: |
32 | | - - path: "src/app/(server)/api/**/route.ts" |
| 45 | + - path: 'src/app/[(]server[)]/api/**/route.ts' |
33 | 46 | instructions: > |
34 | 47 | Keep route handlers thin: validate with Zod (shared schemas), call a Service, |
35 | 48 | then return a typed response. Do NOT import prisma/redis or perform business logic here. |
36 | | - - path: "src/app/(server)/services/**" |
| 49 | + Example: parse with a schema from src/lib/validation/** and call a function in |
| 50 | + src/app/(server)/services/** that returns typed data. |
| 51 | + - path: 'src/app/[(]server[)]/services/**' |
37 | 52 | instructions: > |
38 | 53 | All business logic lives here. No Request/Response/cookies; accept plain inputs |
39 | 54 | and return typed results. Reuse shared types and Zod schemas from src/lib/validation/**. |
40 | | - - path: "src/lib/validation/**" |
| 55 | + Keep services framework-agnostic and unit-testable. |
| 56 | + - path: 'src/lib/validation/**' |
41 | 57 | instructions: > |
42 | 58 | Define Zod schemas and infer types via z.infer. Avoid duplicate shapes; export |
43 | | - schemas for reuse in Services and API routes. |
44 | | - - path: "src/app/(client)/**" |
| 59 | + schemas for reuse in Services and API routes. Co-locate schema files by domain. |
| 60 | + - path: 'src/app/[(]client[)]/**' |
45 | 61 | instructions: > |
46 | 62 | Use TanStack Query hooks for server data (no inline fetches in components). |
47 | | - Keep components presentational; Tailwind-first styling. |
48 | | - - path: "prisma/**" |
| 63 | + Import query keys from src/lib/queryKeys.ts (canonical). Keep components presentational; |
| 64 | + Tailwind-first styling. Example: import { keys } from 'src/lib/queryKeys' and call |
| 65 | + a typed hook rather than fetch in the component. |
| 66 | + - path: 'src/shadcn-ui/**' |
| 67 | + instructions: > |
| 68 | + Generated shadcn primitives. Do not modify these files. Create wrapper or |
| 69 | + derivative components under src/app/(client)/components/** and compose from |
| 70 | + the shadcn primitives instead. |
| 71 | + - path: 'prisma/**' |
49 | 72 | instructions: > |
50 | 73 | If schema changes, include proper Prisma migration(s) and update seed/types. |
51 | 74 | Avoid schema edits without migrations. |
52 | | - - path: "scripts/**" |
| 75 | + - path: 'src/db/prisma.ts' |
| 76 | + instructions: > |
| 77 | + Prisma client must be a singleton and server-only. Do not import in client code. |
| 78 | + - path: 'scripts/**' |
53 | 79 | instructions: > |
54 | 80 | Tooling only (env/db/ops). No app business logic. |
55 | | - - path: "docker/**" |
| 81 | + - path: 'src/lib/queryKeys.ts' |
| 82 | + instructions: > |
| 83 | + Canonical source for TanStack Query keys. Add new keys here and import |
| 84 | + from this module across the client instead of ad-hoc arrays. |
| 85 | + - path: 'docker/**' |
56 | 86 | instructions: > |
57 | 87 | Ensure env parity with env/.env.example. Prefer minimal, portable changes. |
58 | | - - path: "docs/**" |
| 88 | + - path: 'docs/**' |
59 | 89 | instructions: > |
60 | 90 | Keep Development Guide aligned with current directory structure and conventions. |
61 | 91 | Update docs when APIs/routes/schemas change. |
62 | | - - path: "src/shadcn-ui/**" |
63 | | - instructions: > |
64 | | - Generated shadcn primitives. Do not modify these files. Create wrapper or |
65 | | - derivative components under src/app/(client)/components/** and compose from |
66 | | - the shadcn primitives instead. |
67 | | - - path: "src/middleware.ts" |
| 92 | + - path: 'src/middleware.ts' |
68 | 93 | instructions: > |
69 | 94 | Global middleware for auth/guards/request shaping only. No business logic. |
70 | | - - path: "src/lib/middleware/**" |
| 95 | + - path: 'src/lib/middleware/**' |
71 | 96 | instructions: > |
72 | 97 | Shared middleware helpers. Keep lean; no business logic or side effects. |
73 | | - - path: "src/lib/queryKeys.ts" |
74 | | - instructions: > |
75 | | - Canonical source for TanStack Query keys. Add new keys here and import |
76 | | - from this module across the client instead of ad-hoc arrays. |
77 | | - |
78 | | - # Teach CR how to label PRs for this repo |
79 | | - labeling_instructions: | |
80 | | - Apply labels as follows (multiple may apply): |
81 | | - - 🛠 Backend: changes under src/app/(server)/**, src/db/**, prisma/** |
82 | | - - 🎨 Frontend: changes under src/app/(client)/**, src/shadcn-ui/** |
83 | | - - 📖 Documentation: changes under docs/**, README.md, CONTRIBUTING.md, SECURITY.md |
84 | | - - 🔧 Refactor: structural moves/renames or cleanup without API/route contract changes |
85 | | - - 🐛 Bug: fixes for regressions, runtime errors, or failing paths (commit messages often start with "fix:") |
86 | | - - ✨ New Feature: new API route/service, new UI page/component, or new capability |
87 | | - - 🧹 Cleanup: dead code removal, lint fixes, directory tidying |
88 | | - - 🖌️ UX/UI Change: layout/CSS/props purely for UI/UX |
89 | | - - 🧩 Core: proxy/chat/auth/llmConfig or other critical modules |
90 | | - - ✅ Testing: adds or updates tests/test scaffolding |
| 98 | +
|
| 99 | + # Teach CR how to label PRs for this repo (array of objects) |
| 100 | + labeling_instructions: |
| 101 | + - { |
| 102 | + label: '🛠 Backend', |
| 103 | + instructions: 'Apply to changes under src/app/(server)/**, src/db/**, or prisma/**.', |
| 104 | + } |
| 105 | + - { |
| 106 | + label: '🎨 Frontend', |
| 107 | + instructions: 'Apply to changes under src/app/(client)/** or src/shadcn-ui/**.', |
| 108 | + } |
| 109 | + - { |
| 110 | + label: '📖 Documentation', |
| 111 | + instructions: 'Apply to changes under docs/**, README.md, CONTRIBUTING.md, SECURITY.md.', |
| 112 | + } |
| 113 | + - { |
| 114 | + label: '🔧 Refactor', |
| 115 | + instructions: 'Apply to structural moves/renames or cleanup without API/route contract changes.', |
| 116 | + } |
| 117 | + - { |
| 118 | + label: '🐛 Bug', |
| 119 | + instructions: "Apply to fixes for regressions, runtime errors, or failing paths (e.g., commit starts with 'fix:').", |
| 120 | + } |
| 121 | + - { |
| 122 | + label: '✨ New Feature', |
| 123 | + instructions: 'Apply to new API routes/services, new UI pages/components, or new capabilities.', |
| 124 | + } |
| 125 | + - { |
| 126 | + label: '🧹 Cleanup', |
| 127 | + instructions: 'Apply to dead code removal, lint fixes, or directory tidying.', |
| 128 | + } |
| 129 | + - { |
| 130 | + label: '🖌️ UX/UI Change', |
| 131 | + instructions: 'Apply to layout/CSS/prop changes purely for UI/UX.', |
| 132 | + } |
| 133 | + - { |
| 134 | + label: '🧩 Core', |
| 135 | + instructions: 'Apply to proxy/chat/auth/llmConfig or other critical modules.', |
| 136 | + } |
| 137 | + - { |
| 138 | + label: '✅ Testing', |
| 139 | + instructions: 'Apply to additions or updates to tests/test scaffolding.', |
| 140 | + } |
| 141 | + |
| 142 | + tools: |
| 143 | + eslint: |
| 144 | + enabled: true |
| 145 | + yamllint: |
| 146 | + enabled: true |
| 147 | + hadolint: |
| 148 | + enabled: true |
| 149 | + gitleaks: |
| 150 | + enabled: true |
91 | 151 |
|
92 | 152 | knowledge_base: |
93 | 153 | code_guidelines: |
94 | 154 | enabled: true |
95 | 155 | filePatterns: |
96 | | - - "README.md" |
97 | | - - "docs/**" |
98 | | - - "docs/development-guide.md" |
| 156 | + - 'README.md' |
| 157 | + - 'docs/architecture.md' |
| 158 | + - 'docs/getting-started.md' |
| 159 | + - 'docs/development-guide.md' |
| 160 | + web_search: |
| 161 | + enabled: true |
0 commit comments