Create custom slash commands for popular AI agents (Claude Code, Codex, Gemini CLI). Use when user asks to create slash commands, custom commands, or reusable prompts for AI agent CLIs.
Create short, reusable slash command templates for a specific AI agent the user requests (Claude Code, Codex, or Gemini CLI).
As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Follow these steps:
Ask:
Understanding scopes:
Only implement the command for the agent the user asked for. Do not create cross-agent commands unless explicitly requested.
Location:
.claude/commands/~/.claude/commands/File format: Markdown (.md)
Naming:
command-name.md becomes /command-namecategory/command.md becomes /category:commandParameter substitution:
$ARGUMENTS - All arguments passed to the command$1, $2, ..., $9 - Individual space-separated argumentsLocation:
~/.codex/prompts/ (or $CODEX_HOME/prompts)promptsCodex does not support project level commands
File format: Markdown (.md)
---
description: Prep a branch, commit, and open a draft PR
argument-hint: [FILES=<paths>] [PR_TITLE="<title>"]
---
Create a branch named `dev/<feature_name>` for this work.
If files are specified, stage them first: $FILES.
Commit the staged changes with a clear message.
Open a draft PR on the same branch. Use $PR_TITLE when supplied; otherwise write a concise summary yourself.
Codex reads prompt metadata and resolves placeholders the next time the session starts.
Naming:
/prompts:<name>review-code.md becomes /prompts:review-codeParameter types:
$1 through $9/prompts:mycommand arg1 arg2 arg3$ARGUMENTS$FILE, $TICKET_ID (uppercase)/prompts:mycommand FILE=app.js TICKET_ID=123FILE="my file.js"Location:
~/.gemini/commands/.gemini/commands/File format: TOML (.toml)
# In: <project>/.gemini/commands/review.toml
# Invoked via: /review FileCommandLoader.ts
description = "Reviews the provided context using a best practice guide."
prompt = """
You are an expert code reviewer.
Your task is to review {{args}}.
Use the following best practices when providing your review:
@{docs/best-practices.md}
When you run /review FileCommandLoader.ts, the @{docs/best-practices.md} placeholder is replaced by the content of that file, and {{args}} is replaced by the text you provided, before the final prompt is sent to the model.