Skip to content

Add AI agent onboarding and Copilot coding agent configuration#344

Open
obenland wants to merge 23 commits intotrunkfrom
add/agents-md
Open

Add AI agent onboarding and Copilot coding agent configuration#344
obenland wants to merge 23 commits intotrunkfrom
add/agents-md

Conversation

@obenland
Copy link
Copy Markdown
Member

@obenland obenland commented Mar 24, 2026

Summary

  • Adds AGENTS.md with project overview, build/test/lint commands, repository layout, CI workflow details, and coding conventions
  • Adds CLAUDE.md that references AGENTS.md
  • Adds .github/copilot-instructions.md with full autonomous workflow instructions: reading issues, understanding code history, writing secure code with tests, and validating with Playwright + wp-env
  • Adds .github/workflows/copilot-setup-steps.yml to set up the agent environment (Node 24, PHP 8.3, Composer, Playwright, wp-env)
  • Adds path-specific instructions for PHP, JS, and test files in .github/instructions/
  • Reduces repeated codebase exploration by AI coding agents, helping them produce correct changes faster

Test plan

  • Verify AGENTS.md content is accurate and up to date
  • Verify copilot-instructions.md covers the right workflows and URLs
  • Verify copilot-setup-steps.yml runs successfully (trigger via workflow_dispatch)
  • Verify CI passes (no source changes)

🤖 Generated with Claude Code

Provides agents with project overview, build/test/lint commands,
repository layout, CI checks, and coding conventions so they can
work efficiently without repeated codebase exploration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@obenland
Copy link
Copy Markdown
Member Author

@dd32 This repo feels like a good candidate to experiment with Github's autonomous agents to go through the backlog of (I assume low-to-medium priority) issues, curious what you think?

I'd probably add a layer of copilot-specific instructions to respond to assigned issues and enable MCP access to Playwright or Puppeteer or something so it can spin up wp-env and test its changes.

obenland and others added 3 commits March 24, 2026 14:37
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dd32
Copy link
Copy Markdown
Member

dd32 commented Mar 25, 2026

@obenland Sounds like a sane choice to me. I'm not 100% that all of the backlog are things we want to do, which is why I mostly haven't just let AI loose on many things.

