講座 › 分野6 プロンプトとコンテキストのエンジニアリング
6.2 プロンプトエンジニアリング
配点 4.6%Prompt Engineering
明確に、理由も添えて、してほしいことを肯定形で。長い資料は上、質問は最後。指示とデータはタグで分け、外から来た入力は検査する。
未読
明確で直接的な指示と、その理由 読了

Claudeを、優秀だが職場の事情を知らない新人と考えます。何を望むかを正確に伝えるほど、結果は良くなります。指示の理由(なぜそれが大事か)を添えると、目的が伝わり、より的確な応答になります。してほしくないことより、代わりに何をしてほしいかを伝えます。
出典:Prompting best practices
Think of Claude as a brilliant but new employee who lacks context on your norms and workflows.https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Providing context or motivation behind your instructions, such as explaining to Claude why such behavior is importanthttps://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Tell Claude what to do instead of what not to dohttps://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
システムとユーザーの置き場所 読了

役割や全体のふるまいはシステムプロンプトに置きます。1文の役割でも効果があります。2万トークンを超える長い資料は、プロンプトの上のほう、質問・指示・例より前に置きます。質問を最後に置くと、複雑な複数の文書の入力で、品質が最大30%上がったという結果があります。
出典:Prompting best practices
Setting a role in the system prompt focuses Claude’s behavior and tone for your use case.https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Place your long documents and inputs near the top of your prompt, above your query, instructions, and examples.https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Queries at the end can improve response quality by up to 30 percent in testshttps://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
例示・出力の制約・タグ 読了

例(少数ショット)は、形式・口調・構成を導く確実な方法です。指示、背景、例、入力をXMLのタグで分けると、取り違えが減ります。出力の形式を厳密に決めたいときは、構造化出力を使います。
出典:Prompting best practices
A few well-crafted examples (known as few-shot or multishot prompting) improve accuracy and consistency.https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Increase output consistency
If you need Claude to always output valid JSON that conforms to a specific schema, use Structured Outputshttps://platform.claude.com/docs/en/test-and-evaluate/strengthen-guard…(取得 2026-11-17)
反復的な改善と、入力のサニタイズ 読了

プロンプトは、テストケースで試し、改善を繰り返して仕上げます。周りの事情を知らない同僚に見せて、その人が迷うなら、Claudeも迷うと考えます。利用者の入力は、既知の攻撃の型をClaudeに届く前に検査します。小さく速いモデルで、事前に入力を振り分ける方法もあります。
出典:Prompting best practices
Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they’d be confused, Claude will be too.https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Mitigate jailbreaks
Filter user input for known injection patterns before it reaches Claude.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guard…(取得 2026-11-17)
試験のポイント
- 長い資料は上、質問は最後。
出典:Prompting best practices
This improves performance across all models.
https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17) - 「〜するな」より「代わりに〜せよ」。理由も一言添える。
出典:Prompting best practices
can give Claude more information about your goals and help it deliver more targeted responses
https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)