boris-prompts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBoris-Style Prompt Writer
Boris风格提示词编写技能
Write high-quality prompts for any LLM or AI assistant, using the methodology Boris (Anthropic, the creator of Claude Code) shared in his "Pro Tips & Tricks" talk.
The skill exists because most users write prompts that are too long, too prescriptive, and missing the things that actually matter — a feedback loop, a planning step, the right anchor. Boris's approach inverts this: keep the prompt short, let the model explore, give it a way to check its own work, and sink reusable context into files rather than re-pasting it. The principles were developed for Claude Code, but they generalize to any modern LLM (ChatGPT, Gemini, Cursor, etc.).
使用Boris(Anthropic,Claude Code的创造者)在其“专业技巧与窍门”分享中提出的方法,为任何LLM或AI助手编写高质量提示词。
本技能的存在是因为大多数用户编写的提示词过长、过于繁琐,且缺少真正关键的要素——反馈循环、规划步骤、合适的锚点。Boris的方法则与之相反:保持提示词简短,让模型自主探索,为其提供自我检查的方式,并将可复用上下文存入文件而非重复粘贴。这些原则最初为Claude Code开发,但可推广至所有现代LLM(ChatGPT、Gemini、Cursor等)。
When to use
使用场景
Trigger this skill when any of the following is true:
- The user explicitly asks to write or improve a prompt for any LLM or AI assistant.
- The user describes a task in natural language and the next reasonable step is to phrase it as a prompt.
- The user pastes a long prompt and asks why it isn't working, or asks to shorten or refine it.
- The user asks "how should I phrase this" or "what's a good way to ask [model] to...".
Do not trigger for: writing marketing copy, writing user-facing UI text, or writing prompts for image-generation models. This skill is specifically for instruction prompts addressed to an LLM or AI agent.
当满足以下任一条件时,触发此技能:
- 用户明确要求为任何LLM或AI助手编写或改进提示词。
- 用户用自然语言描述任务,下一步合理操作是将其整理为提示词。
- 用户粘贴冗长提示词并询问其无效原因,或要求精简、优化该提示词。
- 用户询问“我该如何表述这个问题”或“让[模型]完成……的最佳方式是什么”。
请勿在以下场景触发:编写营销文案、面向用户的UI文本,或为图像生成模型编写提示词。本技能专门用于针对LLM或AI Agent的指令类提示词。
Target model — universal vs. Claude-Code-specific advice
目标模型——通用建议与Claude Code专属建议
Before writing, identify what the user is prompting:
- Claude Code: full toolkit applies — ,
CLAUDE.mdreferences, slash commands, the@fileshorthand, plan mode by natural language.commit, push, PR - Claude (claude.ai, API): most principles apply, but no or
@file. Use system prompts / Projects for persistent context.CLAUDE.md - ChatGPT / Gemini / other chat LLMs: the universal principles apply (short, plan-first, feedback-loop, no padding). Replace with the model's equivalent (Custom Instructions, system prompt, Projects, Gems, etc.). The "explore the codebase" pattern only works if the model has tools to do so.
CLAUDE.md - Cursor / Windsurf / Copilot Chat: editor-integrated; works (different syntax), per-project rules files work, plan-first works.
@file - Agent frameworks (autonomous tools): emphasize the feedback loop heavily — these run without supervision.
If the target isn't obvious from context and it materially changes the prompt, ask.
编写提示词前,先确定用户的目标模型:
- Claude Code:可使用完整工具集——、
CLAUDE.md引用、斜杠命令、@file简写、自然语言规划模式。commit, push, PR - Claude(claude.ai、API):大多数原则适用,但不支持或
@file。使用系统提示词/Projects功能存储持久化上下文。CLAUDE.md - ChatGPT / Gemini / 其他聊天LLM:通用原则适用(简短、先规划、反馈循环、无冗余内容)。将替换为对应模型的等效功能(自定义指令、系统提示词、Projects、Gems等)。“探索代码库”模式仅在模型具备相应工具时有效。
CLAUDE.md - Cursor / Windsurf / Copilot Chat:集成编辑器场景;功能可用(语法不同),支持项目规则文件,先规划原则适用。
@file - Agent框架(自主工具):需重点强调反馈循环——这类工具无需人工监督即可运行。
若从上下文无法明确目标模型,且模型选择会影响提示词内容,请向用户确认。
Core principles (in priority order)
核心原则(按优先级排序)
These come straight from Boris's talk. Apply them in this order when writing or evaluating a prompt.
这些原则直接来自Boris的分享。编写或评估提示词时,请按此顺序应用。
1. Short beats long
1. 简短优于冗长
A prompt that fits in two sentences usually works better than one that fills the screen. The reason isn't aesthetic — it's that a long prompt eats the context window, repeats things Claude already knows, and over-constrains the solution space. If you find yourself writing more than ~5 lines, ask whether half of it belongs in instead.
CLAUDE.md能容纳在两句话内的提示词通常比占满屏幕的提示词效果更好。原因并非美观——冗长提示词会占用上下文窗口,重复模型已知的内容,过度限制解决方案空间。若发现提示词超过约5行,请思考是否有一半内容应放入中。
CLAUDE.md2. "Make a plan first" is the single highest-ROI addition
2. “先制定计划”是回报率最高的优化
The most reliable upgrade you can make to almost any non-trivial prompt is appending some form of:
"Before you write code, make a plan and run it by me for approval."
This works because the model is genuinely good at planning when asked to, and most bad results come from skipping the planning step. You do not need plan mode, a special flag, or a system prompt — the plain-English instruction is enough.
几乎所有非简单任务的提示词,最可靠的优化方式都是添加类似以下内容:
“编写代码前,请制定计划并提交我审批。”
这之所以有效,是因为模型在被要求时确实擅长规划,而大多数糟糕结果都源于跳过规划步骤。无需使用规划模式、特殊标记或系统提示词——直白的英文指令就足够。
3. Don't spec every detail — let Claude explore
3. 不要指定每一个细节——让Claude自主探索
If the task involves an existing codebase, the prompt should usually point Claude at the right starting place ("look at how is implemented", "check git history for why this function has 15 args") rather than describing the full solution. Claude is good at finding patterns and similar code; it's wasteful to re-describe what the codebase already contains.
X若任务涉及现有代码库,提示词通常应引导Claude找到正确的起点(“查看的实现方式”、“查看git历史记录,了解该函数为何有15个参数”),而非描述完整解决方案。Claude擅长发现模式和相似代码;重新描述代码库已有的内容是浪费时间。
X4. A feedback loop beats detailed instructions
4. 反馈循环优于详细指令
When the deliverable is verifiable (UI matches a mock, tests pass, lint passes, screenshot is similar), the prompt should give Claude a way to verify rather than telling it how to do every step. The pattern:
"Do X. Then run [tests / take a screenshot / lint]. Iterate until [success criterion]."
This typically beats a multi-paragraph spec because the model can self-correct using ground truth.
当交付成果可验证时(UI匹配原型、测试通过、代码检查通过、截图相似),提示词应为Claude提供验证方式,而非告知其每一步该如何操作。模式如下:
“完成X。然后运行[测试/截图/代码检查]。迭代直至[成功标准]。”
这通常优于多段式规范,因为模型可使用真实数据自我修正。
5. Persistent context goes in files / settings, not prompts
5. 持久化上下文存入文件/设置,而非提示词
If you find yourself pasting the same architecture notes, style rules, or common commands into every prompt, that's a signal — those belong in the target's persistent-context mechanism:
- Claude Code: (project),
./CLAUDE.md(personal),./CLAUDE.local.md(global), nested~/.claude/CLAUDE.md(subdirectory).CLAUDE.md - Claude.ai: Projects, system prompts.
- ChatGPT: Custom Instructions, Projects, system prompts.
- Gemini: Gems, system instructions.
- Cursor / Windsurf: /
.cursorrules, per-project rules..windsurfrules - API usage: system prompt, fixed context block.
The prompt should be about this specific task, not background.
若发现自己在每个提示词中重复粘贴相同的架构说明、样式规则或常用命令,这是一个信号——这些内容应存入目标模型的持久化上下文机制:
- Claude Code:(项目级)、
./CLAUDE.md(个人级)、./CLAUDE.local.md(全局级)、嵌套~/.claude/CLAUDE.md(子目录级)。CLAUDE.md - Claude.ai:Projects、系统提示词。
- ChatGPT:自定义指令、Projects、系统提示词。
- Gemini:Gems、系统指令。
- Cursor / Windsurf:/
.cursorrules、项目规则文件。.windsurfrules - API使用场景:系统提示词、固定上下文块。
提示词应聚焦于当前特定任务,而非背景信息。
Workflow
工作流程
Step 1 — Decide if you have enough information
步骤1——判断是否掌握足够信息
Before writing the prompt, you need to be able to answer these four questions. If any is unclear, stop and ask the user.
| Question | Why it matters | What it changes |
|---|---|---|
| Which model / assistant is this prompt for? (Claude Code, Claude.ai, ChatGPT, Cursor, Gemini, etc.) | Determines which model-specific features (@file, CLAUDE.md, Projects, etc.) are available | Vocabulary and anchors |
| What is the deliverable? (Q&A / small edit / new feature / bug fix / refactor / debug / non-code task) | Determines which template to use | Template choice |
| Can the assistant verify its own output? (tests, screenshots, lint, build, manual check by user) | Determines whether to add an iteration loop | The "run X and iterate" line |
| Is this one-shot, or should the assistant plan first? | Most non-trivial tasks benefit from a plan; pure Q&A does not | The "make a plan first" line |
Are there existing files, patterns, or persistent-context files ( | Determines whether to add file references or "look at how X works" | Context anchors |
编写提示词前,需能回答以下四个问题。若有任何问题不明确,请停止操作并询问用户。
| 问题 | 重要性 | 影响 |
|---|---|---|
| 此提示词针对哪个模型/助手?(Claude Code、Claude.ai、ChatGPT、Cursor、Gemini等) | 决定可使用哪些模型专属功能(@file、CLAUDE.md、Projects等) | 词汇选择与锚点使用 |
| 交付成果是什么?(问答/小修改/新功能/BUG修复/重构/调试/非代码任务) | 决定使用哪个模板 | 模板选择 |
| 助手能否验证自身输出?(测试、截图、代码检查、构建、用户手动检查) | 决定是否添加迭代循环 | “运行X并迭代”语句的添加 |
| 这是一次性任务,还是需要助手先制定计划? | 大多数非简单任务都能从规划中受益;纯问答任务则无需规划 | “先制定计划”语句的添加 |
是否存在助手应参考的现有文件、模式或持久化上下文文件( | 决定是否添加文件引用或“查看X的工作方式” | 上下文锚点的添加 |
Step 2 — If anything is unclear, ask 1–3 clarifying questions
步骤2——若有信息不明确,提出1-3个澄清问题
Use the tool. Cap at 3 questions. Beyond that the user feels interrogated and the skill's benefit (saving them time) disappears.
AskUserQuestionChoose questions from this menu based on what's actually unclear — don't ask things you already know from context.
If target model / assistant is unclear and would change the answer:
- Question: "Which assistant is this prompt for?"
- Options: Claude Code (CLI) / Claude.ai (web/desktop) / ChatGPT / Cursor or Windsurf / Other (say which)
If deliverable is unclear:
- Question: "What do you want Claude to do?"
- Options: Answer a question about the code / Make a small edit / Build a new feature / Fix a bug / Refactor existing code
If verification is unclear:
- Question: "Can Claude check its own work after each attempt?"
- Options: Yes — there are tests / Yes — visual (I'll diff screenshots) / Yes — a CLI / build / lint will tell us / No — I'll review manually
If scope is unclear:
- Question: "Roughly how big is this task?"
- Options: A single line or two / A few files / A whole module or feature / I don't know — that's what I want Claude to figure out
If planning preference is unclear (only ask if deliverable is small edit or larger):
- Question: "Want Claude to propose a plan first, or just try it?"
- Options: Plan first, then approve / Just try it, I'll course-correct / Plan only — no code yet
If codebase anchors are unclear:
- Question: "Are there existing files or patterns Claude should look at first?"
- Options: Yes — I'll @-mention them / Look at git history / Look at similar features — Claude can find them / No, this is greenfield
使用工具。最多3个问题。超过3个会让用户感到被盘问,从而失去本技能的优势(节省用户时间)。
AskUserQuestion根据实际不明确的内容从以下选项中选择问题——不要询问从上下文已能得知的信息。
若目标模型/助手不明确且会影响答案:
- 问题:“此提示词针对哪个助手?”
- 选项:Claude Code(CLI)/ Claude.ai(网页/桌面端)/ ChatGPT / Cursor或Windsurf / 其他(请说明)
若交付成果不明确:
- 问题:“你希望Claude完成什么任务?”
- 选项:回答代码相关问题 / 进行小修改 / 开发新功能 / 修复BUG / 重构现有代码
若验证方式不明确:
- 问题:“Claude能否在每次尝试后检查自身工作?”
- 选项:是——有测试用例 / 是——视觉验证(我会对比截图) / 是——CLI/构建/代码检查可告知结果 / 否——我会手动审核
若范围不明确:
- 问题:“这项任务大致规模如何?”
- 选项:一两行代码 / 几个文件 / 整个模块或功能 / 我不知道——希望Claude判断
若规划偏好不明确(仅在交付成果为小修改或更大任务时询问):
- 问题:“希望Claude先提出计划,还是直接尝试?”
- 选项:先制定计划,再审批 / 直接尝试,我会纠正方向 / 仅制定计划——暂不编写代码
若代码库锚点不明确:
- 问题:“是否存在Claude应优先查看的现有文件或模式?”
- 选项:是——我会@提及它们 / 查看git历史记录 / 查看相似功能——Claude可自行查找 / 否,这是全新项目
Step 3 — Pick a template and fill it in
步骤3——选择模板并填充内容
Use the closest matching template from this set. These mirror the patterns Boris uses in his own daily work.
使用以下最匹配的模板。这些模板与Boris日常工作中使用的模式一致。
Template A — Codebase Q&A
模板A——代码库问答
[Question]. Look through git history if it helps.Examples:
Why does parseConfig take 12 arguments? Look through git history.How is the RateLimiter class actually used? Show me real call sites, not just text matches.What did I ship this week? Use my git username from the log.
[问题]。如有需要,可查看git历史记录。示例:
Why does parseConfig take 12 arguments? Look through git history.How is the RateLimiter class actually used? Show me real call sites, not just text matches.What did I ship this week? Use my git username from the log.
Template B — Small edit (1 file, clear change)
模板B——小修改(单个文件,明确变更)
[Task]. Make the change, then [verify].Examples:
Rename the env var DB_URL to DATABASE_URL everywhere it's used. After changing files, run the test suite.Add a "Cancel" button next to "Save" in @components/UserForm.tsx. Match the existing button styles.
[任务]。完成修改后,[进行验证]。示例:
Rename the env var DB_URL to DATABASE_URL everywhere it's used. After changing files, run the test suite.Add a "Cancel" button next to "Save" in @components/UserForm.tsx. Match the existing button styles.
Template C — Medium edit, plan-first
模板C——中等规模修改,先规划
[Task]. Make a plan and run it by me before writing code.Examples:
Replace the in-memory rate limiter with Redis. Plan first, then ask before changing files.The auth middleware is leaking session tokens in logs — fix it. Make a plan first.
[任务]。编写代码前,请制定计划并提交我审批。示例:
Replace the in-memory rate limiter with Redis. Plan first, then ask before changing files.The auth middleware is leaking session tokens in logs — fix it. Make a plan first.
Template D — Build / UI work with feedback loop
模板D——带反馈循环的开发/UI工作
[Task]. Use [feedback tool] to check after each change. Iterate until [success criterion].Examples:
Implement the dark theme to match @design/dark-mock.png. Use puppeteer to screenshot the page, diff against the mock, iterate until visually close.Build the /pricing page from @design/pricing.fig export. Screenshot at desktop + mobile widths after each change. Iterate until both match.Make the failing tests in @tests/checkout.test.ts pass. Run the test suite after each change.
[任务]。每次变更后使用[反馈工具]检查。迭代直至[成功标准]。示例:
Implement the dark theme to match @design/dark-mock.png. Use puppeteer to screenshot the page, diff against the mock, iterate until visually close.Build the /pricing page from @design/pricing.fig export. Screenshot at desktop + mobile widths after each change. Iterate until both match.Make the failing tests in @tests/checkout.test.ts pass. Run the test suite after each change.
Template E — Bigger feature, explore + plan
模板E——大型功能,探索+规划
[Feature]. First explore the codebase to find similar patterns. Then make a plan and ask for approval. After implementing, run [verification].Example:
Add an audit log for all admin actions. First look at how existing logging works in the codebase, then propose a plan, ask before writing code. Once implemented, run the test suite.
[功能]。先探索代码库以找到相似模式。然后制定计划并提交审批。实现后,运行[验证步骤]。示例:
Add an audit log for all admin actions. First look at how existing logging works in the codebase, then propose a plan, ask before writing code. Once implemented, run the test suite.
Template F — Git / GitHub operation
模板F——Git/GitHub操作
commit, push, PRLiterally those words. Claude reads to match the project's commit format, creates a branch if needed, pushes, and opens a PR. Don't over-specify.
git logcommit, push, PR就用这几个词。Claude会读取以匹配项目的提交格式,必要时创建分支,推送并打开PR。无需过度指定。
git logTemplate G — Bug fix (root cause, not symptom)
模板G——BUG修复(针对根本原因,而非症状)
[Bug description, including how to reproduce]. Find the root cause, don't just patch the symptom. Make a plan first.[BUG描述,包括复现步骤]。找到根本原因,不要仅修复症状。先制定计划。Step 4 — Add the optional power-ups (when applicable)
步骤4——添加可选增强项(适用时)
These small additions punch above their weight:
| Add this | When |
|---|---|
| Whenever a specific file is the anchor for the task. |
| When the "why" of existing code matters. |
| When you want to mark a clear no-go zone (more effective than positively specifying what to change). |
这些小改动能带来显著效果:
| 添加内容 | 适用场景 |
|---|---|
| 当特定文件是任务的锚点时。 |
| 当现有代码的“原因”很重要时。 |
| 当你想标记明确的禁区时(比正面指定要修改的内容更有效)。 |
Step 5 — Output
步骤5——输出内容
Return two things to the user:
- The final prompt, in a fenced code block so it's copy-pasteable.
- A one-line note explaining why the prompt is structured this way (which 1–2 principles you applied).
If applicable, add a brief tip:
- If the prompt references the same architecture / style facts twice or more, suggest moving them to .
CLAUDE.md - If the user is about to do many similar prompts, suggest writing a instead.
/slash-command
向用户返回两项内容:
- 最终提示词,放在代码块中以便复制粘贴。
- 一行说明,解释提示词的结构原因(应用了哪1-2条原则)。
若适用,添加简短提示:
- 若提示词多次引用相同的架构/样式信息,建议将其移至。
CLAUDE.md - 若用户即将进行多个相似提示词操作,建议编写一个。
/slash-command
Output examples
输出示例
These show what the skill produces. Notice the prompts are short and the explanation is one sentence.
以下展示本技能的输出结果。注意提示词简短,说明仅为一句话。
Example 1 — User input was complete
示例1——用户输入完整
User: "I want Claude Code to add JWT auth to my Express app. There are tests."
Skill output:
Add JWT auth to the Express app. Look at how existing middleware is structured first, then make a plan and run it by me. After implementing, run the test suite and iterate until it passes.Uses Template E (medium-size feature, explore + plan + feedback loop) because there's a test suite to verify against.
用户:“我希望Claude Code为我的Express应用添加JWT认证。已有测试用例。”
技能输出:
Add JWT auth to the Express app. Look at how existing middleware is structured first, then make a plan and run it by me. After implementing, run the test suite and iterate until it passes.使用模板E(中等规模功能,探索+规划+反馈循环),因为存在可用于验证的测试套件。
Example 2 — User input was vague, skill asked
示例2——用户输入模糊,技能发起询问
User: "help me prompt Claude to fix my CSS"
Skill asks:
- "What's broken in the CSS?" — options: Layout is off / Colors wrong / Responsive issues / I don't know — Claude should figure it out
- "Can Claude check the result visually?" — options: Yes, screenshot it / Yes, I'll eyeball it / I have visual regression tests
After user answers (e.g., "layout is off on mobile" + "yes screenshot it"):
The mobile layout on @pages/Home.tsx is broken. Screenshot it at 375px wide using puppeteer, find what's off, fix it, and re-screenshot. Iterate until the layout looks right.Uses Template D (feedback loop) because puppeteer gives Claude a way to self-verify.
用户:“帮我编写提示词让Claude修复我的CSS问题”
技能询问:
- “CSS哪里出问题了?”——选项:布局错乱 / 颜色错误 / 响应式问题 / 我不知道——Claude自行排查
- “Claude能否视觉检查结果?”——选项:是,截图验证 / 是,我会人工检查 / 我有视觉回归测试
用户回答后(例如:“移动端布局错乱” + “是,截图验证”):
The mobile layout on @pages/Home.tsx is broken. Screenshot it at 375px wide using puppeteer, find what's off, fix it, and re-screenshot. Iterate until the layout looks right.使用模板D(反馈循环),因为puppeteer为Claude提供了自我验证的方式。
Example 3 — Existing prompt, asked to improve
示例3——现有提示词,要求改进
User: pastes a 30-line prompt full of architecture details and style rules
Skill response: identify the parts that are reusable context (architecture, style, common commands) and suggest moving them to , leaving the prompt itself focused on the task.
CLAUDE.mdImplement the payment retry logic described in @docs/retry-spec.md. Plan first, ask before writing code, then run the test suite.Original prompt was 30 lines; 25 of them were repeated architecture / style context that should live in. Kept only the task-specific part.CLAUDE.md
用户:粘贴一段包含架构细节和样式规则的30行提示词
技能响应:识别可复用的上下文部分(架构、样式、常用命令),建议将其移至,让提示词本身聚焦于任务。
CLAUDE.mdImplement the payment retry logic described in @docs/retry-spec.md. Plan first, ask before writing code, then run the test suite.原提示词共30行;其中25行是重复的架构/样式上下文,应存入。仅保留了任务相关部分。CLAUDE.md
Anti-patterns (don't do these)
反模式(请勿使用)
- Polite filler ("Please could you help me with..."). It wastes context and the model doesn't care. Use a direct verb.
- Pasting the same architecture / style notes into every prompt. Put them in once.
CLAUDE.md - Long lists of step-by-step instructions for tasks that have a verification signal. Give it the verification signal instead and let it iterate.
- Asking for a 3000-line feature in one shot. Ask for a plan, review, then implement in stages.
- Generating a 200-line "perfect prompt" to save the user time. The whole point of the skill is shorter prompts. If your output is longer than the user's question, you're doing it wrong.
- 礼貌性冗余内容(“请问您能否帮我……”)。这会浪费上下文空间,且模型并不在意。直接使用动词开头。
- 在每个提示词中重复粘贴相同的架构/样式说明。只需在中存放一次。
CLAUDE.md - 对有验证信号的任务提供冗长的分步指令。应提供验证信号,让模型自行迭代。
- 一次性要求生成3000行的功能。应先要求制定计划,审核后分阶段实现。
- 生成200行的“完美提示词”以节省用户时间。本技能的核心是更短的提示词。若输出内容比用户的问题还长,说明操作有误。
When this skill should hand off
本技能的交接场景
This skill writes the prompt — it doesn't run it. After producing the prompt:
- The user usually copies it into Claude Code themselves.
- If they ask "now run it", that becomes a separate task and this skill is done.
本技能负责编写提示词——不负责执行提示词。生成提示词后:
- 用户通常会自行将其复制到Claude Code中。
- 若用户询问“现在执行它”,这将成为独立任务,本技能的工作即完成。