kaide 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/kaide.png +0 -0
- package/package.json +1 -1
- package/templates/.cursor/rules/core-principles.mdc +1 -0
- package/templates/.cursor/rules/frontend/nextjs.mdc +1 -1
- package/templates/.cursor/rules/frontend/testing.mdc +5 -5
- package/templates/docs/architecture-guide.md +28 -19
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
> **Kaide** (Etymology: Turkish): A fundamental rule, principle, or base that provides structural integrity. The name cleverly embeds **AI** (K**ai**de), reflecting its core mission.
|
|
6
6
|
|
|
7
|
+
<img src="kaide.png" alt="Kaide" width="610px" />
|
|
8
|
+
|
|
7
9
|
## Getting Started
|
|
8
10
|
|
|
9
11
|
### Installation & Setup
|
package/kaide.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -32,6 +32,7 @@ alwaysApply: true
|
|
|
32
32
|
- `// ...existing code` (Provide full blocks).
|
|
33
33
|
- Standard `TODO` or `FIXME` comments.
|
|
34
34
|
- Using `INTENTIONAL_TODO` to skip core logic implementation.
|
|
35
|
+
- Parent-relative imports (`../`, `../../`). Use path aliases only.
|
|
35
36
|
|
|
36
37
|
## Correct Implementation
|
|
37
38
|
|
|
@@ -54,7 +54,7 @@ export default async function DashboardPage() {
|
|
|
54
54
|
// src/features/auth/actions/login.ts
|
|
55
55
|
"use server";
|
|
56
56
|
|
|
57
|
-
import { loginSchema } from "
|
|
57
|
+
import { loginSchema } from "@/features/auth/schemas/login-schema";
|
|
58
58
|
import { api } from "@/lib/api";
|
|
59
59
|
|
|
60
60
|
export async function loginAction(formData: FormData) {
|
|
@@ -8,15 +8,15 @@ alwaysApply: false
|
|
|
8
8
|
|
|
9
9
|
## Principles
|
|
10
10
|
- **Value over Coverage:** Focus on testing complex business logic in `features/[feature]`. Skip simple UI components unless critical.
|
|
11
|
-
-
|
|
11
|
+
- **Behavior Testing:** Focus on user outcomes (Arrange-Act-Assert).
|
|
12
12
|
|
|
13
13
|
## Tech Stack
|
|
14
|
-
-
|
|
14
|
+
- Vitest & React Testing Library.
|
|
15
15
|
|
|
16
16
|
## Preferences (Not Hard Rules)
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
17
|
+
- **API:** Use `MSW` for stable features; simple mocks are okay for rapid prototyping.
|
|
18
|
+
- **Location:** Keep `.test.ts` next to implementation.
|
|
19
|
+
- **Snapshots:** Use only for small, static data structures to prevent maintenance hell.
|
|
20
20
|
|
|
21
21
|
## Correct Approach
|
|
22
22
|
<example>
|
|
@@ -25,11 +25,13 @@ Adhere strictly to the following tree structure. Creating arbitrary folders is F
|
|
|
25
25
|
|
|
26
26
|
```text
|
|
27
27
|
src/
|
|
28
|
-
├── app/ | routes/
|
|
29
|
-
├── features/
|
|
28
|
+
├── app/ | routes/
|
|
29
|
+
├── features/
|
|
30
30
|
│ └── [feature-name]/
|
|
31
31
|
│ ├── api/
|
|
32
32
|
│ ├── components/
|
|
33
|
+
│ ├── constants/
|
|
34
|
+
│ ├── data/
|
|
33
35
|
│ ├── helpers/
|
|
34
36
|
│ ├── hooks/
|
|
35
37
|
│ ├── schemas/
|
|
@@ -37,22 +39,23 @@ src/
|
|
|
37
39
|
│ ├── types/
|
|
38
40
|
│ └── index.ts
|
|
39
41
|
├── components/
|
|
40
|
-
│ ├──
|
|
41
|
-
│ ├── layout/
|
|
42
|
-
│
|
|
43
|
-
|
|
44
|
-
├──
|
|
45
|
-
├──
|
|
42
|
+
│ ├── icons/
|
|
43
|
+
│ ├── layout/
|
|
44
|
+
│ ├── shared/
|
|
45
|
+
│ └── ui/
|
|
46
|
+
├── config/
|
|
47
|
+
├── constants/
|
|
48
|
+
├── helpers/
|
|
46
49
|
├── hooks/
|
|
47
|
-
├── i18n/
|
|
48
|
-
├── lib/
|
|
49
|
-
├── messages/
|
|
50
|
-
├── providers/
|
|
51
|
-
├── schemas/
|
|
52
|
-
├── stores/
|
|
53
|
-
├── styles/
|
|
54
|
-
├── types/
|
|
55
|
-
└── env.ts
|
|
50
|
+
├── i18n/
|
|
51
|
+
├── lib/
|
|
52
|
+
├── messages/
|
|
53
|
+
├── providers/
|
|
54
|
+
├── schemas/
|
|
55
|
+
├── stores/
|
|
56
|
+
├── styles/
|
|
57
|
+
├── types/
|
|
58
|
+
└── env.ts
|
|
56
59
|
```
|
|
57
60
|
|
|
58
61
|
## Shared vs. Feature Matrix (The Rule of Three)
|
|
@@ -62,10 +65,16 @@ Apply the following metric hierarchy to determine code location:
|
|
|
62
65
|
- **Default Scope:** All logic and components originate within `features/[feature]/`.
|
|
63
66
|
- **Promotion:** Any logic or component requested by 2 different features MUST be moved to the global `src/` (shared) layer.
|
|
64
67
|
- **Cross-Import Ban:** Direct imports between features are FORBIDDEN. Communication is restricted to the `src/shared` layer or via prop-drilling at the Page level.
|
|
65
|
-
- **Helpers:** Pure TypeScript functions that strictly transform input to output without side effects.
|
|
66
|
-
- **
|
|
68
|
+
- **Helpers:** Pure TypeScript functions that strictly transform input to output without side effects. MUST NOT contain any package imports. (e.g., `isBrowser()`).
|
|
69
|
+
- **Data:** Feature-specific static data (lists, config objects, constants). ONLY allowed within `features/[feature]/data/`.
|
|
70
|
+
- **Lib:** Contains project-specific configured instances of external libraries (axios, date-fns, js-cookie, etc.). Files containing package imports MUST be placed here. Pure TS functions without package imports belong in `helpers`. (e.g., `isToday()` using date-fns goes to `lib`, `isBrowser()` goes to `helpers`).
|
|
67
71
|
- **Zod Schemas:** All feature-related schemas MUST be stored in `features/[feature]/schemas/`. API functions and UI components MUST import from this single source to prevent duplication.
|
|
68
72
|
|
|
73
|
+
## Imports
|
|
74
|
+
|
|
75
|
+
- **Path Aliases:** Usage of path aliases is MANDATORY.
|
|
76
|
+
- **Parent-Relative:** Parent-relative imports (`../`, `../../`) are FORBIDDEN. Use absolute path aliases.
|
|
77
|
+
|
|
69
78
|
## Server State & Ownership
|
|
70
79
|
|
|
71
80
|
Server state is global, but access is hierarchical:
|