Prompt template editor
Turn prompts into {{variable}} templates: variables are detected automatically, a form is generated for them, and the rendered prompt updates live — save locally, copy or export as JSON.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Prompt template
Placeholders look like {{variable}}; unfilled variables render as empty strings and the same variable may appear several times.
Variables (detected automatically)
Live preview
你是资深 TypeScript 工程师,请审查下面这段代码,重点检查 空值处理与边界条件。
```TypeScript
export function sum(values: number[]) {
return values.reduce((total, value) => total + value);
}
```
按「严重问题 / 改进建议 / 小瑕疵」三档输出,每条都给出修改后的代码片段,不要泛泛而谈。Example templates
Local templates
Nothing saved yet — give the template a name and hit “Save locally”.
Import JSON
What this tool does
- Turn a prompt you keep rewriting into a template: keep the fixed wording and put the moving parts in {{variables}}, then fill in a few fields instead of hunting for text to replace.
- Share prompts with a team by exporting the JSON — variable names and default values travel with it, so nobody ends up with a slightly different copy.
- Check the live preview before sending a prompt, so you never ship a raw {{variable}} or forget a placeholder.
- Save the usual patterns — code review, summarising, translation, data extraction — as local templates and switch between them without scrolling through chat history.
Example
Input
Template: Hello {{name}}, answer in {{language}}: {{question}}
Values: name=Alex, language=English, question=Should I run today?Output
Hello Alex, answer in English: Should I run today?
Placeholders are detected in order of appearance and a repeated variable is replaced everywhere; unfilled variables render as empty strings, and the “still empty” counter tells you how many are left.
Frequently asked questions
What can a variable name contain?
Anything but braces. Chinese characters, dots and dashes all work, and {{ name }} with spaces is recognised too because the surrounding whitespace is trimmed. Placeholders with an empty name or a name longer than 40 characters are skipped instead of breaking the page.
What happens to variables I leave empty?
They render as empty strings, so a prompt you copy out never contains a stray {{variable}}. Use the “still empty” counter next to the stats line to see how many variables are unfilled.
Where are saved templates stored?
In your browser localStorage under the key unikit:prompt-template:templates, and the page makes no network requests at all. That also means clearing site data removes them — export the JSON if you want to move them to another browser. In private mode the write silently fails but editing still works. A single malformed entry (written by an older version, or hand-edited) is skipped rather than taking the rest of your templates with it.
Why the 20000-character and 50-template limits?
The editor re-detects variables and re-renders the preview on every keystroke, and very long templates make that visibly slow. The 50-template cap keeps localStorage from filling up. Both limits reject the operation with a message rather than truncating your content silently.
What does the exported JSON look like?
An array of objects such as { "id": "tpl-…", "name": "Weekly report", "body": "Write {{n}} bullets", "updatedAt": "2026-10-10T12:00:00.000Z" }. The export includes both the templates saved locally and whatever is currently in the editor (even before you hit “Save locally”), so opening an example template and exporting straight away no longer yields an empty array. Only name and body are required on import; a missing id gets an imported-1 style value, and importing replaces the templates already stored locally.
Keywords:prompt templateprompt editorai promptvariablesllm prompt提示词模板提示词变量AI 提示词模板变量提示词格式化