From Sudden Need to Daily Workhorse: Building Single-File Micro-Tools with AI Chat
Have an AI chat build your calculator, deadline tracker, or text cleaner as one HTML file: no install, no account, and data stays on your device.

Every so often you need a tool that no app store carries: a print-shop price calculator with your own discount rules, a contract-deadline tracker, a cleaner for messy pasted lists. The usual options are poor — generic apps stuffed with ads and subscriptions, or an IT request that takes weeks. There is a third path most non-programmers never try: ask an AI chat to build the tool for you, in one conversation, as a single HTML file. Save the file anywhere, double-click it, and it runs in any browser — no installation, no account, no subscription, and the data never leaves your device. This tutorial walks through building such a micro-tool step by step: choosing the right task, writing the brief, testing it, giving it memory, and keeping it alive for years.
1. Pick a Task That Fits the Single-File Pattern
A single-file micro-tool has hard limits: one screen, one job, small data. Those limits are exactly why it can be finished in one session and kept for years. Categories that consistently work: special-purpose calculators (print pricing, loan installments, shipping costs), converters (units, date formats, numbers to words), text processors (remove duplicate lines, fix punctuation, change capitalization), simple personal trackers (deadline checklists, point counters, habit trackers), and generators (invoice numbers, customer message drafts, task templates). On the other hand, avoid jobs that need multiple users with logins, device syncing, or sensitive team data — that is the territory of real applications with servers and security. The quick test is one sentence: write down your problem, then ask, 'can this be finished on one screen without an internet connection?' If yes, it is worth building.
2. Write a Specific Brief in Your First Prompt
Eighty percent of the outcome is decided by the first prompt. Do not ask for 'a POS app' and then complain that the result is generic; treat the AI like a new hire who is eager but knows nothing about your work: explain the goal, the inputs, the rules, the output, and the technical constraints. Two phrases are mandatory: 'a single HTML file' and 'no external libraries' — this is what keeps the result portable, easy to move to a USB stick, another laptop, or a phone without drama. A real example:
Create ONE self-contained HTML file (HTML, CSS, JavaScript combined) with a
print-shop cost calculator.
Inputs: number of sheets; paper type (A4 art paper 150gsm / A3 art paper
150gsm / A4 book paper); price per ream in local currency (editable);
1 ream = 500 sheets.
Rules: round reams up; 10% discount above 1,000 sheets; production time is
1 day per 2,000 sheets.
Output: a full cost breakdown.
Constraints: must look good on a phone, work offline, use no external
libraries, and have 'Calculate' and 'Reset' buttons. End with 2-3 sentences
on how to use it.
Notice the pattern: inputs listed one by one, rules written with exact numbers, technical constraints spelled out. The AI cannot read minds; a specific brief cuts revisions in half.
3. Test Like an Ordinary User, Report Bugs in Plain Language
Save the result as print-calculator.html, open it in a browser, and test it not as a programmer but as a mischievous user. A short checklist: enter extreme numbers (zero, negatives, millions), clear every field and press Calculate, refresh the page, and open it on a phone screen. When something misbehaves, do not attach code; just report the incident:
Bug: when I enter 0 in 'number of sheets' and press Calculate, the result
shows 'NaN' and the layout goes blank. It should show a warning like
'Enter the number of sheets first'. Please fix it and return the complete
file — not a fragment.
Reporting a bug without reading the code feels strange, but it is the right workflow: the AI wrote the code, so let it read its own code. Two or three rounds of test-report-fix are usually enough for a tool this small.
4. Ask for On-Device Memory with localStorage
By default, a single HTML file forgets everything the moment the tab closes. To give the tool a memory — a calculation history, a deadline list, a daily score — ask the AI to add localStorage, the browser's built-in filing cabinet that lives on your device:
Add a 'calculation history': every time the Calculate button is pressed,
store the date, the inputs, and the total in localStorage. Show the latest
20 entries at the bottom with a 'Clear history' button. Do not change any
other features. Return the whole file in one code block.
The bonus of this approach is privacy: no data is sent to anyone's server, because everything stays in your browser. The limits deserve attention too: a plain HTML file is not encrypted, so never store passwords, card numbers, or medical data in it. For bills, personal targets, or task lists, this level is more than enough.
5. Iterate One Feature at a Time, Use Live Preview When You Can
The biggest temptation arrives once the first tool works: requesting five features at once. The result is almost always a fragile file whose faults are hard to trace. Add one feature per request — export the list to CSV, a print view, a dark theme — and always ask for the complete file, not a fragment you have to paste yourself. If your chatbot has live preview, use it: Claude's Artifacts render and run HTML in a side panel so you can test without leaving the chat, while ChatGPT's Canvas makes repeated code editing smoother. The safe iteration order: fix bugs first, then the single feature you will use most, the rest later. And not every idea deserves to be built: if after two weeks you rarely touch a feature, leave the tool simple.
6. Maintain the File: Versions, Backups, and a Brief That Stays
Treat the micro-tool like an important document, not a toy. First, keep versions — print-calculator-v1.html, v2, and so on — and copy the file before any major revision so there is always a way back. Second, back it up to a cloud drive like any other file; this is just an .html, not a project that needs a code repository. Third, and most often forgotten: keep your brief or first prompt, for example pasted as a comment on the very first line of the file. Chat history can be deleted or become impossible to find again, but with the brief in hand, the same tool can be rebuilt in a fresh session within minutes — exactly like a recipe that lets anyone cook the dish again, whenever they want.
Your practice task is simple: pick one boring job you will certainly repeat this week — a repeated calculation, data that needs cleaning, a format you retype every time — and build the tool in one AI session. Your first prompt will not be perfect, but two or three rounds of testing and fixing usually produce something you genuinely use every day. If the little tool eventually gets weekly use by more than one person, that is the moment to think about a more serious version. Until then, one HTML file and one tidy brief are more than enough.
References
- What are Artifacts? — Anthropic Support — the official guide to Claude's Artifacts for building and testing small apps inside the chat.
- Introducing Canvas — OpenAI — OpenAI's announcement of Canvas, ChatGPT's workspace for iterative writing and code editing.
- Window: localStorage — MDN Web Docs — the technical reference for browser local storage used in step four.
- Using the Web Storage API — MDN Web Docs — a practical guide to saving and reading on-device data in the browser.



