Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Creating Custom Slash Commands and Skills

Creating Custom Slash Commands and Skills

~8 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

Beyond the built-in slash commands from the last chapter, you can create custom slash commands for your own project - small, reusable automations for tasks that keep coming up in a similar form within the project.

What custom commands are good for

In the recipe planner, for example, the same kind of request keeps coming up: "Check a new recipe field for consistency between backend validation, frontend form, and tests." Instead of typing that long prompt every time, it can be stored once as a custom command and then invoked with just a few characters.

Creating a custom slash command

Custom slash commands are stored as individual Markdown files inside a .claude/commands/ folder within the project. The file name becomes the command name: check-field.md becomes the command /check-field. The file content is the prompt that gets sent to Claude Code when the command is invoked.

rezept-planer/.claude/commands/check-field.md
Check the new recipe field I'll name below for consistency across the whole project:

1. Is it accounted for in the validation in src/recipes.js?
2. Is there a matching form field in public/index.html?
3. Is there at least one test for it in tests/?

Field: $ARGUMENTS

The placeholder $ARGUMENTS gets replaced at call time with the text you type after the command name - so the command can be reused with different field names:

Terminal
> /check-field preparationTime

Skills: reusable domain knowledge

Beyond individual commands, there are skills: somewhat larger, bundled instructions for a recurring type of task that can contain more than a single prompt - for example several working steps, background knowledge, or references to additional reference files. While a slash command is usually a short, direct instruction, a skill is better suited to more complex, multi-step workflows that still get needed repeatedly in a similar form.

For the recipe planner, a skill could, for example, cover the whole "introduce a new recipe field" process: extending the backend field, adjusting validation, extending the frontend form, writing tests, updating the documentation in CLAUDE.md - a multi-step process that should always follow the same order.

Custom command or normal prompt?

  • If a request only ever comes up once, a normal prompt is perfectly sufficient - a custom command would be unnecessary overhead.
  • If a similar request keeps coming up regularly, a custom slash command is worth it.
  • If the recurring task spans several steps or needs extra background knowledge, a skill is often the better fit.

Tipp: Start small: only create a custom command once you find yourself typing a similar request for the third or fourth time. That prevents you from investing time in automations that turn out not to be needed regularly after all.

With that, you've learned two ways to speed up recurring tasks. The next chapter covers a tool for the opposite case: very large, one-off changes, where the approach should be carefully planned out before anything actually happens.