May 27, 2026
Lab reportWhy Prompt Mirror Does Not Call an AI Model
4 min read
By Donald Leijon - Independent web developer and tool builder, based in Sweden.
A lab report on building a prompt improver that strictly uses local rules instead of a generative API.
1. Hypothesis
The hypothesis was that most prompts fail not because they lack creativity, but because they lack basic structural hygiene: a defined role, concrete specifics, and clear formatting constraints. If the tool could automatically enforce this structure locally, prompt outputs would improve without any prompt content leaving the browser.
2. What I built
Prompt Mirror — a client-side tool that rewrites prompts using five deterministic rules: "Add role", "Flag vagueness", "Set output format", "Remove hedging", and "Add context".
Crucially, it does not send the prompt to an LLM for "improvement". It uses regex functions to strip conversational filler ("please", "maybe") and insert placeholders for missing context.
3. Example Input/Output & UI Decisions
Input: "write me something about productivity please, maybe some tips or whatever, something good would be nice"
The UI Decision: Instead of a black-box "Magic Rewrite" button, I exposed the rules as distinct toggles. This shows the user why their prompt is changing.
Output (with all rules on):
Context: [add relevant background here]
You are an expert. write me [specific something] about productivity, some tips or whatever, [specific something] [define "good" — e.g. concise, accurate] would be [define "nice" — e.g. concise, accurate]
Respond in clear, concise prose. Use bullet points if listing more than three items.
4. What I observed
- Observation: The output often looks clunky with literal placeholders like
[specific something]. - Observation: The tool executes instantly because there is no network latency.
- Interpretation: The clunkiness is a feature, not a bug. By inserting
[define "good"], the tool forces the user to actively think about their constraints rather than passively accepting an AI-generated rewrite. It acts as a "prompt structure linter."
5. What changed
No new rules have been added since the initial build. The five rules — Add role, Flag vagueness, Set output format, Remove hedging, Add context — remain as implemented.
6. Status
kept
FAQ
Why does the output look clunky?
The placeholders like [specific something] and [define "good"] are intentional. They force you to name what you actually want rather than accepting a vague AI-generated rewrite. The clunkiness is the feedback — a well-formed prompt should not need many placeholders.
Can I use the tool with only some rules enabled?
Yes. Each of the five rules is an independent toggle. You can disable "Remove hedging" if you want to keep polite phrasing, or activate only "Set output format" if that is the only structural gap in your prompt.
Does my prompt leave the browser?
No. Prompt Mirror uses local regex functions. The prompt text never reaches a server or an AI model.
Try the tool
Run a rough prompt through Prompt Mirror.
See the five structure rules applied locally. Toggle rules on and off to understand what each one changes.