You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addresses 4 recurring tool failure patterns observed in contributor sessions:
- read:file_not_found (32x): config files use .dist suffix convention, vendor/
and node_modules/ are gitignored and must be installed
- webfetch:other (34x): explicit no-webfetch guidance for WordPress/API docs;
direct agents to search the codebase instead
- edit:not_read_first (24x): mandatory Read-before-Edit reminder
- bash:other (20x): prerequisite checks for wp-cli and composer/npm
Fixes#919
wp db reset --yes &&cd ../wordpress && ./reset.sh # full DB + WordPress reset (requires reset.sh in ../wordpress)
183
183
```
184
+
185
+
## Agent Guidance
186
+
187
+
Recurring error patterns observed in this codebase. Review before starting any session.
188
+
189
+
### File Discovery — `.dist` Config Convention
190
+
191
+
Config files are committed as `.dist` versions; un-suffixed copies are gitignored and may not exist locally:
192
+
193
+
| Tracked (exists) | Local override (gitignored, may be absent) |
194
+
|---|---|
195
+
|`.phpcs.xml.dist`|`.phpcs.xml`|
196
+
|`phpunit.xml.dist`|`phpunit.xml`|
197
+
|`phpstan.neon.dist`|`phpstan.neon`|
198
+
199
+
Always verify a file is tracked before reading it:
200
+
201
+
```bash
202
+
git ls-files 'phpunit.xml*'# shows phpunit.xml.dist, not phpunit.xml
203
+
```
204
+
205
+
The `vendor/` and `node_modules/` directories are gitignored. If they are absent, run:
206
+
207
+
```bash
208
+
composer install && npm install
209
+
```
210
+
211
+
The `docs/` directory exists but is not described in the Project Structure section above — it contains developer documentation markdown files. The `todo/` directory contains task briefs.
212
+
213
+
### No External URL Fetching
214
+
215
+
Do **not** use webfetch for WordPress documentation, PHP manual pages, Stripe/PayPal API docs, or any developer documentation URLs — these requests consistently fail.
216
+
217
+
Use the codebase itself instead:
218
+
219
+
- WordPress functions and hooks → `rg 'function_name'` across `inc/`
- Hook reference → `rg 'do_action\|apply_filters'` across `inc/`
223
+
224
+
### Read Before Edit (Mandatory)
225
+
226
+
The Edit tool **requires** a prior Read call on the same file in the current session. If you attempt to edit without reading first, the tool will fail. Always read the complete target file before editing — even for small changes.
227
+
228
+
### WP-CLI and Bash Prerequisites
229
+
230
+
`wp` commands require the dev WordPress install at `../wordpress`. Check it exists before running:
231
+
232
+
```bash
233
+
ls ../wordpress/wp-config.php 2>/dev/null ||echo"WordPress dev env not found — run ./reset.sh in ../wordpress first"
234
+
```
235
+
236
+
`vendor/bin/phpunit`, `vendor/bin/phpcs`, and `vendor/bin/phpstan` require `composer install`. Check before running test or lint commands:
237
+
238
+
```bash
239
+
ls vendor/autoload.php 2>/dev/null || composer install
0 commit comments