Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

PromptPilot

PromptPilot is a context-aware AI prompt enhancer Chrome extension that improves user prompts using the current prompt + recent chat context.

It works with:

  • ChatGPT
  • Claude
  • Gemini
  • Perplexity

The extension reads the current prompt and recent visible messages, sends them to a FastAPI backend, analyzes the context, and returns a sharper, goal-focused optimized prompt.


Features

  • Context-aware prompt optimization
  • Prompt scoring system
  • Detects vague prompts
  • One-click prompt replacement
  • Copy optimized prompt
  • Multi-platform support
  • Privacy-focused design
  • Optional OpenAI-powered optimization
  • Local backend support

Tech Stack

Frontend

  • Chrome Extension Manifest V3
  • JavaScript
  • HTML/CSS

Backend

  • Python
  • FastAPI
  • Pydantic

Optional AI

  • OpenAI API
  • Ollama

Project Structure

promptpilot/
├── backend/
│   ├── requirements.txt
│   ├── Dockerfile
│   └── app/
│       ├── main.py
│       ├── schemas.py
│       ├── config.py
│       ├── context_extractor.py
│       ├── prompt_analyzer.py
│       ├── prompt_optimizer.py
│       ├── llm_optimizer.py
│       └── privacy.py
│
└── extension/
    ├── manifest.json
    ├── content.js
    ├── styles.css
    ├── popup.html
    ├── popup.js
    └── platforms/
        ├── chatgpt.js
        ├── claude.js
        ├── gemini.js
        └── perplexity.js

Folder Overview

backend/

Handles:

  • prompt analysis
  • context extraction
  • optimization
  • scoring
  • AI integration

Important Files

File Purpose
main.py FastAPI entry point
schemas.py API request/response models
context_extractor.py Extracts recent chat context
prompt_analyzer.py Detects weak/vague prompts
prompt_optimizer.py Rule-based optimization
llm_optimizer.py OpenAI-powered optimization
privacy.py Removes sensitive data

extension/

Chrome extension frontend.

Important Files

File Purpose
manifest.json Extension configuration
content.js Main extension logic
styles.css Floating widget UI
popup.html Popup UI
popup.js Extension settings
platforms/ Platform-specific DOM handlers

System Flow

User Types Prompt
        │
        ▼
Chrome Extension Reads:
- Current Prompt
- Recent Messages
        │
        ▼
FastAPI Backend
        │
        ▼
Context Extraction
        │
        ▼
Prompt Analysis
        │
        ▼
Prompt Optimization
        │
        ▼
Return:
- Optimized Prompt
- Score
- Issues
        │
        ▼
Extension Floating Panel
        │
        ▼
Replace Prompt / Copy

Local Setup

1. Clone Repository

git clone https://github.com/yourusername/promptpilot.git

cd promptpilot

2. Backend Setup

cd backend

python -m venv venv

Windows

venv\Scripts\activate

Mac/Linux

source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Run backend:

uvicorn app.main:app --reload --port 8000

Backend runs at:

http://localhost:8000

3. Load Extension

Open:

chrome://extensions

Enable:

Developer Mode

Click:

Load unpacked

Select:

promptpilot/extension

Testing

Test Backend

Open:

http://localhost:8000/health

Expected:

{
  "status": "ok"
}

Test Extension

  1. Open ChatGPT
  2. Type a prompt:
how to deploy this
  1. Click:
Improve Prompt

Expected:

  • optimized prompt appears
  • score appears
  • Replace Prompt works
  • Copy works

Deployment

Local Version

Chrome Extension
        │
        ▼
Local FastAPI Backend

No server cost.


Chrome Web Store

Steps:

  1. Build extension
  2. Add privacy policy
  3. Add screenshots
  4. Zip extension folder
  5. Upload to Chrome Web Store
  6. Submit for review

Future Improvements

  • LangGraph agents
  • Prompt history
  • Hallucination detection

Vision

PromptPilot aims to become:

“Grammarly for AI prompts”

A tool that automatically transforms weak prompts into high-quality context-aware prompts.

About

Prompt enhancer chrome extension

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors