-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
67 lines (66 loc) · 3.2 KB
/
.coderabbit.yaml
File metadata and controls
67 lines (66 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: 'ja-JP'
tone_instructions: '簡潔に。重要度が high 以上のみ詳述し、low/info は箇条書きでまとめる。'
reviews:
profile: 'assertive'
auto_review:
enabled: true
drafts: false
path_filters:
- '!node_modules/**'
- '!.pnpm-store/**'
- '!pnpm-lock.yaml'
- '!.svelte-kit/**'
- '!.vercel/**'
- '!coverage/**'
path_instructions:
# --- Data layer ---
- path: 'prisma/*'
instructions: |
- CHECK constraints added manually to migration.sql must be documented in prisma/ERD.md.
- path: 'prisma/migrations/**'
instructions: |
- Auto-generated by Prisma. Only flag security vulnerabilities (e.g. privilege escalation, SQL injection) or bugs that could cause data loss or critical errors.
- Skip style, naming, SQL formatting, and documentation issues.
- path: 'src/lib/server/**'
instructions: |
- This directory is server-only. Never import from client-side code or Svelte components.
- DB client must be accessed only via `$lib/server/database`.
# --- Schema / validation ---
- path: 'src/**/zod/**'
instructions: |
- Use `z.number().int().positive()` for Prisma `Int` fields (not `z.number().positive()`, which passes decimals).
- When a Zod constraint mirrors a SQL CHECK, add an inline comment noting both layers and the obligation to keep them in sync.
# --- Domain types ---
- path: 'src/**/*types/**'
instructions: |
- Array types must use a named plural alias: `type Placements = Placement[]`, not `Placement[]` directly in signatures.
- Add TSDoc to every exported type.
- Avoid `any`; check if a `@types/*` package exists first.
# --- Test infrastructure (defined before implementation per TDD) ---
- path: 'src/**/*fixtures/**'
instructions: |
- Use realistic domain values, not abstract placeholders ('t1', 'test1', etc.).
- Shared fixture data must be extracted to a fixture file; avoid duplicating across test cases.
# --- Business logic ---
- path: 'src/**/services/**'
instructions: |
- Service functions must return pure values or null; never Response/json().
- Prisma calls belong here; do not flag direct database access as a violation.
- path: 'src/**/*utils/**'
instructions: |
- Must be pure functions with no side effects.
- Each function must have an adjacent unit test.
# --- State / UI ---
- path: 'src/**/stores/**'
instructions: |
- Stores must use `.svelte.ts` extension, class-based pattern with `$state()`, and export a singleton.
- Legacy stores using `writable()` must be migrated before adding features or extending them.
- path: 'src/routes/**'
instructions: |
- Page routes (+page.server.ts): use redirect() for navigation.
- API routes (+server.ts): use error() — redirect() causes fetch to silently receive the HTML page at the redirect target.
- No direct Prisma calls; delegate to service layer.
- path: 'src/**/*.svelte'
instructions: |
- Use Svelte 5 Runes ($props, $state, $derived, $effect).
- Business logic belongs in utils/, not inside <script> blocks.