Skip to content

Repository files navigation

PromptCraft

PromptCraft Logo

Analyze • Improve • Optimize your AI prompt

A powerful AI prompt engineering tool that analyzes and rewrites prompts for clarity, tone, and effectiveness.

Supports GeminiGroqOpenAIOllama

LicenseNextJSReactTypeScriptSupabase


Demo


Features

Prompt Intelligence

  • Prompt Enhancement — Analyze and rewrite prompts with clarity + completeness scoring
  • Audience Tuning — Adjust tone: Technical, Simple, Executive, Creative, Child

🤖 Multi-Provider AI Support

  • Gemini
  • Groq
  • OpenAI
  • Ollama (local models)

🔍 Prompt Analysis Tools

  • Diff Viewer — Word-level side-by-side comparison
  • Test Prompt — Run prompts directly against LLMs
  • Auto-Tagging — Prompts automatically tagged by type and tone

📚 Prompt Management

  • Prompt History — Full version history with clarity score tracking
  • Folders — Organize prompts into color-coded collections
  • Template Library — Pre-built templates for writing, coding, data analysis, image generation, and more

📊 Insights & Analytics

  • Model usage breakdown
  • Prompt quality averages
  • 14-day activity chart

☁️ Cloud Features

  • Google & GitHub OAuth authentication
  • Privacy mode to skip saving history
  • Cross-device cloud sync via Supabase

Tech Stack

LayerTechnology
FrameworkNext.js 15 (App Router)
UIReact 19, Tailwind CSS 3.4, Radix UI
StateZustand 5 (localStorage + Supabase sync)
DatabaseSupabase PostgreSQL via Prisma 5
AuthAuth.js v5 (Google + GitHub OAuth)
LanguageTypeScript (strict)
Iconslucide-react

🚀 Getting Started

1. Clone & Install

git clone https://github.com/your-username/prompt-enhancer.git
cd prompt-enhancer
npm install

2. Set Up Supabase

  1. Create a project at https://supabase.com

  2. Go to

Project Settings → Database → Connection Pooling
  1. Copy the Transaction Pooler URL (port 6543).

If your password contains special characters like @, encode them as %40.


3. Create the Database Table

Run this query in Supabase SQL Editor.

CREATETABLEIF NOT EXISTS "UserData" (
"id"TEXTNOT NULL DEFAULT gen_random_uuid()::text,
"userId"TEXTNOT NULL,
"entries" JSONB NOT NULL DEFAULT '[]',
"folders" JSONB NOT NULL DEFAULT '[]',
"analytics" JSONB NOT NULL DEFAULT '[]',
"createdAt"TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt"TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT"UserData_pkey"PRIMARY KEY ("id")
);
CREATEUNIQUE INDEXIF NOT EXISTS "UserData_userId_key"ON"UserData"("userId");

4. Configure Environment Variables

Create .env.local

# Auth.jsAUTH_URL=http://localhost:3000AUTH_SECRET=# Google OAuthAUTH_GOOGLE_ID=AUTH_GOOGLE_SECRET=# GitHub OAuthAUTH_GITHUB_ID=AUTH_GITHUB_SECRET=# SupabaseDATABASE_URL=DIRECT_URL=

Generate secret:

npx auth secret

5. Run the Development Server

npm run dev

Open

http://localhost:3000

🔄 How Cloud Sync Works

StateBehavior
Not logged inData stored locally
Logged inData synced from Supabase
ChangesAuto-save after 1.5 seconds
New devicePrompts load automatically

🗂 Project Structure

src
├ app
│ ├ api
│ │ ├ analyze
│ │ ├ analyze-groq
│ │ ├ analyze-openai
│ │ ├ analyze-local
│ │ ├ test-prompt
│ │ └ db/sync
│
│ ├ login
│ └ profile
│
├ components
│ ├ editor
│ ├ analytics
│ ├ api-request
│ ├ history
│ ├ templates
│ └ layout
│
├ store
├ lib
├ types
└ data

🔌 API Routes

RouteDescription
POST /api/analyzeEnhance prompt via Gemini
POST /api/analyze-groqEnhance prompt via Groq
POST /api/analyze-openaiEnhance prompt via OpenAI
POST /api/analyze-localEnhance prompt via Ollama
POST /api/test-promptRun raw prompt against active LLM
GET /api/ollama-testCheck Ollama connectivity
GET /api/db/syncLoad user data from Supabase
POST /api/db/syncSave user data to Supabase

⚠️ Known Limitations (v1.0)

PromptCraft v1.0 is the first public release and is actively being improved.

Improvements in Progress

  • Performance optimization for prompt analysis
  • Improved diff viewer rendering
  • Better error handling for API providers
  • UI responsiveness fixes
  • Expanded analytics metrics

These will be addressed in upcoming releases.

💡 Contributions, feedback, and suggestions are welcome.


🛣 Roadmap

Future improvements planned:

  • Prompt benchmarking system
  • Prompt sharing marketplace
  • Team collaboration
  • Browser extension
  • VS Code extension

🤝 Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Submit a pull request

📜 License

MIT License


⭐ Support the Project

If you find PromptCraft useful:

⭐ Star the repository 🐛 Report issues 💡 Suggest new features

About

Prompt Craft is a multi-LLM prompt optimization tool that automatically analyzes and enhances user prompts to improve response quality. Built with Next.js 15, it supports Gemini, Groq, OpenAI, and Ollama, and includes prompt versioning, diff visualization, templates, analytics, and OAuth login.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages