bun install # Setup
bun run dev:chrome # Dev (also: dev:firefox, dev:safari)
bun run build:chrome # Build (also: build:firefox, build:safari, build:edge, build:all)
bun run test # Test (also: test:watch, test:ui, test:coverage)
bun run typecheck # Type check
bun run lint # Lint
bun run format # Format
bun run bump # Version bump (patch)
bun run docs:dev # Docs dev server- No
anytype. Useunknown+ narrowing. Use Branded Types for IDs. - No direct
chrome.storagein UI components. UseStorageService. Content scripts (src/pages/content/) are an exception — they usechrome.storagedirectly via ExtGlobal. - No
console.login production. UseLoggerService. - No global variables outside defined Services.
- No magic strings. Use constants/enums for Storage Keys and CSS Classes.
- All CSS classes injected into Gemini DOM must be prefixed
gv-. - All translations must be updated in all 10 locales (
en,ar,es,fr,ja,ko,pt,ru,zh,zh_TW) when adding/modifying i18n keys. - Never modify
dist_*folders directly. - Never commit
.envor secrets. - When adding Material Symbol icons, add the icon name to
icon_names=in the Google Fonts URL insrc/pages/popup/index.html.
bun run typecheck— after any.ts/.tsxchangebun run lint— before finishingbun run test— all tests passbun run build:chrome— builds without error- New features/fixes must include tests
Conventional Commits: <type>(<scope>): <imperative summary>
- Types:
feat,fix,refactor,chore,docs,test,build,ci,perf,style - Scope: short, feature-focused (e.g.,
copy,export,popup) - Summary: lowercase, imperative, no trailing period
- If the commit relates to a GitHub issue or discussion, include
Closes #xxxorFixes #xxxin the commit body
bun run bump # auto-updates package.json, manifest.json, manifest.dev.jsonChangelog required: after bumping, ensure src/pages/content/changelog/notes/ has a .md file for the new version before pushing. Do not skip this step.
Then: commit chore: bump to v{VERSION} → git tag v{VERSION} → git push && git push --tags
- KISS. Implement the minimum interpretation of requirements. Never combine orthogonal features (e.g., "fade" and "thin") without explicit confirmation.
- Backward compatibility is iron law. Zero destructiveness to user data (especially
localStorage). - Data structures first. Eliminate special cases by redesigning data, not adding branches.
- For visual/CSS changes: describe expected rendering, verify alignment/centering/spacing in both light and dark themes, and check external resources (icon fonts, CDN links).
- For ambiguous requirements: implement the minimal version first. Ask before adding scope.
- Services: singletons in
src/core/services/.StorageServiceis single source of truth for persistence. - Content scripts:
src/pages/content/. Each sub-module is self-contained. - UI: functional React components + hooks. Business logic in
features/*/services/or custom hooks, not in UI files. - Types:
src/core/types/common.tsfor StorageKeys and shared types. - Translations:
src/locales/*/messages.json(10 languages). - Injected CSS:
public/contentStyle.css.
| Task | Where |
|---|---|
| Add storage key | src/core/types/common.ts → StorageService.ts → all 10 locales |
| Update translations | src/locales/*/messages.json (all 10) |
| Change DOM injection | src/pages/content/ |
| Modify popup settings | src/pages/popup/components/ |
| Fix cloud sync | src/core/services/GoogleDriveSyncService.ts |
| Add keyboard shortcut | src/core/services/KeyboardShortcutService.ts + types |