Topic 1 of 4 · 4 min read
User-invoked commands versus model-invoked skills
Goal: Decide whether a recurring workflow should be a command, a skill or a memory-file rule and explain the trigger difference.
A command runs because you typed it; a skill loads because the agent decided it was relevant; a memory-file rule is always in context. The trigger is the real difference, and it tells you where a recurring workflow belongs.
Check yourself · 1 of 3
What makes a slash command different from a skill?
Why it matters
Engineers keep pasting the same request: "review this branch with our checklist", "write the release note in our format". Each paste is a chance to forget a line. Turning it into a saved file fixes that, but the wrong kind of file fails in a quiet way. A rule that should always apply, saved as a command, never runs when someone forgets to call it. A step-by-step procedure saved as a rule wastes context on every request.
The three triggers
- Command or prompt file. A Markdown or TOML file in your repository or home folder. You call it by name, such as
/reviewin Gemini CLI, Claude Code, Codex or Cursor, or a prompt file in VS Code with Copilot. The text becomes your message. Nothing happens until you ask. - Skill. A folder with instructions and optional scripts. The agent sees only its name and description, and loads the rest when the task matches. You do not have to remember it exists.
- Memory file.
AGENTS.md,CLAUDE.mdorGEMINI.md. It is read at the start of every session. Use it for facts and rules that apply to all work, such as the test command.
Some tools blur these lines. Claude Code, for example, treats a command file and a skill as close relatives, and lets a skill be called by name too. Check your tool's docs; the question to ask stays the same.
How to choose
- Does it apply to everything? Put it in the memory file, in two or three lines.
- Is it a task you start on purpose, with a clear moment ("now review")? Make it a command. You want control over when it runs, especially if it has side effects.
- Is it knowledge or a procedure the agent should pull in by itself, across many kinds of requests? Make it a skill, with a precise description so it triggers correctly.
Before and after
Before: the team memory file holds forty lines titled "How to write a release note". Every chat pays for them, and the agent sometimes writes release notes in the middle of a bug fix.
After: the memory file says one line, "Release notes follow docs/release-notes.md". A /release-note command holds the format and takes the version as an argument. Nobody pays for it until they ask.
What goes wrong
- A command nobody remembers. If the team does not know it exists, it saves nothing. List commands in the README or the memory file.
- A skill with a vague description. "Helps with code" triggers on everything or on nothing.
- Side effects behind an automatic trigger. Anything that pushes, deploys or deletes should be a command you call, not a skill the agent may pick up on its own.
Examples
Sorting four recurring jobs
A team lists what it repeats:
- "Run tests with pnpm test" applies to all work: memory file.
- "Review the branch against our checklist" is started on purpose: command (
/review). - "How we write database migrations" is needed in many tasks, but only some: skill.
- "Open the release PR and tag it" has side effects: command, never automatic.
Same text, wrong home
A 30-line commit message format is saved as a skill with the description "git helper". The agent loads it for every git question and sometimes skips it when committing. Moved to a /commit command, it runs exactly when someone asks for a commit.
Key points
- A command runs when you invoke it by name, a skill loads when the agent judges it relevant, and a memory file is read every session.
- Rules that apply to all work belong in the memory file; procedures you start on purpose belong in commands.
- Skills need a precise description, because the description is what the agent uses to decide to load them.
- Actions with side effects such as pushing or deploying should sit behind a command you call yourself.
- Tools differ in names and overlap, so confirm in your tool's docs how a command and a skill are triggered.
Common mistakes
- Putting long procedures in the memory file, which makes every request slower and more expensive.
- Writing a vague skill description and then blaming the agent for not using the skill.
- Making a deploy or push a skill the agent can trigger by itself.
- Creating commands without telling the team they exist.
Check yourself · 2 of 3
A rule such as 'run pnpm test before saying you are done' should apply to every task. Where does it belong?
Check yourself · 3 of 3
A procedure opens a release PR and pushes a tag. Which home is safest?
Practice items, not counted towards your mastery.
Start here
- Custom commands (Gemini CLI docs) (opens in a new tab)DocsFree
Shows TOML command files, the args placeholder, and shell and file injection with escaping.
- Use prompt files in VS Code (opens in a new tab)DocsFree
Reusable prompt files with front matter for description, agent mode, model and tools.
- Custom prompts (Codex docs) (opens in a new tab)DocsFree
How Codex stores reusable prompts as Markdown files and passes arguments into them.
More for this topic
- Extend Claude with skills (Claude Code docs) (opens in a new tab)DocsFree
Covers slash commands and skills in one place, including who triggers each and tool limits.
- Adding repository custom instructions for GitHub Copilot (opens in a new tab)DocsFree
Where always-on repository instructions live, as opposed to commands you call on demand.