Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PromptPilot

Better prompts, Better results. Transform your AI interactions with smarter, more effective prompts - Better input, better output.

A Chrome extension that enhances your prompts for ChatGPT, Claude, and Gemini. Choose between 100% local AI processing (no API keys needed) or Gemini API (faster, more powerful).

Chrome Web Store License: MIT Open Source

✨ Features

Dual Processing Modes

  • Local AI (WebLLM) - 100% private, no API keys, works offline
  • Gemini API - Faster responses, more powerful enhancements (optional)

Core Capabilities

  • Universal Platform Support - Works seamlessly on ChatGPT, Claude, and Gemini
  • One-Click Enhancement - Transform prompts instantly with structured output
  • Privacy First - Local processing option keeps your prompts on your device
  • Beautiful UX - Smooth animations, real-time feedback, intuitive interface
  • Free Forever - No subscriptions, no usage limits, no catch

Privacy & Security

  • Zero Data Collection - We don't collect, store, or track anything
  • Local Storage Only - All data stored in your browser
  • Open Source - Full transparency, review the code yourself
  • Secure API Key Storage - Encrypted local storage (if using Gemini API)

πŸš€ Quick Start

For Users

  1. Install from Chrome Web Store

  2. Choose Your Mode

    • Local AI: No setup needed, just start using!
    • Gemini API: Add your API key in the extension popup (optional)
  3. Start Enhancing

    • Navigate to ChatGPT, Claude, or Gemini
    • Type your prompt
    • Click "✨ Enhance"
    • Review and use the enhanced prompt

For Developers

  1. Clone the Repository

    git clone <repository-url>
    cd add-in
  2. Install Dependencies

    npm install
  3. Build the Extension

    npm run build
  4. Load in Chrome

    • Open chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the dist/ directory
  5. Development Mode

    npm run dev  # Watch mode for development

πŸ“– Usage

Basic Usage

  1. Navigate to any supported AI platform:

  2. Type your prompt in the text area

  3. Click the "✨ Enhance" button that appears

  4. Review the enhanced, structured prompt:

    • Task: Clear objective
    • Context: Relevant background
    • Instructions: Detailed guidelines
    • Output Format: Desired structure
  5. Choose an action:

    • Replace: Replace original prompt with enhanced version
    • Copy: Copy enhanced prompt to clipboard
    • Close: Dismiss the enhancement UI

API Key Setup (Optional - Gemini API Mode)

  1. Get a free Gemini API key from Google AI Studio
  2. Open the extension popup
  3. Enter your API key
  4. Click "Save Key"
  5. Enjoy faster, more powerful enhancements!

πŸ› οΈ Development

Project Structure

add-in/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/                  # Shared modules
β”‚   β”‚   β”œβ”€β”€ constants.js      # Configuration constants
β”‚   β”‚   β”œβ”€β”€ platform.js       # Platform detection logic
β”‚   β”‚   β”œβ”€β”€ webllm.js         # WebLLM engine management
β”‚   β”‚   β”œβ”€β”€ gemini.js         # Gemini API client
β”‚   β”‚   β”œβ”€β”€ ui.js             # UI components and utilities
β”‚   β”‚   └── utils.js           # General utility functions
β”‚   β”œβ”€β”€ contentScript.js      # Main content script (runs on AI platforms)
β”‚   β”œβ”€β”€ service_worker.js     # Background service worker
β”‚   β”œβ”€β”€ popup.js              # Extension popup script
β”‚   β”œβ”€β”€ popup.html            # Extension popup UI
β”‚   β”œβ”€β”€ options.js            # Options page script
β”‚   β”œβ”€β”€ options.html          # Options page UI
β”‚   β”œβ”€β”€ summary.html          # Summary page (fallback)
β”‚   β”œβ”€β”€ privacy.html          # Privacy policy page
β”‚   └── icon*.png             # Extension icons (16, 48, 128)
β”œβ”€β”€ public/
β”‚   └── logo1.png             # Source logo
β”œβ”€β”€ .github/                   # GitHub templates
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   └── pull_request_template.md
β”œβ”€β”€ manifest.json              # Extension manifest (Chrome Web Store)
β”œβ”€β”€ package.json               # Dependencies and scripts
β”œβ”€β”€ build.js                   # Build script (esbuild)
β”œβ”€β”€ LICENSE                    # MIT License
└── README.md                  # This file

Build Process

The extension uses esbuild to bundle code and create a production-ready build:

npm run build      # Production build (minified)
npm run dev        # Development build (watch mode)

Build Output:

  • Bundled JavaScript files in dist/src/
  • Copied HTML, manifest, and assets
  • Optimized for production

