New help command in GitLab Duo Chat
### Release notes Discover GitLab Duo Chat's powerful features effortlessly! Just type help in the chat message field to explore everything it can do for you. Give it a try and see how GitLab Duo Chat can make your work smoother and more efficient! ![image](/uploads/09a9c220ac9f496a77bf31fe4a290ded/image.png) https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html ### Problem Typically users do not know what kind of question can be answered by the chat. Then some users are not aware that slash commands can be used for asking common questions nor which ones exist. There are many ways we can (and also will) improve this. This issue here is about implementing a simple help function. (This feature proposed here will become more discoverable through https://gitlab.com/gitlab-org/gitlab/-/issues/472278+s and will become more usable through https://gitlab.com/gitlab-org/gitlab/-/issues/470703+.) ### Proposal 1. Add a `/help` command to the Duo Chat experience to for users to get guidance on the chat's capabilities and how to use it. This help command shall work in GitLab and in the IDEs. 2. If it does not grow the effort of this issue include the request (i.e. `/help`) as well as the answer in the chat history so that when users ask follow-up questions the behavior is consistent with the other interactions with the chat. If it does grow the effort the engineer working on this issue should create a follow-up issue and let @tlinz know of it. 3. Ensure that there is a process in place that contributors that enhance the chat with new contexts and new capabilities are aware that they should also adjust the help text so that this help feature does not start rotting. (The how is up to the engineer. Maybe add a text to the contribution guide.) ![CleanShot_2024-06-27_at_14.56.36_2x](/uploads/df71759f5d3d5b6fc8af388056280bf1/CleanShot_2024-06-27_at_14.56.36_2x.png){width="382" height="481"} --- ### Static copy in GitLab: GitLab Duo Chat is your personal AI-powered assistant for boosting productivity. GitLab Duo Chat can help with: * Questions about an issue or an epic, for example: * `Summarize this issue in 5 bullet points.` * `Rewrite the description of this epic to make to be more concise.` * Questions about merge requests, for example: * `Summarize this merge request in one sentence` * `Summarize the comments in this merge request: <merge request URL>.` * _Note: GitLab Duo Chat does not yet have the context of the diff or the files in an MR._ * Explaining or generating code, for example: * `Create a regular expression for parsing IPv4 and IPv6 addresses in Python.` * `Create a CI/CD configuration to build and test Rust code.` * `Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()` * [On a code file, select the lines you want explained, then on the left side, select the question mark](https://docs.gitlab.com/ee/user/project/repository/code_explain.html) `(**{question}**)`. * Questions about how GitLab works, for example: * `How do I add CI/CD variables to a project?` * [Troubleshooting a failed pipeline](https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html#troubleshoot-failed-cicd-jobs-with-root-cause-analysis) (Requires Ultimate and is part of GitLab Duo Enterprise): * On the job log page, select **Troubleshoot** or open GitLab Duo Chat and type `/troubleshoot`. * [Explain a vulnerability](https://docs.gitlab.com/ee/user/application_security/vulnerabilities/index.html#explaining-a-vulnerability) found by a SAST scanner (Requires Ultimate and is part of GitLab Duo Enterprise): * In the upper right, from the Resolve with merge request dropdown list, select **Explain vulnerability**, then select **Explain vulnerability**. * Or, open GitLab Duo Chat and type `/vulnerability_explain`. Ask follow-up questions to dig deeper into or expand on the conversation with GitLab Duo. If you want to switch topics, type `/reset` and you might get better results. Use GitLab Duo Chat in your IDE to explain, create, or refactor code, or to generate tests. After [you set up Chat in your IDE](https://docs.gitlab.com/ee/user/gitlab_duo_chat/#use-gitlab-duo-chat-in-the-web-ide) type `/help` in the IDE to learn how to use it. Learn more about GitLab Duo Chat in the [documentation](https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html). ### Static copy in the IDE: GitLab Duo Chat is your personal AI-powered assistant for boosting productivity. You can ask GitLab Duo Chat questions about code by selecting the code and asking a question. GitLab Duo Chat can help with: * Generating or change code, for example: * Select the code that you have a question about and ask your question. * `Create a regular expression for parsing IPv4 and IPv6 addresses in Python.` * `Create a CI/CD configuration to build and test Rust code.` * Explaining code (you can also use `/explain`), for example: * Select the code you want explain and then ask questions like the following * `Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()` * `/explain why a static variable is used here` * Refactoring code, (you can also use `/refactor`), for example: * Select the code you want refactored and then ask questions like the following * `/refactor to avoid memory leaks` * Fixing code (you can also use `/fix`), for example: * Select the code you want fixed and then ask questions like the following * `/fix duplicate database inserts` * Writing tests (you can also use `/tests`), for example: * Select the code you want to have tests written for and then ask questions like the following * `Write tests using the Boost.test framework` * `/tests` Ask follow-up questions to dig deeper into or expand on the conversation with Duo. If you want to switch topics, type `/reset` and you might get better results. Use GitLab Duo Chat in GitLab to ask questions about issues, epics, merge requests, comments, or to ask questions about GitLab or general DevSecOps questions. The Git Lab Duo Chat button is on the top-right in group and project pages. To use it, ask `/help` in GitLab to learn how. Learn more about GitLab Duo Chat can do in the [documentation](https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html). <!--Use this section to explain the feature and how it will work. It can be helpful to add technical details, design proposals, and links to related epics or issues.--> <!--Consider adding related issues and epics to this issue. You can also reference the Feature Proposal Template (https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal%20-%20detailed.md) for additional details to consider adding to this issue. Additionally, as a data oriented organization, when your feature exits planning breakdown, consider adding the `What does success look like, and how can we measure that?` section.--> ### Implementation Plan draft: - Implement a `/help` command in the backend similar to other slash commands we already have - Built logic to distinguish which host system is making the request (this is already partially done: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/1757) - return correct help text depending on host system - Make this slash command its own unit primitive so that we can measure usage. Make it available to ~"GitLab Duo Pro" and ~"Gitlab Duo Enterprise".
issue