Skip to content

docs: expand agent guidance with directory context and CLAUDE links - #5022

Merged
ebinnion merged 5 commits into
developfrom
codex/ai-readability-plan-clean
Feb 16, 2026
Merged

ebinnion merged 5 commits into
developfrom
codex/ai-readability-plan-clean

Conversation

@ebinnion

@ebinnion ebinnion commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request:

This PR improves AI-agent guidance for this repository and makes CLAUDE.md usage consistent with current guidance (@AGENTS.md file references, not symlinks).

What changed

Updated root AGENTS.md after recent guidance. Add some AGENTS.md in subdirectories. Codex also made suggestons after reviewing past 6 months of commits and PRs.

Why this is needed

Sets a new baseline for AI context following Field Guide guidance.

How this could break

  • Incorrect or stale guidance could steer future agent changes poorly.
  • Directory-level instruction drift could introduce conflicting guidance.

Mitigations

  • Kept root guidance as source of truth for repo-wide rules.
  • Scoped subdirectory guidance to local concerns only.
  • Added explicit maintenance triggers in root AGENTS.md.
  • Added an audit doc to make future updates intentional and reviewable.
  • AGENTS.md is easily changeable.

Testing instructions

Review guidance and verify that it makes sense.


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

This PR only updates internal AI guidance documentation (AGENTS.md / CLAUDE.md) and adds an internal audit doc. It does not change plugin runtime behavior or user-facing functionality.

Post merge

@ebinnion ebinnion self-assigned this Feb 13, 2026
@ebinnion
ebinnion requested review from a team, daledupreez and wjrosa and removed request for a team February 13, 2026 22:52
@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@ebinnion has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Repository documentation expanded with hierarchical AGENTS.md guidelines for root, client, includes (backend), agentic-commerce, and e2e layers; CLAUDE.md pointers added. A new AI readability audit doc and changelog/readme entries were added. No executable code or public APIs changed.

Changes

Cohort / File(s) Summary
Root-level Guidelines
AGENTS.md, docs/ai-readability-audit.md, changelog.txt, readme.txt
Root AGENTS.md rewritten into a prescriptive playbook (CRITICAL rules, Task-to-Command Matrix, architecture, workflows). Added an AI readability audit doc and changelog/readme entry documenting the agent-guidance expansion.
Client-side Guidelines
client/AGENTS.md, client/CLAUDE.md
Added frontend-specific AGENTS doc with scope, CRITICAL rules, structure/ownership, conventions, task-to-command mappings, and test mapping. client/CLAUDE.md added as a pointer to the AGENTS doc.
Backend / Includes
includes/AGENTS.md, includes/CLAUDE.md
Added backend AGENTS doc for PHP includes/ with rules, structure, naming/typing conventions, PHPUnit/testing guidance, and common pitfalls. includes/CLAUDE.md added as a pointer.
Agentic Commerce Integration
includes/agentic-commerce/AGENTS.md, includes/agentic-commerce/CLAUDE.md
Added integration-specific AGENTS doc covering scope, invariants, feed/contract checklist, task-to-command mapping, and test guidance. CLAUDE file points to AGENTS.md.
E2E Testing Guidelines
tests/e2e/AGENTS.md, tests/e2e/CLAUDE.md
Added Playwright e2e AGENTS doc with CRITICAL rules, environment/setup commands, repository structure, authoring guidance, and anti-flakiness practices. CLAUDE file added as a pointer.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (3 files):

⚔️ AGENTS.md (content)
⚔️ changelog.txt (content)
⚔️ readme.txt (content)

These conflicts must be resolved before merging into develop.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: expanding agent guidance with directory-level context files and standardizing CLAUDE.md references.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering changes, rationale, risks, mitigations, and testing approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/ai-readability-plan-clean

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ebinnion ebinnion added this to the 10.5.0 milestone Feb 13, 2026

@daledupreez daledupreez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the files, @ebinnion!

I have some minor suggestions to improve the files. Maybe the only thing we would want to add would be explicit instructions for adding changelog entries to changelog.txt and readme.txt, possibly in conjunction with a dedicated script that can take the entry as arguments or piped input. (Our current npm run changelog script is intended as an interactive developer tool.)

Comment thread client/AGENTS.md Outdated
Comment thread tests/e2e/AGENTS.md
- **CRITICAL:** Treat `test:e2e-setup` against `--base_url` as destructive setup for a target site. Use only disposable/staging environments.
- **CRITICAL:** Do not commit secrets from `tests/e2e/config/local.env`.
- **CRITICAL:** Keep tests deterministic; avoid unnecessary sleeps and flaky selectors.
- **CRITICAL:** For Stripe iframe interactions, do not rely on `networkidle`; use deterministic field readiness/visibility checks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 💯

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
AGENTS.md (2)

66-77: Add a language to the fenced code block.

