@clipboard-health/ai-rules 0.2.3 → 0.2.4
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 +0 -11
- package/backend/CLAUDE.md +0 -12
- package/common/AGENTS.md +0 -9
- package/common/CLAUDE.md +0 -10
- package/frontend/AGENTS.md +0 -33
- package/frontend/CLAUDE.md +0 -34
- package/fullstack/AGENTS.md +0 -35
- package/fullstack/CLAUDE.md +0 -36
- 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
|
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
|
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
|
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
|
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,8 +66,6 @@
|
|
|
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
|
|
|
78
|
-
|
|
79
|
-
|
|
80
69
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
81
70
|
|
|
82
71
|
# Custom Hook Standards
|
|
@@ -407,8 +396,6 @@ export function useHandler() {
|
|
|
407
396
|
- **Options pattern** - For flexible configuration
|
|
408
397
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
409
398
|
|
|
410
|
-
|
|
411
|
-
|
|
412
399
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
413
400
|
|
|
414
401
|
# Data Fetching Standards
|
|
@@ -732,8 +719,6 @@ Feature/
|
|
|
732
719
|
│ └── schemas.ts (optional)
|
|
733
720
|
```
|
|
734
721
|
|
|
735
|
-
|
|
736
|
-
|
|
737
722
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
738
723
|
|
|
739
724
|
# Error Handling Standards
|
|
@@ -1175,8 +1160,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1175
1160
|
retry: (failureCount) => failureCount < 3;
|
|
1176
1161
|
```
|
|
1177
1162
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
1163
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1181
1164
|
|
|
1182
1165
|
# File Organization Standards
|
|
@@ -1463,8 +1446,6 @@ describe("formatFeatureName", () => {
|
|
|
1463
1446
|
});
|
|
1464
1447
|
```
|
|
1465
1448
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
1449
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1469
1450
|
|
|
1470
1451
|
# Import Standards
|
|
@@ -1800,8 +1781,6 @@ npm run lint:fix
|
|
|
1800
1781
|
- Use relative imports for distant files
|
|
1801
1782
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1802
1783
|
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
1784
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1806
1785
|
|
|
1807
1786
|
# Performance Standards
|
|
@@ -2240,8 +2219,6 @@ getTTFB(console.log);
|
|
|
2240
2219
|
- Ignore performance warnings in console
|
|
2241
2220
|
- Skip memoization for expensive operations
|
|
2242
2221
|
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
2222
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2246
2223
|
|
|
2247
2224
|
# React Component Patterns
|
|
@@ -2699,8 +2676,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2699
2676
|
}, []);
|
|
2700
2677
|
```
|
|
2701
2678
|
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
2679
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2705
2680
|
|
|
2706
2681
|
# React
|
|
@@ -2713,8 +2688,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2713
2688
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2714
2689
|
- Use date-fns for any Date based operations like formatting
|
|
2715
2690
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
2691
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2719
2692
|
|
|
2720
2693
|
# Styling Standards
|
|
@@ -3193,8 +3166,6 @@ import { Button } from "@/components/Button";
|
|
|
3193
3166
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3194
3167
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3195
3168
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
3169
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3199
3170
|
|
|
3200
3171
|
# Testing Standards
|
|
@@ -3659,8 +3630,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3659
3630
|
});
|
|
3660
3631
|
```
|
|
3661
3632
|
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
3633
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3665
3634
|
|
|
3666
3635
|
# TypeScript Standards
|
|
@@ -4213,8 +4182,6 @@ if (!user) throw new Error("User not found");
|
|
|
4213
4182
|
// Now TypeScript knows user exists
|
|
4214
4183
|
```
|
|
4215
4184
|
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
4185
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4219
4186
|
|
|
4220
4187
|
# 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,8 +64,6 @@
|
|
|
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
|
|
|
77
|
-
|
|
78
|
-
|
|
79
67
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
80
68
|
|
|
81
69
|
# Custom Hook Standards
|
|
@@ -406,8 +394,6 @@ export function useHandler() {
|
|
|
406
394
|
- **Options pattern** - For flexible configuration
|
|
407
395
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
408
396
|
|
|
409
|
-
|
|
410
|
-
|
|
411
397
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
412
398
|
|
|
413
399
|
# Data Fetching Standards
|
|
@@ -731,8 +717,6 @@ Feature/
|
|
|
731
717
|
│ └── schemas.ts (optional)
|
|
732
718
|
```
|
|
733
719
|
|
|
734
|
-
|
|
735
|
-
|
|
736
720
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
737
721
|
|
|
738
722
|
# Error Handling Standards
|
|
@@ -1174,8 +1158,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1174
1158
|
retry: (failureCount) => failureCount < 3;
|
|
1175
1159
|
```
|
|
1176
1160
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
1161
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1180
1162
|
|
|
1181
1163
|
# File Organization Standards
|
|
@@ -1462,8 +1444,6 @@ describe("formatFeatureName", () => {
|
|
|
1462
1444
|
});
|
|
1463
1445
|
```
|
|
1464
1446
|
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
1447
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1468
1448
|
|
|
1469
1449
|
# Import Standards
|
|
@@ -1799,8 +1779,6 @@ npm run lint:fix
|
|
|
1799
1779
|
- Use relative imports for distant files
|
|
1800
1780
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1801
1781
|
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
1782
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1805
1783
|
|
|
1806
1784
|
# Performance Standards
|
|
@@ -2239,8 +2217,6 @@ getTTFB(console.log);
|
|
|
2239
2217
|
- Ignore performance warnings in console
|
|
2240
2218
|
- Skip memoization for expensive operations
|
|
2241
2219
|
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
2220
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2245
2221
|
|
|
2246
2222
|
# React Component Patterns
|
|
@@ -2698,8 +2674,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2698
2674
|
}, []);
|
|
2699
2675
|
```
|
|
2700
2676
|
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
2677
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2704
2678
|
|
|
2705
2679
|
# React
|
|
@@ -2712,8 +2686,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2712
2686
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2713
2687
|
- Use date-fns for any Date based operations like formatting
|
|
2714
2688
|
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
2689
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2718
2690
|
|
|
2719
2691
|
# Styling Standards
|
|
@@ -3192,8 +3164,6 @@ import { Button } from "@/components/Button";
|
|
|
3192
3164
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3193
3165
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3194
3166
|
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
3167
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3198
3168
|
|
|
3199
3169
|
# Testing Standards
|
|
@@ -3658,8 +3628,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3658
3628
|
});
|
|
3659
3629
|
```
|
|
3660
3630
|
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
3631
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3664
3632
|
|
|
3665
3633
|
# TypeScript Standards
|
|
@@ -4212,8 +4180,6 @@ if (!user) throw new Error("User not found");
|
|
|
4212
4180
|
// Now TypeScript knows user exists
|
|
4213
4181
|
```
|
|
4214
4182
|
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
4183
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4218
4184
|
|
|
4219
4185
|
# 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,8 +79,6 @@
|
|
|
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
|
|
|
93
|
-
|
|
94
|
-
|
|
95
82
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
96
83
|
|
|
97
84
|
# Custom Hook Standards
|
|
@@ -422,8 +409,6 @@ export function useHandler() {
|
|
|
422
409
|
- **Options pattern** - For flexible configuration
|
|
423
410
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
424
411
|
|
|
425
|
-
|
|
426
|
-
|
|
427
412
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
428
413
|
|
|
429
414
|
# Data Fetching Standards
|
|
@@ -747,8 +732,6 @@ Feature/
|
|
|
747
732
|
│ └── schemas.ts (optional)
|
|
748
733
|
```
|
|
749
734
|
|
|
750
|
-
|
|
751
|
-
|
|
752
735
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
753
736
|
|
|
754
737
|
# Error Handling Standards
|
|
@@ -1190,8 +1173,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1190
1173
|
retry: (failureCount) => failureCount < 3;
|
|
1191
1174
|
```
|
|
1192
1175
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
1176
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1196
1177
|
|
|
1197
1178
|
# File Organization Standards
|
|
@@ -1478,8 +1459,6 @@ describe("formatFeatureName", () => {
|
|
|
1478
1459
|
});
|
|
1479
1460
|
```
|
|
1480
1461
|
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
1462
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1484
1463
|
|
|
1485
1464
|
# Import Standards
|
|
@@ -1815,8 +1794,6 @@ npm run lint:fix
|
|
|
1815
1794
|
- Use relative imports for distant files
|
|
1816
1795
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1817
1796
|
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
1797
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1821
1798
|
|
|
1822
1799
|
# Performance Standards
|
|
@@ -2255,8 +2232,6 @@ getTTFB(console.log);
|
|
|
2255
2232
|
- Ignore performance warnings in console
|
|
2256
2233
|
- Skip memoization for expensive operations
|
|
2257
2234
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
2235
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2261
2236
|
|
|
2262
2237
|
# React Component Patterns
|
|
@@ -2714,8 +2689,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2714
2689
|
}, []);
|
|
2715
2690
|
```
|
|
2716
2691
|
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
2692
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2720
2693
|
|
|
2721
2694
|
# React
|
|
@@ -2728,8 +2701,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2728
2701
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2729
2702
|
- Use date-fns for any Date based operations like formatting
|
|
2730
2703
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
2704
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2734
2705
|
|
|
2735
2706
|
# Styling Standards
|
|
@@ -3208,8 +3179,6 @@ import { Button } from "@/components/Button";
|
|
|
3208
3179
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3209
3180
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3210
3181
|
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
3182
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3214
3183
|
|
|
3215
3184
|
# Testing Standards
|
|
@@ -3674,8 +3643,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3674
3643
|
});
|
|
3675
3644
|
```
|
|
3676
3645
|
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
3646
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3680
3647
|
|
|
3681
3648
|
# TypeScript Standards
|
|
@@ -4228,8 +4195,6 @@ if (!user) throw new Error("User not found");
|
|
|
4228
4195
|
// Now TypeScript knows user exists
|
|
4229
4196
|
```
|
|
4230
4197
|
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
4198
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4234
4199
|
|
|
4235
4200
|
# 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,8 +77,6 @@
|
|
|
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
|
|
|
92
|
-
|
|
93
|
-
|
|
94
80
|
<!-- Source: .ruler/frontend/custom-hooks.md -->
|
|
95
81
|
|
|
96
82
|
# Custom Hook Standards
|
|
@@ -421,8 +407,6 @@ export function useHandler() {
|
|
|
421
407
|
- **Options pattern** - For flexible configuration
|
|
422
408
|
- **Explicit dependencies** - In useMemo/useCallback
|
|
423
409
|
|
|
424
|
-
|
|
425
|
-
|
|
426
410
|
<!-- Source: .ruler/frontend/data-fetching.md -->
|
|
427
411
|
|
|
428
412
|
# Data Fetching Standards
|
|
@@ -746,8 +730,6 @@ Feature/
|
|
|
746
730
|
│ └── schemas.ts (optional)
|
|
747
731
|
```
|
|
748
732
|
|
|
749
|
-
|
|
750
|
-
|
|
751
733
|
<!-- Source: .ruler/frontend/error-handling.md -->
|
|
752
734
|
|
|
753
735
|
# Error Handling Standards
|
|
@@ -1189,8 +1171,6 @@ if (isError && error.response?.status === 404) {
|
|
|
1189
1171
|
retry: (failureCount) => failureCount < 3;
|
|
1190
1172
|
```
|
|
1191
1173
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
1174
|
<!-- Source: .ruler/frontend/file-organization.md -->
|
|
1195
1175
|
|
|
1196
1176
|
# File Organization Standards
|
|
@@ -1477,8 +1457,6 @@ describe("formatFeatureName", () => {
|
|
|
1477
1457
|
});
|
|
1478
1458
|
```
|
|
1479
1459
|
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
1460
|
<!-- Source: .ruler/frontend/imports.md -->
|
|
1483
1461
|
|
|
1484
1462
|
# Import Standards
|
|
@@ -1814,8 +1792,6 @@ npm run lint:fix
|
|
|
1814
1792
|
- Use relative imports for distant files
|
|
1815
1793
|
- Create excessive barrel exports that hurt tree-shaking
|
|
1816
1794
|
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
1795
|
<!-- Source: .ruler/frontend/performance.md -->
|
|
1820
1796
|
|
|
1821
1797
|
# Performance Standards
|
|
@@ -2254,8 +2230,6 @@ getTTFB(console.log);
|
|
|
2254
2230
|
- Ignore performance warnings in console
|
|
2255
2231
|
- Skip memoization for expensive operations
|
|
2256
2232
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
2233
|
<!-- Source: .ruler/frontend/react-patterns.md -->
|
|
2260
2234
|
|
|
2261
2235
|
# React Component Patterns
|
|
@@ -2713,8 +2687,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2713
2687
|
}, []);
|
|
2714
2688
|
```
|
|
2715
2689
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
2690
|
<!-- Source: .ruler/frontend/react.md -->
|
|
2719
2691
|
|
|
2720
2692
|
# React
|
|
@@ -2727,8 +2699,6 @@ const handleSubmit = useCallback(() => {
|
|
|
2727
2699
|
- Use react-hook-form for all form UIs and use zod resolver for form schema validation
|
|
2728
2700
|
- Use date-fns for any Date based operations like formatting
|
|
2729
2701
|
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
2702
|
<!-- Source: .ruler/frontend/styling.md -->
|
|
2733
2703
|
|
|
2734
2704
|
# Styling Standards
|
|
@@ -3207,8 +3177,6 @@ import { Button } from "@/components/Button";
|
|
|
3207
3177
|
- **Leverage pseudo-classes** - For hover, focus, disabled states
|
|
3208
3178
|
- **Prefer `sx` over direct props** - `sx` takes priority and is more flexible
|
|
3209
3179
|
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
3180
|
<!-- Source: .ruler/frontend/testing.md -->
|
|
3213
3181
|
|
|
3214
3182
|
# Testing Standards
|
|
@@ -3673,8 +3641,6 @@ it("should not show premium badge when user is not premium", () => {
|
|
|
3673
3641
|
});
|
|
3674
3642
|
```
|
|
3675
3643
|
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
3644
|
<!-- Source: .ruler/frontend/typeScript.md -->
|
|
3679
3645
|
|
|
3680
3646
|
# TypeScript Standards
|
|
@@ -4227,8 +4193,6 @@ if (!user) throw new Error("User not found");
|
|
|
4227
4193
|
// Now TypeScript knows user exists
|
|
4228
4194
|
```
|
|
4229
4195
|
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
4196
|
<!-- Source: .ruler/frontend/uiAndStyling.md -->
|
|
4233
4197
|
|
|
4234
4198
|
# 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.4",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@clipboard-health/util-ts": "3.17.3",
|