I hadn't yet dug into directing copilot, and I didn't realise it had Playwright available to it (I assumed I'd have to install it into the env), I guess when I've used it I haven't properly prompted CoPilot to use wp-env properly, so it had no ability to use playwright anyway.. Partly due to the complexity of the bootup process for the local environments...

@obenland
Copy link
Copy Markdown
Member Author

I'm not 100% that all of the backlog are things we want to do

Yeah, agreed. If you find the time, maybe you could close some of the obvious-to-you wontfix ones? Obviously low priority. I'd probably assign the agent to individual issues to start.

it had no ability to use playwright anyway. Partly due to the complexity of the bootup process for the local environments

This is mainly what the experiment would be about for me. Can we setup copilot through MCPs and agent instructions to where it can act on issues independently. And as a secondary thought, can it be replicated for other (wp-env-based) repos.

@obenland
Copy link
Copy Markdown
Member Author

Could I ask for your help giving me access to the settings necessary to enabled MCPs for this repo?

@dd32
Copy link
Copy Markdown
Member

dd32 commented Mar 26, 2026

@obenland I don't see any settings related to enabling MCPs, AFAICT they're enabled automatically for copilot? Found them: https://github.com/WordPress/wporg-two-factor/settings/copilot/coding_agent

I've bumped Meta team (which still includes you) from Maintain to Admin on this repo though.

@obenland
Copy link
Copy Markdown
Member Author

Thanks! The setting is within the "Code and automation" group under Copilot > Copilot coding agent, at the bottom of the page.

I added Playwright, will experiment with copilot instructions next

Adds instructions and environment setup so GitHub Copilot coding agents
can work on issues end-to-end: understand the codebase and its history,
write fixes with tests, and validate changes using Playwright and wp-env.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 16:26
@obenland obenland changed the title Add AGENTS.md and CLAUDE.md for AI agent onboarding Add AI agent onboarding and Copilot coding agent configuration Mar 26, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds AI-agent onboarding documentation and GitHub Copilot-specific instruction/config files to reduce repeated repository exploration and standardize local/CI setup expectations.

Changes:

  • Add AGENTS.md and CLAUDE.md for AI agent onboarding and cross-referencing.
  • Add GitHub Copilot instruction files under .github/instructions/ plus .github/copilot-instructions.md.
  • Add a copilot-setup-steps GitHub Actions workflow and ignore .claude/settings.local.json.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CLAUDE.md Adds a reference to AGENTS.md for Claude-based agents.
AGENTS.md Introduces a consolidated project overview, repo layout, commands, CI, and conventions.
.gitignore Ignores local Claude settings file.
.github/workflows/copilot-setup-steps.yml Adds an opt-in workflow to stand up wp-env and run tests/lint.
.github/instructions/tests.instructions.md Adds testing guidance for changes under tests/**.
.github/instructions/php.instructions.md Adds PHP conventions guidance for **/*.php.
.github/instructions/js.instructions.md Adds JS/React conventions guidance for settings/**/*.{js,jsx,ts,tsx}.
.github/copilot-instructions.md Adds broader Copilot agent guidance on architecture, security, and validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

obenland and others added 5 commits March 26, 2026 13:50
The push/pull_request path triggers cause unnecessary CI runs whenever
the workflow file is changed in a PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cache node_modules, Playwright browsers, and Docker images to avoid
re-downloading everything on each agent run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove reference to nonexistent .editorconfig, align codeCoverageIgnore
guidance with phpunit.xml.dist philosophy, and correct mu-plugin label
to network-activated plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

obenland and others added 2 commits March 26, 2026 14:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Only cache images from wp-env containers instead of all local images,
and use nullglob to prevent errors when loading from an empty cache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

obenland and others added 2 commits March 26, 2026 14:24
Drop the ambiguous PHPDoc/covers bullet from PHP instructions.
Pin Playwright version in copilot setup for reproducible builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Playwright is provided by the MCP server, not used as a direct
dependency. No need to install browsers in the setup workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@obenland
Copy link
Copy Markdown
Member Author

@dd32 Are you up for me giving this a try?

@dd32
Copy link
Copy Markdown
Member

dd32 commented Mar 30, 2026

Thanks! The setting is within the "Code and automation" group under Copilot > Copilot coding agent, at the bottom of the page.

Yeah I read this as "Playwright MCP is already enabled"; Rendering there to be no need to add it as a Mcpserver 🤷

The GitHub and Playwright MCP servers are enabled by default.

You can configure your own MCP servers by adding JSON configuration below.

@obenland
Copy link
Copy Markdown
Member Author

Oh, I think you're right! Didn't catch that

@obenland
Copy link
Copy Markdown
Member Author

Test session with the agent.md and copilot instructions: https://github.com/WordPress/wporg-two-factor/tasks/2be2a4ed-b0ae-4246-9d4c-ef2dd0a7e70d

obenland and others added 4 commits March 30, 2026 10:35
Use GitHub repo refs instead of zip downloads for plugins (Gutenberg,
bbPress, WebAuthn provider) to speed up environment setup in CI. The
copilot setup workflow and instructions now use --config=.wp-env.copilot.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nfig

Move GitHub repo refs for plugins and core into the shared .wp-env.json
instead of maintaining a separate copilot-specific config. Simplifies
all wp-env commands by removing --config flags everywhere.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI added a commit that referenced this pull request Mar 30, 2026
obenland and others added 5 commits March 30, 2026 10:59
wp-env validates config strictly and rejects unknown keys. Document the
GitHub repo ref requirement in copilot-instructions.md instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The repo is bbpress/bbPress, not WordPress/bbpress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sjinks/wp-two-factor-provider-webauthn GitHub repo requires
composer install for its vendor/autoload.php. The zip download from
wordpress.org includes built dependencies and works out of the box.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The WebAuthn provider GitHub source needs composer install, so use the
pre-built release zip from GitHub instead. Remove the explicit WordPress
core ref — wp-env's default core download is much faster than cloning
WordPress/WordPress with all its branches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot agents can't download from api.wordpress.org. Use the GitHub
archive zip which is fast (~97s vs ~17min for git clone) and available
inside the Copilot sandbox.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants