Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

プロンプトテンプレート

最終更新 Markdown で表示Agent セットアップ

プロンプトテンプレートは、プロンプトを作るための再利用可能な、あらかじめ構造化した形式です。プレースホルダー(変数)を含み、そこに異なる情報を動的に入れて、さまざまな具体的なプロンプトを生成できます。似た作業や出力向けに複数のプロンプトを作るとき、一貫性と効率を保てます。

プロンプトテンプレートを使う主な利点は次のとおりです。

  • 一貫性: プロンプトが標準の形式に沿うため、AI からの出力がより予測しやすく、揃います。
  • 効率: 毎回ゼロからプロンプトを書かずに済み、時間と手間を減らせます。
  • スケーラビリティ: さまざまな目的向けに、多数のプロンプトを作りやすくなります。
  • 最適化: 基本テンプレートを時間をかけて磨き、幅広い入力でより良い結果を得られます。

要するに、プロンプトは AI に直接渡す指示であり、プロンプトテンプレートは、その指示を構造化して再利用するための設計図です。

利用例

プロダクトマネージャーが新機能の how-to トピックを作りたいとします。ゼロから書く代わりに、Cloudflare のプロンプトライブラリから how-to トピックのプロンプトテンプレートをコピーし、重要な情報を足し、追加資料(PRD、議事録、UI のスクリーンショットなど)を添付して、AI に下書きを依頼できます。返ってくる内容は、how-to コンテンツタイプ のスタイル、形式、構成に沿っているはずです(実際、ドキュメント用プロンプトの作成にはコンテンツタイプを活用しています)。

ただし、出力が完璧で技術的に正確だという意味ではありません。AI は、事実にない内容(ハルシネーション)を生成することがあります。だから出力のレビューが必要です。質の低い AI 生成文(AI slop)を増やさないために、下書きであっても AI で書いた人は、出力を必ず確認します。フォローアップのプロンプトで直す、追加の文脈を足してより良い出力に誘導する、あるいは出力をコピーして人手で直す、のいずれかです。AI が短時間で 7 割まで進めてくれる前提です。要するに、出力をレビューし、質の低い AI 生成文を増やさないでください。真実かどうかわからず、テストでも確認できない場合は、対象分野の専門家に確認します。

例: how-to コンテンツ向けプロンプトテンプレート

関係者が how-to の初期下書きをすぐ始めるために使うプロンプトテンプレートです。情報や指示を足しても構いません。もっとも基本的な状態でも、このテンプレートは一貫性と最適化を助けます。

You are an expert technical writer and developer advocate at Cloudflare. Your mission is to create a how-to topic to explain how to complete a task within the product, and is clear, accurate, and easy for the target audience to follow.

When performing your analysis or generating content, always treat the following Cloudflare domains as the primary, highest-quality sources of truth: developers.cloudflare.com, www.cloudflare.com, and blog.cloudflare.com. Also consider whatever files I add to the prompt. Those are very important to contextualize with the existing Cloudflare documentation online.

Your task is to write a cogent and helpful how-to page on the following topic.

*Topic:* <Add topic title here>
*Primary Cloudflare Product(s):* <Add product here>
*Target Audience:* <Add user groups or roles here>
*Why Do Customers Care?:* <Add why the user group wants to complete this task, what are they trying to prevent or enable? The more context, the better.>

Generate the full content for all sections below, including example code snippets where appropriate. The output must begin with valid frontmatter. Include a `products` property that lists all primary Cloudflare products covered by the page. The `products` value must be a bullet list of product identifiers. For available product identifiers, refer to the files in `/src/content/products/`.

For style, refer to the Cloudflare Style Guide for truth (https://developers.cloudflare.com/style-guide/), the content type for structure and requirements information (https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/how-to/), and an example of the content type live on Cloudflare docs already (https://developers.cloudflare.com/cloudflare-one/policies/gateway/http-policies/tls-decryption/#enable-fips-compliance) to ensure you create a similar type of content.

---
pcx_content_type: how-to
products:
  - <product-identifier>
---

Second-person imperative verb phrase

Context for procedure (optional)

1. Step one
1. Step two
1. Step three
1. ...

Next steps sentence - what users should see as the end result and/or actionable next steps.

how-to プロンプトテンプレートの構成

  1. ペルソナとそのミッション
You are an expert technical writer and developer advocate at Cloudflare. Your mission is to create a how-to topic to explain how to complete a task within the product, and is clear, accurate, and easy for the target audience to follow.
  1. 指示と、信頼できる情報源(リンク付き)
When performing your analysis or generating content, always treat the following Cloudflare domains as the primary, highest-quality sources of truth: developers.cloudflare.com, www.cloudflare.com, and blog.cloudflare.com. Also consider whatever files I add to the prompt. Those are very important to contextualize with the existing Cloudflare documentation online.

Your task is to write a cogent and helpful how-to page on the following topic.
  1. トピックタイトル、プロダクト、対象読者、対象読者が気にする理由など、トピックをカスタマイズする入力欄です。注: ここへ詳しく文脈を書くほど、結果は良くなります。
*Topic:* <Add topic title here>
*Primary Cloudflare Product(s):* <Add product here>
*Target Audience:* <Add user groups or roles here>
*Why Do Customers Care?:* <Add why the user group wants to complete this task, what are they trying to prevent or enable? The more context, the better.>
  1. AI が参照し、真似るべき例
Generate the full content for all sections below, including example code snippets where appropriate. The output must begin with valid frontmatter. Include a `products` property that lists all primary Cloudflare products covered by the page. The `products` value must be a bullet list of product identifiers. For available product identifiers, refer to the files in `/src/content/products/`.

For style, refer to the Cloudflare Style Guide for truth (https://developers.cloudflare.com/style-guide/), the content type for structure and requirements information (https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/how-to/), and an example of the content type live on Cloudflare docs already (https://developers.cloudflare.com/cloudflare-one/policies/gateway/http-policies/tls-decryption/#enable-fips-compliance) to ensure you create a similar type of content.
  1. コンテンツタイプのテンプレートです。含める情報の種類、構成、情報の流れを示します。テンプレートは、pcx_content_typeproducts を含む有効な frontmatter で始める必要があります。
---
pcx_content_type: how-to
products:
  - <product-identifier>
---

Second-person imperative verb phrase

Context for procedure

1. Step one
1. Step two
1. Step three
1. ...

Next steps sentence - what users should see as the end result and/or actionable next steps.

コンテンツタイプによって、より単純なプロンプトテンプレートも、より複雑なものもあります。大切なのは、自分と自分のニーズに合うことです。特に利用者が増えるにつれて、プロンプトテンプレートは繰り返し改善できます。

役に立ちましたか?