TreeMap
A free, open-source disk-space visualizer. Squarified treemap, duplicate hunting, disk-full forecasting, and cleanup that only ever moves files to the Trash.
Enhance rough prompts into expert-level outputs using a global hotkey in any app
AI summary · website and README
ProductivityRust · TypeScriptGitHub @Lakshmiyadav65OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Loading the full README. The saved excerpt is shown below.
A system-tray prompt enhancer. Press a global hotkey anywhere on your computer to turn rough prompts into precise ones — works in any app where you can select text.
Built with Tauri 2 + Rust + React + TypeScript.
1. Select rough prompt text in any app (Notepad, Brave, VS Code chat, terminal, anywhere).
2. Press the global hotkey (default Ctrl+Alt+E on Windows, Cmd+Option+E on macOS).
3. PromptAstra captures the selection and runs the Smart Question Engine (see below). The result is pasted back over your selection.Read the full README ↗A system-tray prompt enhancer. Press a global hotkey anywhere on your computer to turn rough prompts into precise ones — works in any app where you can select text.
Built with Tauri 2 + Rust + React + TypeScript.
Ctrl+Alt+E on Windows, Cmd+Option+E on macOS).Think Wispr Flow, but for written prompts to coding agents (Claude Code, Cursor, ChatGPT) instead of voice.
PromptAstra scores the captured input for "enhancement ambiguity" and branches:
score < threshold, or question_mode = Silent, or Shift+hotkey): one LLM call, a small "Enhancing…" pill near your cursor, the enhanced text replaces your selection in ~2–3 seconds.score ≥ threshold, or question_mode = Always ask): a 360px floating card appears with 2–4 chip questions about audience / tone / goal / constraints / format. Pick the most defensible answers (Enter submits, Escape skips, arrow keys navigate), and the enhanced prompt — informed by your answers — replaces your selection.The card's questions are generated by a small Groq model (llama-3.1-8b-instant) in parallel with the window opening, with a hard 3-second budget. If generation fails, times out, returns fewer than 2 valid items, or malformed JSON, the card falls back to a domain-specific static question bank so you always see questions within the latency budget.
| Phase | Status |
|---|---|
| 1 — Tray icon + Quit | done |
2 — Global hotkey (Ctrl+Alt+E) | done |
| 3 — Clipboard capture / replace | done |
| 4 — LLM integration (Groq + Llama 3.3 70B) | done |
| 5 — Floating "Enhancing…" status pill | done |
| 6 — Settings window (API key, hotkey rebind, test connection) | done |
| 7 — Smart Question Engine (scorer + LLM-generated question card + static fallback) | done |
| 8 — Cross-platform polish, code-signing, auto-update | partial / future |
The core round-trip works on Windows for both the silent fast-path (Ctrl+Alt+E on well-constrained inputs) and the question-card path (ambiguous inputs trigger a 360px chip card that gathers context before enhancement). macOS support exists in code but is untested. See docs/eval-protocol.md for the V1 quality eval that should be run before public ship.
The synthetic-input dispatch may be blocked by Electron-based apps that debounce or filter WM_KEYDOWN events. Running PromptAstra as administrator can sometimes work around UIPI-related blocks. To be expanded with real-world data once more users test it.
The repository is split into three top-level folders:
| Folder | Contents |
|---|---|
frontend/ | The React/Vite desktop UI + all Node tooling (this is where you run npm commands). |
backend/ | The Rust/Tauri core (backend/src-tauri/), the system backend/prompts/, the Supabase cloud backend (supabase/), and scripts/. |
landing/ | The marketing/landing site deployed to Vercel (was web/). |
git clone https://github.com/Lakshmiyadav65/Perfectprompt.git
cd Perfectprompt/frontend
npm install
All
npm/tauricommands are run fromfrontend/. Thetauriscript transparently switches intobackend/to find the Rust project, and Tauri'sbeforeDevCommandbuilds the frontend back infrontend/.
Create a .env file at the project root (or copy .env.example) and paste your key:
GROQ_API_KEY=gsk_your_key_here
The .env file is gitignored — your key never gets committed.
You can also set the key via the Settings window after launching the app — it gets stored in settings.json under the app's config directory (%APPDATA%\com.promptforge.app\ on Windows). The env var takes precedence if both are set.
cd frontend
npm run tauri dev
The first build is slow (~2 minutes — pulling and compiling Rust dependencies). Subsequent rebuilds are 5–30 seconds.
You should see:
[env] loaded …/.env and [hotkey] registered: CommandOrControl+Alt+E.fix the dashboard in Notepad and select it).Ctrl+Alt+E.Shift while pressing the hotkey to skip the card for a single invocation, regardless of mode.npm run tauri dev prints structured timing lines to the console — handy when measuring the PRD §12 targets:
[capture] 17 chars captured in 280ms
[pipeline] score=0.70 mode=Adaptive threshold=0.60 → card
[latency] card path hotkey→shown=420ms (PRD §12 target <600ms)
[latency] fetch_question_card_session ready in 1850ms (source=llm, 3 question(s), PRD §12 target <3s)
[clarify] submit_question_card_answers: 2 answer(s)
[latency] submit→pasted=2210ms (PRD §12 latency budget for the enhance call is 1.5–3s)
Fire the hotkey 10–20 times across a range of inputs and grep the dev console for [latency] lines to estimate p95. The full quality + latency eval protocol is in docs/eval-protocol.md.
cd frontend
npm run tauri build
Output:
backend/src-tauri/target/release/perfectprompt.exe plus an MSI installer in backend/src-tauri/target/release/bundle/msi/..app bundle and .dmg in backend/src-tauri/target/release/bundle/.The binary is not code-signed — Windows SmartScreen / macOS Gatekeeper will warn on first run. v1 ships unsigned by design; signing is deferred to v2.
frontend/src/
├── components/
│ ├── StatusIndicator.tsx + .css ← Phase 5: floating "Enhancing…" pill (silent path)
│ ├── Settings.tsx + .css ← Phase 6: API key, hotkey, Smart Question Engine UI
│ └── QuestionCard.tsx + .css ← Phase 7: 360px chip card (Smart Question Engine)
└── App.tsx ← hash routing: #/status, #/settings, #/question-card
backend/src-tauri/src/
├── main.rs ← entry point
├── lib.rs ← plugin registration + setup hook + AppState
├── tray.rs ← Phase 1: system tray icon + menu
├── hotkey.rs ← Phase 2: registers main combo AND Shift-bypass combo
├── clipboard.rs ← Phase 3: capture/replace via Win32 SendInput
├── enhance.rs ← single LLM call (call_llm), bundled prompt loader
├── pipeline.rs ← orchestrator — Stages A→B→C→D→E→F
├── intake.rs ← Stage A: normalize, length gate, adversarial regex
├── cache.rs ← Stage B: LRU keyed on intake fingerprint
├── router.rs ← Stage C: domain + complexity + ambiguity → route
├── validate.rs ← Stage E: strip preambles/fences, reject bad output
├── trace.rs ← Stage F: JSONL log to <app_data>/traces/YYYY-MM-DD.jsonl
├── status_window.rs ← position pill near cursor
├── settings.rs ← persist & expose Tauri commands
├── question_bank.rs ← domain classifier + complexity scorer + static bank
├── generation.rs ← parallel LLM question generation (llama-3.1-8b)
└── clarify.rs ← question-card IPC + [CONTEXT] block assembly
backend/prompts/
├── code-enhancer.md ← system prompt for the Code route (~340 words)
├── writing-enhancer.md ← system prompt for the Writing route (~390 words)
├── generic-enhancer.md ← system prompt for the Generic route (~290 words)
└── questions-system-prompt.md ← dedicated prompt for parallel question generation
When the user presses the hotkey:
Capture (clipboard.rs::capture_selection) — the trickiest part on Windows:
GetAsyncKeyState(VK_CONTROL) and GetAsyncKeyState(VK_MENU) for the user's hotkey modifiers to release. Real users hold the hotkey for 250–450 ms after pressing, and a fixed-time settle delay isn't long enough.SendInput directly (the Windows path bypasses enigo because Key::Unicode produces WM_CHAR, which doesn't trigger the Ctrl+C shortcut).Show indicator (status_window.rs) — show the "Enhancing…" pill near the cursor. Window is hidden until needed.
Pipeline (pipeline.rs) — runs the six-stage pipeline (intake → cache → router → LLM → validate → deliver). The LLM stage is a single call via enhance.rs::call_llm to Groq's OpenAI-compatible endpoint with a route-specific system prompt and the captured text wrapped in <input> tags. 30s timeout.
Replace (clipboard.rs::replace_selection) — write the enhanced text to the clipboard and synthesize Ctrl+V.
Hide indicator — fired in a finally-style branch regardless of success or failure.
enigo's Key::Unicode('c') sends WM_CHAR (text input), not WM_KEYDOWN with VK_C. With Ctrl held, only the latter triggers a Copy shortcut. We bypass enigo on Windows and call SendInput directly.tokio::time::sleep(250ms) looks fine in isolated testing but breaks for many real users who hold their hotkey for 300–500ms while reading the screen.Open via the tray menu → Settings.
settings.json.Ctrl+Shift+Space), click Save. The new shortcut is registered immediately and persisted, along with its Shift+-modified bypass variant.Adaptive (default — show the card only when the complexity score crosses the threshold), Always ask (card on every hotkey), or Silent (never show the card, go straight to enhance + paste).[CONTEXT] block are kept in memory only by PromptAstra, but they are sent to Groq as part of the LLM call.Shift+hotkey bypass — hold Shift while pressing the hotkey to skip the card for a single invocation, regardless of mode. Same effect as Silent for that one call.Settings live in:
%APPDATA%\com.promptforge.app\settings.json~/Library/Application Support/com.promptforge.app/settings.jsonThe file is plain JSON, only readable by the current user (standard file ACLs). Same security model as .env. Schema:
{
"hotkey": "CommandOrControl+Alt+E",
"api_key": "gsk_...", // omit / null to fall back to $GROQ_API_KEY
"question_threshold": 0.6, // [0.0, 1.0]; only used in Adaptive mode
"question_mode": "adaptive", // "adaptive" | "always_ask" | "silent"
"remembered_contexts": {} // reserved for V2 cross-session memory
}
Missing fields fall back to the defaults shown above, so older settings.json files keep loading.
The .env file overrides the saved API key when both are set — useful for development where you want the key in the project directory rather than the user-config directory.
The actual product lives in backend/prompts/. Everything else is plumbing.
Three route-specific prompts (one is loaded per LLM call by the orchestrator, based on the router's decision):
backend/prompts/code-enhancer.md — Code route. Rewrites rough coding requests into precise prompts for a coding agent. Tightens explicit asks; redirects vague verbs to "investigate first". Never invents filenames, libraries, or APIs.backend/prompts/writing-enhancer.md — Writing route (emails, blog posts, tweets). Dominant rule: placeholder discipline. Missing facts ({recipient_name}, {reasons_team_chose_postgres}, {company_one_liner}) stay as placeholders rather than getting invented.backend/prompts/generic-enhancer.md — catch-all route (summarise, translate, explain). Critical rule: never perform the task; only rewrite the request as a spec.Plus one prompt for the parallel question-generation call:
backend/prompts/questions-system-prompt.md — emits 2–4 clarifying-question JSON for the question-card. Loaded by generation.rs; out of scope for the enhancement pipeline.The Step 7 conflict resolution between the brief's "delete the old meta-prompt" rule and the "don't touch the parallel question-gen call" rule produced this dedicated questions prompt. See docs/migration-report.md for the full decision trail. docs/eval-protocol.md is the script to validate any rewrite empirically.
llama-3.3-70b-versatile. The question card adds one extra llama-3.1-8b-instant call per non-silent invocation, so plan accordingly when running the eval.remembered_contexts field in settings.json is reserved for the V2 persistent variant.This is a personal project, but if you want to:
clipboard.rs has a non-Windows branch that uses enigo. Will need real testing on Apple Silicon and Intel.Proprietary — All Rights Reserved. See LICENSE.