Skip to content

Commit 28319c2

Browse files
authored
Update AI rules and tools configuration for improved development workflow (platformplatform#748)
### Summary & Motivation Update AI rules and tools configuration to improve development workflow consistency and align with current conventions. The changes standardize workflow naming, update tool configurations, and enhance frontend development guidelines. - Update Cursor BrowserMCP tool configuration to use the latest version and correct naming. - Rename all workflow rules to follow verb-workflow-name format for consistency. - Fix frontend rules to run build instead of format after each change to ensure proper validation. - Update frontend AI rules to use React form components over HTML to follow established conventions. - Add guidelines for commit messages and code changes to main AI rules. - Remove deprecated .windsurfrules file and add to .gitignore. ### Checklist - [x] I have added tests, or done manual regression tests - [x] I have updated the documentation, if necessary
2 parents 60f1849 + f25dde9 commit 28319c2

27 files changed

+273
-336
lines changed

.cursor/mcp.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"mcpServers": {
3-
"browser-tools": {
3+
"browsermcp": {
44
"command": "npx",
5-
"args": ["-y", "@agentdeskai/browser-tools-mcp@1.2.0"],
6-
"enabled": true
5+
"args": ["@browsermcp/mcp@latest"]
76
},
87
"context7": {
98
"command": "npx",

.cursor/rules/frontend/form-with-validation.mdc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,18 @@ function BadUserProfileForm({ user }) {
9797
};
9898

9999
return (
100-
<form onSubmit={handleSubmit}>
100+
<Form onSubmit={handleSubmit}>
101101
{/* Missing proper validation and error handling */}
102-
<input name="firstName" defaultValue={user?.firstName} required />
103-
<input name="lastName" defaultValue={user?.lastName} required />
104-
<input name="title" defaultValue={user?.title} />
102+
<TextField name="firstName" defaultValue={user?.firstName} isRequired />
103+
<TextField name="lastName" defaultValue={user?.lastName} isRequired />
104+
<TextField name="title" defaultValue={user?.title} />
105105

106-
{error && <div className="error">{error.message}</div>}
106+
{error && <FormErrorMessage error={error} />}
107107

108-
<button type="submit" disabled={isLoading}>
109-
{isLoading ? "Saving..." : "Save changes"}
110-
</button>
111-
</form>
108+
<Button type="submit" isDisabled={isLoading}>
109+
{isLoading ? <Trans>Saving...</Trans> : <Trans>Save changes</Trans>}
110+
</Button>
111+
</Form>
112112
);
113113
}
114114
```

.cursor/rules/frontend/frontend.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Carefully follow these instructions for frontend TypeScript and React developmen
3636
- Reference existing implementations to maintain consistency.
3737

3838
4. Build and format your changes:
39-
- After each minor change, run `[CLI_ALIAS] format --frontend` to format your code. See [Tools](mdc:.cursor/rules/tools.mdc) for details.
39+
- After each minor change, run `[CLI_ALIAS] build --frontend` to format your code. See [Tools](mdc:.cursor/rules/tools.mdc) for details.
4040
- This ensures consistent code style across the codebase.
4141

4242
5. Verify your changes:

.cursor/rules/frontend/react-aria-components.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { Form } from "@repo/ui/components/Form";
2525
import { FormErrorMessage } from "@repo/ui/components/FormErrorMessage";
2626
import { Button } from "@repo/ui/components/Button";
2727
import { TextField } from "@repo/ui/components/TextField";
28+
import { Trans } from "@lingui/react/macro";
2829

2930
<Form>
3031
<TextField

.cursor/rules/frontend/tanstack-query-api-integration.mdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Note: All .NET API endpoints are available as strongly typed API contracts in th
2727
## Example 1 - Data Fetching Example
2828

2929
```typescript
30+
import { LoadingSpinner } from "@repo/ui/components/LoadingSpinner";
31+
import { UserList } from "@repo/ui/components/UserList";
32+
3033
const { data: users, isLoading } = api.useQuery("get", "/api/users", {
3134
params: { query: { Search: search } }
3235
});
@@ -65,6 +68,12 @@ const handleComplete = () => {
6568
## Example 3 - Form Submission Example
6669

6770
```typescript
71+
import { Form } from "@repo/ui/components/Form";
72+
import { FormErrorMessage } from "@repo/ui/components/FormErrorMessage";
73+
import { TextField } from "@repo/ui/components/TextField";
74+
import { Button } from "@repo/ui/components/Button";
75+
import { Trans } from "@lingui/react/macro";
76+
6877
<Form
6978
onSubmit={mutationSubmitter(completeLoginMutation, {
7079
path: { id: loginId }

.cursor/rules/frontend/translations.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Carefully follow these instructions when implementing translations and internati
2222

2323
```tsx
2424
import { Trans } from "@lingui/react/macro";
25+
import { Button } from "@repo/ui/components/Button";
26+
import { Heading } from "@repo/ui/components/Heading";
2527

2628
<Button onPress={handleLogin}>
2729
<Trans>Log in</Trans>

.cursor/rules/main.mdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Always follow these rule files very carefully, as they have been crafted to ensu
2626

2727
Always consult the relevant rule files before each code change.
2828

29+
Please note that I often correct or even revert code you generated. If you notice that, take special care not to revert my changes.
30+
31+
Commit messages should be in imperative form, start with a capital letter, avoid ending punctuation, be a single line, and concisely describe changes and motivation.
32+
2933
## Project Structure
3034

3135
This is a mono repository with multiple self-contained systems (SCS), each being a small monolith. All SCSs follow the same structure.

.cursor/rules/tools.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Never start inspecting or fixing the Developer CLI. If it does not work, ask the
112112
## ❌ Anti-patterns to avoid
113113
- Don't change the working directory before running the CLI command. The CLI can be run from any location with the same result.
114114
- Never fall back to using direct commands like `npm run format` or `dotnet test`. Always use the Developer CLI with the appropriate alias.
115+
- Don't run `[CLI_ALIAS] format --frontend` when you change code, this is only needed before commit.

.cursor/rules/workflows/ai-rules.mdc

Lines changed: 0 additions & 108 deletions
This file was deleted.

.cursor/rules/workflows/git-commits.mdc renamed to .cursor/rules/workflows/commit-changes.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Workflow for writing effective git commit messages
33
globs:
44
alwaysApply: false
55
---
6-
# Git Commit Workflow
6+
# Commite Changes Workflow
77

88
Follow these steps to commit changes:
99

0 commit comments

Comments
 (0)