chore(ai): Add AGENTS.md and testing guidelines#1216
Conversation
…ands Add AGENTS.md with SDK architecture overview, coding standards, transport layer documentation (current HTTPTransport and upcoming telemetry processor), and references to project skills and docs. Add .agents/TESTING.md with testing guidelines that prioritize integration tests exercising real user-facing APIs over isolated unit tests. Extend .claude/settings.json with Go toolchain and Makefile commands. Co-Authored-By: Claude <noreply@anthropic.com>
Register the create-pr skill in dotagents configuration and add the generated CLAUDE.md for agent context. Co-Authored-By: Claude <noreply@anthropic.com>
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Ai
Deps
Other
🤖 This preview updates automatically when you update the PR. |
e9af7cf to
7451a95
Compare
ericapisani
left a comment
There was a problem hiding this comment.
This is a great start! Let me know if it'd be helpful to have a chat about some of the notes I left here.
The general theme for me in the comments I've left is that there's information here that could likely live in the CONTRIBUTING.md file, and have that file be listed as a reference within AGENTS.md so that the agent could grab it when needed, and not have that info in the context at all times.
AGENTS.md
Outdated
| - Requires **Go 1.24+** (tested on 1.24, 1.25, 1.26) | ||
| - After cloning: `make build` |
There was a problem hiding this comment.
These are things that the AI will be able to infer from the README, so I think they can be removed to reduce the duplication of information within the context
AGENTS.md
Outdated
|
|
||
| - Requires **Go 1.24+** (tested on 1.24, 1.25, 1.26) | ||
| - After cloning: `make build` | ||
| - Never change Go version constraints in `go.mod` unless explicitly asked |
There was a problem hiding this comment.
Negative instructions don't seem to work as effectively as positive ones for AIs, so I think it might be worth trying to reframe this in a positive way. Maybe "maintain the Go versions that are in the go.mod unless explicitly asked"?
AGENTS.md
Outdated
| - `sentry.go` — `Init`, `CaptureException`, `CaptureMessage`, `Flush` | ||
| - `client.go` — `Client`, `ClientOptions` | ||
| - `hub.go` — `Hub` manages a stack of `Scope`/`Client` pairs; thread-safe | ||
| - `scope.go` — `Scope` holds contextual data (tags, user, breadcrumbs, spans) | ||
| - `tracing.go` — `Span`, `StartSpan`, `StartTransaction`; W3C Trace Context | ||
| - `transport.go` — `Transport` interface and `HTTPTransport`/`HTTPSyncTransport` | ||
| - `interfaces.go` — `Event`, `Breadcrumb`, `User`, `Request`, `Exception` |
There was a problem hiding this comment.
Are these details necessary in this context?
I see the value in keeping theThe root package sentry contains the entire public API part, but I suspect the AI would be able to infer the rest of these details by exploring the codebase.
In case we've seen mixed results in letting it go off on it's own, maybe we could move this into a references file that the AI can load into its context if needed?
There was a problem hiding this comment.
yeah that's a good suggestion. In most cases it would need to explore the codebase anyways.
AGENTS.md
Outdated
|
|
||
| ### Internal Packages (`/internal/`) | ||
|
|
||
| Private implementation. Do not export types from these packages. |
There was a problem hiding this comment.
Have we seen instances in the past where it attempts to export things from internal? I'm curious if the AI would naturally follow Go conventions here (in which case we could remove this line) 🤔
There was a problem hiding this comment.
Not really, in attempting to export things, but in many cases it doesn't like putting private things under internal. Maybe it makes sense to mention it on coding standards and not here.
AGENTS.md
Outdated
|
|
||
| ### Transport Architecture | ||
|
|
||
| **Current: `transport.go` (active)** — `HTTPTransport` uses a batch-channel model with a single worker goroutine. `HTTPSyncTransport` is the blocking variant for serverless. |
There was a problem hiding this comment.
I wonder if the AI will be able to infer the approach used (the "uses a batch-channel model with a single worker goroutine" part), but imagine it won't with regards to the HTTPTransport being the architecture that's "active" within the project, or that the HTTPSyncTransport is the variant for serverless environments.
I'd keep the latter information, but wonder if we could potentially get rid of the "uses a batch-channel model with a single worker goroutine" part.
| ## Coding Standards | ||
|
|
||
| - Follow existing conventions — check neighboring files first | ||
| - Do not add new dependencies without asking | ||
| - `gofmt -s` formatting, doc comments on exports | ||
| - Public API in root package; internals in `/internal` | ||
| - Thread safety required — guard shared state with mutexes | ||
| - Update tests when modifying behavior |
There was a problem hiding this comment.
This looks like something that would already exist within a CONTRIBUTING.md file and we might be able to remove this list and direct the agent to look at that file as a reference further below in this file.
Aside from the duplicate information being added to the AI context, I worry that the information could get out of sync between the two places.
There was a problem hiding this comment.
Wanted to minimize context, since the Contributing md file would include information that we don't want to include to the agent.
AGENTS.md
Outdated
|
|
||
| ## Testing | ||
|
|
||
| **Prefer tests that exercise real user-facing behavior over isolated unit tests.** Call the same APIs users call — `sentry.Init`, `CaptureException`, `Flush`, framework middleware — rather than mocking internal components. |
There was a problem hiding this comment.
To cut down on the tokens used in the context here, this could likely be removed since you have the test tier preference just below
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is kicking off a free cloud agent to fix this issue. This run is complimentary, but you can enable autofix for all future PRs in the Cursor dashboard.
Description
Add agent configuration files to guide AI-assisted development on the Go SDK.
AGENTS.md — Entry point for coding agents working on this repo. Covers:
HTTPTransportand upcominginternal/telemetryprocessor)Transport,Integration,EventProcessor).claude/settings.json — Extended allow list with Go toolchain commands
(
go test,go vet,gofmt,golangci-lint,make).Also registers the
create-prskill in dotagents and adds the generatedCLAUDE.md.Issues