Skip to content

Commit 736bdaf

Browse files
committed
docs(agents): Remove duplicated build commands and rules
AGENTS.md is force-read at the start of every session, so anything stated there costs context on every task. Several rules had accumulated multiple copies of themselves within that one file. `spotlessApply`/`apiDump` was stated five times in AGENTS.md; it is now stated once as a command and once as a workflow step, with the underlying facts (Spotless enforces formatting, `.api` files are generated) kept where they belong. The Testing command block is dropped in favour of the `test` skill, which already resolves the per-module task and the unit-vs-system split and does not drift. The Repository Skills bullet list restated skill descriptions that the harness already injects, so it is now a pointer. In the rules, `new_module.mdc`'s "Important Notes" was a verbatim restatement of the AGENTS.md contributing guidelines, and `api.mdc` repeated the opt-in-by-default rule in passing; both now defer to their canonical homes. No guidance is lost — every removed line is still stated somewhere that is loaded when it applies.
1 parent 79f1f2f commit 736bdaf

3 files changed

Lines changed: 12 additions & 45 deletions

File tree

.cursor/rules/api.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Public API is tracked via `.api` files generated by the [Binary Compatibility Va
3434
- `SentryAndroidOptions` — Android-specific options
3535
- Integration modules may add their own (e.g. `SentrySpringProperties`)
3636

37-
New features must be **opt-in by default** — add a getter/setter pair to the appropriate options class.
37+
See the `options` rule for how to add and wire up a new option.
3838

3939
### Internal Classes (Not Public API)
4040

.cursor/rules/new_module.mdc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,3 @@ Remind the user to perform the following tasks after the module is merged and re
7979
- Use kebab-case for module names: `sentry-{module-name}`
8080
- Follow existing patterns: `sentry-okhttp`, `sentry-apollo-4`, `sentry-spring-boot`
8181
- For version-specific modules, include the version: `sentry-apollo-3`, `sentry-apollo-4`
82-
83-
## Important Notes
84-
85-
1. **API Files**: Do not modify `.api` files manually. Run `./gradlew apiDump` to regenerate them
86-
2. **Backwards Compatibility**: Ensure new features are opt-in by default
87-
3. **Testing**: Write comprehensive tests for all new functionality
88-
4. **Documentation**: Always include proper documentation and examples

AGENTS.md

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ The project uses **Gradle** with Kotlin DSL. Key build files:
4040

4141
## Essential Commands
4242

43-
### Development Workflow
4443
```bash
4544
# Format code and regenerate .api files (REQUIRED before committing)
4645
./gradlew spotlessApply apiDump
@@ -50,36 +49,14 @@ The project uses **Gradle** with Kotlin DSL. Key build files:
5049

5150
# Generate documentation
5251
./gradlew aggregateJavadocs
53-
```
54-
55-
### Testing
56-
```bash
57-
# Run unit tests for a specific file
58-
./gradlew ':<module>:testReleaseUnitTest' --tests="*<file name>*" --info
59-
60-
# Run system tests (requires Python virtual env)
61-
make systemTest
62-
63-
# Run specific test suites
64-
./gradlew :sentry-android-core:testReleaseUnitTest
65-
./gradlew :sentry:test
66-
```
67-
68-
### Code Quality
69-
```bash
70-
# Check code formatting
71-
./gradlew spotlessJavaCheck spotlessKotlinCheck
72-
73-
# Apply code formatting
74-
./gradlew spotlessApply
75-
76-
# Update API dump files (after API changes)
77-
./gradlew apiDump
7852

7953
# Dependency updates check
8054
./gradlew dependencyUpdates -Drevision=release
8155
```
8256

57+
To run tests, use the `test` skill rather than composing the Gradle invocation by hand — it
58+
resolves the per-module test task and the unit-test vs system-test split for you.
59+
8360
### Android-Specific Commands
8461
```bash
8562
# Assemble Android test APKs
@@ -102,11 +79,9 @@ make systemTest
10279

10380
## Repository Skills
10481

105-
This repo ships task-specific skills (declared in `agents.toml`, sources under `.agents/skills`). Prefer them over performing the steps manually:
106-
- **`create-java-pr`**: Branch, format, `apiDump`, commit, push, open PR, and add the changelog entry (automates the PR workflow above)
107-
- **`test`**: Run unit or system tests for a module or a specific class
108-
- **`check-code-attribution`**: Verify third-party code attribution on the current branch (see Third-Party Code Attribution below)
109-
- **`btrace-perfetto`**: Capture and compare Perfetto traces for Android performance work
82+
This repo ships task-specific skills, declared in `agents.toml` with sources under
83+
`.agents/skills`. Your harness already lists them with their descriptions — prefer them over
84+
performing the steps manually.
11085

11186
## Module Architecture
11287

@@ -150,8 +125,8 @@ The repository is organized into multiple modules:
150125

151126
### Code Style
152127
- **Languages**: Java 8+ and Kotlin
153-
- **Formatting**: Enforced via Spotless - always run `./gradlew spotlessApply` before committing
154-
- **API Compatibility**: Binary compatibility is enforced - run `./gradlew apiDump` after API changes
128+
- **Formatting**: Enforced via Spotless
129+
- **API Compatibility**: Binary compatibility is enforced. `.api` files are generated, never hand-edited
155130

156131
### Exception Handling
157132

@@ -189,10 +164,9 @@ PR description why the broad catch is necessary.
189164

190165
### Contributing Guidelines
191166
1. Follow existing code style and language
192-
2. Do not modify API files (e.g. sentry.api) manually - run `./gradlew apiDump` to regenerate them
193-
3. Write comprehensive tests
194-
4. New features must be **opt-in by default** - extend `SentryOptions` or similar Option classes with getters/setters
195-
5. Consider backwards compatibility
167+
2. Write comprehensive tests
168+
3. New features must be **opt-in by default** - extend `SentryOptions` or similar Option classes with getters/setters
169+
4. Consider backwards compatibility
196170

197171
### Third-Party Code Attribution
198172
When adapting code from third-party libraries:

0 commit comments

Comments
 (0)