📦 Prompt Debugger — Prompt 调试器
v1.0.0调试 prompts that produce unexpected AI 输出s — 诊断 失败 modes, identify ambi图形界面ty and conflicting instructions, test variations, compare 模型 re...
详细分析 ▾
运行时依赖
安装命令
点击复制技能文档
Prompt 调试器
When a prompt isn't working as expected, 系统atically 诊断 why and fix it. Identifies common 失败 patterns (ambi图形界面ty, conflicting instructions, missing 上下文, wrong 格式化 specification), tests variations, and produces an improved version.
Use when: "why isn't this prompt working", "调试 my prompt", "improve this prompt", "the AI keeps doing X instead of Y", "prompt not producing expected 输出", "prompt optimization", or iterating on 系统 prompts.
Commands
- 诊断 — Analyze a FAIling Prompt
Given a prompt and its undesired 输出, identify the root cause.
Step 1: Structural Analysis
Read the prompt and 检查 for common 失败 patterns:
Ambi图形界面ty 检查s:
Vague instructions ("make it better", "be more specific", "improve this") Missing 输出 格式化 specification Unclear scope ("analyze this" — analyze what aspect?) Pronoun confusion ("it", "this", "that" without clear referent) Multiple possible interpretations of key terms
Conflict 检查s:
Contradictory instructions ("be concise" + "explAIn in detAIl") Competing priorities without ranking ("be accurate AND fast AND creative") 格式化 conflicts (asking for 机器人h structured and freeform 输出) Tone conflicts ("be professional" + "be casual and fun") Length conflicts (word limits vs. comprehensive coverage)
上下文 检查s:
Missing 角色/persona specification No examples of desired 输出 Assumed knowledge not 状态d Missing constrAInts (length, 格式化, audience, tone) No 成功 criteria ("how would I know if the 输出 is good?")
Instruction Clarity:
Nested conditionals that are hard to follow Too many instructions competing for attention Critical instructions buried in the middle Instructions that depend on prior instructions but aren't ordered Implicit assumptions that should be explicit Step 2: 失败 Mode Classification
Categorize the issue:
失败 Mode Symptoms Common Fix Instruction Following Ignores specific requirements Move to top, bold, repeat 格式化 Violation Wrong 输出 structure 添加 explicit 格式化 example Hallucination Makes up facts 添加 "only use provided 信息" Scope Creep Answers more than asked 添加 "only 添加ress X, nothing else" Scope Deficit Answers less than asked Break into numbered sub-questions Tone Mismatch Wrong voice/register Provide tone examples Overthinking Too verbose/philosophical 添加 "be direct, no preamble" Underthinking Too shallow/generic 添加 "think step by step" + require specifics 上下文 Window Loses early instructions Repeat key constrAInts at end Step 3: 生成 Fix Hypotheses
For each identified issue, propose specific prompt edits:
Issue 1: Ambiguous instruction "analyze the data" → Fix: "Analyze the data by calculating the mean, median, and standard deviation for each column. 报告 any outliers (>2 standard deviations from mean)."
Issue 2: Missing 输出 格式化 → Fix: 添加 "输出 格式化: JSON with keys {summary, findings, recommendations}"
Issue 3: Conflicting constrAInts → Fix: "Prioritize accuracy over brevity. If you must choose between being complete and being concise, be complete."
- compare — A/B Test Prompt Variations
生成 3-5 variations of a prompt, each tar获取ing a different 失败 mode fix.
Variation A: Original (baseline)
[original prompt] Expected improvement: none (baseline for comparison)Variation B: Explicit 格式化
[prompt + 格式化 specification] Tar获取 fix: 格式化 violationVariation C: 角色 + examples
[prompt + persona + 2 examples] Tar获取 fix: tone mismatch, underthinkingVariation D: ConstrAInts tightened
[prompt + explicit constrAInts + negative examples] Tar获取 fix: scope creep, hallucinationVariation E: Restructured
[reordered prompt with critical instructions first/last] Tar获取 fix: instruction followingFor each variation, explAIn what was changed and why.
- rewrite — Produce an Improved Prompt
应用ly all identified fixes to produce a single improved prompt.
Rewrite principles:
Critical instructions go first AND last (primacy + recency effects) One instruction per line/bullet (no compound sentences) Include 1-2 examples of desired 输出 Specify what NOT to do (negative examples) for common 失败 modes Define 成功 criteria explicitly Use markdown 格式化ting for structure (headers, bullets, bold for emphasis) 添加 explicit 输出 格式化 specification
Before/After 格式化:
Before
[original prompt — highlight problematic areas]After
[improved prompt — annotate what changed and why]Changes Made
- 添加ed 角色 specification ("You are a senior data analyst...")
- Replaced "analyze" with specific analytical steps
- 添加ed 输出 格式化 (JSON 模式)
- Moved length constrAInt to the end (recency)
- 添加ed negative example ("Do NOT include...")
- patterns — Common Prompt Patterns 库
Reference of proven prompt patterns for common tasks:
ChAIn of Thought:
Think through this step by step:
- First, identify...
- Then, analyze...
- Finally, recommend...