Prompt templates and your personal prompt library
Stop rewriting the same prompts. Turn your best prompts into templates with clear placeholders, store them where you can reach them in seconds, and keep them working as AI tools change.
If you use AI regularly, you probably type similar prompts again and again: explain this topic, review this code, draft this email. Each time you rewrite them from memory, you lose the improvements you made last time. Engineers solve this kind of problem by writing something once and reusing it. For prompts, that means templates.
In this tutorial you will build a personal prompt library: 5 to 10 tested templates, stored in one place, that you can fill in and use in under a minute. You need a free AI chat tool and somewhere to keep notes (Google Docs, Google Keep, Notion, a notes app or plain text files). It helps to have done the earlier lessons in this track, because your templates will reuse the six parts from *Anatomy of a good prompt*.
What a template is
A template is a prompt with a fixed part and blanks. The fixed part holds everything that stays the same: the role, the rules, the output format and the lessons you learned the hard way. The blanks, called placeholders, hold what changes each time: the topic, the code, the email.
Think of a bank deposit slip or a college leave application format. Someone already decided what information is needed and in what order, so you only fill in your details.
You are a patient tutor for [SUBJECT].
Explain [TOPIC] to me.
About me: [MY LEVEL, e.g. 2nd-year B.Tech, I know Python basics]. I need this for [PURPOSE, e.g. an exam next week / an interview / a project].
Rules:
- Start with a one-line definition, then an everyday analogy.
- Give one worked example. For code, use [LANGUAGE].
- List 2 common mistakes or misconceptions.
- Under [WORD LIMIT] words.
End with 3 practice questions, easiest first, without answers.What to expect: The rules and format were improved over many uses and never change. Only the bracketed parts change, so each use takes seconds and gives a consistent, tested shape of answer.
Good placeholders vs weak ones
| Weak | Better | Why |
|---|---|---|
| [stuff] | [ERROR MESSAGE, copied exactly] | Says what goes there and how |
| [text] | [JOB DESCRIPTION, full text] | Reminds you to paste all of it, not a summary |
| [level] | [MY LEVEL, e.g. fresher who knows SQL basics] | An example shows the detail expected |
| Placeholder hidden in a sentence | Placeholder on its own line or inside tags | Easy to spot, hard to forget |
| Ten placeholders | Two to five placeholders | More blanks means more effort, so you stop using it |
Use CAPITALS inside the brackets
Writing placeholders as [TOPIC] rather than [topic] makes them stand out, and you can search for [ before sending to check nothing is left unfilled. It also means a tool or script can find them later (the team project at the end of this track does exactly that).
Turn a good conversation into a template
The best templates come from real use, not from imagination. When a chat finally gives you exactly what you wanted, usually after a few corrections, that is the moment to save it. The corrections you made ("shorter", "use a table", "don't assume I know React") are the valuable part, because they become rules in the template.
From one good chat to a reusable template
- 1Finish the task in a normal chat, correcting the AI until the answer is right.
- 2In the same chat, ask the AI to turn the conversation into a template (prompt below). It can see all your corrections.
- 3Read the template it produces. Remove anything specific to this one case that slipped into the fixed part.
- 4Test it in a new, empty chat with a different input. A template that only works inside the original chat is not finished.
- 5If the new answer needed corrections, add them as rules and test again.
- 6Save it in your library with a short header (next section).
That last answer is exactly what I wanted. Turn this conversation into a reusable prompt template so I can get the same quality in one message next time.
Requirements:
- Include every correction I made during this chat as an explicit rule.
- Replace the parts that will change next time with placeholders in [CAPITALS], each with a short example, like [TOPIC, e.g. normalisation].
- Keep the output format I ended up with.
- Use at most 5 placeholders.
- Put pasted material (code, documents) last, inside tags.
Then list the placeholders and what goes in each.What to expect: Check that the fixed part has no leftovers from this case (your specific topic, file name or company), and that your corrections really appear as rules.
Organise your library
A library you can't find things in is a library you don't use. Give each template a short header so that in three months you still know what it is for and whether it still works.
NAME: explain-topic
USE WHEN: learning a new topic for exams or interviews
INPUTS: SUBJECT, TOPIC, MY LEVEL, PURPOSE, LANGUAGE, WORD LIMIT
LAST TESTED: 2026-10 with Gemini and ChatGPT (free)
VERSION: 3 (v3: added 'common mistakes' section)
You are a patient tutor for [SUBJECT].
...rest of the template...The header is for you, not the AI. Copy only the part below the header into the chat.
Where to keep your library
| Option | Good for | Watch out for |
|---|---|---|
| Google Doc or Word file with a heading per template | Beginners; easy search; the outline lets you jump to a template | Copying from a long doc is slower on a phone |
| Notes app (Google Keep, Apple Notes, OneNote) | Quick access on phone and laptop | Gets messy past about 20 notes; use labels |
| Notion or a similar workspace | A table with columns for category, inputs and last tested | Another tool to learn |
| Plain .md or .txt files in a folder (optionally a GitHub repo) | Developers; version history; sharing with a team | Needs some comfort with files and Git |
| Built-in saved assistants: ChatGPT GPTs, Gemini Gems, Claude Projects | Templates you use daily with the same files or instructions | What the free plan includes changes; check your plan. The instructions are tied to one tool |
Group templates by the categories from this track: study, career, coding and work. Name them with a verb and an object (explain-topic, review-code, draft-reply, summarise-meeting) so the name tells you what it does.
Make templates one keystroke away
A text expander types a saved block of text when you type a short trigger. Phone keyboards such as Gboard let you save text shortcuts in their personal dictionary or pin snippets in the clipboard. On a laptop, macOS has built-in text replacements, and Espanso is a free, open-source text expander for Windows, macOS and Linux. Expanders work best for short templates; keep long ones in your doc.
matches:
- trigger: ";review"
replace: |
You are a senior code reviewer. Review the code below for bugs, security issues and readability, in that order.
For each issue give: line, problem, why it matters, a fixed version.
Do not rewrite the whole file.
<code>
[PASTE CODE]
</code>After saving the file, typing ;review in any app replaces it with the template. Then paste your code over the placeholder.
Keep templates working
Templates age. Models get updated, tools change their defaults and your needs grow. A template that gave great answers six months ago may now be too long, too cautious or formatted differently. Treat each template like a small piece of software: it has a version, and you re-test it when something changes.
Maintenance habits
- When you correct a template's answer twice for the same reason, add a rule and bump the version.
- Keep one sample input for each template so you can re-test it in a minute (the next lesson, *Testing and evaluating prompts*, makes this systematic).
- Re-test your most-used templates when you switch tools or notice answers changing.
- Delete templates you haven't used in three months. A short, trusted library beats a long one.
- Write the date and the tool you last tested with in the header.
Never store secrets in a template
Don't put passwords, API keys, phone numbers, Aadhaar or PAN numbers, or confidential company details in the fixed part of a template. Templates get copied, shared and pasted into tools you didn't plan for. Personal facts you reuse safely (your skills, your target role) are fine; anything sensitive should be a placeholder you fill each time, or left out.
Try it: Build your starter library
Create a library with five templates, at least one per category:
1. Study: explain a topic at my level (adapt the example above). 2. Career: tailor my resume bullet points to a job description. 3. Coding: explain an error and suggest a fix. 4. Work: write an email from bullet points. 5. One template for a task you personally repeat every week.
For each: add the header, test it in a fresh chat with two different inputs, and fix anything that needed correcting.
Key takeaways
- A template is a tested prompt with a fixed part (role, rules, format) and a few clear placeholders.
- Write placeholders in [CAPITALS] with an example of what goes there; keep them to five or fewer.
- Build templates from real chats: your corrections become the rules.
- Test every template in a fresh chat with a different input before saving it.
- Add a header (name, use when, inputs, last tested, version), keep the library small, and never store secrets in it.
Check yourself
Finishing the quiz marks the lesson as done.
1. What belongs in the fixed part of a prompt template?
2. You turned a chat into a template. Why test it in a new, empty chat?
3. Which placeholder is best?
4. You keep editing a template's answers to remove the same long introduction. What should you do?
5. A classmate shares a prompt template that includes their college ID and phone number in the fixed part. What is the problem?
Saved on this device. Create a free account to keep it on every device.
Practise this with Sam
A real mock interview, out loud, with an honest scorecard. Free to start.