Skip to content

Commit 817c8de

Browse files
Improve AGENTS.md
1 parent 9ed7fa8 commit 817c8de

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The project uses Preact (for React-like components), SCSS (for styling), and Web
7474

7575
### Manual Browser Extension Testing (CRITICAL)
7676

77-
This browser extension has no automated tests, so manual testing is essential:
77+
This browser extension includes automated unit tests, but manual browser extension testing is still essential:
7878

7979
1. **Load Extension in Browser:**
8080
- Chrome: Go to `chrome://extensions/`, enable Developer Mode, click "Load unpacked", then select the folder `build/chromium/` (the folder must contain `manifest.json`).
@@ -141,7 +141,10 @@ Usage notes:
141141
- ALWAYS run `npm run lint` before committing - CI will fail otherwise
142142
- ALWAYS run `npm run pretty` to format code consistently
143143
- ESLint configuration in `.eslintrc.json` enforces React/JSX standards
144-
- Prettier configuration in `.prettierrc` handles formatting
144+
- Prettier configuration in `.prettierrc` handles formatting (100 char width, no semicolons, single quotes, trailing commas)
145+
146+
✅ Good: `import Browser from 'webextension-polyfill'` (single quotes, no semicolon)
147+
❌ Bad: `import Browser from "webextension-polyfill";` (double quotes, semicolon)
145148

146149
- Naming conventions: component directories use PascalCase; feature folders use kebab-case; entry files are typically `index.jsx` or `index.mjs`
147150
- Avoid heavy dependencies; if necessary, justify and keep bundle size under control
@@ -166,6 +169,7 @@ Usage notes:
166169
- Commit subject: imperative, capitalize first word; separate subject/body with a blank line; wrap at ~72 characters; explain what and why.
167170
- PRs: link related issues, summarize scope/behavior changes; include screenshots for UI changes.
168171
- Note i18n updates in PR description when `src/_locales/` changes.
172+
- If any validation step is skipped, document the reason and the skipped check(s) in the PR description (see `Critical Validation Steps` below).
169173

170174
### Directory Structure
171175

@@ -204,7 +208,7 @@ src/
204208

205209
## Localization
206210

207-
- Source of truth: `src/_locales/en/main.json`; do not change keys
211+
- Source of truth: `src/_locales/en/main.json`; do not change existing keys (only add new ones)
208212
- Add new strings to `en/main.json` first, then propagate to other locales
209213
- Register new locales in `src/_locales/resources.mjs`
210214
- Preserve placeholders and product names; keep punctuation/quotes intact
@@ -240,6 +244,8 @@ The extension supports multiple AI providers:
240244
- Updating API integration: Modify files in `src/services/apis/`
241245
- Adding new UI component: Create in `src/components/`
242246

247+
**Note:** Ask before deleting/renaming files, modifying build config/manifests, or making changes that affect multiple site adapters. If the user explicitly requests one of these changes, proceed and document scope and risk in the current workflow handoff output, and in the PR summary when applicable.
248+
243249
## Time Expectations
244250

245251
- Do not interrupt builds or long-running commands unless they appear hung or unresponsive.
@@ -252,12 +258,10 @@ The extension supports multiple AI providers:
252258

253259
## Critical Validation Steps
254260

255-
1. ALWAYS run `npm run build` after any code changes
256-
2. ALWAYS manually load and test the built extension in a browser (no automated testing available)
257-
3. ALWAYS verify the build creates expected file structure (non-empty bundles, no missing files)
258-
4. ALWAYS test core extension functionality (popup, content script injection, keyboard shortcuts)
259-
260-
Always build and manually test the extension in a browser before considering any change complete. Simply running the build is NOT sufficient - you must load the extension and test actual functionality.
261+
1. General changes (any change not covered by Step 2 or Step 3): run `npm test` and `npm run build`, verify expected build artifacts, and run manual browser smoke tests. If changes include `safari/**`, also run `npm run build:safari` on macOS. If macOS is unavailable for those changes, document the skip reason in PR validation notes.
262+
2. Behavior-adjacent localization changes (`src/_locales/**` only): run `npm run build` and manual browser smoke tests. Use this step only when all changed files are under `src/_locales/**`.
263+
3. Docs-only changes (`*.md`, `screenshots/**`): build/manual browser tests may be skipped, but the PR description must include `Validation skipped: docs/screenshots-only change; no runtime files touched.`
264+
4. If changes span multiple categories, apply the strictest applicable step (runtime > localization > docs/screenshots); when in doubt, treat the change as runtime-impacting and execute the full validation flow.
261265

262266
---
263267

0 commit comments

Comments
 (0)