# Slash Commands

> The Slash Commands are short commands starting with a slash that trigger predefined prompts or actions in AI tools.

## How do I create a custom slash command for an AI agent?

The commands like '/review' or '/test' typed in an AI tool to run a saved prompt or built-in action. Teams store custom commands in the repository to share common workflows.

- Topic: Agent Customization
- Type: concept

## Example

Wrong:

```markdown
Fix GitHub issue 1234 and open a pull request.
```

Right:

```markdown
---
description: Fix an issue by number and open a pull request
---
Fix issue #$ARGUMENTS.
1. Read the issue and find the related code.
2. Write a failing test, then fix the code.
3. Run the tests and open a pull request.
```

A placeholder like `$ARGUMENTS` makes the command reusable for any issue instead of hardcoding one number.

## Key points

- The command file has a short description that explains what it does.
- Arguments are passed through a placeholder instead of being hardcoded in the prompt.
- Project commands are stored in the repository so the whole team can use them.

## Interview questions

### Where are custom slash commands stored?

Usually as Markdown files in a commands folder, either in the project for the team or in your home folder for personal use. The exact path depends on the tool.

### What is the difference between a slash command and a prompt template?

A slash command is a prompt template you can run by name. Some tools also let commands set allowed tools or a model.

### Can a slash command take arguments?

Yes. Text typed after the command is passed in through a placeholder in the command file.

## Related cards

- [Agent Skills](https://wonderium.dev/ai/agent-skills.md)
- [Prompt Template](https://wonderium.dev/ai/prompt-template.md)
- [MCP Prompt](https://wonderium.dev/ai/mcp-prompt.md)
- [Sub-Agent](https://wonderium.dev/ai/sub-agent.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/slash-commands
- Last updated: 2026-11-25
