Skip to content

docs: add comprehensive cursor rules for AI-assisted development#1462

Merged
ckbedwell merged 5 commits into
mainfrom
docs/repo-cursor-rules
Nov 15, 2025
Merged

docs: add comprehensive cursor rules for AI-assisted development#1462
ckbedwell merged 5 commits into
mainfrom
docs/repo-cursor-rules

Conversation

@ckbedwell

Copy link
Copy Markdown
Contributor

Problem

As our team increasingly uses AI tools like Cursor for development, we need consistent guidelines to ensure AI interactions produce high-quality code that meets our standards. Without these rules, AI-generated code may not follow our testing practices, file organization conventions, PR standards, or engineering best practices.

Team members with varying levels of frontend experience (designers, product managers, backend engineers, and frontend engineers) all contribute to this repository and need clear guidance for working with AI assistants.

Solution

This PR adds comprehensive cursor rules that guide AI interactions across all aspects of development:

Core Rules:

  • you-and-me.mdc - Establishes the AI's role and expertise areas (TypeScript, React, Grafana plugins)
  • this-product.mdc - Provides context about Synthetic Monitoring and k6
  • team-composition.mdc - Describes team roles and their varying technical backgrounds

Development Standards:

  • file-organisation.mdc - Component structure conventions (hooks, utils, tests, constants, types)
  • engineering-best-practices.mdc - Git workflow, branch naming, and PR strategies
  • when-writing-tests.mdc - Testing philosophy (integration over unit, TDD proposals)
  • when-creating-prs.mdc - PR checklist and description format

Workflow Rules:

  • documentation.mdc - When to write documentation vs iterate on code
  • reference-directory.mdc - Using .cursor/references for working notes

AI Behavior:

  • modes.mdc - Conversation/Plan/Apply mode system for controlled interactions
  • message-prefix.mdc - Requires model name and confidence percentage

All rules reference relevant configuration files (.commitlintrc.js) and include examples. Personal information is stored in gitignored .cursor/rules/personal/about-me.mdc to maintain privacy while providing AI context.

- Remove redundant code-cleanliness and pr-template rules
- Improve clarity in you-and-me, engineering-best-practices, and when-creating-prs
- Add explicit git command in engineering-best-practices
- Split PR and testing rules into dedicated files
- Fix incomplete sentence in GitHub CLI setup guidance
- Add test execution command (yarn test) to when-writing-tests
- Clarify config file locations (.commitlintrc.js) with examples
- Fix path references to use correct absolute paths
- Add branch naming examples (feat/, fix/, docs/)
- Add yarn install guidance after git pull
- Fix typo: 'the are' -> 'that are'
- Create about-me.mdc in correct location (gitignored)
@ckbedwell ckbedwell requested a review from a team as a code owner November 14, 2025 17:17
@ckbedwell ckbedwell requested review from VikaCep and removed request for a team November 14, 2025 17:17
@ckbedwell

Copy link
Copy Markdown
Contributor Author

Take a guess how this PR was made 😂

Let's get really meta and ask Co-pilot to review it...

@github-actions

github-actions Bot commented Nov 14, 2025

Copy link
Copy Markdown

🔄 Probe API Server Mappings Verification Failed

The probeAPIServerMappings.json file appears to be outdated compared to the Grafana documentation.

Verification Output:

$ /home/runner/work/synthetic-monitoring-app/synthetic-monitoring-app/node_modules/.bin/ts-node scripts/probe-api-mappings/verify-probe-api-mappings.ts
🔍 Verifying probe API server mappings...
📄 Fetching documentation from: https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/set-up/set-up-private-probes/#add-a-new-probe-in-your-grafana-instance
📊 Found 26 entries in documentation
📊 Found 25 entries in current file
❌ Probe API server mappings are outdated!

📋 Comparison Results:
Current file has 25 entries
Documentation has 26 entries

❌ Entry count mismatch!

🔍 Detailed comparison:

💡 Please update the probeAPIServerMappings.json file to match the documentation by running `yarn build:probe-api-mappings`

To fix this, please run the probe mappings build script locally and verify the changes:

yarn build:probe-api-mappings && yarn verify:probe-api-mappings

@github-actions

github-actions Bot commented Nov 14, 2025

