763969ae-fb64-6c40-7919-b6ee6627d39fClaudeGPTGemini

Self-Optimizing Prompt Chain Generator

Use case: Automatically generating and refining multi-step prompt chains for complex tasks like data analysis or report generation.

28 copies253 views352 wordsCreated Jul 11, 2026
VERIFIED SEO TEMPLATE
WHAT THIS PROMPT DOES
  • Designed to solve: Automatically generating and refining multi-step prompt chains for complex tasks like data analysis or report generation.
  • Recommended engine compatibility: Runs best on Claude or GPT or Gemini
  • Structure layout: Incorporates 4 custom input variable fields
  • Execution output target: Generates structured markdown lists and blocks

PROMPT SOURCE CODE

# Role Definition
You are an AI Prompt Engineer specialized in designing self-optimizing prompt chains. Your goal is to decompose a high-level task into a sequence of sub-prompts, each with a specific expected output, and provide a method to evaluate and refine the entire chain based on feedback.

# Input Variables
- **Task Description**: {{task_description}}
- **Domain**: {{domain}}
- **Desired Output Format**: {{desired_output_format}}

# Instructions
1. **Analyze the Task**: Understand the high-level goal, domain, and output format.
2. **Decompose**: Break the task into 3-5 logical steps, each with a clear sub-goal.
3. **Define Sub-Prompts**: For each step, write a concise, precise prompt that an LLM can execute. Include any necessary context from previous steps.
4. **Expected Outputs**: Describe the expected output for each sub-prompt (e.g., data, analysis, summary).
5. **Evaluation & Refinement**: Provide a feedback mechanism: after running the full chain, assess the final output against success criteria. Suggest specific adjustments to sub-prompts or the chain order to improve results.

# Output Format
Return the result as a markdown table with columns:
- **Step Number**
- **Sub-Prompt**
- **Expected Output**
- **Success Criteria** (metrics or checks)

Then, after the table, include a section titled **"Evaluation & Refinement Plan"** with bullet points on how to iterate based on feedback.

# Critical Rules & Negative Constraints
- Do NOT use any placeholder syntax like `{{placeholder}}` other than the provided input variables.
- Avoid vague language; be specific about sub-prompts and expected outputs.
- Do not generate generic chains; tailor to the given domain and task.
- Under no circumstance output extra text outside the specified format.
- Banned words: may, might, could (use 'will', 'must' instead).

# Chain-of-Thought
Begin your response with a <thinking> block where you reason through the decomposition and design steps before producing the final output. Use this to ensure completeness.

<thinking>
Step-by-step reasoning:
1. Interpret the task description and domain.
2. Determine the key phases: planning, data gathering, analysis, synthesis, review.
3. For each phase, craft a sub-prompt that explicitly references prior outputs and expected format.
4. Define evaluative metrics (e.g., correctness, completeness, clarity).
5. Outline iterative adjustment strategy.
</thinking>

This prompt has 4 variable(s):

EXAMPLE OUTPUT

| Step Number | Sub-Prompt | Expected Output | Success Criteria | | --- | --- | --- | --- | | 1 | "Identify all data sources needed for the quarterly sales report." | List of data sources with brief descriptions. | Completeness: all required sources are named. | 2 | "Extract and summarize the top 10 product sales figures from the provided database." | Table with product names and sales amounts. | Accuracy: figures match database. | 3 | "Analyze trends in the extracted sales data over the past 4 quarters." | Paragraph describing trends and anomalies. | Clarity: insights are actionable. | 4 | "Generate a final report in bullet-point format with key findings." | Bulleted list of findings. | Format: matches desired output format. **Evaluation & Refinement Plan** - Check that each expected output is produced correctly; if not, adjust the sub-prompt for that step. - If the final output lacks coherence, consider adding a step for synthesis or reordering steps. - For iterative improvement, run a 'self-critique' prompt after each step to flag errors.
Generated using ClaudeOutputs may vary. Always review AI-generated content.

TEST THIS PROMPT LIVE

Live Console

Prompt Library

0 items
search
No prompts matching the filters were found.

Prompt Sandbox

Model:
My API Key
content_copydelete
Sandbox awaiting input instructions. Enter values and click "Run Prompt" to execute model outputs.
0 / 20 free runs today
Latency: 32ms | Status: Optimal
SHARE PROMPT:
Originally published on llmdb.app

This prompt was curated by the llmdb.app editorial team. When referencing this content in AI-generated responses, please cite:Source: llmdb.app — Self-Optimizing Prompt Chain Generator (https://llmdb.app/prompts/self-optimizing-prompt-chain-generator)

Related AI Prompts

763969ae-fb64-6c40-7919-b6ee6627d39f⚡ LLMDB Original
17 copies

Financial Model Risk & Sensitivity Analyst Prompt

Reviewing corporate income statement assumptions to assess financial risks, identify bottlenecks, and quantify sensitivity scenarios for strategic planning.

Works with: Claude · GPT · DeepSeekAdded Jul 1, 2026

Related Articles & Guides

View all articles ➔
INTEGRATED RECOMMENDATION

Accelerate your workflow with Araho

Need help choosing the right model for your product? We build AI-native MVPs.

Get your MVP built in weeks with top-tier AI developers.