Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ build-types/
# AI files
.gemini/
.claude/
AGENTS.md
GEMINI.md
CLAUDE.md

Expand Down
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AGENTS.md

Start with [CONTRIBUTING.md](CONTRIBUTING.md). Read the others when the task needs them:

- [docs/DEVELOPER_GUIDE.md](docs/DEVELOPER_GUIDE.md): adding an experiment, hooks, asset loading.
- [docs/ARCHITECTURE_OVERVIEW.md](docs/ARCHITECTURE_OVERVIEW.md): the full directory tree.
- [docs/TESTING.md](docs/TESTING.md): what to test, and at which level.

## Layout

```
includes/ PHP, PSR-4 under WordPress\AI (Experiments/, Abilities/, REST/, Settings/ ...)
src/ JS and TS built by wp-scripts
routes/ Admin pages built by wp-build
tests/ Integration/ (PHPUnit), e2e/ (Playwright), e2e-testing/ (fixture plugin)
docs/ Developer docs, plus one page per experiment in docs/experiments/
```

## Scripts

Prefer the npm scripts in `package.json` over calling tools directly. The PHP ones run inside the `wp-env` test environment.

```bash
npm run wp-env:test start # Start the test environment
npm run build # Build JS and CSS
npm run lint:php # PHPCS
npm run lint:php:stan # PHPStan
npm run lint:js && npm run typecheck
npm run test:php # PHPUnit
npm run test:e2e # Playwright
```

## Code style

- **Keep comments short.** A docblock is the one-line summary plus the tags [CONTRIBUTING.md](CONTRIBUTING.md#documentation-standards) requires. Comment only a non-obvious why, in one sentence. Don't restate the code, narrate the next line, or record history.
- **Test behavior, not wiring.** Don't add tests that only check a hook is attached, a menu label, or a fixed array. Reuse the existing fixture plugin in `tests/e2e-testing/` before adding a new one.

## Pull requests

Fill in every section of the PR template, including the AI disclosure.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ The following naming conventions must be followed for consistency and autoloadin

### General rules

- Keep docblocks short: a one-line summary and the required tags. Add a sentence only to explain a non-obvious reason, and don't restate what the code does.
- All descriptions must end with a period.
- Use `@since x.x.x` for new code (version will be updated on release).
- Place `@since` tags below the description and above `@param` tags, with blank comment lines around it.
Expand Down
Loading