A collection of custom slash commands for Claude Code to enhance your development workflow.
This repository contains custom slash commands that extend Claude Code's functionality. These commands help automate common development tasks and improve code organization.
-
Clone this repository:
git clone https://github.com/yourusername/claude-custom-commands.git cd claude-custom-commands
-
Copy the custom commands to your Claude configuration directory:
cp -r commands/* ~/.claude/commands/
-
Restart Claude Code to load the new commands.
Organizes and refactors a function into a well-structured, modular format.
Usage:
/modularize calculateTotalPrice
Features:
- Extracts helper functions for better code organization
- Adds proper error handling
- Implements input validation
- Creates clear function documentation
- Follows best practices for modularity
To create your own custom slash command:
- Create a new file in the
commands/
directory - Define your command configuration following the Claude Code slash command format
- Implement the command logic
- Add documentation to this README
Each command should follow this structure:
{
"name": "command-name",
"description": "Brief description of what the command does",
"parameters": {
"argument_name": {
"type": "string",
"description": "Description of the argument"
}
},
"handler": "path/to/handler/script"
}
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-command
) - Commit your changes (
git commit -m 'Add new command'
) - Push to the branch (
git push origin feature/new-command
) - Open a Pull Request
Here are some ideas for additional commands you could implement:
/test-gen
- Generate unit tests for a function/doc-gen
- Generate comprehensive documentation/optimize
- Optimize code performance/secure
- Add security best practices to code/type-safe
- Add TypeScript types to JavaScript code/clean
- Clean and format code according to standards/extract
- Extract repeated code into reusable functions
MIT License - feel free to use and modify these commands for your projects.
If you encounter any issues or have suggestions, please open an issue on GitHub.