AGENT0S
HomeLibraryAgentic
FeedbackLearn AI
LIVE
Agent0s · AI Intelligence Library
Share FeedbackUpdated daily · 7am PST
Library/skill
skillbeginnerClaude Code

Custom Slash Commands in Claude Code for Repetitive Workflows

Claude Code supports custom slash commands stored in .claude/commands/*.md. Each file becomes a reusable command — perfect for PR descriptions, commit messages, and code review workflows that you run daily.

AI SETUP PROMPT

Paste into Claude Code — it will scan your project and set everything up

# Install & Configure: Custom Slash Commands in Claude Code for Repetitive Workflows

## What This Is
Claude Code supports custom slash commands stored in .claude/commands/*.md. Each file becomes a reusable command — perfect for PR descriptions, commit messages, and code review workflows that you run daily.

Source: https://reddit.com/r/ClaudeAI/comments/1abc123/custom_slash_commands

## Before You Start

Scan my workspace and analyze:
- The project language, framework, and directory structure
- Existing agent configuration (check for .claude/, .codex/, CLAUDE.md, settings.json, commands/, skills/ directories)

Then ask me before proceeding:
1. Where should this skill be installed — project-level (.claude/skills/) or globally?
2. Any customizations needed (trigger conditions, naming, etc.)?

## Source Access Note

The source URL (https://reddit.com/r/ClaudeAI/comments/1abc123/custom_slash_commands) may not be directly accessible from the terminal. Use the Reference Implementation and Additional Context sections below instead. If you need more details, ask me to paste relevant content from the source.

## What to Implement

This is an **Agent Skill** — an auto-loaded capability defined in a SKILL.md file.

- Read the source repository/file to find the skill definition (SKILL.md or equivalent)
- Place it in the correct skills directory for my agent setup (`.claude/skills/`, or equivalent)
- Ensure the SKILL.md frontmatter is valid and the skill is discoverable
- If the skill requires any dependencies, install them using the project's package manager

## Additional Context

- Create a .claude/commands/ directory in your repo root. Each .md file in this folder becomes a /command in Claude Code.
- Write a pr-description.md command that reads recent git diff and formats a structured PR description with Summary, Changes, and Test Plan sections.
- Add commands to your global ~/.claude/commands/ for cross-project utilities like /refactor-to-hooks or /add-error-handling.

## Reference Implementation

```
# .claude/commands/pr-description.md
Generate a pull request description for the current changes.

Steps:
1. Run `git diff main...HEAD` to see all changes
2. Run `git log main...HEAD --oneline` for commit history
3. Identify the primary goal and key implementation decisions

Output format:
## Summary
[1-3 sentence description of what this PR does and why]

## Changes
- [bullet list of key changes]

## Test Plan
- [ ] [specific things to test]
- [ ] Edge cases covered

## Notes
[Any breaking changes, migration steps, or reviewer focus areas]
```

## Guidelines

- Adapt everything to my existing project — do not assume a specific stack or directory layout
- Review any fetched code for safety before installing or executing it
- After setup, run a quick verification and show me a summary of exactly what was installed, where, and how to use it
2,880 charactersCompatible with Claude Code & Codex CLI
MANUAL SETUP STEPS
  1. 01Create a .claude/commands/ directory in your repo root. Each .md file in this folder becomes a /command in Claude Code.
  2. 02Write a pr-description.md command that reads recent git diff and formats a structured PR description with Summary, Changes, and Test Plan sections.
  3. 03Add commands to your global ~/.claude/commands/ for cross-project utilities like /refactor-to-hooks or /add-error-handling.

CODE INTELLIGENCE

bash
# .claude/commands/pr-description.md
Generate a pull request description for the current changes.

Steps:
1. Run `git diff main...HEAD` to see all changes
2. Run `git log main...HEAD --oneline` for commit history
3. Identify the primary goal and key implementation decisions

Output format:
## Summary
[1-3 sentence description of what this PR does and why]

## Changes
- [bullet list of key changes]

## Test Plan
- [ ] [specific things to test]
- [ ] Edge cases covered

## Notes
[Any breaking changes, migration steps, or reviewer focus areas]

FIELD OPERATIONS

Command Library Sharing Platform

A GitHub repo + website where developers share and rate their best Claude Code slash commands, categorized by tech stack.

Auto-Command Generator

Ask Claude to analyze your most common requests and automatically generate slash commands for your top 10 patterns.

STRATEGIC APPLICATIONS

  • →Standardize code review quality across engineering teams with shared /review commands
  • →Automate documentation generation with /add-jsdoc and /update-readme commands
  • →Reduce onboarding time by giving new developers a /setup-project command that scaffolds their environment

TAGS

#slash-commands#workflow#automation#claude-code
Source: REDDIT · Quality score: 8/10
VIEW SOURCE