Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .claude/skills/create-java-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ default body shape — it is the single source of truth for the sections and che
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.

Before you create the PR, check which repository `gh` targets:

```bash
gh repo set-default --view
```

If it prints anything other than `getsentry/sentry-java`, or nothing, ask the user which repository
to target. Don't let `gh` pick a community fork.

Write the body to `/tmp/pr-body-<branch>.md`, with each `/` in the branch name replaced by `-`, not
to pr-writer's `/tmp/pr-body.md`: that file outlives sessions and can still hold another PR's body.
Only after the write succeeds, pass that file to `gh pr create` in place of pr-writer's:
Expand Down Expand Up @@ -169,7 +178,7 @@ Add an entry to `CHANGELOG.md` under the `## Unreleased` section.

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.
**When rebasing or merging `main`:** Your branch can land after a release was cut, where the `## Unreleased` heading your entry lived under has since been renamed to that version number. A merge does this without a conflict, sometimes with a duplicate subsection heading, so check the `## ` headings, not only the diff. 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

Expand Down
15 changes: 12 additions & 3 deletions .claude/skills/test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,23 @@ If the user picks a specific method, use `--tests="*ClassName.methodName"` as th

With a test class filter:
```bash
./gradlew ':<module>:<task>' --tests="*<filter>*" --info
./gradlew ':<module>:<task>' --tests="*<filter>*"
```

Without a filter:
Without a filter, only when the user asks for the whole module (CI runs full suites):
```bash
./gradlew ':<module>:<task>' --info
./gradlew ':<module>:<task>'
```

When you choose the tests yourself, filter to the classes or packages the change touches, plus the
tests of direct callers. Pass `--tests` once per pattern:
```bash
./gradlew ':<module>:<task>' --tests="io.sentry.foo.*" --tests="*BarTest*"
```

Don't add `--rerun` or `--no-build-cache` by default. An `UP-TO-DATE` test task already passed on the
same inputs. Use them only for a named doubt, such as a suspected flaky test.

## Step 3b: Run an Integration Test Suite

The suite's task is named after its source set directory: `src/integrationTestWebflux/...` runs
Expand Down
28 changes: 25 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ resolves the per-module test task, including integration test suites, for you.
3. **Use todo tracking**: Work through todo items, marking them as complete as you go
4. **High-level communication**: Give high-level explanations of changes made, not step-by-step descriptions
5. **Simplicity first**: Make every task and code change as simple as possible. Avoid massive or complex changes. Impact as little code as possible.
6. **Format and regenerate**: Once done, format code and regenerate .api files: `make format api`
7. **Propose commit**: As final step, git stage relevant files and propose (but not execute) a single git commit command. This applies to implementation work; when the task is to open a PR, the `create-java-pr` skill takes over from here and does commit, push, and open it.
6. **Don't code for impossible states**: Before you add state tracking or heuristics around a framework object, find out its real lifecycle.
7. **Format and regenerate**: Once done, format code and regenerate .api files: `make format api`
8. **Propose commit**: As final step, git stage relevant files and propose (but not execute) a single git commit command. This applies to implementation work; when the task is to open a PR, the `create-java-pr` skill takes over from here and does commit, push, and open it.

## Repository Skills

Expand Down Expand Up @@ -133,6 +134,21 @@ The repository is organized into multiple modules:
- **Formatting**: Enforced via Spotless
- **API Compatibility**: Binary compatibility is enforced. `.api` files are generated, never hand-edited

### Comments
Comment thread
markushi marked this conversation as resolved.
Resolved

The default is no comment. Add one only when it gives a reason that the code, the names, and the
class Javadoc don't, in one short sentence: a rationale, a gotcha, the meaning of a magic number,
why an empty catch is safe, or a comment this file requires (for example on a broad catch).

- Don't describe what the next line does, in production code or in tests.
- Don't repeat what a method Javadoc already describes.
- Existing narrating comments are not a pattern to copy.

**Javadoc of an interface, callback, or model class describes only the type itself**, in general
terms. Requirements on the implementer are fine ("Must be fast, no I/O."). Don't name who calls it,
when, or on which thread: a type can't promise how others use it. A thread contract belongs on the
methods of the component that owns the thread.

### Exception Handling

The following section applies only in cases where the spec (sentry-docs) do not define an exception
Expand Down Expand Up @@ -281,7 +297,13 @@ gh pr view --json url -q '.url'

User-facing changes get an entry under the `## Unreleased` section of `CHANGELOG.md`. The
`create-java-pr` skill is the source of truth for the full changelog and PR workflow, including
subsection selection and the rebase caveat when a release renames `## Unreleased`.
subsection selection and the rebase and merge caveat when a release renames `## Unreleased`.

### After Merging `main` or Resolving Conflicts

Before you commit the merge, format and regenerate (workflow rule 7) and check the changelog entry
(the `create-java-pr` rebase and merge caveat). Then compile and run the tests of the modules you
changed: `main` adds build checks over time, so code that passed before the merge can fail after it.

## Useful Resources

Expand Down
Loading