Markdownlint flags this block without a language; add text (or plaintext) to keep lint clean.

🧩 Proposed fix
-```
+```text
 WC_Payment_Gateway_CC (WooCommerce)
     └── WC_Stripe_Payment_Gateway (abstract)
             └── WC_Stripe_UPE_Payment_Gateway
                     └── Uses WC_Stripe_UPE_Payment_Method subclasses

 WC_Stripe_UPE_Payment_Method (abstract)
     ├── WC_Stripe_UPE_Payment_Method_CC
     ├── WC_Stripe_UPE_Payment_Method_Klarna
     ├── WC_Stripe_UPE_Payment_Method_SEPA
     └── ... (20+ methods)

3-9: Document the AI agent implementations and capabilities.

This root guidance should explicitly list which AI agents are supported and what they can/can’t do, per the repo learning. Consider a short section near the top.

🧭 Proposed addition
 This file provides guidance to coding agents working in this repository.

+## Supported AI Agents and Capabilities
+
+- List the agent implementations used in this repo (e.g., ChatGPT, Claude, Copilot, etc.).
+- Summarize capability boundaries (code review, refactoring, doc updates, test guidance, etc.).
+- Note any explicit limitations or disallowed actions.
+
 ## Project Overview

Based on learnings: "Document AI agent implementations and their capabilities in AGENTS.md".

@ebinnion

Copy link
Copy Markdown
Contributor Author

Maybe the only thing we would want to add would be explicit instructions for adding changelog entries to changelog.txt and readme.txt, possibly in conjunction with a dedicated script that can take the entry as arguments or piped input. (Our current npm run changelog script is intended as an interactive developer tool.)

I wonder if this should be a pre-commit hook instead?

@Mayisha Mayisha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these. Looks good to me 🎉

@malithsen malithsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the improvements!

Comment thread AGENTS.md

| Task | Command | Notes |
| --- | --- | --- |
| Install dependencies | `composer install && npm install` | Runs Composer install and npm install, which then installs all dependencies. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Running npm install should be enough, as it has a postinstall step that runs composer install

@ebinnion
ebinnion force-pushed the codex/ai-readability-plan-clean branch from 04aeb12 to e3f43e3 Compare February 16, 2026 21:21
ebinnion and others added 5 commits February 16, 2026 15:22
@ebinnion
ebinnion force-pushed the codex/ai-readability-plan-clean branch from e3f43e3 to 9b9778b Compare February 16, 2026 21:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In `@client/CLAUDE.md`:
- Line 1: Add a top-level H1 to CLAUDE.md (e.g., "# CLAUDE") or update
markdownlint config to exclude CLAUDE.md from the MD041 rule; specifically
either insert an H1 as the first line of the file to satisfy first-line-h1, or
add a pattern for CLAUDE.md to the markdownlint rules (e.g., with "MD041": false
for matching files) so the single-line pointer format remains allowed across the
CLAUDE.md files.

In `@includes/AGENTS.md`:
- Line 69: Fix the hyphenation in the phrase "recurring-payment capable methods"
by changing it to the compound adjective "recurring-payment-capable methods"
(and update any other identical occurrences in the same document), ensuring
consistency in AGENTS.md where the phrase appears.

In `@includes/CLAUDE.md`:
- Line 1: CLAUDE.md currently contains only the single-line pointer
"@AGENTS.md", which triggers markdownlint MD041 (first-line-h1); either add a
top-level heading to CLAUDE.md (e.g., "# CLAUDE" followed by the pointer) to
satisfy the rule, or update the markdownlint config to exclude CLAUDE.md (or the
matching glob) from MD041 checks; locate the file CLAUDE.md and choose one of
these fixes and commit the change so the linter no longer reports MD041.

In `@tests/e2e/CLAUDE.md`:
- Line 1: Add a markdownlint exception so CLAUDE.md files with the single-line
pointer "@AGENTS.md" do not trigger MD041: update the linter config
(coderabbit.markdownlint-cli2.jsonc) to add a rule override for MD041 that
ignores files matching the CLAUDE.md pattern (or lines that exactly equal
"@AGENTS.md"), ensuring the linter rule is suppressed for those files instead of
modifying CLAUDE.md; reference the MD041 rule and the CLAUDE.md/@AGENTS.md
pattern when making the change.

Comment thread client/CLAUDE.md Outdated
Comment thread includes/AGENTS.md Outdated
Comment thread includes/CLAUDE.md Outdated
Comment thread tests/e2e/CLAUDE.md Outdated
@ebinnion
ebinnion enabled auto-merge (squash) February 16, 2026 21:27
@ebinnion
ebinnion merged commit 371be44 into develop Feb 16, 2026
45 checks passed
@ebinnion
ebinnion deleted the codex/ai-readability-plan-clean branch February 16, 2026 21:32
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.

4 participants