@mallardbay/cursor-rules 1.0.8 → 1.0.10
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,70 +1,85 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Defines best practices for building consistent, maintainable, and responsive UI in Mallard Bay projects
|
|
3
3
|
globs:
|
|
4
|
-
alwaysApply:
|
|
4
|
+
alwaysApply: true
|
|
5
5
|
---
|
|
6
|
+
|
|
6
7
|
# UI Development Standards
|
|
7
8
|
|
|
8
9
|
## Theme Usage
|
|
10
|
+
|
|
9
11
|
Use theme values consistently across all components:
|
|
10
12
|
|
|
11
13
|
### Colors
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
+
|
|
15
|
+
- Use theme colors instead of hardcoded values
|
|
16
|
+
- Example: `theme.colors.primary` instead of `'#000000'`
|
|
14
17
|
|
|
15
18
|
### Spacing
|
|
16
|
-
|
|
17
|
-
-
|
|
19
|
+
|
|
20
|
+
- Use theme spacing values for margins and padding
|
|
21
|
+
- Example: `theme.space[4]` instead of `'16px'`
|
|
18
22
|
|
|
19
23
|
### Typography
|
|
20
|
-
|
|
21
|
-
-
|
|
24
|
+
|
|
25
|
+
- Use theme typography settings for text styles
|
|
26
|
+
- Example: `theme.fontSizes.md` instead of `'16px'`
|
|
22
27
|
|
|
23
28
|
### Borders
|
|
24
|
-
|
|
25
|
-
-
|
|
29
|
+
|
|
30
|
+
- Use theme border styles and radius values
|
|
31
|
+
- Example: `theme.borders.sm` instead of `'1px solid'`
|
|
26
32
|
|
|
27
33
|
## Component Structure
|
|
34
|
+
|
|
28
35
|
Maintain clean and consistent component structure:
|
|
29
36
|
|
|
30
37
|
### Nesting
|
|
31
|
-
|
|
32
|
-
-
|
|
38
|
+
|
|
39
|
+
- Limit component nesting to maximum depth of 3
|
|
40
|
+
- Keep component hierarchy readable and maintainable
|
|
33
41
|
|
|
34
42
|
### Inline Styles
|
|
35
|
-
|
|
36
|
-
-
|
|
43
|
+
|
|
44
|
+
- Limit inline styles to maximum of 2 per component
|
|
45
|
+
- Prefer theme-based styling
|
|
37
46
|
|
|
38
47
|
### Component Library
|
|
39
|
-
|
|
40
|
-
-
|
|
48
|
+
|
|
49
|
+
- Use existing components in @mallardbay/lib-react-components, @mallardbay/lib-react-components is based off Crakra UI v2
|
|
50
|
+
- If no component available in @mallardbay/lib-react-components, create one using Crakra UI and place it under src/components/shared/todo-lib-react-components/ to me moved later
|
|
41
51
|
|
|
42
52
|
## Responsive Design
|
|
53
|
+
|
|
43
54
|
Ensure responsive and accessible design:
|
|
44
55
|
|
|
45
56
|
### Breakpoints
|
|
46
|
-
|
|
47
|
-
-
|
|
57
|
+
|
|
58
|
+
- Use theme breakpoints for responsive design
|
|
59
|
+
- Implement mobile-first approach
|
|
48
60
|
|
|
49
61
|
### Spacing
|
|
50
|
-
|
|
51
|
-
-
|
|
62
|
+
|
|
63
|
+
- Use responsive spacing values
|
|
64
|
+
- Adapt layouts for different screen sizes
|
|
52
65
|
|
|
53
66
|
### Animations
|
|
54
|
-
|
|
55
|
-
-
|
|
67
|
+
|
|
68
|
+
- Use theme transition values for animations
|
|
69
|
+
- Keep animations smooth and performant
|
|
56
70
|
|
|
57
71
|
### Rendering
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
72
|
+
|
|
73
|
+
- Optimize component rendering
|
|
74
|
+
- Avoid unnecessary re-renders
|
|
75
|
+
- Use React.memo and useMemo when appropriate
|
|
61
76
|
|
|
62
77
|
## File Patterns
|
|
78
|
+
|
|
63
79
|
These rules apply to all TypeScript and TSX files in the project.
|
|
64
80
|
|
|
65
81
|
## Components
|
|
66
|
-
- Keep components small and focused on a single responsibility
|
|
67
|
-
- Use functional components with hooks instead of class components
|
|
68
|
-
- Prefer `export default function ImpersonationBox() {` over `function ImpersonationBox(): React.ReactElement | null {` when defining components
|
|
69
|
-
|
|
70
82
|
|
|
83
|
+
- Keep components small and focused on a single responsibility
|
|
84
|
+
- Use functional components with hooks instead of class components
|
|
85
|
+
- Prefer `export default function ImpersonationBox() {` over `function ImpersonationBox(): React.ReactElement | null {` when defining components
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Describes Mallard Bay’s mission to simplify and scale outfitter operations through purpose-built software—emphasizing real-world impact, outfitter collaboration, and a long-term vision to digitize and unify the outdoor experience industry.
|
|
3
3
|
globs:
|
|
4
|
-
alwaysApply:
|
|
4
|
+
alwaysApply: true
|
|
5
5
|
---
|
|
6
|
+
|
|
6
7
|
# Mallard Bay: Outfitter Management System Overview
|
|
7
8
|
|
|
8
9
|
Mallard Bay is a specialized platform designed to streamline operations for outfitters—businesses that offer guided outdoor experiences such as hunting, fishing, and eco-tourism. At its core, Mallard Bay operates as an outfitter management system, purpose-built to reduce administrative burden, improve customer experience, and unlock new revenue channels for guides and lodge operators.
|
|
@@ -19,4 +20,4 @@ We’re building tools that fit into the way outfitters actually work — not th
|
|
|
19
20
|
|
|
20
21
|
# Vision
|
|
21
22
|
|
|
22
|
-
Mallard Bay aims to be the digital backbone for the outfitting industry—a single source of truth for trip logistics, customer interaction, and business growth. The long-term goal is to transform an analog, fragmented market into a digital-first, scalable ecosystem.
|
|
23
|
+
Mallard Bay aims to be the digital backbone for the outfitting industry—a single source of truth for trip logistics, customer interaction, and business growth. The long-term goal is to transform an analog, fragmented market into a digital-first, scalable ecosystem.
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Outlines practical, value-driven testing guidelines focused on reliability, developer confidence, and speed. Emphasizes high-impact coverage (not overkill), structured test organization, clear scenarios, and reusable mock/test utilities—enabling fast iteration without sacrificing quality.
|
|
3
3
|
globs:
|
|
4
|
-
alwaysApply:
|
|
4
|
+
alwaysApply: true
|
|
5
5
|
---
|
|
6
|
+
|
|
6
7
|
# Testing Standards
|
|
7
8
|
|
|
8
9
|
## Test Coverage and Structure
|
|
10
|
+
|
|
9
11
|
We aim for high-impact test coverage, focused on adding value and improving developer confidence and experience. The priority is to cover critical logic, edge cases, and integration points where bugs would hurt the most. Tests should act as a safety net and enable fast, fearless iteration—not as a box-ticking exercise.
|
|
10
12
|
|
|
11
13
|
We do not chase 100% coverage for its own sake. If a test doesn’t meaningfully reduce risk or help developers move faster, it’s not worth writing. The goal is smart coverage, not maximum coverage—optimize for reliability, clarity, and development speed without overengineering.
|
|
@@ -13,49 +15,56 @@ We do not chase 100% coverage for its own sake. If a test doesn’t meaningfully
|
|
|
13
15
|
Avoid e2e tests for UI. Favor unit tests.
|
|
14
16
|
|
|
15
17
|
### Coverage Requirements
|
|
16
|
-
- Minimum test coverage: 80%
|
|
17
|
-
- Place tests in `_tests_` directory closest to the file being tested
|
|
18
|
-
- Use `.spec.ts` or `.spec.tsx` file extensions
|
|
19
|
-
- Do NOT Use `.test.ts` or `.test.tsx` file extensions
|
|
20
18
|
|
|
19
|
+
- Minimum test coverage: 80%
|
|
20
|
+
- Place tests in `_tests_` directory closest to the file being tested
|
|
21
|
+
- Use `.spec.ts` or `.spec.tsx` file extensions
|
|
22
|
+
- Do NOT Use `.test.ts` or `.test.tsx` file extensions
|
|
21
23
|
|
|
22
24
|
### Test Organization
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
25
|
+
|
|
26
|
+
- Maximum nesting level: 2
|
|
27
|
+
- Use `test` or `it` for test cases
|
|
28
|
+
- Keep tests focused and atomic
|
|
29
|
+
- Follow AAA pattern (Arrange, Act, Assert)
|
|
27
30
|
|
|
28
31
|
### Required Scenarios
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
32
|
+
|
|
33
|
+
- Happy path testing
|
|
34
|
+
- Error case handling
|
|
35
|
+
- Edge case coverage
|
|
36
|
+
- All tests must pass before completion
|
|
33
37
|
|
|
34
38
|
### Test Quality
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
39
|
+
|
|
40
|
+
- Write clear, descriptive test names
|
|
41
|
+
- Test one concept per test case
|
|
42
|
+
- Avoid test interdependence
|
|
43
|
+
- Use meaningful assertions
|
|
44
|
+
- Avoid tests that will make the overall run slower
|
|
40
45
|
|
|
41
46
|
### Component Testing
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
47
|
+
|
|
48
|
+
- Use `renderWithProviders` for component tests
|
|
49
|
+
- Use `renderHookWithProviders` for hook tests
|
|
50
|
+
- Avoid mocking dependent components
|
|
51
|
+
- Test component behavior, not implementation
|
|
46
52
|
|
|
47
53
|
### Mocking Guidelines
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
+
|
|
55
|
+
- Use mock helpers instead of inline mocks
|
|
56
|
+
- Follow existing patterns for:
|
|
57
|
+
- Entity mocks
|
|
58
|
+
- Apollo mocks
|
|
59
|
+
- Provider mocks
|
|
60
|
+
- Keep mocks simple and maintainable
|
|
54
61
|
|
|
55
62
|
### Test Utilities
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
63
|
+
|
|
64
|
+
- Leverage testing utilities from [@testing-library/react](mdc:package.json)
|
|
65
|
+
- Use [@testing-library/jest-dom](mdc:package.json) for DOM assertions
|
|
66
|
+
- Follow established patterns in existing tests
|
|
59
67
|
|
|
60
68
|
## File Patterns
|
|
69
|
+
|
|
61
70
|
These rules apply to all test files with `.spec.ts` or `.spec.tsx` extensions.
|