正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

GitLab Duo Chatのベストプラクティス

質問でGitLab Duo Chatのプロンプトを実行する際は、具体的な例とガイダンスを得るために、次のベストプラクティスを適用してください。

会話をする

チャットは検索フォームではなく、会話のように扱います。検索のような質問から始め、関連する質問でスコープを絞り込みます。やり取りを通じてコンテキストを構築します。

たとえば、次のように質問します:

c# start project best practices

その後、次のような質問をします:

Please show the project structure for the C# project.

GitLab Duo Agentic Chatを使用すると、複数のプロジェクトを含む会話を行うことができます。

Tell me the difference between project A and project B.

プロンプトを調整する

より良い回答を得るには、より多くのコンテキストを最初に提供します。どの範囲でサポートが必要かを十分に考え、1つのプロンプトに含めます。

How can I get started creating an empty C# console application in VS Code?
Please show a .gitignore and .gitlab-ci.yml configuration with steps for C#,
and add security scanning for GitLab.

または、Agentic Chatを使用する場合:

Create an empty C# console application.
Show a .gitignore and .gitlab-ci.yml configuration with steps for C#,
and add security scanning for GitLab.

プロンプトパターンに従う

プロンプトを問題の説明とサポートの依頼として構成し、その後具体性を追加します。最初の質問にすべてを含める必要はありません。

I need to fulfill compliance requirements. How can I get started with Codeowners and approval rules?

次に、以下を質問します:

Please show an example for Codeowners with different teams: backend, frontend, release managers.

または、Agentic Chatを使用する場合:

Create Codeowners with different teams: backend, frontend, release managers.

The group names are "backend-dev," "frontend-dev," and "release-man."

ローコンテキストコミュニケーションを使用する

コードが選択されていても、何も表示されていないかのようにコンテキストを提供します。言語、フレームワーク、要件などの要素を具体的に指定します。

When implementing a pure virtual function in an inherited C++ class,
should I use virtual function override, or just function override?

Agentic Chatを使用する場合、Agentic Chatは複数のソースから情報を自律的に検索し、取得するため、このコンテキストの重要性は低くなります。ただし、Chatが可能な限り効率的に動作するように、明示的に指示する必要があります。

繰り返す

予期しない応答、または的外れな応答が得られた場合は、質問を言い換えてみてください。さらにコンテキストを追加します。

How can I get started creating an C# application in VS Code?

次の質問をします:

How can I get started creating an empty C# console application in VS Code?

または、Agentic Chatを使用する場合:

Create an empty C# console application in my test project.

辛抱強く待つ

はい/いいえで答えられる質問は避けてください。まず一般的な内容から始めて、必要に応じて詳細を指定します。

Explain labels in GitLab. Provide an example for efficient usage with issue boards.

必要なときにリセットする

Chatが間違った方向に進んでしまった場合は、/resetを使用します。

スラッシュコマンドプロンプトを調整する

基本的なスラッシュコマンドを使うのではなく、より具体的な提案を含めたスラッシュコマンドを使用してください。

/refactor into a multi-line written string. Show different approaches for all C++ standards.

または:

/explain why this code has multiple vulnerabilities

スラッシュコマンドはAgentic Chatでも引き続き機能しますが、GitLab Duo Non-Agentic Chatの場合ほど重要ではありません。Chatにコードの説明またはリファクタリングを依頼すると、プロジェクトを検索し、ファイルを作成および編集し、複数ソースの情報を同時に分析できます。