The goal#
Professionals who use AI daily keep a prompt library - a collection of tested, reusable prompts for their most common tasks. In this capstone you will:
- Design a structure for library prompts (metadata + template + test inputs).
- Build a small Python prompt-library tool.
- Write and test 10 prompts for your own work or study.
इस capstone project में आप अपनी "prompt की लाइब्रेरी" बनाएंगे - यानी अपने रोज़ के कामों के लिए जाँचे-परखे, बार-बार इस्तेमाल होने वाले prompts का संग्रह।
जैसे एक अच्छे रसोइये के पास अपनी recipe book होती है - हर recipe जाँची हुई, साफ़ लिखी हुई, और कोई भी उसे follow कर सके - वैसे ही आपकी prompt library आपका और आपकी team का समय हर दिन बचाएगी।
Step 1: What a library prompt contains#
| Field | Example |
|---|---|
| name | fee_reminder_sms |
| category | office / teaching / coding / data / marketing |
| description | Polite SMS reminding a student about a due fee |
| version | 2 |
| template | Write a {tone} SMS under 160 characters reminding {name}... |
| output format | Plain text, under 160 characters |
| test inputs | 3-5 sets of realistic values, including an edge case |
| notes | "v2: added 'no emojis' - v1 used too many" |
Step 2: Build the tool#
Run this complete prompt library. Read it carefully - it uses classes, dictionaries, string formatting, validation and JSON from the Python course.
The report shows which prompts are ready and what the others need - for example, explain_error needs a length limit, a format and test inputs.
Step 3: Improve a weak prompt#
Upgrade explain_error so it passes every check:
You are a patient Python trainer. Explain the error below to a beginner
in under 120 words, using this format:
1. What the error means (1-2 sentences)
2. Why it happened in this code
3. The corrected code
4. One tip to avoid it next time
<error>
{error}
</error>
<code>
{code}
</code>
Then add at least two test inputs (two different real errors), bump the version to 2, and re-run the report.
Step 4: Your 10 prompts#
Create library entries for your own work or study. Suggestions:
| Category | Prompt ideas |
|---|---|
| Office | email reply, meeting minutes, report summary, notice in Hindi |
| Teaching | lesson plan, quiz generator, worksheet levels, student feedback |
| Coding | code review, explain code, write tests, debug error |
| Data | Excel formula helper, SQL from schema, data cleaning plan |
| Marketing | Instagram caption, course brochure section, WhatsApp broadcast |
| Career | resume tailoring (truthful), interview practice, LinkedIn post |
For each prompt:
- Write it using the R-C-T-C-O structure (Role, Context, Task, Constraints, Output).
- Use clear
{placeholders}. - Test it in an AI assistant with 3 different inputs.
- Fix problems, then save it with version, description and test inputs.
Step 5: Save and share#
Export your library to JSON so you can load it in other programs (or share it with your team):
with open("my_prompt_library.json", "w", encoding="utf-8") as f:
f.write(lib.export_json())
Ideas to take this further:
- Add a command-line menu: list, search, render, copy to clipboard.
- Turn it into a small Flask web app your team can use.
- Connect it to an AI API (previous lessons) so "render + send" happens in one step, and save the responses for review.
Course complete!#
You can now:
- explain how LLMs work and why they make mistakes,
- write clear, structured prompts with role, context, examples and formats,
- use chain-of-thought, chaining and self-critique for complex work,
- apply AI to coding, office work, data and teaching,
- build system prompts, templates and API-powered automations,
- use AI safely and responsibly.
Keep practising - the best prompt engineers are the ones who test, measure and refine every day.