Skip to content

feat(agents): Add AGENTS.md and CLAUDE.md (symlinked)#1003

Merged
Litarnus merged 3 commits intomasterfrom
agents-md
Mar 16, 2026
Merged

feat(agents): Add AGENTS.md and CLAUDE.md (symlinked)#1003
Litarnus merged 3 commits intomasterfrom
agents-md

Conversation

@Litarnus
Copy link
Contributor

Adds AGENTS.md and CLAUDE.md to the repository to enable Agents to understand the codebase better and to know which tools to run and when

Copy link

@giortzisg giortzisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change,
left some comments for minimizing context usage, but overall looks good

AGENTS.md Outdated
Comment on lines +45 to +47
- Follow the existing formatting rules from `.php-cs-fixer.dist.php`: Symfony
style, short arrays, ordered imports, yoda conditions, and 4-space
indentation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's probably better to just point the agent to the file, without specifying the rules:

  • in case they ever change, we would need to maintain the AGENTS.md file as well
  • we add duplicate things to the context if the model loads the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True good point

AGENTS.md Outdated
Comment on lines +10 to +18
- The main entry points are:
- `src/SentryBundle.php`: registers compiler passes.
- `src/DependencyInjection/Configuration.php`: defines the config tree.
- `src/DependencyInjection/SentryExtension.php`: turns config into container
definitions and parameters.
- `src/Resources/config/services.yaml`: defines base services and listener
tags.
- `src/aliases.php`: selects version-specific classes by runtime feature
detection.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also had a similar conversation in sentry-go.

It probably makes sense to let the agent explore the codebase, to gather more info by itself. Aliases seems the most important here, but it's already mentioned under compatibility rules.

AGENTS.md Outdated
Comment on lines +54 to +61
- Config changes usually require synchronized updates in all of these places:
- `src/DependencyInjection/Configuration.php`
- `src/DependencyInjection/SentryExtension.php`
- `src/Resources/config/services.yaml`
- `src/Resources/config/schema/sentry-1.0.xsd`
- `tests/DependencyInjection/Fixtures/{yml,php,xml}`
- `tests/DependencyInjection/ConfigurationTest.php`
- `tests/DependencyInjection/SentryExtensionTest.php`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is probably something that the model can infer, from either exploring or from composer checks.

AGENTS.md Outdated
Comment on lines +84 to +95
- Local verification commands:
- `composer install`
- `composer cs-check`
- `composer phpstan`
- `composer psalm`
- `composer tests`
- `composer check`
- `composer phpstan` runs PHPStan with `512M` because the default local PHP
memory limit can be too low for this repo.
- `php-cs-fixer` is the formatting tool in this repo. If formatting fails, run
`composer cs-fix` and then rerun `composer check`.
- Before committing, run `composer check`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we can just keep only the last bullet point for a pre-commit check. The models should be good enough to handle composer commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will overhaul this. I noticed that this file is missing the instruction to always perform formatting and linter checks after editing files

Comment on lines +103 to +105
- `CONTRIBUTING.md` states that new code should include tests and notes that
style checkers require PHP 7.4+ locally, but shipped code still has to comply
with the package's PHP `7.2` baseline.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already implied from compatibility

AGENTS.md Outdated
Comment on lines +107 to +115
## CI Notes

- `.github/workflows/tests.yaml` runs a PHP/Symfony matrix and also includes
jobs that remove optional packages before running tests.
- `.github/workflows/static-analysis.yaml` runs PHP-CS-Fixer, PHPStan, and
Psalm on a recent PHP version. Check the workflow file for the exact version
currently used in CI.
- A single local green run is necessary but not sufficient. Avoid changes that
only work when optional packages are present.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you feel this section is required? Does the model ever wait for CI after making a change? This seems to be worth it for a more automated workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't wait on the CI changes, but in my local test it tried to make all tools work on all PHP versions, which ultimately failed and produced a lot of helper code.
Telling it that the CI uses the matrix but the linters and static analysis tools run on one version resolved the problem without having to remind it to read the CI file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last bullet point is a bit redundant though

Copy link

@giortzisg giortzisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition!

@Litarnus Litarnus merged commit e313551 into master Mar 16, 2026
41 checks passed
@Litarnus Litarnus deleted the agents-md branch March 16, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants