Skip to content

Commit 2347814

Browse files
committed
feat: add configurable auth schemes and request history features
- Add configurable auth schemes (Bearer, Raw, Basic) for flexible header injection - Implement pattern specificity-based rule precedence (more specific patterns win) - Add multiple rules warning when 2+ rules are active on a page - Add expandable request history with domain-level breakdown in ContextBar - Add per-rule request count badges in RuleCard - Extract stateless components (PageInfo, ActivityStatus, MultipleRulesWarning) - Extract shared utility functions for domain pattern matching - Remove unused SettingsDialog component - Add comprehensive tests for new utilities and components - Add CLAUDE.md with development guidelines
1 parent 040df43 commit 2347814

30 files changed

+1720
-337
lines changed

CLAUDE.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Claude AI Assistant Rules
2+
3+
Guidelines for AI-assisted development in this codebase.
4+
5+
## Code Style & Formatting
6+
7+
- **Biome** for linting and formatting
8+
- Single quotes
9+
- 2 space indentation
10+
- 100 character line width
11+
- Auto-format on save
12+
- **TypeScript** strict mode
13+
- **Pure functions** preferred for testability (extract to `utils/`)
14+
15+
## UI Component Guidelines
16+
17+
- **Use shadcn UI components** (Alert, Button, Dialog, Select, Switch, etc.)
18+
- **Use Lucide icons** for all iconography
19+
- **Extract stateless components** for reusability
20+
- Consistent Tailwind CSS styling
21+
22+
## Architecture Patterns
23+
24+
- **SDK Kit plugin architecture** for background service worker
25+
- **Pure functions** in `utils/` for testability
26+
- **React hooks** for state management (no external state library)
27+
- **Separation of concerns:**
28+
- `background/` - Service worker with SDK Kit plugins
29+
- `panel/` - Side panel UI
30+
- `popup/` - Popup UI
31+
- `options/` - Options page UI
32+
- `shared/` - Shared types and utilities
33+
34+
## Chrome Extension Specifics
35+
36+
- **Manifest V3** patterns
37+
- **`declarativeNetRequest`** API for header injection
38+
- **Priority-based rule ordering** using pattern specificity
39+
- **Storage:**
40+
- `chrome.storage.sync` for rules (synced across devices)
41+
- `chrome.storage.local` for stats (device-specific)
42+
- **⚠️ CRITICAL: New changes must NOT affect permissions**
43+
- Adding new permissions requires Chrome Web Store review
44+
- Check `manifest.json` before making changes that might require new permissions
45+
- If permissions are needed, discuss first before implementing
46+
47+
## Testing Guidelines
48+
49+
- **Vitest** for unit tests
50+
- **Test pure functions** - extract to `utils/` for testability
51+
- **Mock Chrome APIs** in `tests/setup.ts`
52+
- **Colocate tests** with source files (`.test.ts`)
53+
54+
## Git & Versioning
55+
56+
- **Conventional commits** (feat, fix, docs, refactor, test, chore)
57+
- **Manual versioning** (no changesets yet - will add when auto-deploying to Chrome Web Store)
58+
- **Ask before performing git actions** (user preference)
59+
60+
## Code Review Checklist
61+
62+
Before submitting code, ensure:
63+
- ✅ Pure functions extracted for testability
64+
- ✅ Uses shadcn UI components
65+
- ✅ Uses Lucide icons (not emojis)
66+
- ✅ Tests added for new functionality
67+
- ✅ No new permissions required (check `manifest.json`)
68+
- ✅ TypeScript types are correct
69+
- ✅ Follows existing patterns and conventions
70+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auth-header-injector",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Auth HI! - Chrome extension for injecting auth headers. Built with SDK Kit.",
55
"type": "module",
66
"scripts": {
@@ -28,6 +28,7 @@
2828
"@lytics/sdk-kit": "^0.1.1",
2929
"@radix-ui/react-dialog": "^1.1.15",
3030
"@radix-ui/react-label": "^2.1.8",
31+
"@radix-ui/react-select": "^2.2.6",
3132
"@radix-ui/react-slot": "^1.2.4",
3233
"@radix-ui/react-switch": "^1.2.6",
3334
"class-variance-authority": "^0.7.1",

0 commit comments

Comments
 (0)