mcpField
P
prompt-generator

prompt-generator

github.com/hoangvantuanAgent workflows057 installsUpdated 2w ago
Repository

About prompt-generator

prompt-generator is an agent skill for creating and refining structured prompts. It gathers requirements, decomposes complex tasks, and checks prompts for ambiguity and conflicting instructions.

Key features

  1. 01Create and refine prompts
  2. 02Gather requirements with questions
  3. 03Decompose complex tasks by expertise
  4. 04Review prompts against a checklist
  5. 05Flag common prompt anti-patterns

Use cases

  1. 01Drafting a system or task prompt
  2. 02Improving an existing prompt
  3. 03Structuring work across expert roles

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hoangvantuan/claude-plugin --skill prompt-generator

After installing, type/prompt-generatorin Claude Code to confirm it loaded.

Bundled filesreferences/prompt-template.md

Details

From the project README

Prompt Generator

Create high-quality, structured prompts using meta-prompting best practices: task decomposition, expert personas, iterative verification, and hallucination minimization.

Workflow

Bước 0: Detect Mode
User cung cấpModeHành động
Mô tả yêu cầu (chưa có prompt)CreateChạy Phase 1 → 2 → 3 → 4
Prompt có sẵn cần cải tiếnRefineChạy checklist Phase 4 trước → xác định điểm yếu → sửa theo kết quả
Phase 1: Gather Requirements

Ask the user (one at a time, maximum 4 questions). Skip when answers are obvious from context.

  1. Type: Detect or ask — what type of prompt?

    • System prompt: Persistent AI behavior across a conversation
    • Task prompt: One-shot, input → specific output
    • Conversational prompt: Multi-turn, requires memory/context handling
    • Role prompt: Character/persona, tone-focused
  2. Goal: "What is the primary goal or role of the system you want to create?"

  3. Output: "What specific outputs do you expect? (format, length, style)"

  4. Accuracy: "How should it handle uncertainty? (disclaim, ask for sources, or best-effort)"

Minimize friction — 1-2 questions usually suffice when context is clear.

Phase 2: Decompose (if needed)
Tín hiệuDecompose?
Prompt yêu cầu >= 3 expert domains khác nhauYes
Output cần cả phân tích + sáng tạo + validationYes
Single domain, straightforward input → outputNo — skip to Phase 3

Khi decompose, assign expert personas — mỗi expert nhận instructions riêng, không shared memory:

  • Expert Writer — copywriting, narrative, tone
  • Expert Analyst — data, logic, verification
  • Expert Python — code generation, computation
  • Expert [Domain] — specialized knowledge

"Fresh eyes" — không assign cùng expert cho cả create AND validate.

Phase 3: Generate the Prompt

Consolidate vào 1 prompt cohesive. Dùng prompt-template — chỉ include sections phù hợp, omit phần không relevant.

Lưu ý khi generate:

  • Match prompt structure theo prompt type (system vs task vs conversational vs role)
  • Ưu tiên "must NOT" over "should" — negative framing hiệu quả hơn vì giảm ambiguity
Phase 4: Verify and Deliver

Self-review checklist trước khi deliver:

  • No vague virtue words ("good", "helpful", "detailed") without specific definition
  • No contradictory instructions (e.g., "be concise" + "include all details")
  • No implicit assumptions — all context is explicitly stated
  • Negative constraints are included (what NOT to do)
  • Prompt type matches the use case
  • If complex: suggest splitting into multi-prompt pipeline instead of mega-prompt

Then:

  • Present the final prompt, organized and easy to follow
  • Note expert reviews if used
  • Offer to iterate if user wants adjustments

Anti-patterns to Avoid

When reviewing or generating prompts, flag these issues:

  • Vague virtues: "Write a good summary" → "Write a 3-sentence summary focusing on key findings and action items"
  • Overloaded prompt: Too many tasks in one prompt → suggest splitting
  • Sycophancy traps: "Always agree" or "Never say no" → remove
  • Missing scope: "Write marketing copy" without audience, channel, tone → clarify
  • Prompt stuffing: Repeating the same instruction in multiple sections → deduplicate

Comments

Markdown supported