PromptMay 22, 2026

Prompt Engineering Overview for

LLMEngineering

Before Prompt Engineering

Before diving into prompt engineering, it's crucial to have a solid foundation:

  • Clear Success Criteria: A precise definition of what constitutes success for your specific use case.
  • Empirical Testing Methods: Ways to objectively measure performance against your defined success criteria.
  • First Draft Prompt: An initial prompt that you intend to improve upon.

If these prerequisites are not met, it's recommended to establish them first, with resources like "Define success criteria and build evaluations" available for guidance. The Claude Console also offers a "Prompt generator" to help create a first draft.

When to Prompt Engineer

Prompt engineering is most effective for addressing success criteria that are directly controllable through prompt design. It's important to distinguish these from other issues:

  • Controllable Criteria: Focus on aspects of the output that can be improved by modifying the prompt's instructions, examples, or structure.
  • Non-Controllable Criteria: For issues like latency or cost, selecting a different model might be a more suitable solution than prompt engineering.

How to Prompt Engineer

A comprehensive understanding of various prompting techniques is key to effective prompt engineering:

  • Prompting Techniques: Detailed guidance on techniques such as clarity, providing examples, using XML structuring, role prompting, instructing the model to "think," and prompt chaining are covered in the "Prompting best practices" guide, which serves as the primary reference.
  • Console Tools: The Claude Console offers built-in "prompting tools" to facilitate prompt creation and refinement. These include a prompt generator, templates and variables, and a prompt improver.

Prompt Engineering Tutorial

For those who prefer an interactive learning experience, several tutorials are available:

  • GitHub Prompting Tutorial: An example-filled tutorial covering the prompt engineering concepts found in the documentation.
  • Google Sheets Prompting Tutorial: A lighter-weight, interactive spreadsheet-based version of the prompt engineering tutorial.

Key Takeaways

  • Effective prompt engineering requires a foundation of clear success criteria, empirical testing, and an initial prompt draft.
  • Prompt engineering is best suited for refining outputs based on prompt design, rather than addressing issues like latency or cost, which might require model changes.
  • Detailed guidance on various prompting techniques is available in the "Prompting best practices" documentation.
  • The Claude Console provides dedicated tools (generator, templates, improver) to aid in building and refining prompts efficiently.
  • Interactive tutorials on GitHub and Google Sheets offer practical, hands-on learning experiences for prompt engineering concepts.

原文链接:https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview