shape-your-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shape Your Agent

塑造你的Agent

An optional, conversational workflow for creating a system prompt for an AI agent that uses the Sanity Context MCP server. This is for users who control the system prompt in their agent setup.
Don't have access to the system prompt? Skip this skill entirely. The Instructions field (configured via the
dial-your-context
skill) is the primary lever and works on its own. A minimal system prompt like "You are a helpful agent." combined with good Instructions field content scores 80%+ in our evaluations.
这是一个可选的对话式工作流,用于为使用Sanity Context MCP服务器的AI Agent创建系统提示词。此工作流适用于在Agent设置中可控制系统提示词的用户。
无法访问系统提示词? 直接跳过此技能。Instructions字段(通过
dial-your-context
技能配置)是主要调节工具,可独立发挥作用。像“你是一个乐于助人的Agent”这样的极简系统提示词,搭配优质的Instructions字段内容,在我们的评估中得分可达80%以上。

Before You Start

开始之前

What the system prompt is for

系统提示词的作用

The system prompt defines agent behavior — who it is, how it talks, what it refuses to do. Think of it as the agent's personality and policy manual.
系统提示词定义Agent的行为——它的身份、沟通方式、拒绝处理的内容。可以将其视为Agent的个性手册与政策指南。

What the system prompt is NOT for

系统提示词不负责的内容

These are handled elsewhere — don't duplicate them:
ConcernHandled by
Content schema, field meaningsInstructions field (Dial Your Context)
Query patterns, data relationshipsInstructions field (Dial Your Context)
GROQ syntax and guidanceMCP auto-provides
Response formatting rulesMCP auto-provides
Duplicating these in the system prompt creates conflicts. The MCP and Instructions field are purpose-built for data concerns — let them do their job.
以下内容由其他模块处理,请勿重复定义:
关注点负责模块
内容 schema、字段含义Instructions字段(Dial Your Context)
查询模式、数据关系Instructions字段(Dial Your Context)
GROQ 语法与指导MCP 自动提供
响应格式规则MCP 自动提供
在系统提示词中重复这些内容会造成冲突。MCP和Instructions字段是为数据相关问题量身打造的——让它们各司其职。

The golden rule: less is more

黄金法则:少即是多

Every line in your system prompt competes for the model's attention with the context the MCP provides. An over-engineered prompt can actually degrade answer quality. Start minimal. Add rules only when you have a concrete scenario that needs one.

系统提示词中的每一行都会与MCP提供的上下文争夺模型的注意力。过度设计的提示词反而会降低回答质量。从极简版本开始,仅在遇到具体需要规则约束的场景时再添加规则。

How to run this session

如何运行此会话

This is a conversation, not a form. Ask questions, listen to the answers, and adapt. Don't run through the steps as a checklist — let the user's responses guide which areas need more depth. Some users will have strong opinions about tone and need 5 minutes on boundaries. Others will need help thinking through edge cases but already know their voice. Follow the energy.

这是一场对话,而非表单。提出问题、倾听答案并灵活调整。不要像核对清单一样按步骤执行——让用户的回答引导你深入哪些领域。有些用户对语气有强烈要求,需要花5分钟讨论边界;有些用户已经明确沟通风格,需要帮助梳理边缘案例。跟随用户的需求节奏。

Step 1: Understand the Use Case

步骤1:理解使用场景

Start by answering these questions:
  1. Who uses this agent? (customers, internal team, developers, general public)
  2. What setting? (support chat, docs site, internal tool, sales assistant)
  3. What problem does it solve? (answer product questions, troubleshoot issues, find content)
  4. What's the user's typical state? (exploring, stuck, evaluating, frustrated)
These answers drive every decision that follows. A support agent for frustrated customers needs different rules than a docs assistant for developers.
先回答以下问题:
  1. 谁会使用这个Agent?(客户、内部团队、开发者、普通公众)
  2. 使用场景是什么?(客服聊天、文档站点、内部工具、销售助手)
  3. 它解决什么问题?(解答产品问题、排查故障、查找内容)
  4. 用户的典型状态是?(探索阶段、遇到瓶颈、评估产品、情绪沮丧)
这些答案将决定后续的所有决策。面向沮丧客户的客服Agent,与面向开发者的文档助手需要完全不同的规则。

Step 2: Define Behavior

步骤2:定义行为

Choose concrete positions on each axis:
Tone: Professional / Casual / Friendly / Technical
  • Bad: "Be friendly and professional"
  • Good: "Use a warm, first-name tone. No corporate jargon. Write like a knowledgeable coworker, not a press release."
Verbosity: How much detail by default?
  • Bad: "Be concise but thorough"
  • Good: "Lead with a 1-2 sentence answer. Offer to elaborate. Never open with more than 3 sentences before getting to the point."
Technical level: Match the audience.
  • Bad: "Adjust to the user's level"
  • Good: "Assume the user knows JavaScript and REST APIs. Don't explain what an API key is. Do explain Sanity-specific concepts like GROQ projections."
针对每个维度选择明确的定位:
语气: 专业 / 随意 / 友好 / 技术向
  • 反面示例:"要友好且专业"
  • 正面示例:"使用亲切的称呼语气,避免企业行话。像知识丰富的同事一样沟通,不要像新闻通稿。"
冗长程度: 默认提供多少细节?
  • 反面示例:"要简洁但全面"
  • 正面示例:"先用1-2句话给出答案,再主动提供补充说明。开头不要超过3句话才切入正题。"
技术深度: 匹配目标受众
  • 反面示例:"根据用户水平调整"
  • 正面示例:"假设用户了解JavaScript和REST API,无需解释API密钥是什么。但要解释Sanity专属概念,比如GROQ投影。"

Step 3: Set Boundaries

步骤3:设置边界

For each boundary, you need: the rule, a trigger scenario, and the desired response.
What to refuse:
  • Example: "If asked to write or modify content in the dataset, explain that you're a read-only assistant and point them to the Sanity Studio."
What to redirect:
  • Example: "For billing or account questions, say: 'I can help with product questions, but for billing please contact support@example.com.'"
Guardrails:
  • Example: "Never mention competitor products by name. If asked to compare, describe our capabilities without naming alternatives."
  • Example: "Don't quote specific pricing. Say 'Check our pricing page at [url] for current plans.'"
When information isn't found:
  • Example: "If the query returns no results, say so honestly. Suggest 2-3 related topics you can help with. Never fabricate an answer."
The cut test: For every rule, ask: "Can I describe a real user message that would trigger this?" If not, cut the rule. Untriggerable rules are dead weight.
每条边界都需要:规则触发场景期望响应
拒绝处理的内容:
  • 示例:"如果被要求编写或修改数据集中的内容,说明你是只读助手,并引导用户前往Sanity Studio。"
需要重定向的内容:
  • 示例:"对于账单或账户问题,回复:‘我可以解答产品相关问题,账单事宜请联系support@example.com。’"
防护规则:
  • 示例:"绝不能提及竞品名称。如果被要求对比,只描述我们的功能,不要提及替代产品。"
  • 示例:"不要引用具体定价。回复‘请查看我们的定价页面[url]了解当前方案。’"
未找到信息时:
  • 示例:"如果查询无结果,如实告知。建议2-3个你可以提供帮助的相关主题。绝不能编造答案。"
剔除测试: 对于每条规则,问自己:“我能否描述一个会触发这条规则的真实用户消息?” 如果不能,就删除这条规则。无法触发的规则都是无效内容。

Step 4: Draft the Prompt

步骤4:编写提示词

Assemble your answers into a prompt. Use this structure:
You are [role] for [company/product].
将你的答案整理成提示词,使用以下结构:
你是[角色],服务于[公司/产品]。

Voice

语气

[2-3 concrete tone/style rules]
[2-3条具体的语气风格规则]

Boundaries

边界

[Only rules that passed the cut test]
[仅保留通过剔除测试的规则]

When you don't know

未知内容处理

[Specific fallback behavior]

That's it. Most agents need 200-400 words here, not 1500.
[具体的 fallback 行为]

这样就完成了。大多数Agent的提示词只需200-400词,而非1500词。

Example: E-commerce Support Agent

示例:电商客服Agent

You are a customer support agent for Acme Store.
你是Acme Store的客户支持Agent。

Voice

语气

  • Warm and conversational. Use the customer's first name if provided.
  • Keep answers short — lead with the answer, then explain if needed.
  • No marketing language. Don't upsell or promote products unprompted.
  • 亲切且口语化。如果用户提供了名字,使用名字称呼对方。
  • 回答简洁——先给出答案,再按需解释。
  • 禁用营销话术,不要主动推销产品。

Boundaries

边界

  • Never process returns, refunds, or order changes. Direct customers to support@acme.com for order issues.
  • Don't quote exact shipping times. Say "typically 3-5 business days" and link to the shipping policy page.
  • If asked about competitor products, focus on what Acme offers without comparisons.
  • Don't share internal inventory numbers. Say whether something is "in stock" or "currently unavailable."
  • 绝不处理退货、退款或订单修改。引导用户联系support@acme.com处理订单问题。
  • 不要引用确切的配送时间。回复“通常为3-5个工作日”并链接到配送政策页面。
  • 如果被问及竞品,只聚焦Acme的优势,不做对比。
  • 不要透露内部库存数量。只需说明商品“有货”或“暂时缺货”。

When you don't know

未知内容处理

  • Say "I don't have that information" directly. Don't hedge or speculate.
  • Suggest related topics you can help with.
  • For urgent issues, direct to live support at support@acme.com.

This is ~150 words. It covers role, voice, boundaries, and fallback behavior. Everything else — product data, schema details, query patterns — lives in the Instructions field and MCP.
  • 直接回复“我没有相关信息”,不要含糊其辞或猜测。
  • 建议你可以提供帮助的相关主题。
  • 紧急问题引导用户联系在线客服support@acme.com

这段提示词约150词,涵盖了角色、语气、边界和 fallback 行为。其他所有内容——产品数据、schema细节、查询模式——都存储在Instructions字段和MCP中。

Step 5: Review & Iterate

步骤5:审核与迭代

Test your prompt against real scenarios:
  1. Write 5-10 questions your users would actually ask. Include at least 2 edge cases (something off-topic, something you want refused).
  2. For each boundary rule, write the question that triggers it. Verify the agent handles it correctly.
  3. Try removing rules one at a time. If the agent still behaves correctly without a rule, that rule was unnecessary. Cut it.
  4. Check for conflicts with the Instructions field. If both the system prompt and Instructions field address the same concern, remove it from the system prompt. The Instructions field wins for data concerns.
针对真实场景测试你的提示词:
  1. 编写5-10个用户实际会问的问题,至少包含2个边缘案例(比如无关话题、需要拒绝的请求)。
  2. 针对每条边界规则,编写触发该规则的问题,验证Agent是否正确处理。
  3. 尝试逐一删除规则。如果删除某条规则后Agent行为仍符合预期,说明这条规则是多余的,直接删除。
  4. 检查与Instructions字段的冲突。如果系统提示词和Instructions字段涉及同一关注点,将其从系统提示词中移除。数据相关问题以Instructions字段为准。

Signs your prompt is too long

提示词过长的迹象

  • The agent ignores some rules (attention dilution)
  • Answers feel generic or templated (over-constrained)
  • The agent repeats phrasing from the prompt verbatim (parroting)
  • Agent忽略部分规则(注意力分散)
  • 回答显得通用或模板化(过度约束)
  • Agent直接重复提示词中的表述(鹦鹉学舌)

Signs your prompt is too short

提示词过短的迹象

  • The agent's tone is inconsistent across conversations
  • Users get answers to questions that should be refused
  • The agent speculates when it should say "I don't know"

  • Agent的语气在对话中不一致
  • 用户得到了本应被拒绝的回答
  • Agent在应该回复“我不知道”时进行猜测

Quick Reference

快速参考

System prompt checklist

系统提示词检查清单

  • Role is defined in one sentence
  • Tone rules are concrete (not "be professional")
  • Every boundary has a trigger scenario
  • Fallback behavior is specified
  • No overlap with Instructions field content
  • Under 500 words (aim for 200-400)
  • Tested against 5+ real user questions
  • 角色用一句话定义
  • 语气规则具体明确(而非“要专业”)
  • 每条边界都有触发场景
  • 指定了 fallback 行为
  • 与Instructions字段内容无重叠
  • 字数少于500词(目标200-400词)
  • 已针对5个以上真实用户问题测试

The separation principle

分层原则

LayerControlsExample
System promptAgent behavior"Never quote exact pricing"
Instructions fieldData guidance"Products are in the 'product' type with a 'price' field"
MCPQuery mechanicsGROQ syntax, response formatting
System promptCommunicating uncertainty"Say 'I don't have that information' and suggest alternatives"
Instructions fieldRecovery tactics"If product search returns empty, try support-article type"
Each layer has its job. Don't cross the streams.
层级管控范围示例
系统提示词Agent行为“绝不引用确切定价”
Instructions字段数据指导“产品属于'product'类型,包含'price'字段”
MCP查询机制GROQ语法、响应格式
系统提示词不确定性沟通“回复‘我没有相关信息’并提供替代建议”
Instructions字段恢复策略“如果产品搜索无结果,尝试搜索support-article类型”
每个层级都有明确职责,不要混淆边界。