Guidelines for AI-assisted development in this codebase.
- Biome for linting and formatting
- Single quotes
- 2 space indentation
- 100 character line width
- Auto-format on save
- TypeScript strict mode
- Pure functions preferred for testability (extract to
utils/)
- Use shadcn UI components (Alert, Button, Dialog, Select, Switch, etc.)
- Use Lucide icons for all iconography
- Extract stateless components for reusability
- Consistent Tailwind CSS styling
- SDK Kit plugin architecture for background service worker
- Pure functions in
utils/for testability - React hooks for state management (no external state library)
- Separation of concerns:
background/- Service worker with SDK Kit pluginspanel/- Side panel UIpopup/- Popup UIoptions/- Options page UIshared/- Shared types and utilities
- Manifest V3 patterns
declarativeNetRequestAPI for header injection- Priority-based rule ordering using pattern specificity
- Storage:
chrome.storage.syncfor rules (synced across devices)chrome.storage.localfor stats (device-specific)
⚠️ CRITICAL: New changes must NOT affect permissions- Adding new permissions requires Chrome Web Store review
- Check
manifest.jsonbefore making changes that might require new permissions - If permissions are needed, discuss first before implementing
- Vitest for unit tests
- Test pure functions - extract to
utils/for testability - Mock Chrome APIs in
tests/setup.ts - Colocate tests with source files (
.test.ts)
- Conventional commits (feat, fix, docs, refactor, test, chore)
- Manual versioning (no changesets yet - will add when auto-deploying to Chrome Web Store)
- Ask before performing git actions (user preference)
Before submitting code, ensure:
- ✅ Pure functions extracted for testability
- ✅ Uses shadcn UI components
- ✅ Uses Lucide icons (not emojis)
- ✅ Tests added for new functionality
- ✅ No new permissions required (check
manifest.json) - ✅ TypeScript types are correct
- ✅ Follows existing patterns and conventions