Improve agent instructions with AGENTS.md as primary file#2593
Improve agent instructions with AGENTS.md as primary file#2593
Conversation
- 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
|
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` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Let's include that as a second sentence here, something like:
| **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`. |
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
📊 Performance Test ResultsComparing a3fdb14 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
epeicher
left a comment
There was a problem hiding this comment.
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 |
|---|---|
![]() |
![]() |
sejas
left a comment
There was a problem hiding this comment.
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:
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` |
There was a problem hiding this comment.
Let's include that as a second sentence here, something like:
| **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`. |
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` |
There was a problem hiding this comment.
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.





Related issues
Proposed Changes
This PR restructures and enhances the agent instruction files to follow industry best practices and improve coding agent effectiveness:
@AGENTS.mdreferences in CLAUDE.md and .cursorrules for better cross-platform compatibility (Windows, repo sync)add/,update/,fix/, etc.), commit message format, and PR workflow preferencesTesting Instructions
@AGENTS.mdPre-merge Checklist