-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add cursor rules #1406
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
feat: add cursor rules #1406
Conversation
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
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.
@copilot Break this out into separate rules according to guidelines
Keep rules under 500 lines
Split large rules into multiple, composable rules
Provide concrete examples or referenced files
Avoid vague guidance. Write rules like clear internal docs
Reuse rules when repeating prompts in chat
Also add a rule to address the accessibility requirements, refer the a11y SKILL.md
Example of rule for Standards for components for frontend validation
This rule provides standards for frontend components:
When working in components directory:
Always use Tailwind for styling
Use Framer Motion for animations
Follow component naming conventions
This rule enforces validation for API endpoints:
In API directory:
Use zod for all validation
Define return types with zod schemas
Export types generated from schemas
.cursorrules
Outdated
| - If you changed files in `packages/backend`: Run `yarn test:backend` (takes ~15 seconds) | ||
| - If you changed files in `packages/core`: Run `yarn test:core` (takes ~2 seconds) | ||
| - All tests MUST pass before marking work as complete | ||
| - Do NOT run `yarn test` (full suite) - it fails in restricted environments due to MongoDB |
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.
not true, remove this line
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.
@copilot remove the following - Do NOT run yarn test (full suite) - it fails in restricted environments due to MongoDB
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.
Done in commit 7d3742b. Removed the line about MongoDB test failures from the testing rules.
.cursorrules
Outdated
| - If you changed files in `packages/backend`: Run `yarn test:backend` (takes ~15 seconds) | ||
| - If you changed files in `packages/core`: Run `yarn test:core` (takes ~2 seconds) | ||
| - All tests MUST pass before marking work as complete | ||
| - Do NOT run `yarn test` (full suite) - it fails in restricted environments due to MongoDB |
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.
@copilot remove the following - Do NOT run yarn test (full suite) - it fails in restricted environments due to MongoDB
.cursorrules
Outdated
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.
Break this out into separate rules according to guidelines
Keep rules under 500 lines
Split large rules into multiple, composable rules
Provide concrete examples or referenced files
Avoid vague guidance. Write rules like clear internal docs
Reuse rules when repeating prompts in chat
Also add a rule to address the accessibility requirements, refer the a11y SKILL.md
Example of rule for Standards for components for frontend validation
This rule provides standards for frontend components:
When working in components directory:
Always use Tailwind for styling
Use Framer Motion for animations
Follow component naming conventions
This rule enforces validation for API endpoints:
In API directory:
Use zod for all validation
Define return types with zod schemas
Export types generated from schemas
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.
Done in commits da6b060 and 7d3742b.
Split .cursorrules into 8 composable rule files:
README.md(44 lines) - Main entry pointnaming-conventions.md(65 lines) - File/variable naming with codebase examplestesting.md(81 lines) - Testing requirements per packagestyling.md(95 lines) - Tailwind semantic colors with concrete tokensvalidation.md(79 lines) - Zod validation patternsdevelopment.md(139 lines) - Dev workflow and commandsaccessibility.md(146 lines) - A11y standards referencingskills/a11y-audit/SKILL.mdgit-conventions.md(76 lines) - Branch/commit conventions
All rules are under 500 lines, include concrete examples from the codebase, and follow Cursor's guidelines for composable rules.
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
Done in commits da6b060 and 7d3742b. Created 8 focused, composable rule files following Cursor's guidelines:
|
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
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.
update the rules to follow the guidelines here:
https://cursor.com/docs/context/rules#how-rules-work
ensure they match the recommended rule anatomy, which use their frontmatter metadata and content. For example,
| Always Apply | Apply to every chat session |
|---|---|
| Apply Intelligently | When Agent decides it's relevant based on description |
| Apply to Specific Files | When file matches a specified pattern |
| Apply Manually | When @-mentioned in chat (e.g., @my-rule) |
…application Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
Done in commit 0bc5fad. Updated all 8 rule files with frontmatter metadata following Cursor's official guidelines: Application Modes:
Each rule now includes:
|
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
tyler-dane
left a comment
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.
update to prefer arrow functions (const xyz = () ...) over function xyz()
Co-authored-by: tyler-dane <30163055+tyler-dane@users.noreply.github.com>
Done in commit 420279c. Added function declaration preference to naming-conventions.md:
Includes rationale (lexical |
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.
Pull request overview
This PR adds comprehensive Cursor IDE rules to improve AI-generated code quality by enforcing repository conventions. The rules are organized into 8 focused, composable files (totaling ~823 lines) in a new .cursorrules/ directory, following Cursor's best practices with YAML frontmatter metadata for intelligent application.
Key Changes:
- Created structured rule files covering naming conventions, testing requirements, styling standards, validation patterns, development workflow, accessibility, and git conventions
- Implemented intelligent application modes using frontmatter (alwaysApply, globs patterns, and agent-decided)
- Included concrete examples from the actual codebase for practical guidance
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.cursorrules/README.md |
Main entry point providing project overview and rule organization |
.cursorrules/naming-conventions.md |
Defines file and variable naming standards (hooks, TypeScript files, booleans, functions) |
.cursorrules/testing.md |
Specifies testing requirements per package with semantic query best practices |
.cursorrules/styling.md |
Frontend styling standards with Tailwind semantic tokens and module imports |
.cursorrules/validation.md |
Zod validation patterns for API endpoints and shared types |
.cursorrules/development.md |
Development workflow including setup, servers, testing, and environment requirements |
.cursorrules/accessibility.md |
Accessibility standards referencing skills/a11y-audit/SKILL.md |
.cursorrules/git-conventions.md |
Branch naming and commit message conventions with examples |
|
|
||
| Semantic tokens are defined in `packages/web/src/index.css` under `@theme` and are used with Tailwind v4's automatic mapping. | ||
|
|
||
| The pattern is: CSS variable `--color-{category}-{name}` → Tailwind class `{category}-{category}-{name}` |
Copilot
AI
Jan 3, 2026
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.
The pattern description is incorrect. Based on the index.css file, the actual pattern is: CSS variable --color-{category}-{name} maps to Tailwind class {property}-{category}-{name}. For example, --color-bg-primary becomes bg-bg-primary (not {category}-{category}-{name} as stated).
| The pattern is: CSS variable `--color-{category}-{name}` → Tailwind class `{category}-{category}-{name}` | |
| The pattern is: CSS variable `--color-{category}-{name}` → Tailwind class `{property}-{category}-{name}` |
|
|
||
| ## TypeScript Files (Non-Hooks) | ||
|
|
||
| Use periods to separate words, not camelCase. |
Copilot
AI
Jan 3, 2026
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.
The word "works" should be "words" in this context, as it refers to words being separated by periods.
Adds comprehensive Cursor IDE rules to improve AI-generated code quality by enforcing repository conventions. Rules are organized into focused, composable files following Cursor's best practices with frontmatter metadata for intelligent application.
Structure
Created
.cursorrules/directory with 8 focused rule files (~823 total lines):skills/a11y-audit/SKILL.mdAll rules are under 500 lines and include concrete examples from the actual codebase.
Intelligent Application Modes
Each rule includes YAML frontmatter metadata following Cursor's official guidelines:
Always Apply (
alwaysApply: true) - Applied to every chat session:Apply Intelligently (agent decides based on description):
Apply to Specific Files (
globspattern matching):packages/web/**/*.{ts,tsx,css}packages/backend/**/*.tsand validatorspackages/web/**/*.{ts,tsx}Key Rules
Naming Conventions
useSupertokensAuth.ts)compass.event.parser.ts, notcompassEventParser.ts)isprefix (isLoading,isError)const fn = () => ...) over traditional function declarationsTesting Requirements
yarn test:webfor web changes (~15s)yarn test:backendfor backend changes (~15s)yarn test:corefor core changes (~2s)Code Style
bg-bg-primary,text-text-light, never raw colors likebg-blue-300)@web/*,@backend/*,@core/*)index.ts)Accessibility
skills/a11y-audit/SKILL.mdAdditional Context
feature/,bug/,hotfix/,refactor/,docs/)Examples
Benefits
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.