@matteoaliano/forest-ui 0.2.4 → 0.2.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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Forest UI — AI Development Guidelines
|
|
2
2
|
|
|
3
|
+
> **forest-ui v0.2.6**
|
|
4
|
+
|
|
3
5
|
> **This file is auto-generated from the `forest-ui` package.**
|
|
4
6
|
> Run `npx forest-ui sync` to update it.
|
|
5
7
|
|
|
@@ -332,6 +334,4 @@ interface MyButtonProps extends ButtonProps {
|
|
|
332
334
|
}
|
|
333
335
|
```
|
|
334
336
|
|
|
335
|
-
---
|
|
336
337
|
|
|
337
|
-
*Generated from forest-ui v0.2.1*
|
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
# Forest UI — Development Best Practices
|
|
2
2
|
|
|
3
|
+
> **forest-ui v0.2.6**
|
|
4
|
+
|
|
3
5
|
> **This file is synced by the `forest-ui` package.**
|
|
4
6
|
> Run `npx forest-ui sync` to update it.
|
|
5
7
|
|
|
6
8
|
---
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
When generating code or suggesting solutions for Next.js projects, always follow these principles and best practices:
|
|
11
|
+
|
|
12
|
+
Separation of Concerns
|
|
13
|
+
Maintain a clear separation between presentation logic, business logic, and data management. Organize code into meaningful modules and folders (e.g., pages, components, lib, api).
|
|
14
|
+
|
|
15
|
+
Single Responsibility Principle
|
|
16
|
+
Each component, hook, or function must have a single, well-defined purpose. Avoid components or modules that handle multiple responsibilities simultaneously.
|
|
17
|
+
|
|
18
|
+
Clean Code and Naming Conventions
|
|
19
|
+
Write readable code with descriptive names for variables, functions, and components. Use consistent conventions:
|
|
20
|
+
|
|
21
|
+
camelCase for functions and variables.
|
|
22
|
+
|
|
23
|
+
PascalCase for components.
|
|
24
|
+
|
|
25
|
+
kebab-case for files.
|
|
26
|
+
|
|
27
|
+
Component Reusability
|
|
28
|
+
Build generic and reusable components. Avoid duplicating logic or UI. If a pattern repeats, consider extracting it into a shared component.
|
|
29
|
+
|
|
30
|
+
Consistent Data Flow
|
|
31
|
+
Maintain a clear and predictable data flow (top-down). If necessary, use the Context API or global states carefully, documenting the flow.
|
|
32
|
+
|
|
33
|
+
Predictable States
|
|
34
|
+
Manage states clearly and consistently. Use useState, useReducer, or global state libraries (like Zustand or Redux) only when necessary, ensuring every change is traceable and understandable.
|
|
35
|
+
|
|
36
|
+
Final Output
|
|
37
|
+
The generated code must be:
|
|
38
|
+
|
|
39
|
+
Readable and easily maintainable.
|
|
40
|
+
|
|
41
|
+
Compliant with Next.js conventions.
|
|
42
|
+
|
|
43
|
+
Easily testable.
|
|
44
|
+
|
|
45
|
+
Integratable into an existing project without conflicts.
|
|
46
|
+
|
|
47
|
+
If asked to write code, always include brief but helpful comments explaining what important sections do.
|