Skip to content

Add agent-readiness: AGENTS.md, Docker sandbox, Dev Containers#218

Merged
adamziel merged 4 commits intotrunkfrom
add-agent-readiness
Feb 17, 2026
Merged

Add agent-readiness: AGENTS.md, Docker sandbox, Dev Containers#218
adamziel merged 4 commits intotrunkfrom
add-agent-readiness

Conversation

@adamziel
Copy link
Collaborator

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 with network_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.json pre-approves the build, test, lint, and Docker commands so agents can self-verify without prompting on every composer test run.

README.md is updated to document the Dev Container, Docker sandbox, and direct-on-host workflows.

Test plan

  • docker compose build succeeds
  • docker compose run --rm sandbox runs the full test suite and passes
  • docker compose run --rm sandbox vendor/bin/phpcs -d memory_limit=1G . lints cleanly
  • Network isolation: docker compose run --rm sandbox bash -c "curl http://example.com" fails
  • Dev Container opens in VS Code with "Reopen in Container"
  • composer test still works directly on the host

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.
@adamziel adamziel merged commit 205a548 into trunk Feb 17, 2026
22 checks passed
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.

1 participant