egorfedorov/claude-context-optimizer

sharpen-prompt

Rewrite a vague request into a precise prompt — goal, context, scope, constraints, what done looks like, output format.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/egorfedorov/claude-context-optimizer --skill sharpen-prompt

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Sharpen a prompt

A precise prompt saves the back-and-forth, and the tokens, that a vague one costs. Rewrite the user's prompt so another assistant could do the task right on the first try.

Check what the prompt is missing

  1. Goal: what should exist or be true at the end.
  2. Context: who it's for, what it builds on, what was tried.
  3. Scope: exactly which files, sections, data or part of the problem. Name

them.

  1. Constraints: must keep, must avoid, length, tone, tools, deadline.
  2. Done looks like: how to tell it worked: tests pass, a sample output, a

checklist.

  1. Output format: a list, a table, a diff, a file, a one-paragraph answer.

Then

  • If you can fill the gaps from the conversation, write the improved prompt in

a code block in the user's language. Keep it as short as the task allows, and list in one line what you added and why.

  • If one gap is essential and unknowable, ask that one question instead of

guessing. Never ask more than one.

  • Don't do the task itself unless the user asks you to.