Add agent-readiness: AGENTS.md, Docker sandbox, Dev Containers#218
Merged
Add agent-readiness: AGENTS.md, Docker sandbox, Dev Containers#218
Conversation
AI coding agents need three things to work well in a repo: knowledge of the project conventions, the ability to build and test on their own, and a sandboxed environment where mistakes don't escape. AGENTS.md captures the hard-to-discover knowledge: the PHP 7.2 constraint, the zero-dependency rule, the classmap autoloading convention, the single-class architecture, and the common pitfalls that trip up both humans and agents. CLAUDE.md points to it so Claude Code picks it up automatically. The Dockerfile and docker-compose.yml provide a locked-down sandbox (no network, read-only root, all capabilities dropped) where agents can run tests and lints without touching the host. The Dev Container spec reuses the same Dockerfile for VS Code, Codespaces, and any editor that supports the standard. .claude/settings.json pre-approves the build, test, lint, and Docker commands so agents can self-verify without prompting on every run.
Clarify verification instructions for end-to-end testing.
Present it as one option among others, not a recommendation.
The container now drops into a shell by default. Tests, lints, and arbitrary PHP scripts are all passed as explicit commands. This makes the sandbox useful for experimenting with library code, not only for running the test suite.
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.
Summary
AI coding agents need three things to work well in a repo: knowledge of project conventions, the ability to build and test on their own, and a sandboxed environment where mistakes don't escape.
This PR adds all three:
AGENTS.md captures the hard-to-discover knowledge that agents (and new contributors) need: the PHP 7.2 constraint with an explicit list of banned syntax, the zero-dependency rule, classmap autoloading (not PSR-4), the single-class architecture, and common pitfalls like "don't edit root composer.json directly" and "don't add
declare(strict_types=1)to library code." CLAUDE.md points to it so Claude Code loads the same instructions.Docker sandbox (
Dockerfile+docker-compose.yml) provides a locked-down container for running tests and lints. The sandbox runs withnetwork_mode: none, a read-only root filesystem, and all Linux capabilities dropped — the only writable areas are the project mount and/tmp. The image uses PHP 8.1 to match the lint CI.Dev Container (
.devcontainer/devcontainer.json) reuses the same Dockerfile for VS Code "Reopen in Container", GitHub Codespaces, and any editor that supports the Dev Containers spec. Composer deps install automatically, and PHP IntelliSense + PHPCS are pre-configured..claude/settings.jsonpre-approves the build, test, lint, and Docker commands so agents can self-verify without prompting on everycomposer testrun.README.md is updated to document the Dev Container, Docker sandbox, and direct-on-host workflows.
Test plan
docker compose buildsucceedsdocker compose run --rm sandboxruns the full test suite and passesdocker compose run --rm sandbox vendor/bin/phpcs -d memory_limit=1G .lints cleanlydocker compose run --rm sandbox bash -c "curl http://example.com"failscomposer teststill works directly on the host