Commands
Reusable slash-prefixed prompt templates with `$ARGUMENTS` support — turn repeated asks like "review this PR" or "write tests" into one-keystroke actions.
Commands are prompt templates you invoke with a slash in chat (e.g., /summarize, /pr-description). Each command is a single .md file: the markdown body is the prompt, optionally parameterised with $ARGUMENTS.
Use commands when you repeat the same ask often — PR descriptions, bug reports, test generation, code reviews with a specific rubric. Unlike agents, commands don't have a persistent persona; they just inject a template into the conversation.
Quick Start
mkdir -p ~/.fabric-agent/workspaces/{ws}/commands
cat > ~/.fabric-agent/workspaces/{ws}/commands/explain.md <<'EOF'
---
name: "Explain"
description: "Explain a concept in simple terms"
---
Explain the following concept in simple, beginner-friendly terms.
Use an analogy if helpful:
$ARGUMENTS
EOFIn chat:
/explain dependency injection in TypeScriptThe template gets injected into the conversation with $ARGUMENTS replaced by your trailing text:
Explain the following concept in simple, beginner-friendly terms.
Use an analogy if helpful:
dependency injection in TypeScriptFile Format
Commands can have optional frontmatter. A plain markdown file works as a command — name and description are derived from the filename and first line if omitted.
With frontmatter
---
name: "Summarize" # optional
description: "Summarize text in 3-5 bullet points" # optional
icon: "📄" # optional
---
Summarize the following content in 3-5 bullet points, focusing on
key decisions and action items:
$ARGUMENTSWithout frontmatter
Review the following code for potential bugs and suggest fixes:
$ARGUMENTSWhen no frontmatter is present:
- Name derives from the filename —
code-review.md→ "Code Review". - Description is the first non-empty line of the body.
The $ARGUMENTS Placeholder
$ARGUMENTS is replaced with whatever text follows the command name in chat. If the user types only the command name with no arguments, it's replaced with an empty string.
Put the placeholder where the user input makes the most sense in your prompt — usually at the end, but sometimes interleaved:
---
name: "Translate"
description: "Translate text into the target language"
---
Translate the following text into **$ARGUMENTS**, preserving tone and formatting.
Only output the translation — no preamble.Invoked as /translate Spanish (formal register) so $ARGUMENTS lands naturally in the sentence.
Storage Locations
Workspace commands
~/.fabric-agent/workspaces/{workspaceId}/commands/{slug}.mdAvailable in every session of that workspace.
Project commands
Shipped with your repo so teammates get them automatically:
{projectRoot}/.agents/commands/{slug}.md
{projectRoot}/.codex/commands/{slug}.md
{projectRoot}/.claude/commands/{slug}.mdFabric Agents reads all three directories for compatibility with Codex and Claude Code conventions.
Priority order
When a project command and a workspace command share the same slug, the project command wins — letting repos override workspace defaults.
Examples
Pull request description
---
name: "PR Description"
description: "Generate a pull request description from staged changes"
icon: "📝"
---
Generate a pull request description for the current staged changes.
Include:
1. **Summary** — 2-3 sentences describing the change
2. **Changes** — bullet list of specific modifications
3. **Testing** — how to verify the changes work
4. **Breaking changes** — any backward-incompatible changes (or "None")
Format as Markdown suitable for a GitHub PR description.
$ARGUMENTSBug report template
---
name: "Bug Report"
description: "Generate a structured bug report"
icon: "🐛"
---
Create a structured bug report with these sections:
## Bug Description
$ARGUMENTS
## Expected Behavior
(describe what should happen)
## Actual Behavior
(describe what actually happens)
## Steps to Reproduce
1. ...
## Environment
- OS:
- Runtime/Browser:
- Version:Write tests
---
name: "Write Tests"
description: "Generate unit tests for the specified code"
---
Write comprehensive unit tests for the following code.
Use the project's existing test framework and patterns.
Include edge cases and error scenarios.
$ARGUMENTSPlain markdown (no frontmatter)
File: refactor.md
Refactor the following code to improve readability and maintainability.
Preserve all existing behavior. Explain each change you make.
$ARGUMENTSAppears as "Refactor" in the slash menu.
Best Practices
- Keep each command focused. One command = one output format or workflow.
- Place
$ARGUMENTSintentionally. Put it where user input fits naturally in the prompt — not always at the end. - Write prompts that work with empty args too. Users sometimes invoke
/commandwith nothing trailing. - Add frontmatter for discoverability. Optional, but a good
descriptionmakes the slash menu much more useful. - Ship team-wide commands via
.agents/commands/. Commit them to the repo so everyone gets the same templates.
Troubleshooting
Command doesn't appear in the slash menu
- Confirm the file ends with
.mdand isn't empty. - Verify it's in one of the supported directories.
- If using frontmatter, check for YAML syntax errors.
$ARGUMENTS isn't being replaced
- The placeholder is case-sensitive — it must be written as
$ARGUMENTS. - Verify you typed text after the command name in chat.
Wrong command loading
- Project commands override workspace commands with the same slug.
- Check for duplicate slugs across
.agents/commands/,.codex/commands/, and.claude/commands/.
See also
- Agents — persistent personas invoked with
@ - Skills — reusable instruction sets
- Automations — trigger commands and prompts on events