agentleFS
SentryKnown publishergetsentry/sentry-java/.cursor/rules/new_module.mdc

sentry-java / rules

Cursor rule1.4k starsChanged 7 months agoMITView on GitHub

Module Addition Rules for sentry-java

Trending

Quiet this year.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the getsentry/sentry-java repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about getsentry/sentry-java

The biggest 5 of 18 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 18

Talked about on GitHub (18 times).

On GitHub · 18

13 more on GitHub

The file

Show its rules and text

We split this new_module.mdc into the rules it gives an agent

14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create the new module, conforming to the existing naming conventions and build scripts.

    line 15
  2. Very specific:

    Add the module to the include list in settings.gradle.kts

    line 19
  3. Very specific:

    If adding a sentry-samples module, also add it to the ignoredProjects list in the root build.gradle.kts:

    line 21
  4. Very specific:

    Add a SENTRY_{MODULE}_SDK_NAME constant to the Config.Sentry block in buildSrc/src/main/java/Config.kt:

    line 32
  5. Very specific:

    Add the instrumented library to gradle/libs.versions.toml and depend on it with compileOnly(libs.<lib>), so the integration does not force …

    line 42
  6. Very specific:

    If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.

    line 57
  7. Distinctive:

    Create a README.md in the module directory with the following structure:

    line 64
  8. Distinctive:

    Add the new module to the packages table in the main README.md.

    line 78
  9. Very specific:

    Add - sentry-{module-name} to the integrations dropdown in .github/ISSUE_TEMPLATE/bug_report_java.yml, or bug_report_android.yml for an …

    line 90
  10. Distinctive:

    Add the necessary documentation to docs.sentry.io:

    line 95
  11. Distinctive:

    Add the SDK to the Sentry release registry, following the instructions in the sentry-release-registry README

    line 104
  12. Very specific:

    Add the module to .craft.yml in the sdks section:

    line 106
  13. Very specific:

    Use kebab-case for module names: sentry-{module-name}

    line 115
  14. Very specific:

    Follow existing patterns: sentry-okhttp, sentry-apollo-4, sentry-spring-boot

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
new_module.mdc
---
description: Module Addition Rules for sentry-java
alwaysApply: false
---
# Module Addition Rules for sentry-java

## Overview

This document outlines the complete process for adding a new module to the sentry-java repository. Follow these steps in order to ensure proper integration and release management.

## Step-by-Step Process

### 1. Create the Module Structure

1. Create the new module, conforming to the existing naming conventions and build scripts.
   Copy the `build.gradle.kts` of the closest existing integration rather than writing one from
   scratch — `sentry-kafka` is a good JVM template, `sentry-android-timber` a good Android one.

2. Add the module to the include list in `settings.gradle.kts`

If adding a `sentry-samples` module, also add it to the `ignoredProjects` list in the root `build.gradle.kts`:

```kotlin
ignoredProjects.addAll(
    listOf(
        // ... existing projects ...
        "sentry-samples-{module-name}"
    )
)
```

3. Add a `SENTRY_{MODULE}_SDK_NAME` constant to the `Config.Sentry` block in
   `buildSrc/src/main/java/Config.kt`:

```kotlin
val SENTRY_FOO_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.foo"
```

The module's `build.gradle.kts` consumes it in both `buildConfig` and the jar manifest
(`Sentry-SDK-Name` / `Sentry-SDK-Package-Name`) — see `sentry-kafka/build.gradle.kts`.

4. Add the instrumented library to `gradle/libs.versions.toml` and depend on it with
   `compileOnly(libs.<lib>)`, so the integration does not force the dependency on users.

5. Register the integration with the SDK so it is reported in the `sdk` payload. Every
   integration does this — see `sentry-openfeature/.../SentryOpenFeatureHook.java`:

```java
static {
  SentryIntegrationPackageStorage.getInstance()
      .addPackage("maven:io.sentry:sentry-{module-name}", BuildConfig.VERSION_NAME);
}
// then, from the constructor:
addIntegrationToSdkVersion("{IntegrationName}");
```

6. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
   The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.

`sentry-bom` and the root `build.gradle.kts` need no change — they iterate over subprojects.

### 2. Create Module Documentation

Create a `README.md` in the module directory with the following structure:

```markdown
# sentry-{module-name}

This module provides an integration for [Technology/Framework Name].

Please consult the documentation on how to install and use this integration in the Sentry Docs for [Android](https://docs.sentry.io/platforms/android/integrations/{module-name}/) or [Java](https://docs.sentry.io/platforms/java/tracing/instrumentation/{module-name}/).
```

The following tasks are required only when adding a module that isn't a sample.

### 3. Update Main README.md

Add the new module to the packages table in the main `README.md`. Copy the row of a neighbouring
module and swap the name — Android modules carry a third column for the min API level, JVM modules
do not:

```markdown
| sentry-{module-name} | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-{module-name}?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-{module-name}) |
```

Note that the badge will only work after the module is released to Maven Central.

### 4. Add the Module to the Issue Template

Add `- sentry-{module-name}` to the integrations dropdown in
`.github/ISSUE_TEMPLATE/bug_report_java.yml`, or `bug_report_android.yml` for an Android module.

### 5. Add Documentation to docs.sentry.io

Add the necessary documentation to [docs.sentry.io](https://docs.sentry.io):
- For Java modules: Add to Java platform docs, usually in integrations section
- For Android modules: Add to Android platform docs, usually in integrations section
- Include installation instructions, configuration options, and usage examples

### 6. Post release tasks

Remind the user to perform the following tasks after the module is merged and released:

1. Add the SDK to the Sentry release registry, following the instructions in the [sentry-release-registry README](https://github.com/getsentry/sentry-release-registry#adding-new-sdks)

2. Add the module to `.craft.yml` in the `sdks` section:
   ```yaml
   sdks:
     # ... existing modules ...
     maven:io.sentry:sentry-{module-name}:
   ```

## Module Naming Conventions

- Use kebab-case for module names: `sentry-{module-name}`
- Follow existing patterns: `sentry-okhttp`, `sentry-apollo-4`, `sentry-spring-boot`
- For version-specific modules, include the version: `sentry-apollo-3`, `sentry-apollo-4`

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.