.windsurfrules

?
R
xml

To optimize AI interaction with your codebase, .windsurfrules files should employ XML-like tags (e.g., <tag_name>) to group related rules, ensuring clarity, precision, and scalability. This structured approach is vital as rule sets expand. Key categories to encapsulate within these tags include <clarityAndSpecificity> for unambiguous rule definition, <projectContext> for details on tech stack, style, and structure, and <codingStandards> for referencing style guides and organization. Additionally, <frameworkAndLibraryUsage> should specify required tools, <safeEditingAndRestrictions> should list non-modifiable elements and restricted APIs, and <maintainability> should guide the ongoing updating of rules in line with project evolution and global Windsurf standards.

1
2<generalCodeStyleFormatting>
3
4Rule: Follow the Airbnb Style Guide for formatting and code quality.
5
6Rule: Use TypeScript for all code; prefer interfaces over types.
7
8Rule: Use PascalCase for React component filenames (e.g., BookingForm.tsx).
9
10Rule: Prefer named exports for components and utilities.
11
12</generalCodeStyleFormatting>
13
14<projectStructureArchitecture>
15
16Rule: Follow Next.js App Router patterns for routing.
17
18Rule: Place new pages under /app and new components under /components.
19
20Rule: Use /lib for shared utilities and /config for configuration files.
21
22Restriction: Do not modify files in /config/secrets or /scripts/deploy.
23
24</projectStructureArchitecture>
25
26<stylingUI>
27
28Rule: Use Tailwind CSS for styling.
29
30Rule: Use Shadcn UI for reusable components.
31
32Rule: Maintain consistent spacing and responsive design.
33
34</stylingUI>
35
36<dataFetchingForms>
37
38Rule: Use TanStack Query (react-query) for frontend data fetching.
39
40Rule: Use React Hook Form for form management.
41
42Rule: Use Zod for schema validation.
43
44</dataFetchingForms>
45
46<stateManagementLogic>
47
48Rule: Use React Context for global state management.
49
50Rule: Place hooks in /lib/hooks.
51
52</stateManagementLogic>
53
54<backendDatabase>
55
56Rule: Use Prisma for database access.
57
58Rule: Place server actions in /lib/server/server-actions.ts.
59
60Restriction: Do not expose sensitive data in client components.
61
62</backendDatabase>
63
64<testingQuality>
65
66Rule: Use Jest and React Testing Library for unit and integration tests.
67
68Rule: Write tests for all new features and components.
69
70</testingQuality>
71
72<businessLogicSecurity>
73
74Rule: Booking logic must prevent double-booking and validate availability.
75
76Rule: All booking operations must check user authentication and permissions.
77
78Rule: Do not allow bookings in the past.
79
80</businessLogicSecurity>
81
82<apiExternalServices>
83
84Rule: Use RESTful API conventions for internal endpoints.
85
86Restriction: Avoid direct calls to third-party payment APIs from the frontend.
87
88</apiExternalServices>
89
90<restrictionsGlobal>
91
92Restriction: Do not modify files in /public/assets or /config/secrets.
93
94Restriction: Do not use any deprecated APIs or libraries.
95
96</restrictionsGlobal>

Created on 5/21/2025