Slash Commands Plugin
The Slash Commands Plugin lets users define personal shorthand commands that expand to full prompts. For example, /test can expand to "Write comprehensive unit tests for the following code:".
Overview
The Slash Commands plugin:
- Intercepts user input at the start of a message for
/commandpatterns - Looks up the command in the user's personal settings (falls back to admin-configured defaults)
- Replaces the slash command with its configured prompt text
- Appends any arguments that followed the command
Configuration
plugins:
- module: codumentor.plugins.slashcmds
class: SlashCommandsPlugin
args:
enabled: true
default_commands:
- name: test
prompt: "Write comprehensive unit tests for the following code:"
- name: review
prompt: "Review this code for bugs, security issues, and code quality:"
- name: explain
prompt: "Explain what this code does in plain language:"
- name: docs
prompt: "Write docstrings and inline documentation for:"
Configuration Parameters
- enabled (optional): Whether the plugin is active (default:
true) - default_commands (optional): List of default commands shown to users who haven't customized their own. Each entry requires
name(without slash) andprompt. Defaults are shown in the Web UI as a starting point for user customization.
Usage
Invoking a Command
Type a slash command at the start of your message:
/test # Expands to the full prompt
/test UserService.create # Expands to: "Write comprehensive unit tests for UserService.create"
/review src/api.py # Expands to: "Review this code for ... src/api.py"
Any text after the command name is appended to the expanded prompt with a space.
Customizing Commands
Each user can customize their commands via Settings → Slash Commands in the Web UI. The default_commands from server config are pre-populated for easy editing. Changes are stored per-user and do not affect other users.
Command Naming Rules
- Must start with a letter or underscore, followed by letters, numbers, or underscores
- Matching is case-insensitive (
/Testmatchestest) - Only matches when the command is at the very start of the message
Notes
- Does not interfere with the Skills plugin's slash commands — both can coexist; handler priority determines which runs first
- Users who have never customized commands automatically receive the
default_commandsfrom server config - An empty
default_commandslist means users start with no commands until they configure their own