Inspiration
Most people interact with AI the same way every day — typing whatever comes to mind and hoping the model figures out the rest. We noticed that the problem was rarely the model. It was the prompt. Existing enhancers try to fix this by rephrasing what you wrote, but rephrasing a vague prompt just produces a polished vague prompt. The real bottleneck is missing context — things like your academic level, output format, or argument — that the model needs but the user never thinks to provide. We wanted to build something that closes that gap without requiring users to learn prompt engineering.
What it does
Promptly is a Chrome extension that enhances your prompt before you send it. When you click the extension icon on Claude.ai or ChatGPT, it captures your prompt, scrapes your conversation history for context, and runs a multi-round evaluation loop. It figures out exactly what information is missing, asks you only the questions that matter via a floating modal overlay, and uses your answers to rewrite your prompt with full context. One click on "Use this prompt" injects the enhanced version directly into the chat input. The result is a first response that actually does what you needed — without follow-up messages.
How we built it
Promptly is a Manifest V3 Chrome extension built in vanilla JavaScript, bundled with esbuild. The backend logic lives entirely in a service worker (background.js) structured as a message-driven state machine — required for MV3 safety, since service workers can be terminated mid-execution. We use two Claude models via the Anthropic API: Haiku handles the cheap, fast work (seeding profile fields from the raw prompt, evaluating sufficiency, generating survey questions, and mapping survey answers to structured profile fields), while Sonnet handles the final enhancement. The survey UI is a self-contained floating modal injected directly into the host page by content.js, with no dependency on the extension popup. Enhancement criteria and evaluation logic are defined in human-readable .md files loaded at startup, making the system configurable without touching code.
Challenges we ran into
The biggest architectural challenge was MV3's service worker lifecycle. Unlike persistent background pages, MV3 service workers can be terminated at any time — including mid-await. Any in-memory state or loaded criteria files could vanish between message events. We solved this by restructuring the entire backend as a message-driven state machine where each incoming message advances state exactly one step, and by exposing a criteriasReady Promise that all message handlers await before processing, guarding against restart races. A second challenge was preventing the survey from asking questions the user already answered inline — solved by adding a prompt seeding step that runs one Haiku call before evaluation starts to extract whatever structured fields are already present in the raw prompt. We also had to handle the fact that open-ended survey questions would crash the modal renderer, since renderSurvey called q.options.forEach() unconditionally — fixed by requiring every question object to always include an options field, with an empty array for open-ended questions.
Accomplishments that we're proud of
We're proud that the evaluation loop is genuinely dynamic — survey questions are LLM-generated per prompt, not hardcoded, so a history essay and a math problem produce completely different surveys. We're also proud of the full pipeline architecture: seed → evaluate → survey → map → re-evaluate → enhance, where each step uses the cheapest appropriate model and the expensive Sonnet call only fires when the profile is actually sufficient. The extension works end-to-end on both Claude.ai and ChatGPT without any backend server — everything runs client-side through the Anthropic API.
What we learned
Cheap models as gatekeepers are underutilized. Haiku handling seeding, evaluation, survey generation, and field mapping costs a fraction of a cent per session and does the work well enough that Sonnet only needs to touch the final enhancement step. The pattern — cheap classifier gates expensive generator — is reusable far beyond this tool. We also learned that the hardest part of building agentic browser extensions isn't the AI logic; it's the runtime environment. MV3 constraints forced architectural decisions (message-driven state machine, Promise-guarded startup) that made the codebase more robust than a naive implementation would have been.
What's next for Promptly
The evaluation criteria are already defined in a plain .md file — swapping it out for a different domain (legal drafting, code specification, medical queries) requires no code changes. The immediate next step is building a library of domain-specific criteria files users can select from. Beyond that, we want to add support for more chat platforms via selectors.json entries, explore letting the extension learn from a user's past prompt patterns to reduce survey rounds over time, and investigate whether the seeding and evaluation steps can be merged into a single call without sacrificing accuracy.
Trying out needs personal anthropic API key. If you don't know how to get one, contact Jade yuru@uchicago.edu.
Built With
- css
- haiku
- html
- javascript
- json
- md
- sonnet
Log in or sign up for Devpost to join the conversation.