Slash Commands

Slash commands turn a repeatable instruction into a named shortcut. Instead of retyping a long prompt every time, you and your users invoke a command like /review or /changelog, and the SDK expands it into the underlying instructions before Amara acts. They keep complex workflows consistent, discoverable, and easy to maintain in one place.

Defining a command

A slash command is a small definition with a name, a description, and the prompt template it expands into. Register commands when you create a query, and they become available for the agent to invoke.

import { query } from "@syntic/agent-sdk";
 
const response = query({
  prompt: "/review src/payments.ts",
  options: {
    commands: [
      {
        name: "review",
        description: "Review a file for bugs and style issues.",
        prompt: "Review the file at {{args}}. Report correctness bugs first, then style. Be specific and cite line numbers.",
      },
    ],
  },
});
from syntic_agent_sdk import query
 
response = query(
    prompt="/review src/payments.py",
    options={
        "commands": [
            {
                "name": "review",
                "description": "Review a file for bugs and style issues.",
                "prompt": "Review the file at {{args}}. Report correctness bugs first, then style. Be specific and cite line numbers.",
            }
        ]
    },
)

Arguments and context

Commands can accept arguments through the {{args}} placeholder, which the SDK fills with whatever the user typed after the command name. This lets a single definition serve many inputs — a /review command works on any path, a /explain command on any symbol. You can reference multiple named parameters in more advanced templates, and combine a command’s expansion with the session’s existing context so the agent still sees the files and history it has already gathered.

When to use commands

Reach for a slash command when a prompt is worth naming: something your team runs often, phrases carefully, or wants to keep uniform across people. They pair naturally with skills — a command can be the entry point that triggers a deeper skill workflow — and can be distributed to other projects by bundling them in a plugin.