agentleFS
pratikgh0sepratikgh0se/meta-prompt-skill/skill/SKILL.md

meta-prompt

Skill0 starsChanged 4 months agoMITView on GitHub

Use when asked to generate, create, or improve a prompt for a specific task. Triggers on "write me a prompt", "generate a prompt", "create a system prompt", "make a prompt for X", or when the user describes a task and needs a well-structured Claude prompt template for it.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ask Claude to produce <Instructions> — the final prompt template

    line 62
  2. Very specific:

    Use claude-sonnet-4-6 with temperature=0 for deterministic output.

    line 64
  3. Distinctive:

    After running, review changes with git diff metaprompt.py and commit if correct.

    line 91

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

meta-prompt

Overview

Generate high-quality Claude prompt templates from a plain task description using Anthropic's metaprompt technique. Core principle: a structured metaprompt (with examples and XML tags) reliably produces better prompt templates than writing one from scratch.

When to Use

  • User asks to "generate/write/create a prompt for X"
  • User describes a task and wants a reusable prompt template
  • User wants to improve an existing prompt
  • User needs a prompt with input variables (e.g. {$DOCUMENT}, {$QUESTION})

Quick Reference

InputOutput
Task description (required)Prompt template with XML structure
Variable names (optional){$VAR} placeholders in template

Implementation

Option A: Run the metaprompt script (preferred)

The metaprompt script lives at ~/incubator/meta-prompt-skill/metaprompt.py.

  1. Edit TASK and optionally VARIABLES in the script
  2. Run: python ~/incubator/meta-prompt-skill/metaprompt.py
  3. The generated prompt appears in stdout
# Quick one-liner to inject task and run
python -c "
import subprocess, sys
task = '''$TASK_DESCRIPTION'''
# Edit TASK in the script, then run
"

Or use the helper below to invoke it programmatically.

Option B: Inline metaprompt call (when script not available)

Construct the metaprompt directly. The core system prompt structure:

Today you will be writing instructions to an eager, helpful, but inexperienced 
and unworldly AI assistant who needs careful instruction and examples to 
understand how best to behave. I will explain a task to you. You will write 
instructions that will direct the assistant on how best to accomplish the task 
consistently, accurately, and correctly.

Then pass:

  • <Task> — the user's task description
  • <Inputs> — the variable names, written as {$VARNAME}
  • Ask Claude to produce <Instructions> — the final prompt template

Use claude-sonnet-4-6 with temperature=0 for deterministic output. Do NOT use claude-sonnet-5 (rejects temperature=0).

Step-by-step workflow

  1. Gather task — ask user: "Describe the task in 1-2 sentences. What should the AI do?"
  2. Gather variables — ask: "What inputs does this prompt need? (e.g. DOCUMENT, QUESTION, USER_INPUT) — or leave blank for none"
  3. Generate — run metaprompt with task + variables
  4. Present — show the generated <Instructions> block as the prompt template
  5. Test (optional) — offer to run the generated prompt on an example input using claude-haiku-4-5

Keeping the metaprompt current

Anthropic updates the metaprompt notebook at: https://colab.research.google.com/github/anthropics/claude-cookbooks/blob/main/misc/metaprompt.ipynb

To check for updates and apply them:

# From the repo root:

# Check only (exit 0 = up-to-date, exit 2 = update available)
python update-metaprompt.py --check

# Check + apply
python update-metaprompt.py

After running, review changes with git diff metaprompt.py and commit if correct.

Common Mistakes

  • Using claude-sonnet-5 for generation — it rejects temperature=0, use claude-sonnet-4-6
  • Skipping variable elicitation — prompts without {$VAR} placeholders can't be reused
  • Presenting the full metaprompt output — extract only the <Instructions> block for the user
  • Adding variables the user didn't specify — only use what they asked for

Example

User: "Generate a prompt that summarizes legal documents"

Variables: DOCUMENT, FOCUS_AREA (optional)

Generated template (from metaprompt):

You will summarize the following legal document.

<document>
{$DOCUMENT}
</document>

{$FOCUS_AREA}

Provide a structured summary covering: key parties, obligations, 
important dates, and risk factors. Use bullet points for clarity.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.