Build a Prompt Improvement Engine with AI

Use Claude with MCP file system access to build a tool that reads your saved prompts, applies role-stacked expert review, and writes improved versions back to your local files.

What You'll Build

By the end of this project, you'll have a working Prompt Improvement Engine — a local tool powered by Claude that reads your draft prompts from your file system, runs them through a multi-expert review process, and saves polished, production-ready versions back to your machine. No cloud storage, no copy-pasting — your files, improved automatically.

Finished Project Features

  • A local folder structure Claude can read and write to via MCP file system access
  • A master system prompt that role-stacks three expert reviewers: a prompt engineer, a UX writer, and a subject-matter specialist
  • An automated review pipeline that critiques clarity, specificity, and role framing in every draft prompt
  • Improved prompt files written automatically to an /improved subfolder with change notes included
  • A reusable workflow you can run on any new prompts you write in the future

What You'll Need

🤖

Claude (with MCP enabled)

You'll use Claude with the MCP File System server configured so it can read and write files on your local machine. If you haven't done that yet, check out the MCP File System tutorial first.

📝

A Text Editor + Terminal

VS Code works great here, but any text editor will do. You'll also need a terminal to create your folder structure and verify files are being written correctly.

Let's Build It

1

Set Up Your Prompt Folder Structure

Before Claude can read or write anything, you need a clean folder structure on your machine and MCP file system access pointed at it. This step uses Claude to design that structure and create the folders for you — so you're not guessing at organization. Getting this right now means every future step works automatically.

PROMPT
I'm setting up a Prompt Improvement Engine on my local machine. I want you to help me create the right folder structure for this project.

Here's what I need:
- A root folder called prompt-engine
- Inside it: a /drafts folder where I'll save my raw prompt files as .txt files
- Inside it: an /improved folder where you'll save improved versions
- Inside it: a /system folder where I'll keep our master review prompt

Using your MCP file system access, please:
1. Create this full folder structure at [INSERT YOUR PREFERRED PATH, e.g. ~/Documents/prompt-engine]
2. Add a README.txt to the root that explains what each folder is for
3. Add a sample draft prompt file in /drafts called sample-prompt.txt with this content: "Write me a blog post about AI tools."

Confirm each folder and file as you create it.

What to look for: Claude should confirm it created each folder and file one by one using MCP write actions. You'll see it reference actual file paths on your system. Open your file explorer and verify the folders exist — if they do, MCP is working correctly and you're ready to move forward.

2

Build the Role-Stacked Expert Review System Prompt

This is where role stacking comes in. Instead of asking Claude to "improve my prompt," you're going to have it think from three distinct expert perspectives simultaneously — a prompt engineer, a UX writer, and a subject-matter specialist. Claude will help you craft this master system prompt, which you'll save into your /system folder for reuse every time.

PROMPT
I need you to write a master system prompt for a Prompt Improvement Engine. This system prompt will be used every time I want to review and improve a draft AI prompt.

The system prompt must use role stacking — meaning it should instruct Claude to simultaneously think from three expert perspectives:

1. A Senior Prompt Engineer — who evaluates technical prompt structure, specificity, context-setting, and role framing
2. A UX Writer — who evaluates clarity, tone, readability, and whether the request is human-friendly
3. A Subject-Matter Specialist — who evaluates whether the prompt would actually produce accurate, useful, expert-level output in its topic area

The system prompt should instruct Claude to:
- Read the draft prompt provided by the user
- Give a short critique from each of the three expert perspectives (2-3 sentences each)
- Provide one consolidated, improved version of the prompt that incorporates all three perspectives
- Add a brief "What Changed" section explaining the key improvements

Make the system prompt clear, specific, and reusable. After writing it, save it as a file called review-system-prompt.txt inside [INSERT YOUR PATH]/prompt-engine/system/ using your MCP file system access.

What to look for: Claude should produce a well-structured system prompt that clearly defines all three expert roles and gives specific instructions for each review step. It should then confirm the file was written to your /system folder. Open the file to read it — this is your core engine and it's worth understanding every line.

3

Add Your Own Draft Prompts to the /drafts Folder

Now it's time to give the engine something real to work with. You'll write three draft prompts that represent common things you actually ask AI to do — these should be rough, unpolished versions, the kind you'd dash off in a hurry. Then you'll ask Claude to read them all from your /drafts folder and confirm it can see them before we start improving.

PROMPT
I want to add three draft prompts to my prompt-engine project. Using your MCP file system access, please create three new .txt files in [INSERT YOUR PATH]/prompt-engine/drafts/ with the following content:

File 1 — draft-01-blog.txt:
"Write me a blog post about productivity."

File 2 — draft-02-email.txt:
"Write an email to my team about the meeting."

File 3 — draft-03-summary.txt:
"Summarize this article for me."

After creating all three files, read them back and list their contents so I can confirm everything looks right. Then list all files currently in the /drafts folder so I can see the full inventory.

What to look for: Claude should write each file, then read them back and display their contents. You should also see a directory listing confirming all three draft files are present. These intentionally weak prompts are the raw material — vague, context-free, and in need of expert review. That's exactly what we want.

4

Run the Role-Stacked Review on Each Draft

Here's where everything comes together. You'll activate the role-stacked system prompt, then point Claude at your /drafts folder to review all three prompts in sequence. For each one, Claude will step into all three expert roles, critique the draft, produce an improved version, and explain what changed. This is the engine running for the first time.

