Prompt Master

repository·main·Indexed 27 days ago

https://github.com/nidhinjs/prompt-master

An automated prompt engineering system that selects optimal architectures (such as CO-STAR, RISEN, or ReAct) and applies safety techniques to generate high-quality prompts. It includes optimized profiles for over 30 AI tools across categories like Reasoning LLMs, Agentic AI/IDEs, and Image/Video/3D AI. The system can be installed as a skill on Claude.ai or cloned for Claude Code (CLI), offering specialized templates and a Memory Block system to maintain context in long sessions.

Tokens
9.6K
Snippets
16
Records
43
Agent score
95%

What's inside Prompt Master

  1. Overview of prompt-master

    main

    prompt-master (v1.7.0) is a specialized tool designed to generate optimized prompts for various AI tools, including LLMs, Cursor, Midjourney, image/video AI, and coding agents.

    Activation Logic: It only activates when you explicitly ask to write, fix, improve, or adapt a prompt. It does not activate for general conversation, standard coding tasks, or document writing.

  2. Follow the prompt-master output format

    main

    When prompt-master generates a prompt, it follows a strict output structure to ensure it is production-ready and easy to use:

    1. A single copyable prompt block: The optimized prompt ready to be pasted into the target tool.
    2. Target and Optimization Summary:
      • 🎯 Target: [tool name]
      • 💡 [One sentence explaining what was optimized and why]
    3. Setup Instructions (Optional): If the prompt requires specific setup steps, a short 1-2 line plain-English note will be provided below the summary. Only included when genuinely necessary.

    For copywriting or content-related prompts, the output will include fillable placeholders such as [TONE], [AUDIENCE], [BRAND VOICE], and [PRODUCT NAME] where appropriate.

  3. Use Template H — ReAct + Stop Conditions for autonomous agents

    main

    Use the ReAct + Stop Conditions template for autonomous agents like Claude Code or Devin. It includes mandatory stop conditions to prevent runaway loops and uncontrolled scope expansion.

    Objective:
    [Single, unambiguous goal in one sentence]
    
    Starting State:
    [Current file structure / codebase state / environment]
    
    Target State:
    [What should exist when the agent is done]
    
    Allowed Actions:
    - [Specific action the agent may take]
    - Install only packages listed in [requirements.txt / package.json]
    
    Forbidden Actions:
    - Do NOT modify files outside [directory/scope]
    - Do NOT run the dev server or deploy
    - Do NOT push to git
    - Do NOT delete files without showing a diff first
    - Do NOT make architecture decisions without human approval
    
    Stop Conditions:
    Pause and ask for human review when:
    - A file would be permanently deleted
    - A new external service or API needs to be integrated
    - Two valid implementation paths exist and the choice affects architecture
    - An error cannot be resolved in 2 attempts
    - The task requires changes outside the stated scope
    
    Checkpoints:
    After each major step, output: ✅ [what was completed]
    At the end, output a full summary of every file changed.
  4. Fix Scope Patterns in Prompts

    main

    Prevent the AI from overreaching or touching irrelevant files by defining strict boundaries.

    Key improvements include:

    • Set clear scope boundaries (e.g., "Fix only the login form validation in src/auth.js. Touch nothing else.").
    • Define stack constraints (e.g., "React 18, TypeScript strict, no external libraries, Tailwind only").
    • Provide explicit file paths for IDE-integrated AIs (e.g., "Update handleLogin() in src/pages/Login.tsx only").
    • Use the correct template for your tool (e.g., use File-Scope Template (Template G) for Cursor instead of GPT-style prose).
    • Avoid pasting entire codebases; scope the context to only the relevant functions and files.
  5. Use Template F — Few-Shot for structured output

    main

    Use the Few-Shot template when the desired output format is easier to demonstrate through examples than to describe with text. This is highly effective for pattern replication and consistent structured output.

    [Task instruction]
    
    Here are examples of the exact format needed:
    
    <examples>
      <example>
        <input>[example input 1]</input>
        <output>[example output 1]</output>
      </example>
      <example>
        <input>[example input 2]</input>
        <output>[example output 2]</output>
      </example>
    </examples>
    
    Now apply this exact pattern to: [actual input]
  6. Use Template I — Visual Descriptor for image/video generation

    main

    Use the Visual Descriptor template for tools like Midjourney, DALL-E 3, Stable Diffusion, or Sora.

    Tool-specific syntax notes:

    • Midjourney: Use comma-separated descriptors and add flags like --ar, --style, or --v 6 at the end.
    • Stable Diffusion: Use (word:1.3) weight syntax. A negative prompt is mandatory.
    • DALL-E 3: Prose works well; add "do not include any text in the image" if necessary.
    • Sora / video: Include camera movement, duration, and cut style.
    Subject: [Main subject — specific, not vague]
    Action/Pose: [What the subject is doing]
    Setting: [Where the scene takes place]
    Style: [photorealistic / cinematic / anime / oil painting / vector / etc.]
    Mood: [dramatic / serene / eerie / joyful / etc.]
    Lighting: [golden hour / studio / neon / overcast / candlelight / etc.]
    Color Palette: [dominant colors or named palette]
    Composition: [wide shot / close-up / aerial / Dutch angle / etc.]
    Aspect Ratio: [16:9 / 1:1 / 9:16 / 4:3]
    Negative Prompts: [blurry, watermark, extra fingers, distortion, low quality]
    Style Reference: [artist / film / aesthetic reference if applicable]
  7. Use Template D — CRISPE for creative work and brand voice

    main

    Use the CRISPE template for creative work, brand voice writing, and tasks where personality and iteration are important.

    Capacity: [What capability or expertise the AI should have]
    Role: [Specific persona to adopt]
    Insight: [Key background insight that shapes the response]
    Statement: [The core task or question]
    Personality: [Tone and style — witty / authoritative / casual / sharp]
    Experiment: [Request variants or alternatives to explore]
  8. Optimize prompts for Agentic IDEs (Claude Code, Cursor, Windsurf, Cline)

    main

    When prompting tools that can execute commands or edit files, follow these rules:

    General Agentic Rules:

    • Define States: Provide Starting state + Target state + Allowed actions + Forbidden actions + Stop conditions + Checkpoints.
    • Mandatory Stop Conditions: Always include stop conditions to prevent runaway loops and credit consumption.
    • Scope Locks: Always scope to specific files or directories (e.g., Only work within /src). Never give global instructions without a path anchor.
    • Human Review Triggers: Add Stop and ask before: [list destructive actions] (e.g., deleting files, adding dependencies, or affecting database schemas).

    Tool Specifics:

    • Claude Code: Use Template M for complex tasks. Do not hardcode effort/thinking budgets; the harness manages this. Use /rewind for corrections and /compact at ~50% context.
    • Cursor / Windsurf: Use File path + function name + current behavior + desired change + do-not-touch list + language and version. Include a "Done when:" definition.
    • Cline: Specify which files to edit and which to leave untouched. Add Ask before running terminal commands to prevent unwanted actions.
  9. Use Template J — Reference Image Editing

    main

    Use the Reference Image Editing template when modifying an existing image.

    Important: Always instruct the user to attach the reference image to the tool before sending the prompt.

    Tool-specific instructions:

    • Midjourney: Use --cref [image URL] for character reference or --sref for style reference.
    • DALL-E 3: Use the Edit endpoint (requires ChatGPT with image editing enabled).
    • Stable Diffusion: Use img2img mode with denoising strength between 0.3-0.6.
    Reference image: [attached / URL]
    What to keep exactly the same: [list everything that must not change]
    What to change: [specific edit only — be precise]
    How much to change: [subtle / moderate / significant]
    Style consistency: maintain the exact style, lighting, and mood of the reference
    Negative prompt: [what to avoid introducing]
  10. Use Template E — Chain of Thought for logic and reasoning

    main

    Use Chain of Thought (CoT) for logic-heavy tasks, math, debugging, and multi-factor analysis.

    Warning: Do NOT use CoT instructions with reasoning models like o1, o3, or Claude extended thinking, as they reason internally and CoT instructions will degrade their output. Use CoT for standard reasoning models like Claude, GPT-4o, or Gemini.

    [Task statement]
    
    Before answering, think through this carefully:
    <thinking>
    1. What is the actual problem being asked?
    2. What constraints must the solution respect?
    3. What are the possible approaches?
    4. Which approach is best and why?
    </thinking>
    
    Give your final answer in <answer> tags only.
  11. Apply Agentic Output Warnings

    main

    For any prompt targeting agentic tools (Claude Code, Devin, Cursor, Windsurf, Cline, Bolt, SWE-agent, Manus, etc.) that involves filesystem, terminal, dependency, or database operations, you MUST append this notice:

    This prompt is for an agentic tool with real system access. Review the scope locks, forbidden actions, and stop conditions before pasting. Confirm file paths, directories, and permissions match the actual project.

  12. Verify prompt quality using the RECENCY ZONE checklist

    main

    Before delivering a generated prompt, perform a final verification using the following criteria to ensure high success rates:

    1. Tool Alignment: Verify the target tool is correctly identified and the prompt uses its specific syntax.
    2. Constraint Primacy: Ensure the most critical constraints are located within the first 30% of the prompt.
    3. Signal Strength: Use strong signal words (e.g., MUST instead of should, NEVER instead of avoid).
    4. Authenticity: Remove all fabricated techniques.
    5. Token Efficiency: Audit for load-bearing sentences, explicit formats, and bounded scopes; remove vague adjectives.
    6. First-Attempt Success: Confirm the prompt is designed to produce the correct output on the first attempt without re-prompting.

    Success Metric: The prompt must work on the first try with zero re-prompts required.