Skip to content

Conversation

@ScottiBR
Copy link
Contributor

@ScottiBR ScottiBR commented Jan 7, 2026

📝 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:

  • Reduces hallucinations about React vs Preact
  • Enforces PCI compliance rules in generated code
  • Ensures consistent patterns across AI-assisted contributions
  • Speeds up onboarding for AI-assisted development

🧪 Tested scenarios


🔗 Related GitHub Issue / Internal Ticket number

Closes:


@ScottiBR ScottiBR requested a review from a team as a code owner January 7, 2026 13:56
@ScottiBR ScottiBR requested a review from m1aw January 7, 2026 13:56
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

⚠️ No Changeset found

Latest commit: 892dd89

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for adyen-web ready!

Name Link
🔨 Latest commit 892dd89
🔍 Latest deploy log https://app.netlify.com/projects/adyen-web/deploys/696113a8a7a2090008edec0e
😎 Deploy Preview https://deploy-preview-3752.checkout-web-dev.adyen.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 .windsurfrules.md file, which serves as a detailed guide for AI coding assistants, such as Windsurf and Cascade. The purpose of this file is to ensure that AI-generated code adheres to the adyen-web SDK's specific architectural, technical, and compliance requirements. By providing clear, explicit guidelines, the PR aims to improve the accuracy and consistency of AI-generated code, prevent common errors like React/Preact confusion, enforce PCI compliance, and streamline the onboarding process for AI-assisted development.

Highlights

  • New AI Coding Guidelines: Introduced a comprehensive .windsurfrules.md file to provide explicit project context and guidelines for AI coding assistants (Windsurf/Cascade) working on the adyen-web SDK.
  • Improved AI Assistant Performance: The new ruleset aims to significantly reduce AI 'hallucinations' regarding framework choices (e.g., Preact vs. React), enforce critical PCI compliance rules, and ensure consistent coding patterns, thereby speeding up AI-assisted development.
  • Comprehensive Development Standards: The .windsurfrules.md document outlines detailed standards across various development aspects, including architecture, tech stack, coding practices, testing, security, and performance, serving as a single source of truth for AI and human developers alike.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

size-limit report 📦

Path Size
UMD 113.92 KB (0%)
Auto 120.48 KB (0%)
ESM - Core 25.41 KB (0%)
ESM - Core + Card 64.72 KB (0%)
ESM - Core + Dropin with Card 71.17 KB (0%)

## Coding Standards

### Component Structure
- **DO** use default exports for components
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, added

**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
Copy link
Contributor

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?

Copy link
Contributor Author

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`
Copy link
Contributor

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

Copy link
Contributor Author

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.

@ScottiBR ScottiBR force-pushed the add-windsurf-rules branch from e2e352c to 892dd89 Compare January 9, 2026 14:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants