agentleFS
SentryKnown publishergetsentry/sentry-java/.claude/skills/create-java-pr/SKILL.md

create-java-pr

Skill1.4k starsChanged 7 months agoMITView on GitHub

Create a pull request in sentry-java. Use when asked to "create pr", "prepare pr", "prep pr", "open pr", "ready for pr", "prepare for review", "finalize changes". Handles branch creation, code formatting, API dump, committing, pushing, PR creation, changelog, and stacked PRs.

  • Reads credentials
  • Commits and pushes

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 skill into the rules it gives an agent

32 rules. About 0 are common, 17 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    For stacked PRs: read references/stacked-prs.md before proceeding.

    line 10
  2. Distinctive:

    If branch is main or master: default to a standalone PR.

    line 25
  3. Distinctive:

    Do not assume stack mode from main.

    line 26
  4. Distinctive:

    Only use stack mode if the user explicitly asks for a stacked PR.

    line 27
  5. Distinctive:

    Check whether that branch already has a PR and what its base is:

    line 29
  6. Very specific:

    If that branch PR exists and baseRefName is not main/master, treat the work as a stacked PR context.

    line 33
  7. Very specific:

    If that branch PR exists and baseRefName is main/master, also check whether other PRs target the current branch:

    line 34
  8. Distinctive:

    If there are downstream PRs, treat this as next PR in an existing stack with the current branch as the stack base (collection branch).

    line 38
  9. Distinctive:

    If there are no downstream PRs, treat it as standalone PR context.

    line 39
  10. Distinctive:

    If no PR exists for the current branch, check whether other PRs target it:

    line 40
  11. Distinctive:

    If there are no downstream PRs either, treat it as standalone PR context (fresh feature branch).

    line 45
  12. Distinctive:

    If signals are mixed or ambiguous, ask one focused question to confirm.

    line 47
  13. Very specific:

    If the user explicitly says "stack", "stacked PR", or provides numbered stack titles (e.g.

    line 54
  14. Distinctive:

    If on main or master, create and switch to a new branch:

    line 62
  15. Distinctive:

    If the command fails, diagnose and fix the issue before continuing.

    line 82
  16. Distinctive:

    Check for uncommitted changes:

    line 86
  17. Very specific:

    If there are uncommitted changes, invoke the sentry-skills:commit skill to stage and commit them following Sentry commit message …

    line 92
  18. Distinctive:

    Important: When staging, ignore changes that are only relevant for local testing and should not be part of the PR.

    line 100
  19. Distinctive:

    If the push fails due to diverged history, ask the user how to proceed rather than force-pushing.

    line 120
  20. Very specific:

    Read .github/pull_request_template.md and use it as the PR body structure — it is the single source of truth for the sections and …

    line 126
  21. Very specific:

    Use the stacked PR title format: <type>(<scope>): [<Topic> <N>] <Subject> (see references/stacked-prs.md § "PR Title Naming").

    line 143
  22. Very specific:

    Add a merge method reminder at the very end of the PR body (see references/stacked-prs.md § "Stack List in PR Description" for the exact …

    line 145
  23. Distinctive:

    After creating the PR, update the PR description on every other PR in the stack — including the collection branch PR — so all PRs have the …

    line 153
  24. Distinctive:

    Test-only changes (new tests, test refactors, test fixtures)

    line 161
  25. Distinctive:

    If unsure, ask the user.

    line 168
  26. Very specific:

    Add an entry to CHANGELOG.md under the ## Unreleased section.

    line 172
  27. Very specific:

    Create the subsection under ## Unreleased if it does not already exist.

    line 183
  28. Very specific:

    Use the PR number returned by sentry-skills:create-pr.

    line 193
  29. Very specific:

    If no changelog entry is needed, append #skip-changelog to the end of the PR description to disable the changelog CI check, using the …

    line 207
  30. Very specific:

    Do not use shell redirects (>, >>), pipes (|), or compound commands (&&, ||).

    line 212
  31. Very specific:

    Read the body with gh pr view <PR_NUMBER> --json body --jq '.body' (output is returned directly)

    line 215
  32. Very specific:

    Use the Write tool to save it to /tmp/pr-body.md, and the Edit tool to modify it

    line 216

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill 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
SKILL.md

Create Pull Request (sentry-java)

Prepare local changes and create a pull request for the sentry-java repo.

For stacked PRs: read references/stacked-prs.md before proceeding. It is the source of truth for stack structure, title naming, stack list format, and merge strategy.

Step 0: Determine PR Type From Git Branch Context

Infer PR type from the current branch before asking the user.

  1. Get current branch:
git branch --show-current
  1. Apply these rules:
  • If branch is main or master: default to a standalone PR.
    • Do not assume stack mode from main.
    • Only use stack mode if the user explicitly asks for a stacked PR.
  • If branch is not main/master:
    • Check whether that branch already has a PR and what its base is:
      gh pr list --head "$(git branch --show-current)" --json number,baseRefName,title --jq '.[0]'
    • If that branch PR exists and baseRefName is not main/master, treat the work as a stacked PR context.
    • If that branch PR exists and baseRefName is main/master, also check whether other PRs target the current branch:
      gh pr list --base "$(git branch --show-current)" --json number,headRefName,title
      • If there are downstream PRs, treat this as next PR in an existing stack with the current branch as the stack base (collection branch).
      • If there are no downstream PRs, treat it as standalone PR context.
    • If no PR exists for the current branch, check whether other PRs target it:
      gh pr list --base "$(git branch --show-current)" --json number,headRefName,title
      • If there are downstream PRs, treat this as next PR in an existing stack with the current branch as the stack base (collection branch).
      • If there are no downstream PRs either, treat it as standalone PR context (fresh feature branch).
  1. If signals are mixed or ambiguous, ask one focused question to confirm.

PR types:

  • Standalone PR — regular PR targeting main.
  • First PR of a new stack — create collection branch from main, then first PR off it.
  • Next PR in an existing stack — target the current stack base branch (usually the previous stack PR branch, or the collection branch if creating the first follow-up PR from the collection branch).

If the user explicitly says "stack", "stacked PR", or provides numbered stack titles (e.g. [Topic 2]), honor that even if branch heuristics are inconclusive.

Step 1: Ensure Feature Branch

git branch --show-current

If on main or master, create and switch to a new branch:

git checkout -b <type>/<short-description>

Derive the branch name from the changes being made. Use feat/, fix/, ref/, etc. matching the commit type conventions.

For stacked PRs: For the first PR in a new stack, first create and push the collection branch (see references/stacked-prs.md § "Why a Collection Branch"), then branch the PR off it. For subsequent PRs, branch off the previous stack branch. Give every branch in the stack a shared prefix naming the feature, with a descriptive suffix per PR.

CRITICAL: Never merge, fast-forward, or push commits into the collection branch. It stays at its initial position until the user merges stack PRs through GitHub. Updating it will auto-merge and destroy the entire PR stack.

Step 2: Format Code and Regenerate API Files

./gradlew spotlessApply apiDump

This is required before every PR in this repo. It formats all Java/Kotlin code via Spotless and regenerates the .api binary compatibility files.

If the command fails, diagnose and fix the issue before continuing.

Step 3: Commit Changes

Check for uncommitted changes:

git status --porcelain

If there are uncommitted changes, invoke the sentry-skills:commit skill to stage and commit them following Sentry commit message conventions:

<type>(<scope>): <subject>

Allowed types: feat, fix, ref, chore, docs, test, perf, build, ci, style, meta, license

Important: When staging, ignore changes that are only relevant for local testing and should not be part of the PR. Common examples:

Ignore PatternReason
Hardcoded booleans flipped for testingLocal debug toggles
Sample app config changes (sentry-samples/)Local testing configuration
.env or credentials filesSecrets

Restore these files before committing:

git checkout -- <file-to-restore>

Step 4: Push the Branch

git push -u origin HEAD

If the push fails due to diverged history, ask the user how to proceed rather than force-pushing.

Step 5: Create PR

Invoke the sentry-skills:create-pr skill to create a draft PR.

Read .github/pull_request_template.md and use it as the PR body structure — it is the single source of truth for the sections and checklist, so never reproduce it from memory. Fill in each section based on the changes being PR'd, drop the HTML comment hints, and check any checklist items that apply.

PR title format — same as the commit subject (Step 3):

<type>(<scope>): <Subject>

Examples:

  • feat(core): Add structured logging support
  • fix(android): Prevent crash on API 21 when registering receiver

For stacked PRs:

  • Pass --base <previous-stack-branch> so the PR targets the previous branch (first PR in a stack targets the collection branch).
  • Use the stacked PR title format: <type>(<scope>): [<Topic> <N>] <Subject> (see references/stacked-prs.md § "PR Title Naming").
  • Include the stack list at the top of the PR body, before the ## :scroll: Description section (see references/stacked-prs.md § "Stack List in PR Description" for the format).
  • Add a merge method reminder at the very end of the PR body (see references/stacked-prs.md § "Stack List in PR Description" for the exact text). This only applies to stack PRs, not the collection branch PR.

Then continue to Step 5.5 (stacked PRs only) or Step 6.

Step 5.5: Update Stack List on All PRs (stacked PRs only)

Skip this step for standalone PRs.

After creating the PR, update the PR description on every other PR in the stack — including the collection branch PR — so all PRs have the same up-to-date stack list. Follow the format and commands in references/stacked-prs.md § "Stack List in PR Description".

Edit each body using the procedure in § "Editing PR Descriptions" below.

Step 6: Update Changelog

First, determine whether a changelog entry is needed. Skip this step (and go straight to "No changelog needed" below) if the changes are not user-facing, for example:

  • Test-only changes (new tests, test refactors, test fixtures)
  • CI/CD or build configuration changes
  • Documentation-only changes
  • Code comments or formatting-only changes
  • Internal refactors with no behavior change visible to SDK users
  • Sample app changes

If unsure, ask the user.

If changelog is needed

Add an entry to CHANGELOG.md under the ## Unreleased section.

Determine the subsection

Change TypeSubsection
New feature### Features
Bug fix### Fixes
Refactoring, internal cleanup### Internal
Dependency update### Dependencies

Create the subsection under ## Unreleased if it does not already exist.

When rebasing: A rebase onto main can land your branch after a release was cut, where the ## Unreleased heading your entry lived under has since been renamed to that version number. If that happens, move your new entry into an ## Unreleased section at the top of CHANGELOG.md (create the section if it no longer exists) so it is not left under an already-released version.

Entry format

- <Short description of the change> ([#<PR_NUMBER>](https://github.com/getsentry/sentry-java/pull/<PR_NUMBER>))

Use the PR number returned by sentry-skills:create-pr. Match the style of existing entries — sentence case, ending with the PR link, no trailing period.

Commit and push

Stage CHANGELOG.md, commit with message changelog, and push:

git add CHANGELOG.md
git commit -m "changelog"
git push

No changelog needed

If no changelog entry is needed, append #skip-changelog to the end of the PR description to disable the changelog CI check, using the procedure in § "Editing PR Descriptions" below.

Editing PR Descriptions

Do not use shell redirects (>, >>), pipes (|), or compound commands (&&, ||). These create compound shell expressions that won't match permission patterns. Instead:

  1. Read the body with gh pr view <PR_NUMBER> --json body --jq '.body' (output is returned directly)
  2. Use the Write tool to save it to /tmp/pr-body.md, and the Edit tool to modify it
  3. Update with gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md

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.