Scaffold a Claude Code Slash Command

VerifiedSafe

Create a new slash command (skill) in .claude/commands/ directory following existing command patterns.

Sby Skills Guide Bot
DevelopmentBeginner
7/28/2026
Claude Code
#claude-code#slash-commands#scaffolding#prompt-authoring

Recommended for

Automated summary

Scaffolds a new Claude Code slash command in .claude/commands/ by mirroring the shape of existing commands (verify.md, run.md).

Strengths

  • Matches the frontmatter and body style of commands already in the repo
  • Splits the command name from the rest of the description using the first token
  • Produces a numbered-step body the agent can follow directly
  • Reminds you to restart the session so the command shows up in the / menu

Limitations

  • Assumes .claude/commands/verify.md and run.md already exist as references
  • Does not validate or test the generated command afterwards
  • Makes no commit and performs no style checks beyond reading those two files
When to use it

When you want to add a new custom /name command to your Claude Code project quickly while staying consistent with existing ones.

When not to use it

If the repo has no .claude/commands/ directory with the reference files, or if you need a command that deliberately departs from the existing style.

Security analysis

Safe
Quality score78/100

The declared tools are Read and Write, and the skill's actions are clear: read two existing command files and write one new markdown file into `.claude/commands/`. There is no network access, no shell, no secret handling, and no destructive or obfuscated behavior. The only real concern is that the user-supplied name goes into a file path unvalidated, which could escape the target directory. That's a mild hardening gap, not a risk of exfiltration or destruction, so the skill is safe to list.

Findings
  • •The skill name comes straight from `$ARGUMENTS` and is used as the filename without sanitizing it, so a value like `../../foo` or one with `..` could write outside `.claude/commands/` (path traversal). It's limited to markdown files you write to your own repo, but a check like `^[a-z0-9-]+$` would be better.
  • •It writes a file into `.claude/commands/` and overwrites silently, with no check that a file of that name already exists.
How this analysis is made

Examples

New deploy-check command
/new-command deploy-check verify the build passes and all tests are green before deploying
New changelog command
/new-command changelog summarize the commits since the last git tag into CHANGELOG.md
No arguments
/new-command

description: Scaffold a new Claude Code slash command (skill) in .claude/commands/ argument-hint: <skill-name> <what it should do> allowed-tools: Read, Write

Arguments: $ARGUMENTS Treat the first token as the skill name and the rest as what it should do. If no arguments were given, ask me for them.

Create a new slash command, following the existing commands' shape.

Steps:

  1. Read .claude/commands/verify.md and .claude/commands/run.md to match the frontmatter (description, optional allowed-tools) and body style.
  2. Create .claude/commands/<skill-name>.md with a clear description and a body that tells the agent exactly what to do, in numbered steps.
  3. Tell me to start a new Claude Code session (or that it's available now) and that the command will appear in the / menu as /<skill-name>.

Keep it focused. Do not commit unless I ask.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/scaffold-a-claude-code-slash-command-ms47vqp6/download' --output '.skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6/SKILL.md.part' && mv '.skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6/SKILL.md.part' '.skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/scaffold-a-claude-code-slash-command-ms47vqp6/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills