Pular para o conteúdo principal

AGENTS.md for ByJG PHP components

An AGENTS.md file gives an AI coding agent (Codex, Claude Code, Cursor, GitHub Copilot, Gemini, ...) the instructions it needs before it touches your code. This one is written for PHP projects that use the byjg/* components, and for work on the components themselves.

Get it​

From the root of your project:

curl -fsSL https://opensource.byjg.com/AGENTS.md -o AGENTS.md

Or open opensource.byjg.com/AGENTS.md and save the file.

To update it, run the same command again. The file has no project-specific content, so replacing it is safe. Put your own project's instructions in a separate section or file.

Make your agent read it​

AgentSetup
Codex, Cursor, GitHub CopilotNothing. They read AGENTS.md from the project root
Claude CodeClaude Code reads CLAUDE.md. Import the file with a line in it: echo '@AGENTS.md' >> CLAUDE.md
Gemini CLIGemini CLI reads GEMINI.md by default. Point its context file setting to AGENTS.md

What it contains​

SectionContent
Working rulesAnswer questions with options before implementing; stop on workarounds; never commit before the diff is reviewed; no AI attribution in commits; run tests before and after a change; no fake tests; EASY, KISS and DRY
Finding documentationHow to connect and query the ByJG Docs MCP Server, when to trust the installed vendor/ code instead, and the agent skills
Component catalogEvery PHP component, with its package name, docs slug and purpose, plus the abandoned packages to avoid
VersionsHow to install the 7.x line while it is published as 7.0.x-dev, and the v6 to v7 changes agents get wrong
Common pitfallsMistakes seen in practice: strict controller registration, APP_ENV, MockServer exceptions, destructive migration resets, Psalm configuration
ApplicationsPatterns for DI, models and repositories, REST endpoints, migrations and tests, with code
ComponentsThe rules of the php-* repositories, summarised from PHP components
Definition of doneThe checklist an agent completes before handing the change back