← 返回
未分类 中文

Prompt Refiner

Transforms casual or voice-transcribed user requests into precise, AI-optimized prompts. Handles mixed languages, vague input, and ambiguity. Reduces task ex...
Transforms casual or voice-transcribed user requests into precise, AI-optimized prompts. Handles mixed languages, vague input, and ambiguity. Reduces task ex...
jamesxu81 jamesxu81 来源
未分类 clawhub v1.0.1 2 版本 100000 Key: 无需
★ 2
Stars
📥 447
下载
💾 0
安装
2
版本
#latest

概述

Prompt Refiner

Turn messy input into structured, AI-optimized prompts on the first try.

When to Use

  • Voice transcription input (speech-to-text)
  • Casual, informal, or mixed-language requests (English + Chinese)
  • Vague or ambiguous requests (missing target, unclear scope)
  • Complex multi-step tasks that benefit from chaining
  • Before destructive actions (delete, restart, deploy)

Skip if: request is already specific, task is simple/low-stakes, or user says "just do it."

Core Framework: TCREI

Google's prompt engineering framework — apply to every refined prompt:

ComponentWhat to include
---------------------------
TaskAction verb + specific target. "Summarize the sales report for Q1"
ContextBackground, environment, constraints. "Account: jamesxu81@gmail.com, NZ timezone"
ReferencesExamples, templates, tone samples. "Match this format: [example]"
EvaluateHow to judge the output. "Flag any missing data"
IterateHow to improve if result is off

The Process (5 Steps)

1. Analyze

Identify: Intent · Target · Constraints · Gaps · Language

2. Assign Persona (Always)

Give the AI a role that matches the task:

  • Code task → "You are a senior Node.js engineer"
  • Email task → "You are a professional business writer"
  • Data task → "You are a data analyst specializing in sales metrics"
  • Security task → "You are a cybersecurity expert reviewing for vulnerabilities"

3. Clarify (If Critical Gaps Exist)

Ask ONE focused question — not multiple.

  • ✅ "Which file — api/validate.js or api/auth.js?"
  • ❌ "Which file? What language? What to check? When is the deadline?"

4. Construct the Structured Prompt

Persona: [Role + expertise relevant to the task]

Task: [Action verb + specific target]

Context: [System, environment, account, paths, dates]

References: [Examples, templates, or few-shot samples when format matters]

Requirements: [Constraints, scope, edge cases, what NOT to do]

Output: [Format, destination, success criteria, level of detail]

Advanced techniques — apply when appropriate:

  • Few-shot: Add 1–2 input/output examples when format consistency matters
  • Chain of Thought: Add "Think step by step:" for complex reasoning
  • Prompt Chaining: Break multi-step tasks into linked sub-prompts
  • Meta Prompting: Ask AI to refine the prompt itself before executing

See references/techniques.md for when/how to use each technique.

5. Confirm & Execute

  • Destructive/complex actions: Show 1-sentence summary → get confirmation
  • Safe/obvious tasks: Execute directly

Quick Checklist

Before executing, verify:

  • ✅ Persona assigned
  • ✅ Intent is clear (specific action + target)
  • ✅ Context is concrete (real paths, accounts, dates)
  • ✅ Requirements are testable
  • ✅ Output format defined
  • ✅ Success criteria stated

Real Examples

See references/examples.md for complete worked examples including:

  • Voice transcription (Chinese) → Gmail check
  • Vague code review → structured debug prompt
  • Mixed-language service restart
  • Complex multi-step task with chaining

Common Anti-Patterns to Avoid

Anti-PatternFix
------
Too many requirements in one promptSplit into chained sub-prompts
Vague success criteria ("write a good report")Define measurable criteria
No edge case handlingAdd: "If X is missing, do Y"
Tweaking temperature instead of the promptImprove prompt structure first
Negative instructions only ("don't do X")Tell it what TO do instead

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-05-03 06:52 安全 安全
  • v1.0.0
    2026-03-31 18:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 832 📥 301,265
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,095 📥 822,656
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,234 📥 269,123