這是使用 Claude 最新模型進行提示工程的參考資料,包括 Claude Fable 5、Claude Mythos 5、Claude Opus 5、Claude Opus 4.8、Claude Opus 4.7、Claude Opus 4.6、Claude Sonnet 5、Claude Sonnet 4.6 和 Claude Haiku 4.5。本頁面分為三個部分:
如需模型能力的概覽,請參閱模型概覽。如需 Claude Fable 5 的能力與 API 變更,請參閱介紹 Claude Fable 5 和 Claude Mythos 5。如需 Claude Sonnet 5 的新功能詳情,請參閱 Claude Sonnet 5 的新功能。如需 Claude Opus 5 的新功能詳情,請參閱 Claude Opus 5 的新功能。如需遷移指南,請參閱遷移指南。
Claude Fable 5 和 Claude Mythos 5 的提示指南有其專屬頁面:提示 Claude Fable 5。該頁面涵蓋與 Claude Opus 4.8 的行為差異,以及值得進行的提示和鷹架調整,包括努力程度、指令遵循、長時間執行的進度聲明、記憶系統,以及 reasoning_extraction 拒絕類別。
Claude Sonnet 5 的提示指南有其專屬頁面:提示 Claude Sonnet 5。該頁面涵蓋與 Claude Sonnet 4.6 的行為差異,以及值得進行的提示調整,包括回應長度、努力程度與思考深度校準、工具使用觸發、字面指令遵循,以及設計和前端預設值。
Claude Opus 5 的提示指南有其專屬頁面:提示 Claude Opus 5。該頁面涵蓋與先前 Opus 模型的行為差異,以及值得進行的提示調整,包括回應長度與冗長度、面向使用者的進度更新、書面交付成果長度、任務範圍與過度驗證、子代理控制,以及自我修正。
Claude Opus 4.8 的提示指南有其專屬頁面:提示 Claude Opus 4.8。該頁面涵蓋回應長度、努力程度與思考深度校準、工具使用觸發、字面指令遵循、子代理控制,以及設計和前端預設值。
本節及後續章節中的技術適用於所有現行的 Claude 模型,包括 Claude Fable 5 和 Claude Mythos 5。
Claude 對清晰、明確的指令回應良好。具體說明您期望的輸出有助於提升結果。如果您想要「超越期待」的行為,請明確要求,而不是依賴模型從模糊的提示中推斷。
將 Claude 視為一位聰明但剛入職的新員工,他對您的規範和工作流程缺乏背景知識。您越精確地解釋您想要什麼,結果就越好。
**黃金法則:**將您的提示展示給一位對該任務背景知識極少的同事,並請他們遵循。如果他們會感到困惑,Claude 也會。
提供指令背後的背景資訊或動機,例如向 Claude 解釋為什麼這樣的行為很重要,可以幫助 Claude 更好地理解您的目標並提供更有針對性的回應。
Claude 足夠聰明,能夠從解釋中進行歸納。
範例是引導 Claude 輸出格式、語氣和結構最可靠的方法之一。幾個精心設計的範例(稱為 few-shot 或 multishot 提示)可以提升準確性和一致性。
加入範例時,請確保它們:
<example> 標籤中(多個範例則包在 <examples> 標籤中),讓 Claude 能將它們與指令區分開來。XML 標籤幫助 Claude 明確無誤地解析複雜的提示,特別是當您的提示混合了指令、背景資訊、範例和變數輸入時。將每種類型的內容包在各自的標籤中(例如 <instructions>、<context>、<input>)可以減少誤解。
最佳實踐:
<documents> 內,每份文件放在 <document index="n"> 內)。在系統提示中設定角色可以讓 Claude 的行為和語氣聚焦於您的使用案例。即使只有一句話也能帶來差異:
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-5",
max_tokens=1024,
system="You are a helpful coding assistant specializing in Python.",
messages=[
{"role": "user", "content": "How do I sort a list of dictionaries by key?"}
],
)
print(message.content)處理大型文件或資料密集的輸入(20k+ tokens)時,請仔細建構您的提示以獲得最佳結果:
**將長篇資料放在頂部:**將您的長文件和輸入放在提示的頂部附近,位於您的查詢、指令和範例之上。這可以提升所有模型的表現。
**使用 XML 標籤結構化文件內容和中繼資料:**使用多份文件時,將每份文件包在 <document> 標籤中,並使用 <document_content> 和 <source>(以及其他中繼資料)子標籤以提高清晰度。
**以引用為回應的依據:**對於長文件任務,請 Claude 在執行任務之前先引用文件中的相關部分。這有助於 Claude 專注於相關內容並忽略文件的其餘部分。
如果您希望 Claude 在您的應用程式中正確識別自己,或使用特定的 API 字串:
The assistant is Claude, created by Anthropic. The current model is Claude Opus 5.對於需要指定模型字串的 LLM 驅動應用程式:
When an LLM is needed, please default to Claude Opus 5 unless the user requests
otherwise. The exact model string for Claude Opus 5 is claude-opus-5.與先前的模型相比,Claude 的最新模型具有更簡潔、更自然的溝通風格:
這表示 Claude 可能會在工具呼叫後省略口頭摘要,直接跳到下一個動作。如果您希望更清楚地了解其推理過程:
After completing a task that involves tool use, provide a quick summary of the work you've done.Claude Opus 5 在冗長度方面是個例外:其預設的面向使用者回應比先前的模型更長,而且提高或降低 effort 並不能可靠地改變可見的回應長度。請改為明確提示要求簡潔。請參閱提示 Claude Opus 5 以取得範例指令。
有幾種特別有效的方法可以引導輸出格式:
告訴 Claude 該做什麼,而不是不該做什麼
使用 XML 格式指示符
讓您的提示風格與期望的輸出相符
您提示中使用的格式風格可能會影響 Claude 的回應風格。如果您在輸出格式的可引導性方面仍有問題,請嘗試讓您的提示風格盡可能接近您期望的輸出風格。例如,從提示中移除 markdown 可以減少輸出中 markdown 的數量。
針對特定格式偏好使用詳細的提示
若要更精確地控制 markdown 和格式的使用,請提供明確的指引:
<avoid_excessive_markdown_and_bullet_points>
When writing reports, documents, technical explanations, analyses, or any long-form
content, write in clear, flowing prose using complete paragraphs and sentences. Use
standard paragraph breaks for organization and reserve markdown primarily for `inline
code`, code blocks (```...```), and simple headings (## and ###). Avoid using **bold**
and *italics*.
DO NOT use ordered lists (1. ...) or unordered lists (*) unless: a) you're presenting
truly discrete items where a list format is the best option, or b) the user explicitly
requests a list or ranking
Instead of listing items with bullets or numbers, incorporate them naturally into
sentences. This guidance applies especially to technical writing. Using prose instead of
excessive formatting will improve user satisfaction. NEVER output a series of overly
short bullet points.
Your goal is readable, flowing text that guides the reader naturally through ideas
rather than fragmenting information into isolated points.
</avoid_excessive_markdown_and_bullet_points>Claude 的最新模型預設使用 LaTeX 來表示數學表達式、方程式和技術說明。如果您偏好純文字,請在提示中加入以下指令:
Format your response in plain text only. Do not use LaTeX, MathJax, or any markup
notation such as \( \), $, or \frac{}{}. Write all math expressions using standard text
characters (e.g., "/" for division, "*" for multiplication, and "^" for exponents).Claude 的最新模型在建立簡報、動畫和視覺文件時具有強大的指令遵循能力,通常在第一次嘗試時就能產生可用的輸出。
若要在文件建立方面獲得最佳結果:
Create a professional presentation on [topic]. Include thoughtful design elements,
visual hierarchy, and engaging animations where appropriate.從 Claude 4.6 模型和 Claude Mythos Preview 開始,最後一個 assistant 回合的預填回應(提供部分 assistant 訊息讓 Claude 接續)不再受支援。向這些模型發送帶有預填 assistant 訊息的請求會回傳 400 錯誤。模型的智慧和指令遵循能力已經進步到大多數預填的使用案例不再需要它。較早的模型繼續支援預填,而在對話中其他位置加入 assistant 訊息則不受影響。
以下是常見的預填情境以及如何從中遷移:
Claude 的最新模型經過訓練以精確遵循指令,並受益於使用特定工具的明確指示。如果您說「你能建議一些變更嗎」,Claude 有時會提供建議而不是實際執行,即使進行變更可能才是您的本意。關於如何定義工具和排解工具觸發問題,請參閱使用 Claude 進行工具使用。
若要讓 Claude 採取行動,請更明確地表達:
若要讓 Claude 預設更主動地採取行動,您可以在系統提示中加入以下內容:
<default_to_action>
By default, implement changes rather than only suggesting them. If the user's intent is
unclear, infer the most useful likely action and proceed, using tools to discover any
missing details instead of guessing. Try to infer the user's intent about whether a tool
call (e.g., file edit or read) is intended or not, and act accordingly.
</default_to_action>另一方面,如果您希望模型預設更為謹慎、較不傾向直接開始實作,並且只在被要求時才採取行動,您可以使用如下的提示來引導此行為:
<do_not_act_before_instructions>
Do not jump into implementation or change files unless clearly instructed to make
changes. When the user's intent is ambiguous, default to providing information, doing
research, and providing recommendations rather than taking action. Only proceed with
edits, modifications, or implementations when the user explicitly requests them.
</do_not_act_before_instructions>Claude Opus 4.5 和 Claude Opus 4.6 對系統提示的反應也比先前的模型更敏感。如果您的提示是為了減少工具或技能的觸發不足而設計的,這些模型現在可能會過度觸發。解決方法是調低任何激進的措辭。原本您可能會說「CRITICAL: You MUST use this tool when...」,現在可以使用更正常的提示,如「Use this tool when...」。
Claude 的最新模型會平行執行獨立的工具呼叫。這些模型會:
此行為是可引導的。雖然模型在沒有提示的情況下平行工具呼叫的成功率很高,但您可以將其提升至約 100% 或調整積極程度:
<use_parallel_tool_calls>
If you intend to call multiple tools and there are no dependencies between the tool
calls, make all of the independent tool calls in parallel. Prioritize calling tools
simultaneously whenever the actions can be done in parallel rather than sequentially.
For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into
context at the same time. Maximize use of parallel tool calls where possible to increase
speed and efficiency. However, if some tool calls depend on previous calls to inform
dependent values like the parameters, do NOT call these tools in parallel and instead
call them sequentially. Never use placeholders or guess missing parameters in tool
calls.
</use_parallel_tool_calls>Execute operations sequentially with brief pauses between each step to ensure stability.Claude Opus 4.6 比先前的模型進行更多的前期探索,特別是在較高的 effort 設定下。這些初始工作通常有助於最佳化最終結果,但模型可能會在沒有提示的情況下收集大量上下文或追蹤多條研究線索。如果您的提示先前鼓勵模型更加徹底,您應該為 Claude Opus 4.6 調整該指引:
effort 使用較低的設定。在某些情況下,Claude Opus 4.6 可能會進行大量思考,這可能會增加思考 tokens 並減慢回應速度。如果不希望出現此行為,您可以加入明確的指令來限制其推理,或者降低 effort 設定以減少整體思考和 token 使用量。
When you're deciding how to approach a problem, choose an approach and commit to it.
Avoid revisiting decisions unless you encounter new information that directly
contradicts your reasoning. If you're weighing two approaches, pick one and see it
through. You can always course-correct later if the chosen approach fails.如果您需要對思考成本設定硬性上限,帶有 budget_tokens 上限的擴展思考在 Opus 4.6 和 Sonnet 4.6 上仍然可用,但已被棄用。在 Claude 4.7 及更新的模型上,設定 budget_tokens 會回傳 400 錯誤。建議改為降低 effort 設定,或搭配自適應思考使用 max_tokens 作為硬性限制。
Claude 的最新模型提供思考能力,對於涉及工具使用後反思或複雜多步驟推理的任務特別有幫助。您可以引導其初始或交錯思考以獲得更好的結果。
Claude 4.6 及更新的模型和 Claude Mythos Preview 使用自適應思考(thinking: {type: "adaptive"}),Claude 會動態決定何時思考以及思考多少。在 Claude Fable 5 和 Claude Mythos 5 上,思考始終開啟,且自適應思考是唯一的模式。Claude 根據兩個因素校準其思考:effort 參數和查詢複雜度。較高的 effort 會引發更多思考,較複雜的查詢也是如此。對於不需要思考的較簡單查詢,模型會直接回應。在內部評估中,自適應思考可靠地帶來比擴展思考更好的表現。請考慮改用自適應思考以獲得最智慧的回應。
對於需要代理行為的工作負載,如多步驟工具使用、複雜的程式編寫任務和長時程代理迴圈,請使用自適應思考。較舊的模型使用帶有 budget_tokens 的手動擴展思考;請參閱各模型配置表以了解每個模型接受哪種配置。
您可以引導 Claude 的思考行為:
After receiving tool results, carefully reflect on their quality and determine optimal
next steps before proceeding. Use your thinking to plan and iterate based on this new
information, and then take the best next action.自適應思考的觸發行為是可透過提示調整的。如果您發現模型思考的頻率比您希望的更高(這在大型或複雜的系統提示中可能發生),請加入指引來引導它:
Thinking adds latency and should only be used when it will meaningfully improve
answer quality - typically for problems that require multistep reasoning. When in
doubt, respond directly.如果您正在從帶有 budget_tokens 的擴展思考遷移,請替換您的思考配置,並將預算控制移至 effort。以下範例顯示遷移前後的相同請求(請參閱 effort 以了解可用的等級和各模型的可用性):
# 之前:使用手動預算的擴展思考(較舊的模型)
client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[{"role": "user", "content": "..."}],
)
# 之後:使用 effort 的自適應思考
client.messages.create(
model="claude-opus-4-8",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "high"},
messages=[{"role": "user", "content": "..."}],
)如果您沒有使用擴展思考,則不需要任何變更。在 Claude Opus 4.6 到 Claude Opus 4.8 以及 Claude Sonnet 4.6 上,當您省略 thinking 參數時,思考是關閉的。在 Claude Opus 5 和 Claude Sonnet 5 上,當您省略 thinking 參數時,思考預設為開啟;在 Claude Opus 5 上,您只能在 effort 為 high 或更低時停用它。在 Claude Fable 5 和 Claude Mythos 5 上,無論您是否設定 thinking 參數,思考始終開啟。
<thinking> 標籤向 Claude 展示推理模式。它會將該風格推廣到自己的擴展思考區塊中。<thinking> 和 <answer> 這樣的結構化標籤,將推理與最終輸出清楚地分開。在 Claude Opus 5 上,建議改為在較低的 effort 等級下保持思考啟用:停用思考時,模型偶爾會在其可見輸出中發出內部 XML 標籤,因此在該模型上套用此模式之前,請參閱在停用思考的情況下執行。Claude 的最新模型以強大的狀態追蹤能力處理長時程推理任務。Claude 透過專注於漸進式進展,在延長的工作階段中保持方向感,一次穩定地推進少數幾件事,而不是試圖一次完成所有事情。這種能力在跨越多個上下文視窗或任務迭代時尤其明顯,Claude 可以處理複雜任務、儲存狀態,然後以全新的上下文視窗繼續。
Claude Sonnet 5、Claude Sonnet 4.6、Claude Sonnet 4.5 和 Claude Haiku 4.5 具備上下文感知功能,使模型能夠在整個對話中追蹤其剩餘的上下文視窗(即其「token 預算」)。這使 Claude 能夠透過了解自己有多少工作空間,更有效地執行任務和管理上下文。
管理上下文限制:
如果您在會壓縮上下文或允許將上下文儲存到外部檔案的代理框架中使用 Claude(如在 Claude Code 中),請考慮將此資訊加入您的提示,讓 Claude 能夠相應地行動。否則,Claude 有時可能會在接近上下文限制時自然地嘗試收尾工作。以下是一個範例提示:
Your context window will be automatically compacted as it approaches its limit, allowing
you to continue working indefinitely from where you left off. Therefore, do not stop
tasks early due to token budget concerns. As you approach your token budget limit, save
your current progress and state to memory before the context window refreshes. Always be
as persistent and autonomous as possible and complete tasks fully, even if the end of
your budget is approaching. Never artificially stop any task early regardless of the
context remaining.記憶工具與上下文感知搭配使用,非常適合管理上下文轉換。
對於跨越多個上下文視窗的任務:
**為第一個上下文視窗使用不同的提示:**使用第一個上下文視窗來建立框架(撰寫測試、建立設定腳本),然後使用後續的上下文視窗來迭代待辦清單。
**讓模型以結構化格式撰寫測試:**請 Claude 在開始工作之前建立測試,並以結構化格式(例如 tests.json)追蹤它們。這會帶來更好的長期迭代能力。提醒 Claude 測試的重要性:「移除或編輯測試是不可接受的,因為這可能導致功能缺失或有錯誤。」
**設定便利工具:**鼓勵 Claude 建立設定腳本(例如 init.sh)以順利啟動伺服器、執行測試套件和 linter。這可以避免在從全新的上下文視窗繼續時重複工作。
**重新開始與壓縮的取捨:**當上下文視窗被清除時,請考慮以全新的上下文視窗開始,而不是使用壓縮。Claude 的最新模型在從本地檔案系統探索狀態方面極為有效。在某些情況下,您可能會想利用這一點而非壓縮。請明確規定它應該如何開始:
**提供驗證工具:**隨著自主任務的長度增加,Claude 需要在沒有持續人工回饋的情況下驗證正確性。像 Playwright MCP 伺服器或用於測試 UI 的電腦使用能力等工具都很有幫助。
**鼓勵完整使用上下文:**提示 Claude 在繼續之前有效率地完成各個元件:
This is a very long task, so it may be beneficial to plan out your work clearly. It's
encouraged to spend your entire output context working on the task - just make sure you
don't run out of context with significant uncommitted work. Continue working
systematically until you have completed this task.在沒有指引的情況下,Claude Opus 4.6 可能會採取難以逆轉或影響共享系統的行動,例如刪除檔案、強制推送或發佈到外部服務。如果您希望 Claude Opus 4.6 在採取潛在風險行動之前先確認,請在提示中加入指引:
Consider the reversibility and potential impact of your actions. You are encouraged to
take local, reversible actions like editing files or running tests, but for actions that
are hard to reverse, affect shared systems, or could be destructive, ask the user before
proceeding.
Examples of actions that warrant confirmation:
- Destructive operations: deleting files or branches, dropping database tables, rm -rf
- Hard to reverse operations: git push --force, git reset --hard, amending published commits
- Operations visible to others: pushing code, commenting on PRs/issues, sending
messages, modifying shared infrastructure
When encountering obstacles, do not use destructive actions as a shortcut. For example,
don't bypass safety checks (e.g. --no-verify) or discard unfamiliar files that may be
in-progress work.Claude 的最新模型能夠有效地從多個來源尋找和綜合資訊。若要獲得最佳研究結果:
**提供明確的成功標準:**定義什麼構成對您研究問題的成功答案。
**鼓勵來源驗證:**請 Claude 跨多個來源驗證資訊。
對於複雜的研究任務,使用結構化方法:
Search for this information in a structured way. As you gather data, develop several
competing hypotheses. Track your confidence levels in your progress notes to improve
calibration. Regularly self-critique your approach and plan. Update a hypothesis tree or
research notes file to persist information and provide transparency. Break down this
complex research task systematically.這種結構化方法幫助 Claude 有條理地處理大型語料庫,並迭代地審視其發現。
Claude 的最新模型原生支援子代理協調。這些模型能夠識別何時將工作委派給專門的子代理會對任務有益,並在不需要明確指令的情況下主動這樣做。
若要善用此行為:
如果您看到過度使用子代理的情況,請加入關於何時需要和不需要子代理的明確指引:
Use subagents when tasks can run in parallel, require isolated context, or involve
independent workstreams that don't need to share state. For simple tasks, sequential
operations, single-file edits, or tasks where you need to maintain context across steps,
work directly rather than delegating.有了自適應思考和子代理協調,Claude 在內部處理大多數多步驟推理。當您需要檢查中間輸出或強制執行特定的管線結構時,明確的提示串連(將任務分解為循序的 API 呼叫)仍然有用。
最常見的串連模式是**自我修正:**生成草稿 → 讓 Claude 根據標準審查它 → 讓 Claude 根據審查結果進行改進。每個步驟都是獨立的 API 呼叫,因此您可以在任何時點記錄、評估或分支。
Claude 的最新模型有時可能會為了測試和迭代目的建立新檔案,特別是在處理程式碼時。這種方法讓 Claude 能夠在儲存最終輸出之前,將檔案(特別是 Python 腳本)用作「臨時草稿本」。使用臨時檔案可以改善結果,特別是對於代理式程式編寫的使用案例。
如果您希望盡量減少淨新增的檔案建立,可以指示 Claude 自行清理:
If you create any temporary new files, scripts, or helper files for iteration, clean up
these files by removing them at the end of the task.Claude Opus 4.5 和 Claude Opus 4.6 有過度工程化的傾向,會建立額外的檔案、加入不必要的抽象層,或建構未被要求的彈性。如果您看到這種不希望出現的行為,請加入具體的指引以保持解決方案的精簡。
例如:
Avoid over-engineering. Only make changes that are directly requested or clearly
necessary. Keep solutions simple and focused:
- Scope: Don't add features, refactor code, or make "improvements" beyond what was
asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need
extra configurability.
- Documentation: Don't add docstrings, comments, or type annotations to code you didn't
change. Only add comments where the logic isn't self-evident.
- Defensive coding: Don't add error handling, fallbacks, or validation for scenarios
that can't happen. Trust internal code and framework guarantees. Only validate at system
boundaries (user input, external APIs).
- Abstractions: Don't create helpers, utilities, or abstractions for one-time
operations. Don't design for hypothetical future requirements. The right amount of
complexity is the minimum needed for the current task.Claude 有時可能會過度專注於讓測試通過,而犧牲了更通用的解決方案,或者可能會使用變通方法(如用於複雜重構的輔助腳本)而不是直接使用標準工具。若要防止此行為並獲得可泛化的解決方案:
Please write a high-quality, general-purpose solution using the standard tools
available. Do not create helper scripts or workarounds to accomplish the task more
efficiently. Implement a solution that works correctly for all valid inputs, not just
the test cases. Do not hard-code values or create solutions that only work for specific
test inputs. Instead, implement the actual logic that solves the problem generally.
Focus on understanding the problem requirements and implementing the correct algorithm.
Tests are there to verify correctness, not to define the solution. Provide a principled
implementation that follows best practices and software design principles.
If the task is unreasonable or infeasible, or if any of the tests are incorrect, please
inform me rather than working around them. The solution should be robust, maintainable,
and extendable.Claude 的最新模型較不容易產生幻覺,並能根據程式碼提供更準確、更有依據、更智慧的答案。若要進一步鼓勵此行為並減少幻覺:
<investigate_before_answering>
Never speculate about code you have not opened. If the user references a specific file,
you MUST read the file before answering. Make sure to investigate and read relevant
files BEFORE answering questions about the codebase. Never make any claims about code
before investigating unless you are certain of the correct answer - give grounded and
hallucination-free answers.
</investigate_before_answering>與先前的 Claude 模型相比,Claude Opus 4.5 和 Claude Opus 4.6 具有改進的視覺能力。它們在影像處理和資料擷取任務上表現更好,特別是當上下文中存在多張影像時。這些改進也延伸到電腦使用,模型可以更可靠地解讀螢幕截圖和 UI 元素。您也可以透過將影片分解為影格來使用這些模型分析影片。
一個已被證明能進一步提升表現的有效技巧是為 Claude 提供裁切工具或代理技能。測試顯示,當 Claude 能夠「放大」影像的相關區域時,在影像評估上有一致的提升。Anthropic 已建立了一個裁切工具的範例。
Claude Opus 4.5 和 Claude Opus 4.6 能夠建構具有強大前端設計的複雜、真實世界的網頁應用程式。然而,在沒有指引的情況下,模型可能會預設使用通用模式,產生使用者所稱的「AI slop」美學。若要建立令人驚喜和愉悅的獨特、有創意的前端:
如需改善前端設計的詳細指南,請參閱關於透過技能改善前端設計的部落格文章。
對於 API 之外的前端設計工作,Claude Design 提供畫布和設計工具,讓 Claude 能夠互動式地生成和迭代設計。
以下是一個您可以用來鼓勵更好前端設計的系統提示片段:
<frontend_aesthetics>
You tend to converge toward generic, "on distribution" outputs. In frontend design, this
creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive
frontends that surprise and delight.
Focus on:
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic
fonts like Arial and Inter; opt instead for distinctive choices that elevate the
frontend's aesthetics.
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency.
Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw
from IDE themes and cultural aesthetics for inspiration.
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only
solutions for HTML. Use Motion library for React when available. Focus on high-impact
moments: one well-orchestrated page load with staggered reveals (animation-delay)
creates more delight than scattered micro-interactions.
- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer
CSS gradients, use geometric patterns, or add contextual effects that match the overall
aesthetic.
Avoid generic AI-generated aesthetics:
- Overused font families (Inter, Roboto, Arial, system fonts)
- Clichéd color schemes (particularly purple gradients on white backgrounds)
- Predictable layouts and component patterns
- Cookie-cutter design that lacks context-specific character
Interpret creatively and make unexpected choices that feel genuinely designed for the
context. Vary between light and dark themes, different fonts, different aesthetics. You
still tend to converge on common choices (Space Grotesk, for example) across
generations. Avoid this: it is critical that you think outside the box!
</frontend_aesthetics>您也可以參考完整的技能定義。
從較早世代的模型遷移到目前的 Claude 模型時:
明確說明期望的行為: 考慮準確描述您希望在輸出中看到的內容。
使用修飾語來構建您的指示: 加入鼓勵 Claude 提高輸出品質和細節的修飾語,有助於更好地塑造 Claude 的表現。例如,不要使用「建立一個分析儀表板」,而是使用「建立一個分析儀表板。盡可能包含更多相關功能和互動。超越基礎,建立一個功能完整的實作。」
明確要求特定功能: 當需要動畫和互動元素時,應明確提出要求。
更新思考配置: Claude 4.6 模型使用自適應思考(thinking: {type: "adaptive"}),而非使用 budget_tokens 的手動思考。使用 effort 參數來控制思考深度。
遷移離開預填回應: 從 Claude 4.6 模型和 Claude Mythos Preview 開始,不再支援最後一個 assistant 回合的預填回應。請參閱遷移離開預填回應以取得替代方案的詳細指引。
調整反怠惰提示: 如果您的提示先前鼓勵模型更徹底或更積極地使用工具,請減少這類指引。Claude 4.6 模型更加主動,可能會對先前模型所需的指示過度觸發。
如需詳細的遷移步驟,請參閱遷移指南。
請參閱遷移指南中的從 Claude Sonnet 4.5 或更早版本遷移到 Claude Sonnet 5,其中涵蓋 effort 預設值的變更以及手動擴展思考(budget_tokens)的移除。
Claude Fable 5 和 Claude Mythos 5 的行為差異與提示模式,涵蓋 effort、指令遵循、長時間執行、記憶體和鷹架變更。
Claude Sonnet 5 的行為差異與提示模式,涵蓋 effort、自適應思考預設值、工具使用,以及從 Claude Sonnet 4.6 的遷移。
Claude Opus 5 的行為差異與提示模式,涵蓋回應冗長度、代理式敘述、任務範圍界定、子代理委派和自我修正。
何時使用提示工程,以及在調整提示之前如何規劃您的方法。
Was this page helpful?