Add a CLAUDE.md so agents inherit the project's rules - #13
Merged
Conversation
The conventions that bite hardest here are the ones no amount of reading src/ reveals: tests only run through slic, the namespace deliberately does not match the package name, production classes never grow a reset() for the suite's benefit, and exit() is never mocked. Collect them where a coding agent reads them before touching anything. Export-ignored alongside the other dev-only files, so consumers installing the library do not receive it.
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: a CLAUDE.md capturing the conventions a coding agent cannot infer from src/.
Usage:
slic run unit tests/unit/ConfigTest.php slic run unit "tests/unit/ConfigTest.php:test_it_rejects_invalid_hook_prefixes"Both forms are in the file because
slic runexposes no--filter— narrowing is the positional<test>argument, which is not guessable from the help output.Why this way: the rules worth writing down are the ones that are invisible or actively counter-intuitive — tests only run through slic, the namespace (
Nexcess\PluginAbsorber\) deliberately does not match the package (stellarwp/plugin-absorber), production classes never grow areset()for the suite's benefit,exit()is never mocked, and the design spec overridesengineering-plan.mdwherever they disagree. Architecture is described at the level that needs several files to reconstruct (the resolve/boot/load lifecycle, the four collaborators) rather than restating file listings. It isexport-ignored with the other dev-only files, matching the existing.gitattributespolicy, so consumers do not receive it.Verify:
composer test:analysisis green, andgit check-attr export-ignore -- CLAUDE.md README.md src/Config.phpshows the attribute set on CLAUDE.md only. The test suite is untouched by this PR — it adds no PHP.