From 391613020a24f3161b9fc72d85cfbbf82bca5d3e Mon Sep 17 00:00:00 2001 From: markushi Date: Wed, 16 Jul 2025 11:37:24 +0200 Subject: [PATCH 1/3] feat(dev): Add Cursor IDE coding rules configuration Adds coding rules configuration for Cursor IDE that includes: - Project overview and tech stack information - Key gradle commands for development workflow - Contributing guidelines and coding standards - Development process and formatting requirements This helps maintain consistency in the development environment and provides quick reference for common project commands. --- .cursor/rules/coding.mdc | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .cursor/rules/coding.mdc diff --git a/.cursor/rules/coding.mdc b/.cursor/rules/coding.mdc new file mode 100644 index 00000000000..ce38d39b14e --- /dev/null +++ b/.cursor/rules/coding.mdc @@ -0,0 +1,55 @@ +--- +alwaysApply: true +description: Cursor Coding Rules +--- + +# Coding Rules + +## Overview + +sentry-java is the Java and Android SDK for Sentry. This repository contains the source code and examples for SDK usage. + +## Tech Stack + +- **Language**: Java and Kotlin +- **Build Framework**: Gradle + +## Key Commands + +```bash +# Format code and regenerate .api file +./gradlew spotlessApply apiDump + +# Run tests and lint +./gradlew check + +# Run unit tests +./gradle '::testDebugUnitTest' --tests="**" --info +``` + +## Contributing Guidelines + +1. Follow existing code style and language +2. Do not modify the API files (e.g. sentry.api) manually, instead run `./gradlew apiDump` to regenerate them +3. Write comprehensive tests +4. Use Kotlin only for test code and Android modules which already use Kotlin, otherwise use Java +5. New features should be opt-in by default, extend `SentryOptions` with getters and setters to enable/disable a new feature +6. Consider backwards compatibility +7. Before implementing a feature or a fix, create a new branch off the `main` branch, the branch name should have the following pattern: `markushi/[feat|fix]/branch-name` + +## Coding rules + +1. First think through the problem, read the codebase for relevant files, and propose a plan +2. Before you begin working, check in with me and I will verify the plan +3. Then, begin working on the todo items, marking them as complete as you go +4. Please every step of the way just give me a high level explanation of what changes you made +5. Make every task and code change you do as simple as possible. We want to avoid making any massive or complex changes. Every change should impact as little code as possible. Everything is about simplicity. +6. Once you're done, format the code and regenerate the .api files using the following command `./gradlew spotlessApply apiDump` +7. As a last step, do a git commit + + +## Useful Resources + +- Main SDK documentation: https://develop.sentry.dev/sdk/overview/ +- Internal contributing guide: https://docs.sentry.io/internal/contributing/ +- Git commit messages conventions: https://develop.sentry.dev/engineering-practices/commit-messages/ From e4a1803f6b423d89b242b3b6a36af07334d52567 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Wed, 16 Jul 2025 11:41:20 +0200 Subject: [PATCH 2/3] Update coding.mdc --- .cursor/rules/coding.mdc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.cursor/rules/coding.mdc b/.cursor/rules/coding.mdc index ce38d39b14e..397f43ab51b 100644 --- a/.cursor/rules/coding.mdc +++ b/.cursor/rules/coding.mdc @@ -3,7 +3,7 @@ alwaysApply: true description: Cursor Coding Rules --- -# Coding Rules +# Contributing Rules for Agents ## Overview @@ -17,13 +17,13 @@ sentry-java is the Java and Android SDK for Sentry. This repository contains the ## Key Commands ```bash -# Format code and regenerate .api file +# Format code and regenerate .api files ./gradlew spotlessApply apiDump -# Run tests and lint +# Run all tests and linter ./gradlew check -# Run unit tests +# Run unit tests for a specific file ./gradle '::testDebugUnitTest' --tests="**" --info ``` From a43110e03c988b95ed56f24c33893ca359fb93c5 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Wed, 16 Jul 2025 12:25:22 +0200 Subject: [PATCH 3/3] Refine coding.mdc --- .cursor/rules/coding.mdc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.cursor/rules/coding.mdc b/.cursor/rules/coding.mdc index 397f43ab51b..e7af7273f15 100644 --- a/.cursor/rules/coding.mdc +++ b/.cursor/rules/coding.mdc @@ -32,20 +32,18 @@ sentry-java is the Java and Android SDK for Sentry. This repository contains the 1. Follow existing code style and language 2. Do not modify the API files (e.g. sentry.api) manually, instead run `./gradlew apiDump` to regenerate them 3. Write comprehensive tests -4. Use Kotlin only for test code and Android modules which already use Kotlin, otherwise use Java -5. New features should be opt-in by default, extend `SentryOptions` with getters and setters to enable/disable a new feature -6. Consider backwards compatibility -7. Before implementing a feature or a fix, create a new branch off the `main` branch, the branch name should have the following pattern: `markushi/[feat|fix]/branch-name` +4. New features should always be opt-in by default, extend `SentryOptions` or similar Option classes with getters and setters to enable/disable a new feature +5. Consider backwards compatibility ## Coding rules 1. First think through the problem, read the codebase for relevant files, and propose a plan 2. Before you begin working, check in with me and I will verify the plan 3. Then, begin working on the todo items, marking them as complete as you go -4. Please every step of the way just give me a high level explanation of what changes you made +4. Please do not describe every step of the way and just give me a high level explanation of what changes you made 5. Make every task and code change you do as simple as possible. We want to avoid making any massive or complex changes. Every change should impact as little code as possible. Everything is about simplicity. 6. Once you're done, format the code and regenerate the .api files using the following command `./gradlew spotlessApply apiDump` -7. As a last step, do a git commit +7. As a last step, git stage the relevant files and propose (but not execute) a single git commit command (e.g. `git commit -m ""`) ## Useful Resources