Commands & Participants

Speed up your workflow with slash commands and chat participants in Positron Assistant. Access quick actions and specialized AI help without long prompts.

Slash commands

Slash commands provide quick access to common tasks without writing long prompts.

Using slash commands

To use a slash command in the chat pane or inline chat, type the / character to bring up the command popup. Then, select a command and optionally add any additional instructions before sending the message.

Available slash commands

Slash commands are provided by Positron Assistant and other installed extensions, as well as any custom prompt files you have created.

Some built-in slash commands include:

  • /exportQuarto: Generate a Quarto document from the current chat conversation.
  • /fix: Fix a piece of code.
  • /explain: Explain a piece of code or concept.

Custom slash commands

Create custom slash commands by adding custom prompt files. This allows you to:

  • Reuse prompts across chat requests and sessions
  • Explicitly apply prompts to specific chat requests

Run the command Chat: Configure Prompt Files… to manage custom prompt files in your chat sessions.

Create a custom prompt file

  1. Run the command Chat: New Prompt File… and follow the prompts to create a new prompt file.
  2. Edit the newly created .prompt.md file to specify the prompt description, chat agents the prompt should be available for, the tools the prompt can use, as well as the prompt content.

After creating a custom prompt file, you can access it through slash commands in both the chat pane and inline chat.

Tip

To learn more about the format of custom prompt files, see the following VS Code documentation:

Note: Positron Assistant does not support the model field at this time.

Example custom prompt file

This shows a custom prompt tailored to code review which demonstrates key features of custom prompts in Positron Assistant. It includes header fields like description, name, agent, tools, and argument-hint to configure behavior and guide users. The prompt body uses an input variable (${input:codeContext}) to accept dynamic user input, making it reusable across different code snippets and files. By specifying the agent mode and restricting what tools are available, the prompt tailors Assistant’s behavior to exactly what’s at hand.

code-review.prompt.md
---
description: Perform a thorough code review focusing on best practices and potential issues
name: code-review
agent: agent
tools: ['search', 'todos', 'executeCode']
argument-hint: "File path or brief description of code to review"
---

You are an expert code reviewer. Perform a comprehensive code review of the provided code, focusing on code quality, best practices, and potential issues.

## Review Criteria

1. **Code quality**: Assess readability, maintainability, and adherence to style guidelines
2. **Logic and correctness**: Identify potential bugs, edge cases, or logical errors
3. **Performance**: Highlight inefficient operations or opportunities for optimization
4. **Security**: Check for common security vulnerabilities or unsafe practices
5. **Best practices**: Suggest improvements based on language-specific conventions

## Output Format

Structure your review as follows:
- **Overall assessment**: Brief summary of code quality
- **Strengths**: What the code does well
- **Issues found**: List specific problems with severity (critical/moderate/minor)
- **Recommendations**: Concrete suggestions for improvement

The code to review is: ${input:codeContext:e.g., src/utils/data-processor.py}

Use the available tools to search the codebase and execute code examples if needed.

Chat participants

Chat participants provide specialized knowledge to Positron Assistant. If you want help with a specific topic, you can add a chat participant to your conversation.

Adding chat participants

To add a chat participant, enter @ to bring up the chat participant popup. Then, select a participant and optionally add any additional instructions before sending the message.

Available chat participants

Chat participants are provided by Positron Assistant and other installed extensions.

Shiny Assistant

Shiny Assistant is a chat participant available within Positron Assistant that provides context-aware assistance for developing Shiny applications in Python or R. It can help you with tasks such as generating Shiny UI components, server logic, and reactive expressions.

Shiny Assistant is available in the chat once you have installed the Shiny extension. Like other chat participants, Shiny Assistant can be invoked by typing @shiny in the chat pane or inline chat, followed by your question or request related to Shiny development.

Shiny Assistant enhances the default prompt with additional information about Shiny that we have found improves the quality of generated apps and Shiny components. It is also kept up to date with the latest Shiny features and best practices, in a way that is not practical with foundation models or fine-tuning.

GitHub Copilot

If you are authenticated with GitHub Copilot as a language model provider in Positron, you can use chat participants provided by GitHub Copilot when chatting with GitHub Copilot models in Positron Assistant.

Refer to the GitHub Copilot Chat participants documentation for more information on available chat participants and how to use them.