@clipboard-health/ai-rules 0.2.3 → 0.2.5
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/backend/AGENTS.md +6 -11
- package/backend/CLAUDE.md +6 -12
- package/common/AGENTS.md +6 -9
- package/common/CLAUDE.md +6 -10
- package/frontend/AGENTS.md +4 -31
- package/frontend/CLAUDE.md +4 -32
- package/fullstack/AGENTS.md +4 -33
- package/fullstack/CLAUDE.md +4 -34
- package/package.json +1 -1
package/backend/AGENTS.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- Generated by Ruler -->
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
<!-- Source: .ruler/backend/nestJsApis.md -->
|
|
5
4
|
|
|
6
5
|
# NestJS APIs
|
|
@@ -14,8 +13,6 @@
|
|
|
14
13
|
- Requests and responses follow the JSON:API specification, including pagination for listings.
|
|
15
14
|
- Use TypeDoc to document public functions, classes, methods, and complex code blocks.
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
16
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
20
17
|
|
|
21
18
|
# Code style and structure
|
|
@@ -30,8 +27,6 @@
|
|
|
30
27
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
31
28
|
- Prefer data immutability.
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
30
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
36
31
|
|
|
37
32
|
# Error handling and validation
|
|
@@ -45,8 +40,6 @@
|
|
|
45
40
|
- Implement proper error logging and user-friendly error messages.
|
|
46
41
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
43
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
51
44
|
|
|
52
45
|
# Key conventions
|
|
@@ -56,8 +49,6 @@
|
|
|
56
49
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
57
50
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
52
|
<!-- Source: .ruler/common/testing.md -->
|
|
62
53
|
|
|
63
54
|
# Testing
|
|
@@ -68,8 +59,6 @@
|
|
|
68
59
|
- Prefer `it.each` for multiple test cases.
|
|
69
60
|
- Avoid conditional logic in tests.
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
62
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
74
63
|
|
|
75
64
|
# TypeScript usage
|
|
@@ -89,3 +78,9 @@
|
|
|
89
78
|
- Leverage `readonly` properties for function parameter immutability.
|
|
90
79
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
91
80
|
- Implement exhaustiveness checking using `never`.
|
|
81
|
+
|
|
82
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
83
|
+
|
|
84
|
+
# Overlay
|
|
85
|
+
|
|
86
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
package/backend/CLAUDE.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
<!-- Source: .ruler/backend/nestJsApis.md -->
|
|
4
2
|
|
|
5
3
|
# NestJS APIs
|
|
@@ -13,8 +11,6 @@
|
|
|
13
11
|
- Requests and responses follow the JSON:API specification, including pagination for listings.
|
|
14
12
|
- Use TypeDoc to document public functions, classes, methods, and complex code blocks.
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
14
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
19
15
|
|
|
20
16
|
# Code style and structure
|
|
@@ -29,8 +25,6 @@
|
|
|
29
25
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
30
26
|
- Prefer data immutability.
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
28
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
35
29
|
|
|
36
30
|
# Error handling and validation
|
|
@@ -44,8 +38,6 @@
|
|
|
44
38
|
- Implement proper error logging and user-friendly error messages.
|
|
45
39
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
41
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
50
42
|
|
|
51
43
|
# Key conventions
|
|
@@ -55,8 +47,6 @@
|
|
|
55
47
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
56
48
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
|
|
60
50
|
<!-- Source: .ruler/common/testing.md -->
|
|
61
51
|
|
|
62
52
|
# Testing
|
|
@@ -67,8 +57,6 @@
|
|
|
67
57
|
- Prefer `it.each` for multiple test cases.
|
|
68
58
|
- Avoid conditional logic in tests.
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
|
|
72
60
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
73
61
|
|
|
74
62
|
# TypeScript usage
|
|
@@ -88,3 +76,9 @@
|
|
|
88
76
|
- Leverage `readonly` properties for function parameter immutability.
|
|
89
77
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
90
78
|
- Implement exhaustiveness checking using `never`.
|
|
79
|
+
|
|
80
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
81
|
+
|
|
82
|
+
# Overlay
|
|
83
|
+
|
|
84
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
package/common/AGENTS.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- Generated by Ruler -->
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
5
4
|
|
|
6
5
|
# Code style and structure
|
|
@@ -15,8 +14,6 @@
|
|
|
15
14
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
16
15
|
- Prefer data immutability.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
17
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
21
18
|
|
|
22
19
|
# Error handling and validation
|
|
@@ -30,8 +27,6 @@
|
|
|
30
27
|
- Implement proper error logging and user-friendly error messages.
|
|
31
28
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
30
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
36
31
|
|
|
37
32
|
# Key conventions
|
|
@@ -41,8 +36,6 @@
|
|
|
41
36
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
42
37
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
39
|
<!-- Source: .ruler/common/testing.md -->
|
|
47
40
|
|
|
48
41
|
# Testing
|
|
@@ -53,8 +46,6 @@
|
|
|
53
46
|
- Prefer `it.each` for multiple test cases.
|
|
54
47
|
- Avoid conditional logic in tests.
|
|
55
48
|
|
|
56
|
-
|
|
57
|
-
|
|
58
49
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
59
50
|
|
|
60
51
|
# TypeScript usage
|
|
@@ -74,3 +65,9 @@
|
|
|
74
65
|
- Leverage `readonly` properties for function parameter immutability.
|
|
75
66
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
76
67
|
- Implement exhaustiveness checking using `never`.
|
|
68
|
+
|
|
69
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
70
|
+
|
|
71
|
+
# Overlay
|
|
72
|
+
|
|
73
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
package/common/CLAUDE.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
4
2
|
|
|
5
3
|
# Code style and structure
|
|
@@ -14,8 +12,6 @@
|
|
|
14
12
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
15
13
|
- Prefer data immutability.
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
15
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
20
16
|
|
|
21
17
|
# Error handling and validation
|
|
@@ -29,8 +25,6 @@
|
|
|
29
25
|
- Implement proper error logging and user-friendly error messages.
|
|
30
26
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
28
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
35
29
|
|
|
36
30
|
# Key conventions
|
|
@@ -40,8 +34,6 @@
|
|
|
40
34
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
41
35
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
37
|
<!-- Source: .ruler/common/testing.md -->
|
|
46
38
|
|
|
47
39
|
# Testing
|
|
@@ -52,8 +44,6 @@
|
|
|
52
44
|
- Prefer `it.each` for multiple test cases.
|
|
53
45
|
- Avoid conditional logic in tests.
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
|
|
57
47
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
58
48
|
|
|
59
49
|
# TypeScript usage
|
|
@@ -73,3 +63,9 @@
|
|
|
73
63
|
- Leverage `readonly` properties for function parameter immutability.
|
|
74
64
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
75
65
|
- Implement exhaustiveness checking using `never`.
|
|
66
|
+
|
|
67
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
68
|
+
|
|
69
|
+
# Overlay
|
|
70
|
+
|
|
71
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
package/frontend/AGENTS.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- Generated by Ruler -->
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
5
4
|
|
|
6
5
|
# Code style and structure
|
|
@@ -15,8 +14,6 @@
|
|
|
15
14
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
16
15
|
- Prefer data immutability.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
17
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
21
18
|
|
|
22
19
|
# Error handling and validation
|
|
@@ -30,8 +27,6 @@
|
|
|
30
27
|
- Implement proper error logging and user-friendly error messages.
|
|
31
28
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
30
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
36
31
|
|
|
37
32
|
# Key conventions
|
|
@@ -41,8 +36,6 @@
|
|
|
41
36
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
42
37
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
39
|
<!-- Source: .ruler/common/testing.md -->
|
|
47
40
|
|
|
48
41
|
# Testing
|
|
@@ -53,8 +46,6 @@
|
|
|
53
46
|
- Prefer `it.each` for multiple test cases.
|
|
54
47
|
- Avoid conditional logic in tests.
|
|
55
48
|
|
|
56
|
-
|
|
57
|
-
|
|
58
49
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
59
50
|
|
|
60
51
|
# TypeScript usage
|
|
@@ -75,7 +66,11 @@
|
|
|
75
66
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
76
67
|
- Implement exhaustiveness checking using `never`.
|
|
77
68
|
|
|
69
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
70
|
+
|
|
71
|
+
# Overlay
|
|
78
72
|
|
|
73
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
|
79
74
|
|
|
80
75
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
81
76
|
|
|
@@ -407,8 +402,6 @@ export function useHandler() {
|
|
|
407
402
|
- **Options pattern** - For flexible configuration
|
|
408
403
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
409
404
|
|
|
410
|
-
|
|
411
|
-
|
|
412
405
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
413
406
|
|
|
414
407
|
# Data Fetching Standards
|
|
@@ -732,8 +725,6 @@ Feature/
|
|
|
732
725
|
│ └── schemas.ts (optional)
|
|
733
726
|
```
|
|
734
727
|
|
|
735
|
-
|
|
736
|
-
|
|
737
728
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
738
729
|
|
|
739
730
|
# Error Handling Standards
|
|
@@ -1175,8 +1166,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1175
1166
|
retry: (failureCount) => failureCount < 3;
|
|
1176
1167
|
```
|
|
1177
1168
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
1169
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1181
1170
|
|
|
1182
1171
|
# File Organization Standards
|
|
@@ -1463,8 +1452,6 @@ describe("formatFeatureName", () => {
|
|
|
1463
1452
|
});
|
|
1464
1453
|
```
|
|
1465
1454
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
1455
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1469
1456
|
|
|
1470
1457
|
# Import Standards
|
|
@@ -1800,8 +1787,6 @@ npm run lint:fix
|
|
|
1800
1787
|
- Use relative imports for distant files
|
|
1801
1788
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1802
1789
|
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
1790
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1806
1791
|
|
|
1807
1792
|
# Performance Standards
|
|
@@ -2240,8 +2225,6 @@ getTTFB(console.log);
|
|
|
2240
2225
|
- Ignore performance warnings in console
|
|
2241
2226
|
- Skip memoization for expensive operations
|
|
2242
2227
|
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
2228
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2246
2229
|
|
|
2247
2230
|
# React Component Patterns
|
|
@@ -2699,8 +2682,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2699
2682
|
}, []);
|
|
2700
2683
|
```
|
|
2701
2684
|
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
2685
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2705
2686
|
|
|
2706
2687
|
# React
|
|
@@ -2713,8 +2694,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2713
2694
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2714
2695
|
- Use date-fns for any Date based operations like formatting
|
|
2715
2696
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
2697
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2719
2698
|
|
|
2720
2699
|
# Styling Standards
|
|
@@ -3193,8 +3172,6 @@ import { Button } from "@/components/Button";
|
|
|
3193
3172
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3194
3173
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3195
3174
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
3175
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3199
3176
|
|
|
3200
3177
|
# Testing Standards
|
|
@@ -3659,8 +3636,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3659
3636
|
});
|
|
3660
3637
|
```
|
|
3661
3638
|
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
3639
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3665
3640
|
|
|
3666
3641
|
# TypeScript Standards
|
|
@@ -4213,8 +4188,6 @@ if (!user) throw new Error("User not found");
|
|
|
4213
4188
|
// Now TypeScript knows user exists
|
|
4214
4189
|
```
|
|
4215
4190
|
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
4191
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4219
4192
|
|
|
4220
4193
|
# UI and Styling
|
package/frontend/CLAUDE.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
4
2
|
|
|
5
3
|
# Code style and structure
|
|
@@ -14,8 +12,6 @@
|
|
|
14
12
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
15
13
|
- Prefer data immutability.
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
15
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
20
16
|
|
|
21
17
|
# Error handling and validation
|
|
@@ -29,8 +25,6 @@
|
|
|
29
25
|
- Implement proper error logging and user-friendly error messages.
|
|
30
26
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
28
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
35
29
|
|
|
36
30
|
# Key conventions
|
|
@@ -40,8 +34,6 @@
|
|
|
40
34
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
41
35
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
37
|
<!-- Source: .ruler/common/testing.md -->
|
|
46
38
|
|
|
47
39
|
# Testing
|
|
@@ -52,8 +44,6 @@
|
|
|
52
44
|
- Prefer `it.each` for multiple test cases.
|
|
53
45
|
- Avoid conditional logic in tests.
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
|
|
57
47
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
58
48
|
|
|
59
49
|
# TypeScript usage
|
|
@@ -74,7 +64,11 @@
|
|
|
74
64
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
75
65
|
- Implement exhaustiveness checking using `never`.
|
|
76
66
|
|
|
67
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
68
|
+
|
|
69
|
+
# Overlay
|
|
77
70
|
|
|
71
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
|
78
72
|
|
|
79
73
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
80
74
|
|
|
@@ -406,8 +400,6 @@ export function useHandler() {
|
|
|
406
400
|
- **Options pattern** - For flexible configuration
|
|
407
401
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
408
402
|
|
|
409
|
-
|
|
410
|
-
|
|
411
403
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
412
404
|
|
|
413
405
|
# Data Fetching Standards
|
|
@@ -731,8 +723,6 @@ Feature/
|
|
|
731
723
|
│ └── schemas.ts (optional)
|
|
732
724
|
```
|
|
733
725
|
|
|
734
|
-
|
|
735
|
-
|
|
736
726
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
737
727
|
|
|
738
728
|
# Error Handling Standards
|
|
@@ -1174,8 +1164,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1174
1164
|
retry: (failureCount) => failureCount < 3;
|
|
1175
1165
|
```
|
|
1176
1166
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
1167
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1180
1168
|
|
|
1181
1169
|
# File Organization Standards
|
|
@@ -1462,8 +1450,6 @@ describe("formatFeatureName", () => {
|
|
|
1462
1450
|
});
|
|
1463
1451
|
```
|
|
1464
1452
|
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
1453
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1468
1454
|
|
|
1469
1455
|
# Import Standards
|
|
@@ -1799,8 +1785,6 @@ npm run lint:fix
|
|
|
1799
1785
|
- Use relative imports for distant files
|
|
1800
1786
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1801
1787
|
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
1788
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1805
1789
|
|
|
1806
1790
|
# Performance Standards
|
|
@@ -2239,8 +2223,6 @@ getTTFB(console.log);
|
|
|
2239
2223
|
- Ignore performance warnings in console
|
|
2240
2224
|
- Skip memoization for expensive operations
|
|
2241
2225
|
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
2226
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2245
2227
|
|
|
2246
2228
|
# React Component Patterns
|
|
@@ -2698,8 +2680,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2698
2680
|
}, []);
|
|
2699
2681
|
```
|
|
2700
2682
|
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
2683
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2704
2684
|
|
|
2705
2685
|
# React
|
|
@@ -2712,8 +2692,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2712
2692
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2713
2693
|
- Use date-fns for any Date based operations like formatting
|
|
2714
2694
|
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
2695
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2718
2696
|
|
|
2719
2697
|
# Styling Standards
|
|
@@ -3192,8 +3170,6 @@ import { Button } from "@/components/Button";
|
|
|
3192
3170
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3193
3171
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3194
3172
|
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
3173
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3198
3174
|
|
|
3199
3175
|
# Testing Standards
|
|
@@ -3658,8 +3634,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3658
3634
|
});
|
|
3659
3635
|
```
|
|
3660
3636
|
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
3637
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3664
3638
|
|
|
3665
3639
|
# TypeScript Standards
|
|
@@ -4212,8 +4186,6 @@ if (!user) throw new Error("User not found");
|
|
|
4212
4186
|
// Now TypeScript knows user exists
|
|
4213
4187
|
```
|
|
4214
4188
|
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
4189
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4218
4190
|
|
|
4219
4191
|
# UI and Styling
|
package/fullstack/AGENTS.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- Generated by Ruler -->
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
<!-- Source: .ruler/backend/nestJsApis.md -->
|
|
5
4
|
|
|
6
5
|
# NestJS APIs
|
|
@@ -14,8 +13,6 @@
|
|
|
14
13
|
- Requests and responses follow the JSON:API specification, including pagination for listings.
|
|
15
14
|
- Use TypeDoc to document public functions, classes, methods, and complex code blocks.
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
16
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
20
17
|
|
|
21
18
|
# Code style and structure
|
|
@@ -30,8 +27,6 @@
|
|
|
30
27
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
31
28
|
- Prefer data immutability.
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
30
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
36
31
|
|
|
37
32
|
# Error handling and validation
|
|
@@ -45,8 +40,6 @@
|
|
|
45
40
|
- Implement proper error logging and user-friendly error messages.
|
|
46
41
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
43
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
51
44
|
|
|
52
45
|
# Key conventions
|
|
@@ -56,8 +49,6 @@
|
|
|
56
49
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
57
50
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
52
|
<!-- Source: .ruler/common/testing.md -->
|
|
62
53
|
|
|
63
54
|
# Testing
|
|
@@ -68,8 +59,6 @@
|
|
|
68
59
|
- Prefer `it.each` for multiple test cases.
|
|
69
60
|
- Avoid conditional logic in tests.
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
62
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
74
63
|
|
|
75
64
|
# TypeScript usage
|
|
@@ -90,7 +79,11 @@
|
|
|
90
79
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
91
80
|
- Implement exhaustiveness checking using `never`.
|
|
92
81
|
|
|
82
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
93
83
|
|
|
84
|
+
# Overlay
|
|
85
|
+
|
|
86
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
|
94
87
|
|
|
95
88
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
96
89
|
|
|
@@ -422,8 +415,6 @@ export function useHandler() {
|
|
|
422
415
|
- **Options pattern** - For flexible configuration
|
|
423
416
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
424
417
|
|
|
425
|
-
|
|
426
|
-
|
|
427
418
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
428
419
|
|
|
429
420
|
# Data Fetching Standards
|
|
@@ -747,8 +738,6 @@ Feature/
|
|
|
747
738
|
│ └── schemas.ts (optional)
|
|
748
739
|
```
|
|
749
740
|
|
|
750
|
-
|
|
751
|
-
|
|
752
741
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
753
742
|
|
|
754
743
|
# Error Handling Standards
|
|
@@ -1190,8 +1179,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1190
1179
|
retry: (failureCount) => failureCount < 3;
|
|
1191
1180
|
```
|
|
1192
1181
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
1182
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1196
1183
|
|
|
1197
1184
|
# File Organization Standards
|
|
@@ -1478,8 +1465,6 @@ describe("formatFeatureName", () => {
|
|
|
1478
1465
|
});
|
|
1479
1466
|
```
|
|
1480
1467
|
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
1468
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1484
1469
|
|
|
1485
1470
|
# Import Standards
|
|
@@ -1815,8 +1800,6 @@ npm run lint:fix
|
|
|
1815
1800
|
- Use relative imports for distant files
|
|
1816
1801
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1817
1802
|
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
1803
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1821
1804
|
|
|
1822
1805
|
# Performance Standards
|
|
@@ -2255,8 +2238,6 @@ getTTFB(console.log);
|
|
|
2255
2238
|
- Ignore performance warnings in console
|
|
2256
2239
|
- Skip memoization for expensive operations
|
|
2257
2240
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
2241
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2261
2242
|
|
|
2262
2243
|
# React Component Patterns
|
|
@@ -2714,8 +2695,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2714
2695
|
}, []);
|
|
2715
2696
|
```
|
|
2716
2697
|
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
2698
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2720
2699
|
|
|
2721
2700
|
# React
|
|
@@ -2728,8 +2707,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2728
2707
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2729
2708
|
- Use date-fns for any Date based operations like formatting
|
|
2730
2709
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
2710
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2734
2711
|
|
|
2735
2712
|
# Styling Standards
|
|
@@ -3208,8 +3185,6 @@ import { Button } from "@/components/Button";
|
|
|
3208
3185
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3209
3186
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3210
3187
|
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
3188
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3214
3189
|
|
|
3215
3190
|
# Testing Standards
|
|
@@ -3674,8 +3649,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3674
3649
|
});
|
|
3675
3650
|
```
|
|
3676
3651
|
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
3652
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3680
3653
|
|
|
3681
3654
|
# TypeScript Standards
|
|
@@ -4228,8 +4201,6 @@ if (!user) throw new Error("User not found");
|
|
|
4228
4201
|
// Now TypeScript knows user exists
|
|
4229
4202
|
```
|
|
4230
4203
|
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
4204
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4234
4205
|
|
|
4235
4206
|
# UI and Styling
|
package/fullstack/CLAUDE.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
<!-- Source: .ruler/backend/nestJsApis.md -->
|
|
4
2
|
|
|
5
3
|
# NestJS APIs
|
|
@@ -13,8 +11,6 @@
|
|
|
13
11
|
- Requests and responses follow the JSON:API specification, including pagination for listings.
|
|
14
12
|
- Use TypeDoc to document public functions, classes, methods, and complex code blocks.
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
14
|
<!-- Source: .ruler/common/codeStyleAndStructure.md -->
|
|
19
15
|
|
|
20
16
|
# Code style and structure
|
|
@@ -29,8 +25,6 @@
|
|
|
29
25
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
30
26
|
- Prefer data immutability.
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
28
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
35
29
|
|
|
36
30
|
# Error handling and validation
|
|
@@ -44,8 +38,6 @@
|
|
|
44
38
|
- Implement proper error logging and user-friendly error messages.
|
|
45
39
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
41
|
<!-- Source: .ruler/common/keyConventions.md -->
|
|
50
42
|
|
|
51
43
|
# Key conventions
|
|
@@ -55,8 +47,6 @@
|
|
|
55
47
|
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
56
48
|
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
|
|
60
50
|
<!-- Source: .ruler/common/testing.md -->
|
|
61
51
|
|
|
62
52
|
# Testing
|
|
@@ -67,8 +57,6 @@
|
|
|
67
57
|
- Prefer `it.each` for multiple test cases.
|
|
68
58
|
- Avoid conditional logic in tests.
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
|
|
72
60
|
<!-- Source: .ruler/common/typeScript.md -->
|
|
73
61
|
|
|
74
62
|
# TypeScript usage
|
|
@@ -89,7 +77,11 @@
|
|
|
89
77
|
- Prefer narrow types whenever possible with `as const` assertions, `typeof`, `instanceof`, `satisfies`, and custom type guards.
|
|
90
78
|
- Implement exhaustiveness checking using `never`.
|
|
91
79
|
|
|
80
|
+
<!-- Source: .ruler/common/zOverlay.md -->
|
|
92
81
|
|
|
82
|
+
# Overlay
|
|
83
|
+
|
|
84
|
+
- If an ./OVERLAY.md file exists, read it for additional rules.
|
|
93
85
|
|
|
94
86
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
95
87
|
|
|
@@ -421,8 +413,6 @@ export function useHandler() {
|
|
|
421
413
|
- **Options pattern** - For flexible configuration
|
|
422
414
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
423
415
|
|
|
424
|
-
|
|
425
|
-
|
|
426
416
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
427
417
|
|
|
428
418
|
# Data Fetching Standards
|
|
@@ -746,8 +736,6 @@ Feature/
|
|
|
746
736
|
│ └── schemas.ts (optional)
|
|
747
737
|
```
|
|
748
738
|
|
|
749
|
-
|
|
750
|
-
|
|
751
739
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
752
740
|
|
|
753
741
|
# Error Handling Standards
|
|
@@ -1189,8 +1177,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1189
1177
|
retry: (failureCount) => failureCount < 3;
|
|
1190
1178
|
```
|
|
1191
1179
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
1180
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1195
1181
|
|
|
1196
1182
|
# File Organization Standards
|
|
@@ -1477,8 +1463,6 @@ describe("formatFeatureName", () => {
|
|
|
1477
1463
|
});
|
|
1478
1464
|
```
|
|
1479
1465
|
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
1466
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1483
1467
|
|
|
1484
1468
|
# Import Standards
|
|
@@ -1814,8 +1798,6 @@ npm run lint:fix
|
|
|
1814
1798
|
- Use relative imports for distant files
|
|
1815
1799
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1816
1800
|
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
1801
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1820
1802
|
|
|
1821
1803
|
# Performance Standards
|
|
@@ -2254,8 +2236,6 @@ getTTFB(console.log);
|
|
|
2254
2236
|
- Ignore performance warnings in console
|
|
2255
2237
|
- Skip memoization for expensive operations
|
|
2256
2238
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
2239
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2260
2240
|
|
|
2261
2241
|
# React Component Patterns
|
|
@@ -2713,8 +2693,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2713
2693
|
}, []);
|
|
2714
2694
|
```
|
|
2715
2695
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
2696
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2719
2697
|
|
|
2720
2698
|
# React
|
|
@@ -2727,8 +2705,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2727
2705
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2728
2706
|
- Use date-fns for any Date based operations like formatting
|
|
2729
2707
|
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
2708
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2733
2709
|
|
|
2734
2710
|
# Styling Standards
|
|
@@ -3207,8 +3183,6 @@ import { Button } from "@/components/Button";
|
|
|
3207
3183
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3208
3184
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3209
3185
|
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
3186
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3213
3187
|
|
|
3214
3188
|
# Testing Standards
|
|
@@ -3673,8 +3647,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3673
3647
|
});
|
|
3674
3648
|
```
|
|
3675
3649
|
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
3650
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3679
3651
|
|
|
3680
3652
|
# TypeScript Standards
|
|
@@ -4227,8 +4199,6 @@ if (!user) throw new Error("User not found");
|
|
|
4227
4199
|
// Now TypeScript knows user exists
|
|
4228
4200
|
```
|
|
4229
4201
|
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
4202
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4233
4203
|
|
|
4234
4204
|
# UI and Styling
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/ai-rules",
|
|
3
3
|
"description": "Pre-built AI agent rules for consistent coding standards.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@clipboard-health/util-ts": "3.17.3",
|