Architecture

Content Script (contentScript.js)

  • Detects AI platform pages (ChatGPT, Claude, Gemini)
  • Injects "Enhance" button near text input fields
  • Handles prompt enhancement UI
  • Manages WebLLM and Gemini API integration
  • Processes user interactions (click, copy, replace)

Service Worker (service_worker.js)

  • Manages WebLLM engine lifecycle
  • Handles model download and caching
  • Processes extension messages
  • Manages storage operations

Popup (popup.js / popup.html)

  • API key management (Gemini API mode)
  • Extension information and capabilities
  • Simple, focused interface

Options Page (options.js / options.html)

  • AI method selection (Local AI vs Gemini API)
  • Settings management
  • Privacy information

Key Modules

lib/constants.js

  • Model configuration
  • UI dimensions and styles
  • Platform selectors
  • Storage keys
  • System prompts

lib/platform.js

  • Platform detection (ChatGPT, Claude, Gemini)
  • Text extraction from platform-specific elements
  • Textarea finding logic

lib/webllm.js

  • WebLLM engine initialization
  • Model download and caching
  • Progress tracking
  • Engine state management

lib/gemini.js

  • Gemini API client
  • SSE stream parsing
  • Error handling
  • API request management

lib/ui.js

  • UI element creation
  • Enhancement modal management
  • Styling utilities
  • Button state management

lib/utils.js

  • Error message formatting
  • Extension context validation
  • Safe Chrome API wrappers
  • HTML escaping

πŸ”§ Configuration

Model Configuration

Local AI (WebLLM):

  • Model: gemma-2-2b-it-q4f16_1-MLC-1k
  • Location: src/lib/constants.js - MODEL_ID
  • First download: ~2-3GB (one-time)
  • Cached in IndexedDB

Gemini API:

  • Model: gemini-2.5-flash-lite
  • Location: src/lib/gemini.js - GEMINI_MODEL
  • Requires API key from Google AI Studio

Permissions

The extension requires:

  • storage - Store user preferences and API key locally
  • host_permissions - Access to AI platform domains and Gemini API

Note: The extension uses content scripts (declared in manifest.json) which have automatic DOM access. No activeTab, tabs, or scripting permissions are needed.

See CHROME_STORE_PRIVACY_JUSTIFICATIONS.md for detailed permission justifications.

πŸ§ͺ Testing

Manual Testing

  1. Test on Each Platform:

  2. Test Both Modes:

    • Local AI (WebLLM) - No API key
    • Gemini API - With API key
  3. Test Features:

    • Prompt enhancement
    • Copy functionality
    • Replace functionality
    • Error handling
    • UI responsiveness

Browser Requirements

  • Chrome 113+ or Edge 113+ (WebGPU support required)
  • For Chrome 123, enable: chrome://flags/#enable-experimental-web-platform-features
  • 4GB+ RAM recommended
  • Stable internet connection for initial model download (Local AI mode)

πŸ› Troubleshooting

WebGPU Not Supported

  • Update to Chrome 113+ or Edge 113+
  • Enable chrome://flags/#enable-experimental-web-platform-features
  • Restart browser

Model Loading Issues (Local AI)

  • Ensure stable internet connection for first download
  • Check browser console for errors
  • Clear extension storage and retry
  • Verify WebGPU is enabled

Gemini API Issues

  • Verify API key is correct
  • Check API key has proper permissions
  • Ensure internet connection is active
  • Check browser console for error messages

Extension Not Working

  • Reload the extension (chrome://extensions)
  • Refresh the AI platform page
  • Check browser console for errors
  • Verify you're on a supported platform

πŸ“ Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Add comments for complex logic
  • Test on all supported platforms
  • Update documentation as needed
  • Ensure error handling is robust

πŸ—ΊοΈ Roadmap

Coming Soon (v2.0)

  • Personalized Prompt Personas
    • Example-Oriented Persona
    • Essay Persona
    • Depth-Focused Persona
    • Concise Persona
    • Creative Persona
    • Technical Persona
    • Business Persona

Future Features

  • Prompt templates library
  • Prompt history and management
  • Custom enhancement rules
  • Keyboard shortcuts
  • Batch processing
  • Team collaboration features

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • WebLLM by MLC AI for local LLM inference
  • Google Gemini API for API-based enhancement
  • Chrome Extensions team for the excellent platform

πŸ“ž Support

  • Issues: GitHub Issues
  • Documentation: See DEVELOPER.md for detailed developer docs
  • Privacy: See src/privacy.html for privacy policy

Made with ❀️ for the AI community

About

No description, website, or topics provided.

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages