Skip to content

docs: introduce a contributor guide for humans and AI coding tools#23195

Merged
enricobattocchi merged 17 commits intotrunkfrom
docs/agents-md-contributor-guide
Apr 28, 2026
Merged

docs: introduce a contributor guide for humans and AI coding tools#23195
enricobattocchi merged 17 commits intotrunkfrom
docs/agents-md-contributor-guide

Conversation

@enricobattocchi
Copy link
Copy Markdown
Member

@enricobattocchi enricobattocchi commented Apr 24, 2026

Context

  • Establishes a single canonical contributor guide for this repository that humans and AI coding tools (Claude Code, Cursor, GitHub Copilot, OpenAI Codex, and others following the AGENTS.md convention) can share, instead of each tool carrying its own duplicated and drifting copy of the rules.

Summary

This PR can be summarized in the following changelog entry:

  • Introduces a shared contributor guide for humans and AI coding tools.

Relevant technical choices:

  • CONTRIBUTING.md is the single source of truth; AGENTS.md, .cursor/rules/*.mdc, .github/copilot-instructions.md, CLAUDE.md, and the Claude Code create-pr skill all reference it rather than duplicating rules. Edits to rules land in CONTRIBUTING.md (or the PR template) so every tool picks them up.
  • Pre-push checks (composer test, test-wp-env, check-branch-cs, lint-branch, yarn lint, yarn test, grunt build:images) were not run: the diff contains only Markdown and .mdc files — no PHP, JS, CSS, images, or other runtime code.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Open .github/CONTRIBUTING.md and read through it section by section; confirm the table of contents and all intra-repo links (to AGENTS.md, PULL_REQUEST_TEMPLATE.md, docs/workflows/create-pr.md, license.txt, src/README.md) resolve.
  • Open AGENTS.md and confirm it reads as a short agent-behaviour delta that points back at CONTRIBUTING.md.
  • Open docs/workflows/create-pr.md and walk through the PR-creation procedure end to end.
  • Open .github/copilot-instructions.md and confirm the review-priority sections are coherent as Copilot review guidance.
  • Open .cursor/rules/agents.mdc and .cursor/rules/create-pr.mdc and confirm the @../../… include directives reference the expected files.
  • Open CLAUDE.md at the repo root and confirm the two @ includes point at CONTRIBUTING.md and AGENTS.md.
  • Open .github/PULL_REQUEST_TEMPLATE.md and confirm the Quality-assurance checkbox about grunt build:images reads "committed" (not "commited") and covers both new and edited images.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

  • Not applicable — this is a non-user-facing documentation change, so there is nothing for QA to verify at RC time.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • No plugin runtime behaviour is affected. The impact is on the contributor / AI-tool onboarding experience for anyone editing this repository.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and committed the results, if my PR introduces or edits images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

enricobattocchi and others added 14 commits April 20, 2026 12:07
Adopts the AGENTS.md convention (stewarded by the Agentic AI Foundation
under the Linux Foundation) as the single source of truth for coding-agent
and contributor instructions. AGENTS.md is recognised natively by ~20 AI
coding tools including OpenAI Codex, Cursor, Aider, Zed, Copilot,
Gemini CLI, Windsurf, and JetBrains Junie.

CLAUDE.md becomes a thin pointer that uses Claude Code's @-include syntax
to pull AGENTS.md into context, keeping one source of truth across tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .cursor/rules/agents.mdc: always-applied Cursor rule that references
  AGENTS.md via @-include so Cursor users share the same context.
- .github/copilot-instructions.md: tuned for Copilot's PR-review use
  case. Points at AGENTS.md / CONTRIBUTING.md / the PR template as
  authoritative sources, then lists review priorities (PR hygiene,
  tests/coverage, code style, safety, security) plus a 'what not to
  flag' list. Kept under the 4,000-character limit Copilot enforces on
  review instructions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove broken 2013 S3-hosted logo image.
- Correct label name to 'patch welcome' (was 'patch-welcome').
- Replace outdated 'New issue template' phrasing with a reference to
  the GitHub issue forms picker.
- Clarify that 'trunk' is the dev branch and 'main' tracks the latest
  released version.
- Add pointer to the security program.
- Replace the standalone link to the WordPress Coding Standards with a
  reference to Yoast Coding Standards (a WPCS superset).
- Add a 'Supported environment' line (PHP 7.4+, latest two WP majors).
- Add a pre-push checklist: composer test, composer check-branch-cs
  must report no new errors/warnings, composer lint-branch, yarn lint
  and yarn test for JS changes, plus guidance on composer test-wp-env.
- Add a coverage paragraph: every PR should increase or hold coverage
  and explain in the PR body when it cannot.
- Add a short 'Changelog entry and label' subsection pointing external
  contributors at the PR template for the full rules.
- Flatten heading hierarchy and update stale help.github.com links.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Strengthens the commit-hygiene guidance in three places:

- AGENTS.md: replaces the generic 'small, atomic commits are preferred'
  line with actionable guidance — what atomic means, when to split
  (unrelated changes), and when not to (closely coupled changes).
- CONTRIBUTING.md: same guidance aimed at external contributors, in
  the pull-request opening checklist.
- .github/copilot-instructions.md: adds a PR-hygiene bullet asking
  Copilot code review to suggest splitting when a PR mixes unrelated
  changes in a single commit. Kept under the 4000-character limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds explicit license-compatibility guidance so contributors (human and
AI) can confirm their code is safe to submit under GPL-2.0-or-later:

- CONTRIBUTING.md: new 'License and copyright' subsection listing the
  specific checks — own work or relicense-able, no incompatible sources
  (proprietary, GPL-3.0-only, CC with restrictions), attribution for
  reused compatible code, no code whose licensing is unclear (including
  AI-generated code whose terms have not been verified).
- AGENTS.md: thin reminder section pointing at the CONTRIBUTING.md
  guidance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduces a tool-agnostic procedure for opening a pull request that
can be shared across Claude Code, Cursor, and any human contributor.

- docs/workflows/create-pr.md: canonical procedure. Contains only
  process steps (gather context, verify checks, decide changelog
  bullets, fill template, create PR, self-check). Defers every rule
  — grammar, labels, bracket syntax, release-branch handling — to
  PULL_REQUEST_TEMPLATE.md / CONTRIBUTING.md / AGENTS.md so the rules
  live in one place each.
- .cursor/rules/create-pr.mdc: auto-applied Cursor rule that loads
  the recipe via @-include when the user asks to open a pull request.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds guidance that applies to both issues and pull requests: keep the
description focused on what the reviewer or triager actually needs,
and do not pad sections to look thorough.

- CONTRIBUTING.md: softens the 'include as much information as
  possible' bullet on issue reports to 'include everything needed,
  stay focused'. Adds a new step 8 on the PR-opening checklist asking
  for focused Context / Relevant technical choices / Test instructions
  and for links instead of restatements of linked issues or epics.
- AGENTS.md: thin bullet mirroring the rule with a pointer tone.
- .github/copilot-instructions.md: adds a PR-hygiene bullet asking
  Copilot code review to flag padded descriptions and restatements of
  linked issues/epics. Compresses the intro to stay under the 4000-
  character cap Copilot enforces on review instructions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Moves the content-based guidance (repository layout, code placement,
dependency injection, build/test commands, testing policy, code style)
out of AGENTS.md and into .github/CONTRIBUTING.md. AGENTS.md becomes a
thin 'agent delta' that lists only the behaviours specific to AI
coding tools, pointing back at CONTRIBUTING.md for everything else.

The net effect:

- CONTRIBUTING.md now has seven new subsections under 'I want to
  create a patch': Repository layout, Where to put new code (with
  Onion dependency rules and Legacy folders subsections), Dependency
  injection, PHP workflow, JavaScript workflow, Testing, Code style.
  It also gains a branch-naming convention bullet in step 1 of
  'Opening a pull request'.
- AGENTS.md shrinks from 148 lines to 27: a short intro plus a list
  of agent-specific behaviours (delegate long-running commands,
  verify before recommending, ask don't guess, prefer editing,
  don't paper over failures, respect creator/merger split, never
  hand-edit generated files, default to CONTRIBUTING.md).
- Both files agree on which one wins when they appear to contradict:
  CONTRIBUTING.md is authoritative for content, AGENTS.md only for
  agent behaviour.

No information was lost — every rule still lives in exactly one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Follows the canonical-source-of-truth split introduced in the previous
commit: CONTRIBUTING.md is the primary contributor doc, AGENTS.md is
the agent-behaviour delta.

- CLAUDE.md: now pulls CONTRIBUTING.md into context first, then
  AGENTS.md on top, via the @-include syntax.
- .cursor/rules/agents.mdc: same — CONTRIBUTING.md is primary,
  AGENTS.md layers the agent delta.
- .github/copilot-instructions.md: reorders the authoritative list so
  CONTRIBUTING.md and PULL_REQUEST_TEMPLATE.md come first, AGENTS.md is
  described as an agent-behaviour supplement. Intro line tightened to
  keep the file under Copilot's 4000-character cap.
- docs/workflows/create-pr.md: consolidates the 'where rules live'
  pointers. Content rules (architecture, tooling, testing, commits,
  branches, pre-push) now all point to CONTRIBUTING.md; AGENTS.md only
  covers agent-behaviour rules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a collapsed-link TOC at the top of CONTRIBUTING.md so readers can
jump directly to the relevant section. The file now covers three
distinct flows — reporting issues, developing against the plugin, and
opening PRs — and the TOC makes that easier to navigate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Dependency injection section in CONTRIBUTING.md (and a matching
Copilot review bullet) previously instructed contributors to commit
the regenerated src/generated/container.php and .meta. That was
wrong: /src/generated/ is gitignored (.gitignore:88) and has never
been tracked. composer install / update run compile-di via the
post-autoload-dump hook, so local dev, CI, and the release build
each regenerate it fresh. The compiled container does end up in the
shipped release artifact — just not in the Git history.

- CONTRIBUTING.md Repository-layout table: note that src/generated/
  is gitignored and bundled into the release artifact by the build
  pipeline.
- CONTRIBUTING.md Dependency-injection section: replace the
  'commit the regenerated files' bullet with the correct guidance
  (do not commit; every environment rebuilds). Rewrite the
  'CI complains' bullet to describe the actual failure mode:
  DI-compilation failure due to unresolvable auto-wiring, not a
  committed-container-out-of-sync situation.
- .github/copilot-instructions.md: drop the Code-style bullet that
  required a committed container.php. Reword the Safety bullet from
  descriptive ('Never hand-edited: ...') to action-oriented ('Flag
  any file under these paths in the diff — gitignored; must not be
  committed') so Copilot knows what to do when it sees one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The docs were prescribing a specific bugfix pattern
('Fixes a bug where … (was …) when …') that the PR template only
presents as an example. The template explicitly allows either
'happened when …' or 'was caused by …' phrasings, and stipulates
only the substantive rules: past tense, incorrect behaviour
followed by the triggering condition, no hypothetical or nested
conditionals.

The rigid phrasing also contradicted the 'don't flag minor
changelog wording variations' guidance in the same Copilot file.

- CONTRIBUTING.md Changelog entry section: restate the real rules
  (past tense, behaviour-then-condition, no hypotheticals) and show
  both accepted phrasings. Point to PULL_REQUEST_TEMPLATE.md as the
  full authority.
- .github/copilot-instructions.md PR-hygiene bullet: trim to the
  substantive rules; rely on the existing 'What NOT to flag' entry
  for wording-variation tolerance.
- docs/workflows/create-pr.md self-check bullet: reference the PR
  template's grammar rules instead of a rigid pattern string.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
svn-assets/ holds the wordpress.org plugin-directory assets (banners,
icons, screenshots). It is tracked in Git and hand-maintained, not
generated or gitignored, so it does not belong in the same list as
build/, vendor/, node_modules/, etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The release artifact pipeline re-runs grunt build:images (imagemin)
during create-rc / create-beta / artifact. If the committed images
aren't already optimised, the release build fails. Make this explicit
in the contributor guide, the create-pr self-check, AGENTS.md, and
the Copilot review checklist, so both humans and AI tools catch it
before the PR is opened.

Also fix the matching PR-template checkbox: a "commited" typo and
narrow "introduces new images" wording that didn't cover edits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@enricobattocchi enricobattocchi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Apr 24, 2026
Add an explicit conciseness rule for changelog bullets (one short
sentence, no colon- or semicolon-chained clauses) across CONTRIBUTING.md,
the PR template, AGENTS.md, the create-pr self-check, and the Copilot
review checklist. At the same time, drop Context / Relevant technical
choices conciseness from the Copilot flag list and soften the matching
CONTRIBUTING.md paragraph — brevity there is welcome but not enforced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@enricobattocchi enricobattocchi changed the title docs: unify contributor and agent docs across tools docs: introduce a contributor guide for humans and AI coding tools Apr 24, 2026
Non-user-facing PRs (documentation, pure refactors, internal tooling)
don't need QA verification at RC time — QA checks user-visible
behaviour. Make this explicit in the PR-template HTML comment and in
the create-pr workflow step, so future authors don't fabricate QA
steps for PRs where there is nothing for QA to check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@enricobattocchi enricobattocchi added this to the 27.6 milestone Apr 28, 2026
@enricobattocchi enricobattocchi added changelog: other Needs to be included in the 'Other' category in the changelog and removed changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Apr 28, 2026
@enricobattocchi enricobattocchi merged commit 777600d into trunk Apr 28, 2026
9 checks passed
@enricobattocchi enricobattocchi deleted the docs/agents-md-contributor-guide branch April 28, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: other Needs to be included in the 'Other' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants