Skip to main content
This guide is for developers turning recurring prompts into reusable /command shortcuts with no code or build step. Each prompt template is a Markdown file whose filename (without .md) becomes its slash command. Choose a skill instead when the model should decide when to load instructions automatically, or an extension when you need TypeScript code.

Before you begin

Before you add a project template, confirm the following:
  • Atomic is installed and available on your PATH.
  • For project templates under .atomic/prompts/, your project is trusted (run /trust in Atomic or start with --approve; see Security).

Create your first template

Follow these steps to create and test a reusable /review prompt template:
1

Save the template file

Save the following file as .atomic/prompts/review.md for one project, or ~/.atomic/agent/prompts/review.md (%USERPROFILE%\.atomic\agent\prompts\review.md on Windows) for every project:
2

Reload your session

Run /reload in an active Atomic session so Atomic picks up the template without restarting.
3

Invoke and verify

Type /review or /review "auth edge cases" in the editor. Confirm that autocomplete shows /review, its [focus area] hint, and its description, and that submitting expands the template into the prompt.

Format and frontmatter

Prompt templates support two optional YAML frontmatter fields:
  • Filename: Determines the slash command name. Saving review.md registers /review.
  • description: Optional summary shown in autocomplete. If omitted or set to a non-string YAML value, Atomic uses the first non-empty line of the template body, truncated to 60 characters with ....
  • argument-hint: Optional usage hint shown before the description in autocomplete (non-string YAML values are ignored). Use <angle brackets> for required arguments and [square brackets] for optional arguments.
The following frontmatter declares both a description and a required argument hint:
Autocomplete renders each command’s argument-hint ahead of its description:
Invalid YAML frontmatter (such as an unquoted colon in description: Broken: value) skips only that template and reports a warning with the filename and parse position. Valid sibling templates still load.

Use prompt templates

Type / followed by the template name and any arguments:
Template expansion behaves as follows across modes and views:
  • Multiline arguments: The command name ends at the first space, tab, or line break, so arguments can start on the next line with Shift+Enter, and line breaks inside arguments stay intact.
  • Subagent views: While viewing a subagent, invoking a prompt template expands and sends the prompt to that subagent instead of main (see Commands while viewing a subagent).
  • Non-interactive and queued inputs: Prompt templates also expand in print (-p), JSON, and Remote Procedure Call (RPC) modes as well as queued steer and followUp messages. From extensions, atomic.sendUserMessage() expands templates only when you pass { expandPromptTemplates: true }. Skill commands (/skill:...) expand before prompt templates.

Arguments and placeholders

Templates support bash-style positional arguments, defaults, and slicing. Substitution runs in a single pass (not recursively), so argument values containing $1 or $@ stay literal text. The following table lists every supported placeholder: Default values inside ${N:-default} or ${@:-default} can’t contain }. Defaults longer than 1,024 characters don’t match and stay literal text. The following template combines $1 and $@:
Running /component Button "onClick handler" "disabled support" replaces $1 with Button and $@ with Button onClick handler disabled support. To pass an empty positional argument without shifting later positions, use "" or ''. For Review $2. Focus: ${1:-correctness}., running /review "" src/index.ts expands to Review src/index.ts. Focus: correctness.

Quote and split arguments

Atomic tokenizes template arguments with the following rules:
  • Arguments split on space ( ) and tab (\t) only, not on newlines (\n). Multiline text without spaces or tabs between lines stays in one argument.
  • Quotes (" or ') start a quoted argument only at the start of a token, so apostrophes inside words (doesn't) stay literal. Unquoted characters immediately after a closing quote stay in the same argument ("hello"world becomes helloworld).
  • Atomic treats an unclosed quote as a literal character and tokenizes the remaining text normally.
  • Backslash escaping applies only to a matching quote inside a quoted argument (\" inside "..." or \' inside '...'). All other backslashes (including \\ and unquoted backslashes) stay literal.

Locations and loading rules

Atomic loads prompt templates from the following sources:
  • Global: ~/.atomic/agent/prompts/*.md (%USERPROFILE%\.atomic\agent\prompts\*.md on Windows).
  • Project (requires project trust): .atomic/prompts/*.md.
  • Packages: prompts/ directories or atomic.prompts entries in package.json.
  • Settings: The prompts array in global or project settings.json (Resource settings), accepting files, directories, and filter patterns (!glob, +path, and -path with ~ expansion; see Package filtering).
  • CLI: --prompt-template <path> (repeatable; accepts a .md file or a directory and still loads with --no-prompt-templates / -np; see CLI resource options).
Discovery and precedence follow these rules:
  • Auto-discovery in ~/.atomic/agent/prompts/ and .atomic/prompts/ is non-recursive and skips dotfiles, node_modules, broken symlinks, and files matched by .gitignore, .ignore, or .fdignore inside prompts/. Atomic follows direct symlinks to .md files.
  • Explicit --prompt-template <dir> paths read all .md files in that directory without applying dotfile or .gitignore filters. Atomic ignores a non-.md file path passed to --prompt-template silently.
  • Built-in slash commands and extension slash commands always take precedence over prompt templates with the same name. Among templates themselves, -e packages win first, then project overrides global, both override configured and bundled packages, and explicit --prompt-template paths apply last (see Resource precedence order).
Legacy .pi paths (~/.pi/agent/prompts/*.md, .pi/prompts/*.md, and pi.prompts in package.json) continue to load alongside .atomic paths. If an inherited legacy .pi template collides with a bundled template, the bundled template wins.

Troubleshooting

The following table lists common prompt template issues and how to fix them:

Next steps

Use skills

Provide instructions that the agent loads automatically when a task matches.

Subagents

Delegate a focused, bounded task to a child agent.

Install and manage packages

Bundle prompt templates with skills, themes, and extensions to share with your team.

Build with Atomic

Compare every customization option in Atomic.