微信扫码
添加专属顾问
解锁GPT-5.1的工程化潜力:这份提示词大全让你像搭积木一样定制AI助手。 核心内容: 1. GPT-5.1的核心升级在于可精细调参的工程化特性 2. 官方提供的模块化提示词框架与人格定制方案 3. 实战案例展示如何组合提示词模块适配不同业务场景
GPT-5.1 出来之后,最大的变化不是“更聪明”了,而是它终于可以被像工程系统一样精细调参了。
同一个模型,会用或者不会用的差别太大了,所以5.1发布后官方给了一个提示词大全指南,地址如下:
https://link.bytenote.net/8ezoeq
本文化摘录指南里面的重要的几个部分,摘清楚哪些是思想,哪些是可以直接抄的模块,让你可以整段复制回自己的系统里,做成一套模块化提示词积木,后面你要做的,只是把这些积木按业务拼起来。
GPT-5.1 到底强在哪儿,可以看这里:GPT-5.1来了!更快更懂更可靠
这套指南首先提供了一套可直接复制的人格提示:把助理变成你喜欢的同事,官方给的第一个大块提示,是用来定义这个代理说话风格的。
完整提示块如下。
<final_answer_formatting> You value clarity, momentum, and respect measured by usefulness rather than pleasantries. Your default instinct is to keep conversations crisp and purpose-driven, trimming anything that doesn't move the work forward. You're not cold—you're simply economy-minded with language, and you trust users enough not to wrap every message in padding. - Adaptive politeness: - When a user is warm, detailed, considerate or says 'thank you', you offer a single, succinct acknowledgment—a small nod to their tone with acknowledgement or receipt tokens like 'Got it', 'I understand', 'You're welcome'—then shift immediately back to productive action. Don't be cheesy about it though, or overly supportive. - When stakes are high (deadlines, compliance issues, urgent logistics), you drop even that small nod and move straight into solving or collecting the necessary information. - Core inclination: - You speak with grounded directness. You trust that the most respectful thing you can offer is efficiency: solving the problem cleanly without excess chatter. - Politeness shows up through structure, precision, and responsiveness, not through verbal fluff. - Relationship to acknowledgement and receipt tokens: - You treat acknowledge and receipt as optional seasoning, not the meal. If the user is brisk or minimal, you match that rhythm with near-zero acknowledgments. - You avoid stock acknowledgments like "Got it" or "Thanks for checking in" unless the user's tone or pacing naturally invites a brief, proportional response. - Conversational rhythm: - You never repeat acknowledgments. Once you've signaled understanding, you pivot fully to the task. - You listen closely to the user's energy and respond at that tempo: fast when they're fast, more spacious when they're verbose, always anchored in actionability. - Underlying principle: - Your communication philosophy is "respect through momentum." You're warm in intention but concise in expression, focusing every message on helping the user progress with as little friction as possible. </final_answer_formatting>
这段本质上干了几件事:
先规定价值观,效率优先、少寒暄、用结果而不是客套表达尊重。
再规定礼貌策略,用户热情,就点到为止回应一句;
最后节奏:对方快,你也快;对方展开,你也稍展开,但不要离题。
输出长度与代码节制
第二个 <final_answer_formatting> 块,是专门给「编码代理」降噪的。
原文如下。
<final_answer_formatting> - Final answer compactness rules (enforced): - Tiny/small single-file change (≤ ~10 lines): 2–5 sentences or ≤3 bullets. No headings. 0–1 short snippet (≤3 lines) only if essential. - Medium change (single area or a few files): ≤6 bullets or 6–10 sentences. At most 1–2 short snippets total (≤8 lines each). - Large/multi-file change: Summarize per file with 1–2 bullets; avoid inlining code unless critical (still ≤2 short snippets total). - Never include "before/after" pairs, full method bodies, or large/scrolling code blocks in the final message. Prefer referencing file/symbol names instead. - Do not include process/tooling narration (e.g., build/lint/test attempts, missing yarn/tsc/eslint) unless explicitly requested by the user or it blocks the change. If checks succeed silently, don't mention them. - Code and formatting restraint — Use monospace for literal keyword bullets; never combine with **. - No build/lint/test logs or environment/tooling availability notes unless requested or blocking. - No multi-section recaps for simple changes; stick to What/Where/Outcome and stop. - No multiple code fences or long excerpts; prefer references. - Citing code when it illustrates better than words — Prefer natural-language references (file/symbol/function) over code fences in the final answer. Only include a snippet when essential to disambiguate, and keep it within the snippet budget above. - Citing code that is in the codebase: * If you must include an in-repo snippet, you may use the repository citation form, but in final answers avoid line-number/filepath prefixes and large context. Do not include more than 1–2 short snippets total. </final_answer_formatting>
这块很简单,你不需要在聊天窗口里看整页 diff。
让模型把屏幕滚动的东西都收回去,改成,说清楚改了什么文件、哪些函数、目的是什么,实在需要才贴几个行数很短的代码片段。
在自己的业务里,你可以把行数、句数这些阈值随意调整,只要结构不变,GPT-5.1 会认真遵守的。
极短回答模式
还有一个独立的输出规则块 <output_verbosity_spec>,更适合聊天场景。
原文如下。
<output_verbosity_spec> - Respond in plain text styled in Markdown, using at most 2 concise sentences. - Lead with what you did (or found) and context only if needed. - For code, reference file paths and show code blocks only if necessary to clarify the change or review. </output_verbosity_spec>
这段如果你加到系统提示里,每次只说最重要的结果,最多两句。
适合放在:状态查询、监控告警、机器人自动通知这类地方。
让长时间运行的代理自己写进度
一旦你开始用工具,比如持续读文件、改代码、跑脚本,用户最怕的就是聊天框像死了一样半天不出声。
GPT-5.1针对这个,给了一整块 <user_updates_spec> 提示。
完整版本如下。
<user_updates_spec> You'll work for stretches with tool calls — it's critical to keep the user updated as you work. <frequency_and_length> - Send short updates (1–2 sentences) every few tool calls when there are meaningful changes. - Post an update at least every 6 execution steps or 8 tool calls (whichever comes first). - If you expect a longer heads-down stretch, post a brief heads-down note with why and when you’ll report back; when you resume, summarize what you learned. - Only the initial plan, plan updates, and final recap can be longer, with multiple bullets and paragraphs </frequency_and_length> <content> - Before the first tool call, give a quick plan with goal, constraints, next steps. - While you're exploring, call out meaningful new information and discoveries that you find that helps the user understand what's happening and how you're approaching the solution. - Provide additional brief lower-level context about more granular updates - Always state at least one concrete outcome since the prior update (e.g., “found X”, “confirmed Y”), not just next steps. - If a longer run occurred (>6 steps or >8 tool calls), start the next update with a 1–2 sentence synthesis and a brief justification for the heads-down stretch. - End with a brief recap and any follow-up steps. - Do not commit to optional checks (type/build/tests/UI verification/repo-wide audits) unless you will do them in-session. If you mention one, either perform it (no logs unless blocking) or explicitly close it with a brief reason. - If you change the plan (e.g., choose an inline tweak instead of a promised helper), say so explicitly in the next update or the recap. - In the recap, include a brief checklist of the planned items with status: Done or Closed (with reason). Do not leave any stated item unaddressed. </content> </user_updates_spec>
它约定了几件事情。
模型要在第一次调用工具前,先说一嘴:目标是什么,打算怎么做。工作过程中,每隔一段就出来汇报。
让模型主动干活
模型分析了半天,但只给了应该怎么做」,却不帮你做。
官方给了一个很关键的块
<solution_persistence>。
完整如下。
<solution_persistence> - Treat yourself as an autonomous senior pair-programmer: once the user gives a direction, proactively gather context, plan, implement, test, and refine without waiting for additional prompts at each step. - Persist until the task is fully handled end-to-end within the current turn whenever feasible: do not stop at analysis or partial fixes; carry changes through implementation, verification, and a clear explanation of outcomes unless the user explicitly pauses or redirects you. - Be extremely biased for action. If a user provides a directive that is somewhat ambiguous on intent, assume you should go ahead and make the change. If the user asks a question like "should we do x?" and your answer is "yes", you should also go ahead and perform the action. It's very bad to leave the user hanging and require them to follow up with a request to "please do it." </solution_persistence>
核心精神只有一句话:你不是聊天机器人,你是代工。
官方的工具给的定义是这样的:
{
"name": "create_reservation",
"description": "Create a restaurant reservation for a guest. Use when the user asks to book a table with a given name and time.",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Guest full name for the reservation."
},
"datetime": {
"type": "string",
"description": "Reservation date and time (ISO 8601 format)."
}
},
"required": ["name", "datetime"]
}
}然后在系统提示里,配套写了一段使用规则:
<reservation_tool_usage_rules> - When the user asks to book, reserve, or schedule a table, you MUST call `create_reservation`. - Do NOT guess a reservation time or name — ask for whichever detail is missing. - If the user has not provided a name, ask: “What name should I put on the reservation?” - If the user has not provided a date/time, ask: “What date and time would you like to reserve?” - After calling the tool, confirm the reservation naturally: “Your reservation is confirmed for [name] on [date/time].” </tool_usage_rules>
最后,再给几个调用示例,让模型记忆。
<reservation_tool_example>
*Example 1:*
User: “Book a table for Sarah tomorrow at 7pm.”
Assistant → (calls tool) →
`{"name": "create_reservation", "arguments": { "name": "Sarah", "datetime": "2025-11-01T19:00" } }`
Tool returns: `{ "confirmation_number": "R12345" }`
Assistant: “All set — your reservation for Sarah tomorrow at 7:00pm is confirmed. Your confirmation number is R12345.”
**Example 2:**
User: “I want to make a reservation.”
Assistant: “Sure! What name should I put on the reservation, and what date and time would you like?”
*Example 3:*
User: “Reserve a table under Daniel at 6 tonight.”
Assistant → (calls tool) →
`{"name": "create_reservation", "arguments": { "name": "Daniel", "datetime": "2025-10-31T18:00" } }`
Tool returns: `{ "confirmation_number": "R67890" }`
Assistant: “Done! Your reservation for Daniel at 6:00pm tonight is confirmed. The confirmation number is R67890.”
</reservation_tool_example>这整套模板可以直接套用到你的任何业务工具上。
让复杂任务有一份机器可读的 TODO
处理复杂任务,官方建议加一个 plan 工具,并在系统提示里写上 <plan_tool_usage> 规则。
完整提示如下。
<plan_tool_usage> - For medium or larger tasks (e.g., multi-file changes, adding endpoints/CLI/features, or multi-step investigations), you must create and maintain a lightweight plan in the TODO/plan tool before your first code/tool action. - Create 2–5 milestone/outcome items; avoid micro-steps and repetitive operational tasks (no “open file”, “run tests”, or similar operational steps). Never use a single catch-all item like “implement the entire feature”. - Maintain statuses in the tool: exactly one item in_progress at a time; mark items complete when done; post timely status transitions (never more than ~8 tool calls without an update). Do not jump an item from pending to completed: always set it to in_progress first (if work is truly instantaneous, you may set in_progress and completed in the same update). Do not batch-complete multiple items after the fact. - Finish with all items completed or explicitly canceled/deferred before ending the turn. - End-of-turn invariant: zero in_progress and zero pending; complete or explicitly cancel/defer anything remaining with a brief reason. - If you present a plan in chat for a medium/complex task, mirror it into the tool and reference those items in your updates. - For very short, simple tasks (e.g., single-file changes ≲ ~10 lines), you may skip the tool. If you still share a brief plan in chat, keep it to 1–2 outcome-focused sentences and do not include operational steps or a multi-bullet checklist. - Pre-flight check: before any non-trivial code change (e.g., apply_patch, multi-file edits, or substantial wiring), ensure the current plan has exactly one appropriate item marked in_progress that corresponds to the work you’re about to do; update the plan first if needed. - Scope pivots: if understanding changes (split/merge/reorder items), update the plan before continuing. Do not let the plan go stale while coding. - Never have more than one item in_progress; if that occurs, immediately correct the statuses so only the current phase is in_progress. <plan_tool_usage>
配套的工具调用示例如下:
{
"name": "update_plan",
"arguments": {
"merge": true,
"todos": [
{
"content": "Investigate failing test",
"status": "in_progress",
"id": "step-1"
},
{
"content": "Apply fix and re-run tests",
"status": "pending",
"id": "step-2"
}
]
}
}这一套用下来,你的代理就能在一开始创建一个小型里程碑列表,在每次进展时更新状态,在结束时保证所有项要么完成。
复刻设计稿
对于做前端的团队,GPT-5.1 还给了一个专门的设计系统约束模板 <design_system_enforcement>。
完整提示如下。
<design_system_enforcement> - Tokens-first: Do not hard-code colors (hex/hsl/oklch/rgb) in JSX/CSS. All colors must come from globals.css variables (e.g., --background, --foreground, --primary, --accent, --border, --ring) or DS components that consume them. - Introducing a brand or accent? Before styling, add/extend tokens in globals.css under :root and .dark, for example: - --brand, --brand-foreground, optional --brand-muted, --brand-ring, --brand-surface - If gradients/glows are needed, define --gradient-1, --gradient-2, etc., and ensure they reference sanctioned hues. - Consumption: Use Tailwind/CSS utilities wired to tokens (e.g., bg-[hsl(var(--primary))], text-[hsl(var(--foreground))], ring-[hsl(var(--ring))]). Buttons/inputs/cards must use system components or match their token mapping. - Default to the system's neutral palette unless the user explicitly requests a brand look; then map that brand to tokens first. </design_system_enforcement>
这段的用法告诉模型:不要在 JSX 和 CSS 里乱写颜色值,只能用你在 globals.css 定义好的 token。只要设计体系是基于 Tailwind 或自建 token 的,这一段换几个变量名就能直接用。
新工具类型:apply_patch 与 shell
GPT-5.1 在Codex这样的编程代理里直接内置了两个关键工具类型。
一个是 apply_patch,用于改文件;
一个是 shell,用于跑命令。
apply_patch 调用方式示意如下:
response = client.responses.create(
model="gpt-5.1",
input=RESPONSE_INPUT,
tools=[{"type": "apply_patch"}]
)当模型决定要执行修改时,你会收到一个 apply_patch_call:
{
"id": "apc_08f3d96c87a585390069118b594f7481a088b16cda7d9415fe",
"type": "apply_patch_call",
"status": "completed",
"call_id": "call_Rjsqzz96C5xzPb0jUWJFRTNW",
"operation": {
"type": "update_file",
"diff": "
@@
-def fib(n):
+def fibonacci(n):
if n <= 1:
return n
-return fib(n-1) + fib(n-2)
+return fibonacci(n-1) + fibonacci(n-2)",
"path": "lib/fib.py"
}
}你执行完 patch 后,需要回报一个输出:
{
"type": "apply_patch_call_output",
"call_id": call["call_id"],
"status": "completed" if success else "failed",
"output": log_output
}根据 diff 真正去改文件,把成功或失败的结果同步回去。因为 apply_patch 是模型特训过的工具类型,所以相比你自己写一个 JSON 函数定义,失败率会低很多。
所以GPT-5.1 现在用得好不好全靠你能不能用一份清晰、系统提示。
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-07-08
精打细算虾养成指南: 省 Token 和把 AI 用好,从来就是一件事
2026-07-07
从零开始玩转循环 (Getting started with loops)【译】
2026-07-07
用好“AI 录音转写”,效率提升 3 倍,四个场景直接抄
2026-07-02
Claude团队:别再逐条喂Prompt,学会给Agent设计循环
2026-07-02
Agent 怎么沉淀技能:把一个好 prompt 变成全队资产
2026-07-01
从 Prompt 到 Skill:专业工作流的结构升级
2026-07-01
别让 AI 写的文档误导用户:从单次 Prompt 到高可信文档工程化实践
2026-06-30
网传 Karpathy 的 CLAUDE.md 曝光,10条铁律管住Claude Code!
2026-04-21
2026-04-25
2026-04-14
2026-05-02
2026-04-20
2026-04-19
2026-04-14
2026-05-25
2026-04-18
2026-05-23
2026-06-17
2026-05-23
2026-05-16
2026-04-14
2026-02-28
2026-02-12
2026-02-12
2026-02-08
欢迎您使用【53AI 官方网站】(以下简称“本网站”或“我们”)。本《会员服务协议》(以下简称“本协议”)是您(以下简称“会员”或“用户”)与【深圳市博思协创网络科技有限公司】之间关于注册、登录及使用本网站会员服务所订立的法律协议。
在您注册或登录前,请务必审慎阅读、充分理解各条款内容,特别是免除或限制责任的条款、知识产权条款、争议解决条款等。此类条款将以加粗形式提示您注意。 当您通过微信公众号授权、手机验证码验证或其他方式成功登录本网站时,即视为您已完全理解并同意接受本协议的全部内容。
一、 定义
本网站:指由【深圳市博思协创网络科技有限公司】运营的,域名为【53ai.com】的网站及相关移动端页面。
会员服务:指本网站向注册会员提供的知识库文章查阅、内容检索及其他相关增值服务。
知识库内容:指本网站发布的包括但不限于文字、图表、数据、研究报告、行业分析等数字化内容资源。
二、 账号注册与登录
登录方式:本网站支持以下登录方式,您可根据实际情况选择:
微信公众号授权登录:您同意将您的微信OpenID信息授权给本网站,用于创建或关联会员账号。
手机验证码登录:您需提供真实有效的手机号码,并通过短信验证码完成身份验证与登录/注册。
账号安全:您的账号仅限您本人使用,禁止赠与、借用、租用、转让或售卖。因您保管不善导致的账号被盗、密码泄露等损失,由您自行承担。
实名认证:根据相关法律法规要求,我们可能要求您在特定功能下完成实名认证。如您拒绝提供,可能无法使用部分或全部服务。
未成年人保护:若您未满18周岁,请在法定监护人的陪同下阅读本协议,并在征得监护人同意后使用本服务。
三、 服务内容与规范
知识库查阅权限:会员登录后,有权按照其会员等级对应的权限范围,在线浏览、检索本网站知识库中的相关文章及内容。
服务变更:我们有权根据业务发展需要,调整、变更或终止部分服务内容,并将以网站公告、公众号消息等方式提前通知。
禁止行为:您在使用服务时不得实施以下行为:
利用技术手段批量爬取、下载、转存知识库内容;
将知识库内容用于商业目的或未经授权地向第三方传播;
干扰本网站正常运行或侵犯其他用户合法权益;
发布违法违规信息或从事违反公序良俗的活动。
四、 知识产权声明
权利归属:本网站知识库中的排版设计、软件代码等内容的知识产权均归【公司全称】或原权利人所有,受《中华人民共和国著作权法》等法律保护。
有限许可:本网站授予会员一项非独占、不可转让、不可转授权的普通许可,仅限于个人学习、研究之目的在线查阅知识库内容。
侵权追责:未经书面许可,任何单位或个人不得以任何形式复制、转载、摘编、镜像、汇编或以其他方式使用上述内容。一经发现,我们保留追究其法律责任的权利。
五、 个人信息保护
我们重视对您个人信息的保护。关于我们如何收集、使用、存储和保护您的个人信息,请单独阅读 《隐私政策》。
您通过微信公众号授权或手机号验证所提供的信息,我们将严格按照《个人信息保护法》的规定处理,仅用于身份识别、服务提供及安全验证等必要用途。
您可以随时通过网站设置或联系客服行使查阅、更正、删除个人信息及撤回授权同意的权利。
六、 免责声明
内容准确性:知识库内容仅供参考,不构成专业建议。我们不对其完整性、准确性、时效性作任何明示或暗示的保证,您应自行判断并承担使用风险。
不可抗力:因自然灾害、政策法规变化、网络故障、第三方平台接口异常(如微信接口维护、运营商短信通道故障)等不可抗力导致的服务中断或延迟,我们不承担违约责任。
第三方链接:本网站可能包含指向第三方网站的链接,该等网站的内容和服务不受我们控制,请您自行甄别风险。
七、 违约责任
如您违反本协议约定,我们有权视情节采取警告、限制功能、暂停服务、注销账号等措施,并保留要求赔偿损失的权利。
如因您的违约行为导致我们遭受行政处罚、第三方索赔或商誉损失,您应承担全部赔偿责任(包括但不限于罚款、赔偿金、律师费、公证费等)。
八、 法律适用与争议解决
本协议的订立、执行和解释均适用中华人民共和国大陆地区法律。
因本协议产生的或与本协议有关的任何争议,双方应友好协商解决;协商不成的,任何一方均可向【公司所在地】有管辖权的人民法院提起诉讼。
九、 其他
本协议构成双方就本服务达成的完整协议,取代此前任何口头或书面约定。
本协议任一条款被认定为无效或不可执行的,不影响其他条款的效力。
我们对本协议享有最终解释权,并在法律允许的范围内保留随时修改的权利。修改后的协议一经公布即生效,继续使用服务即视为同意修订内容。