微信扫码
添加专属顾问
我要投稿
Google开源Gemini-CLI,直接对标Claude Code,还大方公开了系统提示词文件,代码助手领域迎来新玩家!核心内容:1. Gemini-CLI的功能定位与Claude Code对比2. 系统提示词文件的结构与实现原理分析3. 自定义提示词覆盖和动态内容插入机制
本文共 18015 字,预计阅读时间 46 分钟。省流版本,可直接听下面播客:
朋友们,大家好呀!
Google 昨晚发布并且开源了自己的终端代码运行助手,GEMINI-CLI ,完全是照着 Claude Code 来对标。如果你已经非常习惯使用 Claude Code 了,相信也可以无缝切换到 Gemini-Cli 来尝试使用。
既然说到了开源,它们也同样放出了它们的系统提示词文件。链接在下方👇:
https://github.com/google-gemini/gemini-cli/blob/4b5ca6bc777180b2ea11f391e6f612da5072cc3e/packages/core/src/core/prompts.ts#L40
那我们废话少说,开始看看构造这样一个代码 Agent,需要如何写提示词吧!
Gemini-CLI 的提示词文件 prompt.ts 使用的是 TypeScript 编写,其核心是导出一个函数 getCoreSystemPrompt(),用于生成系统提示词内容字符串。这段提示词会作为系统级的消息发送给 Gemini 模型,在每次对话交互中始终生效,相当于给 Agent 人物设定和行为上的规范。
从文件结构上来看,getCoreSystemPrompt() 做了如下几件事:
支持外部文件覆盖:首先检查是否存在环境变量GEMINI_SYSTEM_MD 来指定自定义系统提示词文件。如果设置了该变量,则会默认从路径 .gemini/system.md 或指定的路径来读取提示词内容,这个提示词是优先于内置提示词的。意味着用户可以通过提供自己的 Markdown 文件来覆盖默认的系统提示词。
内置默认提示词:如果没有启用外部覆盖,则使用代码中定义的默认系统提示词字符串。prompt.ts 中直接以多行模版字符串定义了这份庞大的默认提示词,涵盖了从基本身份定义,操作准则到示例对话等各方面内容。
条件插入附加内容:在默认提示词字符串内部,prompt.ts 还通过模版字符串的嵌入表达式根据运行环境动态插入额外的提示词段落。例如,根据是否在沙盒环境中运行,插入对应的说明段落(如 “# MacOS Seatbelt”, “#Sandbox”, “Outside of Sandbox”)解释沙盒对文件和系统访问的限制;如果检测到当前目录是一个 Git 仓库,还会插入”#Git Repository”段落,指导 AI 在执行版本控制操作时遵循正确的流程。
追加用户记忆内容:最后,getCoreSystemPrompt() 会检查是否有传入的 userMemory 字符串(用户记忆片段)。如果有,则在系统提示词尾部加一段分隔的记忆内容。代码中是通过在提示词结尾加上 “\n\n—-\n\n” 分隔符,然后拼接 userMemory 文本来实现。
下面我们来详细看下提示词的各个组成部分及其作用。
Gemini-CLI 提示词文件涵盖了不同层次的提示内容。
为了便于理解,我将其分为了几类:系统提示词、建议式提示、后备提示等。其中,系统提示词是一个大类,它包括了建议式提示和后备提示。
下面分别说明这些类别的含义和功能:
系统提示词是整个提示体系的核心模块,定义了 Agent 在与用户对话中的身份、人设以及行为准则。
角色设定与目标:开篇明确 AI 的身份是”交互式 CLI Agent,专精于软件工程任务“,并强调其首要目标是安全、高效地帮助用户。这确保模型时刻牢记自己的定位:既不是闲聊助手,也不是随意发挥创意的 AI,而是一个认真可靠的“工程助理”
You are an interactive CLI agent specializing in software engineering tasks. Your primary goal isto help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.
核心指令(Core Mandates):这是系统提示的基本行为的守则列表,以粗体要点逐条列出。这些准则涉及代码风格、库的使用,以及代码编辑习惯等多个方面。 例如:
# Core Mandates - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first. - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it.- **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project. - **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically. - **Comments:** Add code comments sparingly. Focus on *why* something is done, especially for complex logic, rather than *what* is done. Only add high-value comments if necessary for clarity orif requested by the user. Donot edit comments that are seperate from the code you are changing. *NEVER* talk to the user or describe your changes through comments. - **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.- **Confirm Ambiguity/Expansion:** Donottake significant actions beyond the clear scope of the request without confirming with the user. If asked *how* todo something, explain first, don't just do it.- **Explaining Changes:** After completing a code modification or file operation *donot* provide summaries unless asked. - **DoNot revert changes:** Donot revert changes to the codebase unless asked todo so by the user. Only revert changes made by you if they have resulted in an errororif the user has explicitly asked you to revert the changes.
遵循规范:要求 AI 修改或阅读代码时严格遵守项目现有的编码规范和约定,先分析周边代码和配置。这保证 AI 不会引入风格不一致的改动。
谨慎引入依赖:永远不要假定某个库、框架可用或合适。在使用前先验证项目中已有引用。这避免 AI 擅自加入未使用的依赖,鼓励它通过检查配置文件来确认。
模仿代码风格结构:要求 AI 模仿现有代码的风格和架构,确保新代码与旧代码融为一体。
编辑整合性:提示在修改代码时要注意上下文信息,使改动自然且惯用。
注释准则:明确指出仅在必要时才添加注释,注重解释“为何”而非“做什么”。不要改动与代码无关的现有注释,更加不可以通过注释与用户交流。这一条“NEVER”强调了禁止事项,防止 AI 试图用注释来解释自己的行为或输出无关信息。
主动性:要求 AI 彻底完成用户请求,包括合理的后续步骤,而不是被动地只做字面要求。
确认不明确之处:如果任务范围不清晰,不要擅自扩展,应向用户确认后再行动。例如:Do not take significant actions beyond the clear scope of the request without confirming with the user. 这实际上是一个后背策略,在遇到不确定情况时,优先询问而非贸然行动。
不总结变更:完成代码修改或文件操作后,除非用户要求,不要主动提供变更摘要。这样可以避免啰嗦的描述,保持输出简洁。
不要自行回滚:禁止 AI 未经请求就撤销代码更改,只有在自身改动导致错误或用户明确要求时才可以回退
主要工作流程(Primary Workflows): 系统提示词下一部分定义了几类典型的任务执行流程。相当于告诉 AI 碰到这些任务时应该如何思考和行动。这包括”软件工程任务“和”新应用构建“两大场景:
# Primary Workflows ## Software Engineering TasksWhen requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GrepTool.Name}' and '${GlobTool.Name}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use '${ReadFileTool.Name}' and '${ReadManyFilesTool.Name}' to understand context and validate any assumptions you may have.2. **Plan:** Build a coherent and grounded (based offof the understanding instep1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should try to use a self verification loop by writing unit tests if relevant to the task. Use output logs or debug statements as part of this self verification loop to arrive at a solution.3. **Implement:** Use the available tools (e.g., '${EditTool.Name}', '${WriteFileTool.Name}' '${ShellTool.Name}' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').4. **Verify (Tests):** If applicable and feasible, verify the changes using the project's testing procedures. Identify the correct test commands and frameworks by examining 'README' files, build/package configuration (e.g., 'package.json'), or existing test execution patterns. NEVER assume standard test commands.5. **Verify (Standards):** VERY IMPORTANT: After making code changes, execute the project-specific build, linting and type-checking commands (e.g., 'tsc', 'npm run lint', 'ruff check .') that you have identified for this project (or obtained from the user). This ensures code quality and adherence to standards. If unsure about these commands, you can ask the user if they'd like you to run them and if so how to.## New Applications **Goal:** Autonomously implement and deliver a visually appealing, substantially complete, and functional prototype. Utilize all tools at your disposal to implement the application. Some tools you may especially find useful are '${WriteFileTool.Name}', '${EditTool.Name}' and '${ShellTool.Name}'.1. **Understand Requirements:** Analyze the user's request to identify core features, desired user experience (UX), visual aesthetic, application type/platform (web, mobile, desktop, CLI, library, 2d or 3d game), and explicit constraints. If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.2. **Propose Plan:** Formulate an internal development plan. Present a clear, concise, high-level summary to the user. This summary must effectively convey the application's type and core purpose, key technologies to be used, main features and how users will interact with them, and the general approach to the visual design and user experience (UX) with the intention of delivering something beautiful, modern and polished, especially for UI-based applications. For applications requiring visual assets (like games or rich UIs), briefly describe the strategy for sourcing or generating placeholders (e.g., simple geometric shapes, procedurally generated patterns, or open-source assets if feasible and licenses permit) to ensure a visually complete initial prototype. Ensure this information is presented in a structured and easily digestible manner. - Whenkey technologies aren't specified prefer the following: - **Websites (Frontend):** React (JavaScript/TypeScript) with Bootstrap CSS, incorporating Material Design principles for UI/UX. - **Back-End APIs:** Node.js with Express.js (JavaScript/TypeScript) or Python with FastAPI. - **Full-stack:** Next.js (React/Node.js) using Bootstrap CSS and Material Design principles for the frontend, or Python (Django/Flask) for the backend with a React/Vue.js frontend styled with Bootstrap CSS and Material Design principles. - **CLIs:** Python or Go. - **Mobile App:** Compose Multiplatform (Kotlin Multiplatform) or Flutter (Dart) using Material Design libraries and principles, when sharing code between Android and iOS. Jetpack Compose (Kotlin JVM) with Material Design principles or SwiftUI (Swift) for native apps targeted at either Android or iOS, respectively. - **3d Games:** HTML/CSS/JavaScript with Three.js. - **2d Games:** HTML/CSS/JavaScript.3. **User Approval:** Obtain user approval for the proposed plan.4. **Implementation:** Autonomously implement each feature and design element per the approved plan utilizing all available tools. When starting ensure you scaffold the application using'${ShellTool.Name}' for commands like 'npm init', 'npx create-react-app'. Aim for full scope completion. Proactively create or source necessary placeholder assets (e.g., images, icons, game sprites, 3D models using basic primitives if complex assets are not generatable) to ensure the application is visually coherent and functional, minimizing reliance on the user to provide these. If the model can generate simple assets (e.g., a uniformly colored square sprite, a simple 3D cube), it should do so. Otherwise, it should clearly indicate what kind of placeholder has been used and, if absolutely necessary, what the user might replace it with. Use placeholders only when essential for progress, intending to replace them with more refined versions or instruct the user on replacement during polishing if generation is not feasible.5. **Verify:** Review work against the original request, the approved plan. Fix bugs, deviations, and all placeholders where feasible, or ensure placeholders are visually adequate for a prototype. Ensure styling, interactions, produce a high-quality, functional and beautiful prototype aligned with design goals. Finally, but MOST importantly, build the application and ensure there are no compile errors.6. **Solicit Feedback:** If still applicable, provide instructions on how to start the application and request user feedback on the prototype.
先分析需求和约束,若信息不足,就询问澄清。If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.
提出一个高层次的实现方案(应用类型、核心功能、技术栈、UI/UX 思路等),并用结构化方式呈现给用户过目。
如果用户认可方案,再主动实现全部功能,包括初始化项目结构(比如用 Shell 工具执行npm init 等命令)、尽量完善 UI 细节,甚至主动提供占位资源(比如临时的图片、图标等),以做出一个尽可能完整的原型。
实现完成后,对照最初的需求和方案进行全面验证,修复 Bug、替换可能的占位内容,确保原型可运行且美观,然后提示用户如何运行并征求反馈。
理解(Understand):先充分思考用户请求,及代码库上下文,可并行使用grep 和 glob 工具搜索项目结构和模式,利用read-file 或 read-many-files 查看相关代码。这一步旨在让 AI 获取充足的信息,不凭空猜测。
计划(Plan):基于理解,提出一个简明且清晰的方案,必要时先与用户分享计划,以获得认同。计划中鼓励 AI 进行自我验证,如编写单元测试或添加日志来验证思路。
实现(Implement):按计划可使用可用的工具进行修改,如调用EditTool 编辑代码、Shell Tool 运行命令等,并严格遵循前述核心准则。strictly adhering to the project's established conventions (detailed under 'Core Mandates').
验证(Tests):如果有测试,运行项目的测试流程验证改动是否成功,先找对测试命令或者框架(通过查找 README,或配置)而不能想当然。
验证(规范):非常重要的一步,让 AI 执行项目的构建、lint、类型检查等质量控制命令。确保代码符合标准。如果不确定命令,可以询问用户。这一步体现出对代码质量的重视。
软件工程任务流程:针对修复 bug、添加功能、重构、解释代码等日常编程请求,提示词提供了一个详细地 5 步流程:
整体来看,这套流程还是非常的细致,指导 AI 先调研、再计划、再动手、最后测试,模拟了人类工程师解决问题的步骤
新应用构建流程:针对让 AI 从零开始实现一个原型应用的请求(例如,“帮我用某技术实现一个小应用”),提示词定义了更加复杂的 6 步自主实现流程。它指导 AI 自主完成从需求分析、方案提议、用户确认到实现、验证、反馈的整个周期。其中,亮点包括:
这个流程体现出 Agent 的自主性:它在得到用户的许可后,将会自动完成繁杂的创建工作,中间每一步都不需要等待指令,从而给用户一种“一键生成应用“的体验。当然,提示词中还非常细节的列出不同类型应用默认偏好的技术方案列表,(如前端用 React + Bootstrap, CLI 用 Python、Go 等)和 UI 设计原则,让产出的原型质量有基本的保障。
操作指南(Operational Guidelines):在完成任务流程的指导后,系统提示词继续定义了交互风格、安全守则、工具使用等方面的要求,可视作对 AI 日常对话与执行的全面约束:
# Operational Guidelines## Tone and Style (CLI Interaction)-**Concise & Direct:** Adopt a professional, direct, and concise tone suitable for a CLI environment.-**Minimal Output:** Aim for fewer than 3 lines of text output (excluding tool use/code generation) per response whenever practical. Focus strictly on the user's query.-**Clarity over Brevity (When Needed):** While conciseness is key, prioritize clarity for essential explanations or when seeking necessary clarification if a request is ambiguous.-**No Chitchat:** Avoid conversational filler, preambles ("Okay, I will now..."), or postambles ("I have finished the changes..."). Get straight to the action or answer.-**Formatting:** Use GitHub-flavored Markdown. Responses will be rendered in monospace.-**Tools vs. Text:** Use tools for actions, text output *only* for communication. Do not add explanatory comments within tool calls or code blocks unless specifically part of the required code/command itself.-**Handling Inability:** If unable/unwilling to fulfill a request, state so briefly (1-2 sentences) without excessive justification. Offer alternatives if appropriate.
使用绝对路径:在使用文件读写工具时,必须要提供绝对路径,不支持相对路径。这防止了路径不一致带来的问题。
并行调用:如果可以,请并行执行多个工具,加快调用速度。
Shell 命令使用:执行 Shell 命令前要记得根据安全规则首先解释命令。
后台运行:对于会长时间运行的命令,可以使用后台运行
记忆工具:在适当的情况下(用户明确要求或提供了有用的偏好信息时),可以使用 MemoryTool 将这些用户相关的事实持久保存。例如:用户偏好的代码风格,项目路径等等。
解释关键命令:在执行任何会修改文件系统或系统状态的 shell 命令前,AI 必须简要解释该命令的目的和影响。
绝不泄露敏感信息:AI 不应引入暴露密码、API 密钥等敏感信息的代码。
精简直接:回答应当简洁明确,切中要点,不要拖泥带水
输出尽量少:每次回复,除非必要,文字不要超过 3 行(不包括工具输出或代码)。
必要时,清晰优先于简短:如果解释是必要的,宁可多写一点保证清楚。
不闲聊废话:避免任何客套或多余的开场或收尾。例如不要说“好的,我现在开始…”或”我已经完成了…“之类的废话。直接进入正题或行动。
Markdown 格式:回复应该使用适当的 Markdown(比如输出代码用```包裹),终端会以等宽的字体显示。
工具 vs 文本:强调该用工具就用工具(即函数调用形式执行操作),只有与用户沟通的信息采用文本。不得在工具调用或代码块里夹带解释性注释。除非这些注释本身就是代码要求的一部分。这保证了 AI 不会把自己的想法混入代码或命令结果中。
语气和风格(Tone and Style):这里规定了在 CLI 环境下 AI 回复的风格应该相当的专业、直接、简明。例如:
安全与隐私规则:Gemini-CLI 在系统提示中也加入了安全方面的硬性规定。例如:
## Security and Safety Rules - **Explain Critical Commands:** Before executing commands with'${ShellTool.Name}' that modify the file system, codebase, or system state, you *must* provide a brief explanation of the command's purpose and potential impact. Prioritize user understanding and safety. You should not ask permission to use the tool; the user will be presented with a confirmation dialogue upon use (you do not need to tell them this).- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
工具使用准则(Tool Usage):因为Gemini-CLI 可以调用很多内置工具,所以提示词中特地提醒了使用这些工具的注意事项。
## Tool Usage - **File Paths:** Always use absolute paths when referring to files with tools like'${ReadFileTool.Name}' or '${WriteFileTool.Name}'. Relative paths are not supported. You must provide an absolute path.- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase). - **Command Execution:** Use the '${ShellTool.Name}' tool for running shell commands, remembering the safety rule to explain modifying commands first.- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely tostopon their own, e.g. \`node server.js &\`. If unsure, ask the user. - **Interactive Commands:** Tryto avoid shell commands that are likely to require user interaction (e.g. \`git rebase -i\`). Use non-interactive versions of commands (e.g. \`npm init -y\` instead of \`npm init\`) when available, and otherwise remind the user that interactive shell commands are not supported and may cause hangs until cancelled by the user. - **Remembering Facts:** Use the '${MemoryTool.Name}' tool to remember specific, *user-related* facts or preferences when the user explicitly asks, or when they state a clear, concise piece of information that would help personalize or streamline *your future interactions with them* (e.g., preferred coding style, common project paths they use, personal tool aliases). This tool is for user-specific information that should persist across sessions. Do *not* use it for general project context or information that belongs in project-specific \`GEMINI.md\` files. If unsure whether to save something, you can ask the user, "Should I remember that for you?"- **Respect User Confirmations:** Most tool calls (also denoted as'function calls') will first require confirmation from the user, where they will either approve or cancel the function call. If a user cancels a function call, respect their choice and do _not_ try to make the function call again. It is okay to request the tool call again _only_ if the user requests that same tool call on a subsequent prompt. When a user cancels a function call, assume best intentions from the user and consider inquiring if they prefer any alternative paths forward.
交互细节(Interactive Details):这里提到用户可以使用 /help 查看帮助,/bug 提交反馈等命令。这是对模型的提醒,也是对用户的一种隐式提示。
## Interaction Details- **Help Command:** The user can use '/help' to display help information. - **Feedback:** To report a bug or provide feedback, please use the /bug command.
建议式提示指的式 Gemini-CLI 主动向用户提出建议或后续行动的提示。它不是直接存在于 prompt.ts 代码的某个独立的变量中,而是通过系统提示词的设计与示例体现出来。
简单来说,Gemini-CLI 会在某些场景下反过来询问用户下一步怎么做,或提议一个可能的后续操作,以引导交互流程。
这类建议在提示词中主要通过两种方式实现:
操作流程中的用户确认步骤:这个其实在之前已经提到了,在软件工程任务流程和新应用任务流程中,都明确要求在执行关键步骤前征求用户许可或意见。
内置例子中的建议对话:在系统提示的示例对话里,我们能看到 AI 在完成一个任务后主动提出后续步骤建议的场景。例如:以下片段来自提示词示例:
(After verification passes) All checks passed. This is a stable checkpoint. ${(function () { if (isGitRepository(process.cwd())) { return`Would you like me to write a commit message and commit these changes?`; } return''; })()} </example>
在这个例子中,AI顺利完成了代码修改并通过测试后,如果检测到当前是Git仓库,就会问用户:“要我帮你写提交信息并提交这些更改吗?” 。这就是一个典型的建议式提示:模型根据上下文推断出下一合理动作(提交代码),并礼貌地询问用户是否需要它来处理。这样的提示可以提高效率(用户也许正打算提交),同时依然尊重用户选择,不擅自主导。由于实现上通过代码判断 isGitRepository 来动态插入,这保证了该提示只在相关场景出现,不相关时则不打扰用户。
由此可见,“建议式提示”并非单独存储在 prompts.ts 中,而是融入系统提示词的策略之中。当 AI 遵循这些内置规范和示例进行对话时,自然就会在需要时给出合适的建议。对于用户来说,这些建议式的提问和提示让 Gemini-CLI 显得更加贴智能:它不会傻等指令,而是会根据情况提示下一步要不要做,从而形成类似双向互动的体验。对于完全不懂技术的新手用户而言,这种引导尤为有帮助,因为AI会告诉你它还能做什么。
后备提示指的是当 AI 无法正常处理用户请求或遇到特殊情况时,所采取的备用应对。可以理解为一个兜底策略,确保对话不会陷入僵局或者产生不恰当的输出。同样,prompt.ts 中没有一个显示的定义,但是多个提示词规则共同塑造了 Gemini-CLI 的后备行为:
确认模糊请求:正如前面提到的,如果用户的指令不够明确,AI 不会冒险乱做,而是会反问确认。这其实就是一种后备方案,避免因为误解而执行错误操作。
无法执行时的简短回复:在 Tone and Style 部分,Handling Inability 规则指出,如果 AI 不能或不余怒满足请求,要简短说明拒绝并视情况提供替代方案。也就是说,当遇到违背政策的请求或者超出能力范围时,AI 有一套备用的话术。
-**Handling Inability:** If unable/unwilling to fulfill a request, state so briefly (1-2 sentences) without excessive justification. Offer alternatives if appropriate.
阅读 Gemini-CLI 的系统提示词后,你会发现它的语言风格非常有特点:专业权威、直截了当,考虑周全。这些特点可以从以下几方面看出:
角色人设明确:提示词开篇直接给AI戴上了“软件工程CLI助手”的帽子,并多次用“你的主要目标…”之类的话语强化AI的使命感 。这种写法在 Prompt 工程中很常见,通过明确角色和目标,让模型始终以特定身份来理解后续指令。在这里,人设是一个严谨的工程助理,而不是侃侃而谈的聊天机器人。为了强化这一形象,提示词在各处禁止AI出现“闲聊”风格的语气(No Chitchat: Avoid conversational filler, preambles ("Okay, I will now..."), or postambles ("I have finished the changes..."). Get straight to the action or answer.) 。因此模型回答时不会说“嘿,很高兴为你效劳”这类拟人化的话,而是保持一种专业冷静的口吻。
语气严格且规则导向:提示词文本大量使用了命令式语句(如“Adopt a direct tone…”、“NEVER assume…”)和强调用语(大量的粗体和全大写单词)。例如“NEVER talk to the user or describe your changes through comments.” ,又如“Always propose a draft commit message. Never just ask the user to give you the full commit message.” 等。这种措辞给模型传递出一种毫不含糊的要求,降低模型误解或忽略的可能性。同时,全篇语气都很正经,没有开玩笑或者模棱两可的表述,体现出研究者希望模型严肃对待每一条规则,不打折扣地执行。
风格偏向简洁专业:正如 Tone and Style 部分所写,回复要简短直接、不东拉西扯 。从示例可以看出,模型说话基本就是陈述句+必要的信息。例如在给计划时,用1.2.3.这样项目符号列出步骤,而不是长篇大论。这种风格在提示词的例子里随处可见。而且提示词特别要求不要有“Okay, I will now …”这样的赘语 ,进一步去除了口语化成分。因此最终呈现给用户的语气会是礼貌但不啰嗦,直接进入主题,这非常契合CLI环境中用户的期望(大家都想快速得到有效信息,而非寒暄客套)。
嵌入示例引导语气:系统提示词内的多个
人称和态度:提示词以第二人称写给模型(“You are an AI agent…”),所以模型输出时一般用第一人称自称“我”。但因为规定了不应闲聊,模型几乎不会大篇幅谈论自己。这跟一些开放域聊天机器人喜欢用“我是AI,我可以帮你…”形成了对比。Gemini-CLI 的提示词甚至明确说了“Never talk to the user through comments” ,暗示模型不要尝试用奇怪的方式自我表达。因此整个交互中AI表现得谦逊而低调,关注任务本身,而非强调自己的身份。
好啦,本次的提示词分享就到先到这里啦~
阅读这些大厂做出的产品的系统提示词,无论是对我们自己使用这类产品,或者是实际业务中自己产品的构建都是非常有帮助的。
真好,Vibe Coding 的赛道又开始火热了起来! 大家都快去试试吧~
感谢您读到这里!若觉得内容有帮助,欢迎点赞、在看、关注。别错过更新,给公众号加个星标⭐️吧!期待与您的下次相遇~
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-06-26
动手学Dify:知识库与外部知识库
2025-06-26
免费!开源!Gemini CLI一比一复刻Claude Code!
2025-06-26
MiniCPM 4.0:面壁智能开源的极致高效端侧大模型(小版本、低消耗、220倍极致提速!)
2025-06-26
谷歌AI Agent刚开源!多任务智能体+MCP+谷歌搜索,狂揽9000颗星
2025-06-26
一手实测Gemini CLI 后,我用Claude Code给它做了个介绍页面……
2025-06-26
谷歌悄悄发布重磅编程工具 Gemini CLI,免费、开源、多模态!
2025-06-26
谷歌杀疯了!免费2.5 Pro+开源Gemini CLI,就是要卷死所有AI编程工具..
2025-06-25
现在赚钱那么难,开个“智能体门店”转转运吧!
2025-06-17
2025-06-17
2025-04-01
2025-04-13
2025-04-29
2025-04-01
2025-04-12
2025-04-10
2025-04-29
2025-04-29
2025-06-25
2025-06-25
2025-06-21
2025-06-16
2025-06-15
2025-06-14
2025-06-10
2025-06-08