agentleFS
SentryKnown publishergetsentry/sentry-php/AGENTS.md

sentry-php

AGENTS.md1.9k starsChanged 5 months agoMITView on GitHub

- sentry/sentry is the core PHP SDK, not an application or framework bundle. - Public entry points include the autoloaded global helpers in src/functions.php and the public classes and interfaces under src/. - Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details. - The minimum supported PHP version for shipped code is 7.2. composer.json requires ^7.2|^8.0, so shipped code must remain valid on PHP 7.2 unless support policy is intentionally…

Trending

Quiet since February.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 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-php repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about getsentry/sentry-php

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

See all 14

Talked about on GitHub (14 times).

On GitHub · 14

9 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details.

    line 8
  2. Distinctive:

    Do not assume optional packages or binaries are available.

    line 23
  3. Distinctive:

    Do not gate runtime setup or transport behavior on DSN alone.

    line 27
  4. Very specific:

    Keep declare(strict_types=1).

    line 31
  5. Very specific:

    Follow the existing formatting rules from .php-cs-fixer.dist.php.

    line 32
  6. Very specific:

    If you add or change an SDK option, update the resolver/defaults in Options, the relevant getters and setters, the init() option …

    line 33
  7. Distinctive:

    Add tests with every behavior change.

    line 62
  8. Very specific:

    Every SDK option/default must have a valid case in OptionsTest::optionsDataProvider().

    line 64
  9. Distinctive:

    Prefer targeted PHPUnit runs while iterating.

    line 70
  10. Distinctive:

    After editing files, run the relevant formatting, lint, and test commands for the code you changed.

    line 71
  11. Very specific:

    Before handing back substantive code changes, run composer check when feasible and call out anything you could not run.

    line 73
  12. Distinctive:

    If you change error handling, fatal error capture, or PHP-version-specific behavior, add or update PHPT coverage.

    line 75
  13. Distinctive:

    If you change runtime-context or worker-mode behavior, add or update focused coverage for the FrankenPHP or RoadRunner paths as appropriate.

    line 77
  14. Very specific:

    If a change may require updates in the separate documentation repo, ask the user whether to review ../sentry-docs if that sibling checkout …

    line 92
  15. Distinctive:

    If a change affects installation, configuration, error handling, tracing, profiling, metrics, logs, or worker-mode behavior, call out the …

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md

AGENTS.md

Overview

  • sentry/sentry is the core PHP SDK, not an application or framework bundle.
  • Public entry points include the autoloaded global helpers in src/functions.php and the public classes and interfaces under src/.
  • Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details.

Compatibility Rules

  • The minimum supported PHP version for shipped code is 7.2. composer.json requires ^7.2|^8.0, so shipped code must remain valid on PHP 7.2 unless support policy is intentionally being changed.
  • This SDK has a broad public API surface. Treat changes to global helpers, Options, ClientBuilder, ClientInterface, HubInterface, TransportInterface, IntegrationInterface, tracing/logs/metrics types, and Monolog handlers as BC-sensitive.
  • Preserve the existing cross-version compatibility style. This repo supports multiple psr/log, symfony/options-resolver, guzzlehttp/psr7, and monolog/monolog major versions.
  • Do not assume optional packages or binaries are available. Monolog is only a suggested dependency, and FrankenPHP/RoadRunner worker coverage depends on optional binaries and dev dependencies.
  • Spotlight is treated as an active send path alongside DSN-based delivery. Do not gate runtime setup or transport behavior on DSN alone.

Editing Guidance

  • Keep declare(strict_types=1); in PHP files.
  • Follow the existing formatting rules from .php-cs-fixer.dist.php.
  • If you add or change an SDK option, update the resolver/defaults in Options, the relevant getters and setters, the init() option array-shape docs in src/functions.php, and the affected tests.
  • src/functions.php is autoloaded and part of the public API. Keep helper signatures, phpdoc, and runtime behavior synchronized with the underlying client, hub, and runtime-context implementation. Functions in src/functions.php should use camelCase naming.
  • IntegrationRegistry intentionally calls setupOnce() only once per integration class during the process lifetime. Preserve de-duplication and default-integration gating when changing integration setup behavior.
  • ErrorHandler has fragile register-once, previous-handler chaining, reserved memory, and out-of-memory behavior. Preserve that lifecycle carefully and add PHPT coverage when changing fatal or silenced error handling.
  • SentrySdk::startContext(), endContext(), and withContext() must keep runtime-context isolation and best-effort flushing intact for logs, metrics, and transport in long-running worker scenarios.
  • HttpTransport and PayloadSerializer are tightly coupled. Preserve the envelope item selection, Spotlight delivery path, dynamic sampling context, and the transaction/profile relationship when changing transport or serialization behavior.
  • Monolog support spans multiple Monolog major versions through the compatibility traits and handlers under src/Monolog/. Preserve that compatibility style when changing logging integrations.
  • Client::SDK_VERSION is updated by the release action via scripts/bump-version.sh. Do not modify it manually as part of normal development changes.

Test Expectations

  • Add tests with every behavior change. This is a library repo with broad compatibility and regression coverage.
  • Every SDK option/default must have a valid case in OptionsTest::optionsDataProvider(). Keep the exhaustive option-coverage and default-validation tests passing when adding or changing options.
  • New tests belong under tests/.
  • phpunit.xml.dist defines a unit suite that includes both PHPUnit tests and tests/phpt, plus a separate oom suite for tests/phpt-oom.
  • Prefer targeted PHPUnit runs while iterating.
  • After editing files, run the relevant formatting, lint, and test commands for the code you changed.
  • Before handing back substantive code changes, run composer check when feasible and call out anything you could not run.
  • If you change error handling, fatal error capture, or PHP-version-specific behavior, add or update PHPT coverage.
  • If you change runtime-context or worker-mode behavior, add or update focused coverage for the FrankenPHP or RoadRunner paths as appropriate.

Tools And Commands

  • phpstan.neon only analyzes src, uses phpstan-baseline.neon, and will not catch behavior regressions in tests/ or PHPT coverage.
  • phpunit.xml.dist is strict about unexpected output, so noisy debug output will fail tests.
  • This repo is a library, so do not expect a runnable application entrypoint.

Docs And Release Notes

  • README.md and CHANGELOG.md are updated manually during releases, so do not modify them as part of normal development changes.
  • If a change may require updates in the separate documentation repo, ask the user whether to review ../sentry-docs if that sibling checkout exists. If it does not exist, ask the user for the local docs path first. If they opt in, update that repo's master branch when safe, use git worktrees to inspect the relevant docs, and suggest any needed changes to avoid stale documentation.
  • If a change affects installation, configuration, error handling, tracing, profiling, metrics, logs, or worker-mode behavior, call out the likely README or release-note follow-up in your summary instead of editing those files automatically.

CI Notes

  • .github/workflows/ci.yml runs the PHPUnit compatibility matrix across Ubuntu and Windows, lowest and highest dependencies, and separate runtime jobs for FrankenPHP and RoadRunner.
  • .github/workflows/static-analysis.yaml runs PHP-CS-Fixer, PHPStan, and Psalm on single recent PHP versions rather than across the full test matrix.

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.