-
Notifications
You must be signed in to change notification settings - Fork 165
Add Windsurf AI Rules for adyen-web #3752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for adyen-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @ScottiBR, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a comprehensive set of AI rules for the adyen-web project in a .windsurfrules.md file. The rules are well-structured and cover a wide range of topics from project architecture to coding standards and security. My review focuses on ensuring the clarity and consistency of these new guidelines. I've identified a couple of minor inconsistencies that could be improved for better understanding by both human developers and AI assistants. Specifically, I've suggested clarifying the TypeScript strict mode configuration and aligning the stylesheet naming convention in the component colocation example with the styling guide.
size-limit report 📦
|
.windsurf/rules/code-guide.md
Outdated
| ## Coding Standards | ||
|
|
||
| ### Component Structure | ||
| - **DO** use default exports for components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we only need default exports for UIElements. For preact components, named exports are better because of the following
- tree shaking is easier to handle for bundlers
- named exports make it easier maintain components by preventing issues like using a different name for the component when imported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, that also prevents AI from rename a component during import
| ### Localization | ||
| - **DO** use `i18n.get('key')` for all user-facing strings | ||
| - **DO** use descriptive keys: `card.number.label` not `cardNumber` | ||
| - **DO NOT** hardcode English strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I think we can have here which is also an potential improvement point for our code base is passing translation keys as props. We should instead pass the result of i18n.get as this gives more options to parent components and makes it obvious where a string is used as a translation key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added
.windsurf/rules/code-guide.md
Outdated
| **Rules**: | ||
| - **DO** group imports with blank lines between categories | ||
| - **DO** use `import type` for type-only imports | ||
| - **DO NOT** use relative imports traversing more than 2 levels up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be fine to traverse more than 2 levels up. Otherwise, what would it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense, this is probably some pattern picked from the last commits, maybe none of then had more than two levels up
| - **DO** use default exports for components | ||
| - **DO** define props interfaces above the component | ||
| - **DO** provide default values via destructuring | ||
| - **DO** colocate: `Component.tsx`, `Component.test.tsx`, `ComponentName.module.scss`, `types.ts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mention that we also add a index.ts file exporting the Component from its folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I've added in another section
### Components Directory
**Rules**:
- **DO**: treat every component folder as a self-contained unit containing `index.ts`, `[Name].tsx`, and `[Name].test.tsx`.
- **DO**: Every component folder must have an `index.ts`.
- **DO**: External files should **only** import from the `index.ts` of the folder, never the `.tsx` file directly.
- **DO**: extract component-specific helper logic into `utils.ts` or `validate.ts` *inside* the component's own folder.
- **DO NOT** import directly from a `.tsx` file; external files must only import from the folder's `index.ts`.
- **DO NOT** use `export *` in `index.ts` to ensure clear APIs and better tree-shaking.
- **DO NOT** allow sub-component logic (tests, utils, styles) to live outside its specific nested folder.
e2e352c to
892dd89
Compare
|



📝 Summary
Adds a .windsurfrules.md file to provide AI coding assistants (Windsurf/Cascade) with project-specific context and guidelines for the adyen-web SDK.
AI assistants work better with explicit project context. This file:
🧪 Tested scenarios
🔗 Related GitHub Issue / Internal Ticket number
Closes: