kaide 1.0.5 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaide",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "AI-native architecture kit for modern React. High-discipline protocols for autonomous agents.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@ alwaysApply: true
16
16
  - **Minimal Intervention:** Modify only necessary areas.
17
17
  - **Source of Truth:** Reference the codebase. Correct it if erroneous.
18
18
  - **Boy Scout:** Clean unused imports, `console.log`, and dead code.
19
- - **Naming:** `kebab-case` for folders/non-component files; `PascalCase` for React components.
19
+ - **Naming:** `kebab-case` for folders/non-component files; `PascalCase` for React components. File type suffixes: `*.types.ts`, `*.constants.ts`, `*.config.ts`, `*.test.ts`, `*.spec.ts`, `*.stories.tsx`, `*.schema.ts`, `*.api.ts`, `*.store.ts` (base name in kebab-case).
20
20
  - **Exports:** Group exports with `index.ts`.
21
21
  - **No Silent Failures:** Do not swallow errors. Manage `try/catch` blocks.
22
22
  - **Secret Protection:** Do not log `.env` content.
@@ -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 "../schemas/login-schema";
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
- - [cite_start]**Behavior Testing:** Focus on user outcomes (Arrange-Act-Assert)[cite: 3].
11
+ - **Behavior Testing:** Focus on user outcomes (Arrange-Act-Assert).
12
12
 
13
13
  ## Tech Stack
14
- - [cite_start]Vitest & React Testing Library[cite: 1, 12].
14
+ - Vitest & React Testing Library.
15
15
 
16
16
  ## Preferences (Not Hard Rules)
17
- - [cite_start]**API:** Use `MSW` for stable features; simple mocks are okay for rapid prototyping[cite: 5, 8].
18
- - [cite_start]**Location:** Keep `.test.ts` next to implementation[cite: 4].
19
- - [cite_start]**Snapshots:** Use only for small, static data structures to prevent maintenance hell.
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/ # Routing layer (See Framework Rules)
29
- ├── features/ # Domain & business logic
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
- │ ├── ui/ # Atomic (shadcn)
41
- │ ├── layout/ # Layout parts
42
- └── shared/ # Reusable functional
43
- ├── config/ # App/SEO config
44
- ├── constants/ # Static values
45
- ├── helpers/ # Framework-agnostic pure functions
42
+ │ ├── icons/
43
+ │ ├── layout/
44
+ ├── shared/
45
+ │ └── ui/
46
+ ├── config/
47
+ ├── constants/
48
+ ├── helpers/
46
49
  ├── hooks/
47
- ├── i18n/ # Localization setup
48
- ├── lib/ # Third-party configurations
49
- ├── messages/ # Translations
50
- ├── providers/ # Global context
51
- ├── schemas/ # Shared validation
52
- ├── stores/ # Global state
53
- ├── styles/ # Tailwind/base CSS
54
- ├── types/ # Global TS types
55
- └── env.ts # Env validation
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
- - **Lib:** Contains project-specific configured instances of external libraries. Components MUST import the wrapped instance from `src/lib` rather than the external package directly.
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: