[3.0] Add AGENTS.md instructions for AI coding agents - #9323
Open
albertlast wants to merge 2 commits into
Open
Conversation
AGENTS.md is the cross-tool convention, read directly by Copilot, Codex, Cursor, Gemini CLI and others. Claude Code reads only CLAUDE.md, so that file imports AGENTS.md rather than duplicating it. A symlink would also work, but not on Windows without Developer Mode, and .gitattributes already forces LF for Windows checkouts, so the import is the portable choice. Contents are derived from the repository's own configuration rather than from habit: .editorconfig, .gitattributes, .php-cs-fixer.dist.php and its custom SectionComments fixer, composer.json, the workflows in .github, DCO.txt, the PR template and compose.yaml. Two points are worth stating explicitly for tools that cannot infer them: that there is no test suite, so green CI only means the code parses and is formatted; and that the sign-off check can pass on a pull request even when the commits are unsigned, because it walks up to the parents. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
This is actually a helpful read for human coders, too... |
The Docker environment gained a MySQL service and made it the default engine, so the service list in AGENTS.md was describing a stack that no longer matches: it named PostgreSQL alone, and pointed at a container called smf-dev-db-1 that no longer exists now that the service is named postgres. Lists both engines, and switches the examples to docker compose exec, which addresses services by name and so does not break again if the project or container naming changes. Also states that SMF_DB_TYPE defaults to mysql, and how to re-test on the other engine, because "any raw SQL must work on both" earlier in this document is otherwise an instruction with no stated way to follow it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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.
Note
This change was produced by an LLM. The file, the commit message and this
description were all written by Claude (Anthropic), driven by @albertlast. It has
not yet had human code review.
Unlike the bug fixes in #9319–#9322, there is no runtime behaviour to verify here.
What was checked is that every claim in the file was read out of this repository's
own configuration rather than written from habit, and that the two new files do not
disturb the existing checks. Please review it as untrusted work, and in particular
as a proposal rather than a fix: whether SMF wants agent instructions in-tree at all
is a project decision, not a defect.
Description
AGENTS.mdis the cross-tool convention for giving AI coding agents project context.GitHub Copilot reads it natively, as do Codex, Cursor, Gemini CLI, Aider, Windsurf and
Zed. Claude Code reads only
CLAUDE.md, so that file is a two-line import:A symlink is the other documented option, but it needs Developer Mode or Administrator
on Windows, and
.gitattributesalready goes out of its way to keep Windows checkoutsworking, so the import is the portable choice. The result is one file to maintain and
no duplicated instructions.
The contents are derived from this repository rather than from assumption:
.editorconfig,.gitattributes.php-cs-fixer.dist.php@PER-CS2x0, theordered_class_elementsorder,composer lint/lint-fix.github/phpcs/SectionComments.php.github/workflows/*.ymlcomposer.jsonDCO.txt,check-signed-off.php.github/PULL_REQUEST_TEMPLATE/standard_pr.mdcompose.yamlSources/Db/Schema/v3_0/Two things are stated explicitly because a tool cannot infer them, and both were learned
the hard way while working on #9319–#9322:
executes SMF. An agent that treats four green checks as "this works" will be wrong,
and all four of those bugs were runtime failures in code that parsed perfectly.
check-signed-off.phplooks forSigned-off-by:on the last line, and when it doesnot find one it walks up to the parent commits — where
release-3.0is signed off. Runagainst a feature branch directly it exits 1; run against
release-3.0it exits 0. Thefile tells agents to verify locally rather than trust the badge.
The remaining sections cover the codebase traps that produced the recent run of bugs,
generalised rather than listed: typed properties that throw when read before their load
step, static properties shared with descendant classes,
empty()hiding a null object,and columns that migrations removed while a query still names them.
What was checked
buildjob runs pass with the files added:check-smf-license,check-smf-index,check-smf-languages,check-version.Found 0 of 1725 files that can be fixed. Markdownis outside the finder, so the new files are not linted, but nothing else shifted.
.editorconfig, and together come to155 lines, within the 200-line guidance for instruction files.
@inAGENTS.mdis`@PER-CS2x0`inside a code span, so it is notmistaken for an import when Claude Code expands the file.
Relationship to other PRs
Depends on #9317. The "Verifying a change" section documents
docker compose up,the service ports and the two
docker exechelpers, all of which come from the Dockerenvironment added there. If #9317 is not merged, that section describes something that
does not exist and should be dropped or rewritten before this lands. Merging #9317 first
is the natural order.
Related to #9319, #9320, #9321 and #9322 by origin rather than by content: the "Things
that bite in this codebase" section is a generalisation of those four root causes, and
the "no test suite" note is the reason each of them had to be verified by hand against a
running forum. No file overlap with any of them.
This PR touches only new files, so it conflicts with nothing.
Issues References (Fixes|Related|Closes)