Privacy-focused Chrome extension (Manifest V3) that generates AI-powered LinkedIn replies using WebLLM for on-device inference without external data transmission.
A privacy-focused Chrome extension (Manifest V3) that provides AI-powered LinkedIn reply suggestions running entirely locally using WebLLM for AI inference without sending data to external servers.
**Background Service Worker (`src/background.ts`)**
**LinkedIn Content Script (`src/linkedin-content.ts`)**
**Popup Interface (`src/popup.ts`, `popup.html`)**
```bash
npm install
npm run dev
```
**Development**
```bash
npm run dev # Start development with hot reload (Parcel)
npm run build # Production build with webextension config
npm run clean # Clean build artifacts
```
**Testing**
```bash
npm test # Run full test suite (132+ tests)
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm test -- path/to/test.spec.ts
npm test -- --testNamePattern="pattern"
```
**Code Quality**
```bash
npm run lint # Check code with ESLint (must pass with 0 warnings)
npm run lint:fix # Auto-fix linting issues
npm run type-check # TypeScript type checking (strict mode)
npm run format # Format code with Prettier
```
**Building & Packaging**
```bash
npm run build:script # Full build pipeline with quality checks (./scripts/build.sh)
npm run package # Create distribution packages
npm run zip # Build and package in one command
npm run validate-manifest # Validate manifest.json structure
```
The automated build script performs these steps in order:
1. Validates dependencies are installed
2. Runs TypeScript type checking (strict mode)
3. Executes ESLint checks (must have 0 warnings)
4. Runs full test suite (all tests must pass)
5. Compiles TypeScript to JavaScript
6. Copies static assets to `dist/`
7. Validates `manifest.json` structure
8. Reports build size
**All quality checks must pass before deployment.**
Before committing or deploying:
The extension specifically targets LinkedIn's DOM structure:
When modifying LinkedIn integration:
1. Test on different post types (articles, standard posts, comments, replies)
2. Handle dynamic content loading (LinkedIn uses infinite scroll)
3. Respect LinkedIn's rate limits and UI responsiveness
4. Test with various LinkedIn UI themes (light/dark mode)
5. Verify button injection doesn't break LinkedIn's native functionality
Communication between components uses Chrome runtime messaging:
**Message Types:**
**Example:**
```typescript
chrome.runtime.sendMessage({ type: 'generateReply', postContent, replyContext }, response => {
// Handle response
});
```
Chrome storage API keys:
The background service worker automatically selects models based on:
All AI inference happens on-device using WebLLM:
```bash
npm test
npm run test:watch
npm run test:coverage
npm test -- tests/linkedin-content.spec.ts
```
The test setup (`tests/setup.ts`) provides mocks for:
```
ReplyMate/
├── src/ # Main source code (TypeScript)
│ ├── background.ts # Service worker (AI engine)
│ ├── linkedin-content.ts # Content script (UI injection)
│ ├── popup.ts # Extension popup logic
│ └── popup.html # Popup UI markup
├── tests/ # Test files with Chrome API mocks
│ ├── setup.ts # Jest configuration and mocks
│ └── *.spec.ts # Test suites
├── dist/ # Build output (git-ignored)
├── scripts/ # Build and packaging automation
│ └── build.sh # Full build pipeline
├── docs/ # Architecture and troubleshooting guides
├── icons/ # Extension icons (multiple sizes)
├── manifest.json # Chrome extension manifest
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
```
1. Update model tier configuration in `src/background.ts`
2. Add model ID to fallback hierarchy
3. Update popup UI model selector in `src/popup.ts`
4. Test model loading and inference performance
1. Inspect LinkedIn DOM structure (use DevTools)
2. Update selectors in `src/linkedin-content.ts`
3. Test on multiple post types and UI states
4. Verify no conflicts with LinkedIn's native UI
1. Load unpacked extension from `dist/` directory
2. Open DevTools on LinkedIn page (content script logs)
3. Open DevTools on extension popup (popup logs)
4. Inspect service worker in `chrome://extensions` (background logs)
```bash
npm run build:script
npm run package
npm run zip
```
**Model loading fails:**
**LinkedIn buttons not appearing:**
**Tests failing:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/replymate-local-ai-linkedin-reply-generator/raw