@mallardbay/cursor-rules 1.0.35 → 1.1.0
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/.cursor/frontend/rules/ui.mdc +0 -3
- package/.cursor/frontend-mobile/rules/{mobile-ui.mdc → ui.mdc} +0 -1
- package/.cursor/shared/rules/code-review.mdc +1 -1
- package/.cursor/shared/skills/address-pr-feedback/SKILL.md +1 -28
- package/.cursor/shared/skills/check-and-fix-ci/SKILL.md +0 -22
- package/.cursor/shared/skills/commit-and-pr/SKILL.md +76 -83
- package/.cursor/shared/skills/commit-and-push/SKILL.md +9 -7
- package/.cursor/shared/skills/prep-for-pr/SKILL.md +1 -32
- package/.cursor/shared/skills/review-pr/SKILL.md +5 -29
- package/.cursor/shared/skills/should-we-merge/SKILL.md +1 -24
- package/.cursor/skills/prep-for-pr/SKILL.md +1 -1
- package/.cursor/skills/review-pr/SKILL.md +1 -1
- package/bin/setup-cursor.sh +0 -0
- package/package.json +3 -2
- package/.cursor/frontend-mobile/rules/react-native.mdc +0 -92
- package/.cursor/rules/code-quality.mdc +0 -55
- package/.cursor/rules/code-review.mdc +0 -46
- package/.cursor/rules/error-handling.mdc +0 -48
- package/.cursor/rules/general-best-practices.mdc +0 -190
- package/.cursor/rules/mallardbay.mdc +0 -23
- package/.cursor/rules/performance.mdc +0 -45
- package/.cursor/rules/testing.mdc +0 -72
- package/.cursor/rules/typescript.mdc +0 -29
- package/.cursor/rules/ui.mdc +0 -91
- package/.cursor/shared/rules/project-ecosystem.mdc +0 -68
package/.cursor/rules/ui.mdc
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Defines best practices for building consistent, maintainable, and responsive UI in Mallard Bay projects
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# UI Development Standards
|
|
8
|
-
|
|
9
|
-
## Theme Usage
|
|
10
|
-
|
|
11
|
-
Use theme values consistently across all components:
|
|
12
|
-
|
|
13
|
-
### Colors
|
|
14
|
-
|
|
15
|
-
- Use theme colors instead of hardcoded values
|
|
16
|
-
- Example: `theme.colors.primary` instead of `'#000000'`
|
|
17
|
-
|
|
18
|
-
### Spacing
|
|
19
|
-
|
|
20
|
-
- Use theme spacing values for margins and padding
|
|
21
|
-
- Example: `theme.space[4]` instead of `'16px'`
|
|
22
|
-
|
|
23
|
-
### Typography
|
|
24
|
-
|
|
25
|
-
- Use theme typography settings for text styles
|
|
26
|
-
- Example: `theme.fontSizes.md` instead of `'16px'`
|
|
27
|
-
|
|
28
|
-
### Borders and border radius
|
|
29
|
-
|
|
30
|
-
- Use theme border styles and radius values
|
|
31
|
-
- Examples: `theme.borders.sm` instead of `'1px solid'`, `theme.radii.md` instead of using px values
|
|
32
|
-
|
|
33
|
-
## Component Structure
|
|
34
|
-
|
|
35
|
-
Maintain clean and consistent component structure:
|
|
36
|
-
|
|
37
|
-
### Nesting
|
|
38
|
-
|
|
39
|
-
- Limit component nesting to maximum depth of 3
|
|
40
|
-
- Keep component hierarchy readable and maintainable
|
|
41
|
-
|
|
42
|
-
### Inline Styles
|
|
43
|
-
|
|
44
|
-
- Limit inline styles to maximum of 2 per component
|
|
45
|
-
- Prefer theme-based styling
|
|
46
|
-
|
|
47
|
-
### Component Library
|
|
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
|
|
51
|
-
|
|
52
|
-
## Responsive Design
|
|
53
|
-
|
|
54
|
-
Ensure responsive and accessible design:
|
|
55
|
-
|
|
56
|
-
### Breakpoints
|
|
57
|
-
|
|
58
|
-
- Use theme breakpoints for responsive design
|
|
59
|
-
- Implement mobile-first approach
|
|
60
|
-
|
|
61
|
-
### Spacing
|
|
62
|
-
|
|
63
|
-
- Use responsive spacing values
|
|
64
|
-
- Adapt layouts for different screen sizes
|
|
65
|
-
|
|
66
|
-
### Animations
|
|
67
|
-
|
|
68
|
-
- Use theme transition values for animations
|
|
69
|
-
- Keep animations smooth and performant
|
|
70
|
-
|
|
71
|
-
### Rendering
|
|
72
|
-
|
|
73
|
-
- Optimize component rendering
|
|
74
|
-
- Avoid unnecessary re-renders
|
|
75
|
-
- Use React.memo and useMemo when appropriate
|
|
76
|
-
- Avoid defining functions inside components to prevent recreation on each render
|
|
77
|
-
- Move function definitions outside components or use useCallback for event handlers
|
|
78
|
-
- Use useCallback for functions passed as props to child components
|
|
79
|
-
- Use useMemo for expensive computations and complex data transformations
|
|
80
|
-
- Memoize filtered, sorted, or mapped arrays to avoid recalculation on every render
|
|
81
|
-
- Use useMemo for object/array creation that would otherwise be recreated on each render
|
|
82
|
-
|
|
83
|
-
## File Patterns
|
|
84
|
-
|
|
85
|
-
These rules apply to all TypeScript and TSX files in the project.
|
|
86
|
-
|
|
87
|
-
## Components
|
|
88
|
-
|
|
89
|
-
- Keep components small and focused on a single responsibility
|
|
90
|
-
- Use functional components with hooks instead of class components
|
|
91
|
-
- Prefer `export default function ImpersonationBox() {` over `function ImpersonationBox(): React.ReactElement | null {` when defining components
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Map of Mallard Bay's interconnected repositories and guidance on where to look for cross-project context. AI agents should consult sibling repos (locally) or the GitHub org when context is missing.
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Mallard Bay Project Ecosystem
|
|
8
|
-
|
|
9
|
-
Mallard Bay is split across several repositories that depend on and reference each other. When working in one repo, the answers you need (types, GraphQL schema, shared helpers, business logic, similar UI patterns) often live in another. Always check sibling repos before assuming context is missing or building something from scratch.
|
|
10
|
-
|
|
11
|
-
## Repositories
|
|
12
|
-
|
|
13
|
-
- **server** — Node.js/GraphQL backend. The source of truth for the GraphQL schema, resolvers, business logic, database models, integrations (Stripe, HubSpot, etc.), and background jobs. Any frontend questions about API shape, mutation behavior, or business rules are answered here.
|
|
14
|
-
- **web** — Customer-facing Next.js web app (booking, marketing, guest experience). Consumes `server`'s GraphQL API.
|
|
15
|
-
- **dashboard** — Outfitter-facing web app for managing trips, bookings, customers, and operations. Consumes `server`'s GraphQL API. Shares many UI patterns with `web`.
|
|
16
|
-
- **outfitter-mobile** — React Native mobile app for outfitters/guides in the field. Consumes `server`'s GraphQL API. Shares domain logic with `dashboard`.
|
|
17
|
-
- **lib-react-components** — Shared React component library (Chakra UI v2 based) used by `web`, `dashboard`, and (where compatible) other frontends. The first place to look before building any new UI primitive.
|
|
18
|
-
- **lib-shared-helpers** — Shared TypeScript utilities, constants, types, copy strings, and helpers consumed across all frontends and sometimes the server. The first place to look for utility functions, formatters, validators, and shared constants.
|
|
19
|
-
|
|
20
|
-
## Typical dependency direction
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
┌──────────────────────┐
|
|
24
|
-
│ server │ (GraphQL API, business logic)
|
|
25
|
-
└──────────┬───────────┘
|
|
26
|
-
│
|
|
27
|
-
┌─────────────────────┼─────────────────────┐
|
|
28
|
-
│ │ │
|
|
29
|
-
┌───▼───┐ ┌─────▼──────┐ ┌──────▼─────────┐
|
|
30
|
-
│ web │ │ dashboard │ │ outfitter-mobile│
|
|
31
|
-
└───┬───┘ └─────┬──────┘ └──────┬─────────┘
|
|
32
|
-
│ │ │
|
|
33
|
-
└─────────────┬───────┴─────────────────────┘
|
|
34
|
-
│
|
|
35
|
-
┌────────────▼────────────┐
|
|
36
|
-
│ lib-react-components │ (UI primitives — frontends only)
|
|
37
|
-
│ lib-shared-helpers │ (utilities — used everywhere)
|
|
38
|
-
└─────────────────────────┘
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## When to look in another repo
|
|
42
|
-
|
|
43
|
-
Before writing new code or assuming behavior, check sibling repos when you need:
|
|
44
|
-
|
|
45
|
-
- **GraphQL schema, query/mutation behavior, or business rules** → `server`
|
|
46
|
-
- **A UI component, theme value, or design pattern** → `lib-react-components` first, then `web` / `dashboard` for usage examples
|
|
47
|
-
- **A utility, formatter, validator, constant, or shared type** → `lib-shared-helpers`
|
|
48
|
-
- **How a similar feature was implemented on another surface** → check the parallel repo (e.g. building it in `dashboard`? see how `web` or `outfitter-mobile` did it)
|
|
49
|
-
- **Copy strings, error messages, test IDs** → `lib-shared-helpers` (most projects re-export from there)
|
|
50
|
-
- **Type definitions that feel like they should be shared** → `lib-shared-helpers` or generated types from `server`
|
|
51
|
-
|
|
52
|
-
## How to access cross-project context
|
|
53
|
-
|
|
54
|
-
AI agents should use whichever method is available:
|
|
55
|
-
|
|
56
|
-
1. **Sibling folders (preferred when running locally).** All Mallard Bay repos are typically cloned as siblings. From any repo, check `../<other-repo>` first — it's the fastest and gives full code search. Example: working in `dashboard`, look at `../server/src/...` or `../lib-react-components/src/...`.
|
|
57
|
-
2. **GitHub via `gh` CLI.** When sibling folders aren't available (CI, sandboxed environments, or the user hasn't cloned the other repo), use `gh` with the configured GitHub token to search and read code across the `mallardbay` org. Useful commands:
|
|
58
|
-
- `gh search code --owner mallardbay '<query>'`
|
|
59
|
-
- `gh api repos/mallardbay/<repo>/contents/<path>`
|
|
60
|
-
- `gh repo view mallardbay/<repo>`
|
|
61
|
-
3. **Ask the user** if neither is available, or if you need to confirm which repos are cloned locally.
|
|
62
|
-
|
|
63
|
-
## Guidance for agents
|
|
64
|
-
|
|
65
|
-
- **Don't reinvent.** If a helper, component, type, or constant might already exist elsewhere, search before writing. Duplication across repos is a recurring pain point.
|
|
66
|
-
- **Mention what you found.** When you pull context from another repo, briefly note where (e.g. "based on `../server/src/resolvers/booking.ts`") so the user can verify.
|
|
67
|
-
- **Respect dependency direction.** Frontends depend on `server` and the libs — not the other way around. Don't suggest changes that would invert this.
|
|
68
|
-
- **When changing a shared lib**, remember that `web`, `dashboard`, and `outfitter-mobile` all consume it. A breaking change in `lib-shared-helpers` or `lib-react-components` ripples everywhere.
|