Skip to content

Commit 8908088

Browse files
committed
chore: Windsurf rules
1 parent 82996b8 commit 8908088

File tree

3 files changed

+54
-39
lines changed

3 files changed

+54
-39
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
trigger: manual
3+
---
4+
5+
#### Tailwind & CSS
6+
7+
- We are using Tailwind v4 which uses oklch colors so we now want to refer to the CSS vars directly, without wrapping it with any color function like `hsla/hsl`, `rgba` etc.

.windsurf/rules/sveltekit-architecture.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,43 @@
22
trigger: manual
33
---
44

5-
# SvelteKit Architecture Rules
6-
7-
## Services vs Stores Separation Pattern
8-
9-
### `lib/services/` - Pure Business Logic
10-
- **Purpose**: Stateless business logic and external communication
11-
- **Contains**:
12-
- Database operations (DatabaseService)
13-
- API calls to external services (ApiService)
14-
- Pure business logic functions (ChatService, etc.)
15-
- **Rules**:
16-
- NO Svelte runes ($state, $derived, $effect)
17-
- NO reactive state management
18-
- Pure functions and classes only
19-
- Can import types but not stores
20-
- Focus on "how" - implementation details
21-
22-
### `lib/stores/` - Reactive State Management
23-
- **Purpose**: Svelte-specific reactive state with runes
24-
- **Contains**:
25-
- Reactive state classes with $state, $derived, $effect
26-
- UI-focused state management
27-
- Store orchestration logic
28-
- **Rules**:
29-
- USE Svelte runes for reactivity
30-
- Import and use services for business logic
31-
- NO direct database operations
32-
- NO direct API calls (use services)
33-
- Focus on "what" - reactive state for UI
34-
35-
### Enforcement
36-
- Services should be testable without Svelte
37-
- Stores should leverage Svelte's reactivity system
38-
- Clear separation: services handle data, stores handle state
39-
- Services can be reused across multiple stores
40-
41-
### Tailwind & CSS
42-
43-
- We are using Tailwind v4 which uses oklch colors so we now want to refer to the CSS vars directly, without wrapping it with any color function like `hsla/hsl`, `rgba` etc.
5+
# Coding rules
6+
7+
## Svelte & SvelteKit
8+
9+
### Services vs Stores Separation Pattern
10+
11+
#### `lib/services/` - Pure Business Logic
12+
13+
- **Purpose**: Stateless business logic and external communication
14+
- **Contains**:
15+
- Database operations (DatabaseService)
16+
- API calls to external services (ApiService)
17+
- Pure business logic functions (ChatService, etc.)
18+
- **Rules**:
19+
- NO Svelte runes ($state, $derived, $effect)
20+
- NO reactive state management
21+
- Pure functions and classes only
22+
- Can import types but not stores
23+
- Focus on "how" - implementation details
24+
25+
#### `lib/stores/` - Reactive State Management
26+
27+
- **Purpose**: Svelte-specific reactive state with runes
28+
- **Contains**:
29+
- Reactive state classes with $state, $derived, $effect
30+
- UI-focused state management
31+
- Store orchestration logic
32+
- **Rules**:
33+
- USE Svelte runes for reactivity
34+
- Import and use services for business logic
35+
- NO direct database operations
36+
- NO direct API calls (use services)
37+
- Focus on "what" - reactive state for UI
38+
39+
#### Enforcement
40+
41+
- Services should be testable without Svelte
42+
- Stores should leverage Svelte's reactivity system
43+
- Clear separation: services handle data, stores handle state
44+
- Services can be reused across multiple stores
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
trigger: manual
3+
---
4+
5+
## TypeScript
6+
7+
- Add JSDocs for functions

0 commit comments

Comments
 (0)