PROMPT
I want you to act as the Prompt Improvement Engine using the review system we built. Here's how to proceed:

Step 1: Read the system prompt file at [INSERT YOUR PATH]/prompt-engine/system/review-system-prompt.txt and confirm you've loaded it.

Step 2: Read each of the three draft prompt files in [INSERT YOUR PATH]/prompt-engine/drafts/ one at a time.

Step 3: For each draft, apply the full role-stacked review process exactly as described in the system prompt — give critiques from all three expert perspectives, then provide the improved prompt and a "What Changed" summary.

Step 4: After completing the review for each draft, save the improved version as a new file in [INSERT YOUR PATH]/prompt-engine/improved/ using the same filename as the original (e.g., draft-01-blog.txt). Include the "What Changed" notes at the bottom of each improved file.

Process all three drafts in order. Confirm each file write as you go.

What to look for: Claude should load the system prompt, then work through each draft sequentially. For each one you should see three distinct expert-voice critiques, a clearly improved prompt, and a "What Changed" section. Then it should confirm writing each improved file to /improved. Check that folder — you should have three new files with noticeably better, more specific prompts than you started with.

5

Generate a Review Report and Audit the Engine Itself

The final step closes the loop: you're going to ask Claude to review the review system itself. Using the prompt review skills from this week's tutorials, Claude will audit the system prompt you built, suggest any improvements, and save a full session report to your /system folder. This makes the engine self-improving — and it's a pattern you can run every few weeks.

PROMPT
Now I want you to do two things to wrap up this session:

Task 1 — Audit the Engine:
Read the system prompt at [INSERT YOUR PATH]/prompt-engine/system/review-system-prompt.txt and review it critically as if you were a prompt engineer evaluating it for the first time. Ask yourself:
- Is the role stacking clearly defined and distinct?
- Are the review criteria specific enough to produce consistent output?
- Is anything ambiguous or missing?
Provide 3-5 concrete improvement suggestions.

Task 2 — Generate a Session Report:
Create a new file called session-report.txt in [INSERT YOUR PATH]/prompt-engine/system/ that includes:
- Today's date
- A list of all three prompts reviewed this session
- One-line summary of the biggest improvement made to each
- Your top 3 suggestions for improving the review-system-prompt.txt itself
- A recommended next step for making this engine even more useful

Save the report file and confirm it was written successfully.

What to look for: Claude should provide a thoughtful audit of the system prompt with specific, actionable suggestions — not just "this looks good." The session report file should be a real summary you could open a week from now and immediately understand what happened. If the suggestions are vague, ask Claude to be more specific about each one.

Common Issues

Claude says it can't access my files

This almost always means MCP File System isn't configured correctly or isn't pointing at the right path. Go back to your MCP settings and confirm the allowed directory includes the path you're using. Also double-check you're starting Claude in a session where MCP tools are active — some interfaces require you to enable them per conversation.

The role stacking feels like one voice, not three

If the expert perspectives all sound the same, the system prompt probably isn't differentiating the roles clearly enough. Go back to your review-system-prompt.txt and add a one-sentence description of each expert's background and priorities. For example: "The UX Writer has 10 years of content design experience and is obsessed with plain language." Specificity makes the roles feel distinct.

Improved files aren't being written to /improved

Claude might be generating the improved prompts in the conversation but not writing them to disk. If this happens, follow up with: "Please now write the improved version of [filename] to the /improved folder using MCP file system access." Being explicit about the write action usually resolves this — Claude sometimes needs a direct instruction to trigger the file write tool call.

The improvements are too minor or too generic

If Claude is making surface-level tweaks instead of meaningful structural improvements, add more context to your draft prompts — even one extra sentence about the goal or audience helps. You can also explicitly tell Claude in your Step 4 prompt: "I expect significant structural changes, not just word tweaks." Giving permission to be bold often unlocks better output.

What You Learned

📁

MCP File System in Practice

You set up a real local folder structure and used MCP file system access to have Claude read and write files automatically — not just generate text, but actually save it to your machine.

🎭

Role Stacking for Richer Output

You built a system prompt that stacks three distinct expert perspectives, giving Claude a structured framework for producing multi-dimensional critique instead of a single opinion.

🔍

AI-Powered Prompt Review

You applied prompt review techniques to real draft prompts and saw concretely how vague language, missing context, and poor role framing produce weaker AI output — and how to fix them.

⚙️

Building Reusable AI Workflows

You designed a self-contained system — with a saved system prompt, an organized file structure, and a session report — that you can pick back up and run on new prompts any time.

Tips for Going Further

  • Add a fourth expert role. Try stacking in an SEO Strategist or a Data Scientist depending on the kinds of prompts you write most. The more specific the role, the more targeted the critique.
  • Build a prompt scoring rubric. Ask Claude to score each draft out of 10 on three criteria — specificity, context, and role clarity — before and after improvement, and save those scores in the session report.
  • Connect this to your prompt template library. Once a prompt passes review, move it into a /templates folder and have Claude tag it with a category. Over time you'll build a personal library of battle-tested, expert-reviewed prompts.
  • Schedule weekly engine runs. Make a habit of dropping any new prompts you wrote that week into /drafts every Friday, then running the engine to improve them before the weekend. Your prompt quality will compound fast.
  • Use the engine to review prompts from others. Copy in prompts you've found online or from AI communities, run them through the engine, and compare the output. It's a fast way to train your eye for what makes prompts effective.
More projects

One of 29 hands-on projects.

All projects Claude Code tutorials