Skip to content

Commit 9ee8622

Browse files
committed
Add copilot-instructions.md file
1 parent 7ffa85d commit 9ee8622

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## PR review guidelines
2+
3+
When reviewing pull requests:
4+
5+
- Only comment on semantically meaningful issues: bugs, incorrect logic, security problems, accessibility regressions, or API contract violations.
6+
- Skip style, formatting, naming, and whitespace observations — these are enforced by lint and PHPCS.
7+
- Keep each comment short — one or two sentences maximum.
8+
- Do not write long descriptions or summaries of what the code does.
9+
- Do not suggest refactors or improvements unrelated to the PR's stated goal.
10+
- NEVER produce a review body or top-level PR overview comment. The review body MUST be empty. Put findings only in inline comments on specific lines.
11+
12+
## What not to flag
13+
14+
- **Do not speculate about external code.** Verify WordPress, PHP, and Node APIs, function signatures, and version constraints against the diff or repo files (`composer.json`, `package.json`, etc.) before flagging compatibility or contract issues. Do not invent strings, error messages, or behaviour in linked codebases such as WordPress core. If a claim cannot be verified from the diff or repository, do not include it.
15+
- **Do not request refactor of inherited duplication.** If a pattern already exists in the codebase before this PR, do not ask the author to extract a helper or deduplicate. Flag it at most once for awareness.
16+
- **Calibrate edge-case warnings.** Do not flag theoretical edge cases (`Number.MAX_VALUE`, subnormals, inputs that cannot occur given current callers). Flag edge cases only when they correspond to inputs that can plausibly reach the code.
17+
- **Do not request tests** when the surrounding test files are out of scope for the PR. Flag missing tests only when the new behaviour is risky and adding a test fits the diff naturally.
18+
19+
## Gutenberg-specific context
20+
21+
- Do not suggest replacing `@wordpress/data` selectors / actions with local React state — this is the project's intentional state pattern.
22+
- Do not suggest replacing `__()` / `_x()` / `_n()` calls with template literals — these are WordPress i18n functions.
23+
- Do not suggest moving code between `block-editor`, `editor`, and `edit-post` packages without considering the layering rule (`block-editor` is WordPress-agnostic; lower layers must not depend on higher ones).

0 commit comments

Comments
 (0)