Version: (Reflects current package version) Status: (e.g., MVP Development, Beta)
Promptly is a free, local-first Chrome extension for intelligent writing assistance. It leverages a local Large Language Model (LLM) via WebLLM to provide on-the-fly suggestions and transformations for selected text, entirely within the user's browser. This ensures maximum user privacy (no data leaves the browser), zero cost, and offline availability.
- Local-First AI: All LLM processing happens directly in the browser via WebLLM. No server calls, no API keys needed.
- Contextual Actions: Provides relevant AI actions based on selected text content (word, sentence, paragraph, code) and the context of the current webpage (e.g., dev docs, social media, email).
- Floating Overlay UI: An unobtrusive chat-like interface appears on text selection, showing available actions and AI responses.
- Markdown Rendering: AI responses are formatted in Markdown with syntax highlighting for code.
- Configuration Popup: Allows users to select LLM models, toggle the extension, and switch themes.
- Privacy Focused: User text selection and data never leave the browser.
- Customizable: Theme selection (Dark Mode) and model choice.
- Unique Visual Identity: Features a retro-modern neo-brutalist design aesthetic.
Promptly follows a robust architecture based on these principles:
- Domain-Driven Design (DDD): Logic is organized into distinct domain modules (
src/modules/) likeinference,selection,actions,configuration, etc., each with clear responsibilities. Seearch.mdfor details. - SOLID Principles: Adherence to Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion principles.
- Clean Code & Conventions: Strict adherence to coding conventions defined in
promptly_conventions_mdc(TypeScript strict mode, specific naming conventions, etc.). - Minimal Dependencies: Relies only on essential libraries (React, TypeScript, WebLLM, Markdown/Highlighting libs). No external UI libraries or state managers.
- Event Bus: Uses an abstracted event bus (
messagingmodule) built on Chrome APIs for all cross-component communication (content script, background, popup). - Local State & Storage: Prefers local React state; uses
chrome.storage.localfor persisting settings and conversation history.
See the Architecture Document (arch.md) for a detailed breakdown.
- Node.js (LTS version recommended)
- pnpm (or npm/yarn, though commands below use pnpm)
- Google Chrome or a Chromium-based browser that supports WebGPU (for optimal model performance).
-
Clone the repository:
git clone <repository-url> cd promptly-chrome-extension
-
Install dependencies:
pnpm install
-
Start the WXT development server:
pnpm dev
This command will:
- Build the extension for development.
- Watch for file changes and automatically reload the extension.
- Output a
promptly-chrome-extension-dev-<browser>directory (e.g.,promptly-chrome-extension-dev-chrome).
-
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" (usually a toggle in the top-right corner).
- Click "Load unpacked".
- Select the generated development directory (e.g.,
.output/chrome-mv3or the specific dev directory mentioned by WXT, check WXT output).
- Open Chrome and navigate to
-
Develop: Make changes to the code. WXT will automatically rebuild and reload the extension in your browser.
-
Build the extension:
pnpm build
This command will:
- Create an optimized production build.
- Generate a
.zipfile in the.outputdirectory, ready for distribution or uploading to the Chrome Web Store.
This project strictly limits external dependencies to:
reactreact-domtypescript@mlc-ai/web-llmreact-markdownreact-highlighthighlight.jswxt(Development Dependency)
No other external UI libraries, state managers, or CSS frameworks are permitted.
All code MUST adhere to the standards defined in the Coding Conventions Document (promptly_conventions_mdc). ESLint and Prettier are configured to help enforce these rules.