Skip to content

Commit b11673b

Browse files
authored
GH#928: docs(agents): expand webfetch and bash-prerequisite guidance (#929)
PR #920 (GH#919) eliminated read:file_not_found and edit:not_read_first patterns. Two patterns persisted with new occurrences since that fix: - webfetch:other (+3): added GitHub URL guidance — use gh CLI, not webfetch; expanded prohibited URL list with BerlinDB docs, npm package docs; added BerlinDB schema research pointer to codebase. - bash:other (+2): added npm install prerequisite check for JS/CSS lint; added xdebug caveat for coverage reports; added git ls-files over find/glob guidance to prevent No-such-file errors on gitignored paths. Fixes #928
1 parent a1c6361 commit b11673b

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,26 @@ The `docs/` directory exists but is not described in the Project Structure secti
212212

213213
### No External URL Fetching
214214

215-
Do **not** use webfetch for WordPress documentation, PHP manual pages, Stripe/PayPal API docs, or any developer documentation URLs — these requests consistently fail.
215+
Do **not** use webfetch for WordPress documentation, PHP manual pages, Stripe/PayPal API docs,
216+
BerlinDB documentation, npm package docs, or any other developer documentation URLs — these
217+
requests consistently fail.
216218

217-
Use the codebase itself instead:
219+
Do **not** use webfetch for GitHub URLs (issues, PRs, raw content, commits). Use the `gh` CLI
220+
instead:
221+
222+
```bash
223+
gh issue view 123 --repo Ultimate-Multisite/ultimate-multisite
224+
gh pr view 456 --repo Ultimate-Multisite/ultimate-multisite
225+
gh api repos/Ultimate-Multisite/ultimate-multisite/contents/path/to/file
226+
```
227+
228+
Use the codebase itself for API/hook research:
218229

219230
- WordPress functions and hooks → `rg 'function_name'` across `inc/`
220231
- Existing gateway patterns → read `inc/gateways/` directly
221232
- REST API shape → read `inc/apis/` trait files
222233
- Hook reference → `rg 'do_action\|apply_filters'` across `inc/`
234+
- BerlinDB schema → read `inc/database/` directly
223235

224236
### Read Before Edit (Mandatory)
225237

@@ -238,3 +250,13 @@ ls ../wordpress/wp-config.php 2>/dev/null || echo "WordPress dev env not found
238250
```bash
239251
ls vendor/autoload.php 2>/dev/null || composer install
240252
```
253+
254+
`npm run lint:js`, `npm run lint:css`, and `npm run check` require `npm install`. Check before running JS/CSS lint or the combined quality check:
255+
256+
```bash
257+
ls node_modules/.bin/eslint 2>/dev/null || npm install
258+
```
259+
260+
Coverage reports (`--coverage-*` flags) require the xdebug PHP extension (`php -d zend_extension=xdebug`). If xdebug is not installed, omit the coverage flags — tests still run without them.
261+
262+
For file discovery, use `git ls-files '<pattern>'` rather than `find` or glob patterns — only tracked files exist reliably, and gitignored paths (vendor, node_modules, *.xml without .dist) will cause `No such file` errors if accessed directly.

0 commit comments

Comments
 (0)