Copy link
Copy Markdown

Script size changes

Name +/- Main This PR Outcome
[502.js] = 1,736.41 kB 1,736.41 kB
[832.js] = 959.99 kB 959.99 kB
[datasource/module.js] = 24.49 kB 24.49 kB
[692.js] = 20.19 kB 20.19 kB
[663.js] = 5.84 kB 5.84 kB
[module.js] = 4.92 kB 4.92 kB

Totals

Name +/- Main This PR Outcome
[Scripts] = 2,751.85 kB 2,751.85 kB
[Non-script Assets] = 2,655.26 kB 2,655.26 kB
[All] = 5,407.11 kB 5,407.11 kB

Generated by 🚫 dangerJS against e434dc3

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 establishes comprehensive cursor rules to guide AI-assisted development across a team with varying technical backgrounds. The rules ensure consistent code quality, testing practices, file organization, and PR standards when working with AI tools like Cursor.

Key Changes:

  • Adds 10 .mdc rule files covering AI behavior, development standards, testing philosophy, and workflow practices
  • Updates .gitignore to exclude personal rules and reference directories while keeping shared rules versioned
  • Establishes mode-based interactions and conventions for team members ranging from designers to frontend engineers

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.gitignore Excludes personal AI rules and reference notes from version control
.cursor/you-and-me.mdc Defines AI assistant expertise and user identification process
.cursor/this-product.mdc Provides context about Synthetic Monitoring and k6 products
.cursor/team-composition.mdc Describes team roles and varying technical backgrounds
.cursor/file-organisation.mdc Specifies component structure conventions and separation of concerns
.cursor/engineering-best-practices.mdc Outlines git workflow, branching, and PR strategies
.cursor/when-writing-tests.mdc Details testing philosophy favoring integration tests and TDD proposals
.cursor/when-creating-prs.mdc Defines PR checklist and description format requirements
.cursor/documentation.mdc Guides when to write documentation versus iterate on code
.cursor/reference-directory.mdc Explains usage of gitignored reference directory for working notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .cursor/reference-directory.mdc Outdated
Comment thread .cursor/file-organisation.mdc Outdated
Comment thread .cursor/when-writing-tests.mdc Outdated
Comment thread .cursor/documentation.mdc Outdated
Comment thread .cursor/when-creating-prs.mdc Outdated
- Fix 'commited' -> 'committed' in reference-directory.mdc
- Fix 'colocacting' -> 'colocating' in file-organisation.mdc
- Fix 'unfocussed' -> 'unfocused' in when-writing-tests.mdc and documentation.mdc
- Fix inconsistent verb forms (ensures -> ensure) in when-creating-prs.mdc

@VikaCep VikaCep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯 LGTM!

@ckbedwell ckbedwell merged commit ef5c4a7 into main Nov 15, 2025
23 of 25 checks passed
@ckbedwell ckbedwell deleted the docs/repo-cursor-rules branch November 15, 2025 06:51
VikaCep pushed a commit that referenced this pull request Nov 18, 2025
* docs: added repo cursor rules

* docs: pr template rule

* docs: refine cursor rules based on AI feedback

- Remove redundant code-cleanliness and pr-template rules
- Improve clarity in you-and-me, engineering-best-practices, and when-creating-prs
- Add explicit git command in engineering-best-practices
- Split PR and testing rules into dedicated files
- Fix incomplete sentence in GitHub CLI setup guidance

* docs: add missing details and fix inconsistencies in cursor rules

- Add test execution command (yarn test) to when-writing-tests
- Clarify config file locations (.commitlintrc.js) with examples
- Fix path references to use correct absolute paths
- Add branch naming examples (feat/, fix/, docs/)
- Add yarn install guidance after git pull
- Fix typo: 'the are' -> 'that are'
- Create about-me.mdc in correct location (gitignored)

* docs: fix spelling and grammar issues in cursor rules

- Fix 'commited' -> 'committed' in reference-directory.mdc
- Fix 'colocacting' -> 'colocating' in file-organisation.mdc
- Fix 'unfocussed' -> 'unfocused' in when-writing-tests.mdc and documentation.mdc
- Fix inconsistent verb forms (ensures -> ensure) in when-creating-prs.mdc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants