Skip to content

Improve agent instructions with AGENTS.md as primary file#2593

Merged
wojtekn merged 5 commits intotrunkfrom
update/agent-instructions
Feb 16, 2026
Merged

Improve agent instructions with AGENTS.md as primary file#2593
wojtekn merged 5 commits intotrunkfrom
update/agent-instructions

Conversation

@wojtekn
Copy link
Contributor

@wojtekn wojtekn commented Feb 16, 2026

Related issues

  • Related to improving coding agent effectiveness across the team (PCYsg-1bzA-p2)

Proposed Changes

This PR restructures and enhances the agent instruction files to follow industry best practices and improve coding agent effectiveness:

  • Create AGENTS.md as primary file: Follows industry standard, making instructions accessible to all coding agents (Claude Code, Cursor, Windsurf, etc.)
  • Remove symlink structure: Replaced symlinks with simple @AGENTS.md references in CLAUDE.md and .cursorrules for better cross-platform compatibility (Windows, repo sync)
  • Add Common Pitfalls section: Documents WordPress Playground-specific gotchas and Electron architecture pitfalls that agents commonly encounter
  • Add Git & PR Conventions: Specifies branch naming (add/, update/, fix/, etc.), commit message format, and PR workflow preferences
  • Emphasize critical instructions: Strategic use of MUST/CRITICAL/IMPORTANT keywords to help agents distinguish critical requirements from suggestions

Testing Instructions

  • Verify CLAUDE.md and .cursorrules are regular files (not symlinks) containing @AGENTS.md
  • Verify AGENTS.md exists and contains comprehensive instructions
  • Test with coding agents to ensure they properly load and follow the instructions

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

- Create AGENTS.md as primary instruction file (industry standard)
- Replace CLAUDE.md and .cursorrules symlinks with @AGENTS.md references
- Add Common Pitfalls section with WordPress and Electron-specific gotchas
- Add Git & PR Conventions with branch naming, commit, and PR guidelines
- Emphasize critical instructions with MUST/CRITICAL/IMPORTANT keywords
- Remove docs/ai-instructions.md symlink structure for better cross-platform compatibility
@wojtekn wojtekn self-assigned this Feb 16, 2026
@wojtekn wojtekn requested a review from a team February 16, 2026 09:21
@wojtekn
Copy link
Contributor Author

wojtekn commented Feb 16, 2026

I tested those changes in Cursor and Claude Code and both pick the guidelines correctly.

AGENTS.md Outdated

## Git & PR Conventions

**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`
Copy link
Contributor

Choose a reason for hiding this comment

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

I've adopted a convention that I originally picked up from @bcotrim where I use the Linear issue identifier as a branch prefix. Really clever approach, IMO. Maybe we can instruct the agent to ask for a Linear issue identifier before creating a branch and use it as the branch name prefix?

Copy link
Member

Choose a reason for hiding this comment

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

Let's include that as a second sentence here, something like:

Suggested change
**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`
**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`. When working on a Linear issue (STU-XYZ), include it in the branch name after the verb. Example: `add/stu-123-something-new`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What convention would you use for PRs without a linear issue?

It would be nice to follow one convention as now we use multiple different ways:

CleanShot 2026-02-16 at 10 55 18@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sejas thanks. On second thought, maybe we should drop the add/delete part, or move it to a place after the Linear code without a slash? I always preferred that style, but I'm no longer sure if it helps much.

For example:

  • new-dark-mode
  • improve-agent-instructions
  • fix-login-bug
  • add-logout-button
  • stu-123-update-sync-feature

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that adding the linear issue number as a prefix would be great, the Linear-generated branch names also use this pattern.

I don't have a strong opinion whether having a slash helps or not, I think having a verb at the beginning like add- or add/ helps to clarify the intent of the branch in both cases.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can follow Linear’s suggested branch format, which starts with the Linear ID and then the slug, ideally we can include the verb: stu-123-add-something-new.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 16, 2026

📊 Performance Test Results

Comparing a3fdb14 vs trunk

site-editor

Metric trunk a3fdb14 Diff Change
load 2720.00 ms 2722.00 ms +2.00 ms ⚪ 0.0%

site-startup

Metric trunk a3fdb14 Diff Change
siteCreation 7094.00 ms 6084.00 ms -1010.00 ms 🟢 -14.2%
siteStartup 3917.00 ms 3924.00 ms +7.00 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks @wojtekn for applying this! I believe the main AGENTS.md is a living document that we should update constantly to adapt to our needs, and this PR introduces it. I have tested and confirmed that different agents can see the changes, so I think we can merge it and continue iterating.

Claude Code Cursor using GPT-5.3 Codex
Image Image

Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

I tested the PR with Claude Code, and it loaded Agents.md into context without requiring any tool, and it was able to answer my questions:

Image

Maybe we can mention the paths to AppData and the logs.

## WordPress Studio Paths

### App Data
- **macOS:** `~/Library/Application Support/Studio/appdata-v1.json`
- **Windows:** `C:\Users\<username>\AppData\Roaming\Studio\appdata-v1.json`

### Logs
- **macOS (release):** `~/Library/Logs/Studio/`
- **Windows:** `C:\Users\<username>\AppData\Roaming\Studio\logs\`

### Sites
- **All platforms:** `~/Studio/`

AGENTS.md Outdated

## Git & PR Conventions

**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`
Copy link
Member

Choose a reason for hiding this comment

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

Let's include that as a second sentence here, something like:

Suggested change
**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`
**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`. When working on a Linear issue (STU-XYZ), include it in the branch name after the verb. Example: `add/stu-123-something-new`.

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

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

LGTM and works great. I tested with Claude Code and the Codex app, to check different harnesses.

Claude Code Codex (GPT-5.3)
Image Image

AGENTS.md Outdated

## Git & PR Conventions

**Branches**: Create from `trunk` using dash-separated lowercase names with prefixes: `add/something-new`, `update/feature-xyz`, `delete/something-else`, `fix/foo-bar`, `release/1.7.8`
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that adding the linear issue number as a prefix would be great, the Linear-generated branch names also use this pattern.

I don't have a strong opinion whether having a slash helps or not, I think having a verb at the beginning like add- or add/ helps to clarify the intent of the branch in both cases.

@wojtekn wojtekn merged commit f32716f into trunk Feb 16, 2026
9 checks passed
@wojtekn wojtekn deleted the update/agent-instructions branch February 16, 2026 15:53
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.

6 participants