Inspired by Anthropic's Claude Code Best Practices: These custom commands are designed following the principles and recommendations outlined in Anthropic's Claude Code Best Practices to maximize effectiveness and provide structured workflows for software development.
This repository contains custom slash commands for Claude Code that provide specialized workflows for common software development tasks. These commands enable comprehensive analysis, development, and maintenance workflows for any codebase.
These custom slash commands work with Claude Code's built-in slash command system. When installed properly, they become available as /project:command-name in your Claude Code sessions, providing predefined workflows with consistent, thorough results across different projects.
- /project:architecture-review - Comprehensive architectural analysis and design pattern assessment
- /project:code-review - Complete code quality review with security and performance analysis
- /project:security-audit - Systematic security vulnerability assessment and remediation guidance
- /project:performance-audit - Performance bottleneck identification and optimization recommendations
- /project:dependency-audit - Dependency security scanning and update recommendations
- /project:create-feature - End-to-end feature development workflow with planning, implementation, and testing
- /project:fix-issue - Structured GitHub issue resolution with root cause analysis and testing
- /project:refactor-code - Safe refactoring workflow with automated testing and quality checks
- /project:debug-error - Systematic debugging approach for error resolution
- /project:optimize-build - Build system optimization and performance improvements
Use the provided installation script for easy setup:
The script provides an interactive menu with options to:
- Install to current project (creates ./.claude/commands/)
- Install globally for all projects
- Create a symbolic link for development
- List all available commands
This method adds the commands to a specific project directory, making them available as /project:command-name when working in that project.
-
Navigate to Your Project:
-
Create Claude Commands Directory:
# Create the .claude/commands directory structure mkdir -p .claude/commands -
Copy the Command Files:
# Copy all command files from this repository cp /path/to/claude-rules/.claude/commands/*.md ./.claude/commands/ # Or if you cloned this repo, copy from the local path: cp ./.claude/commands/*.md ./.claude/commands/ -
Verify Installation:
# Check that all commands were copied ls -la .claude/commands/ # You should see: # architecture-review.md # code-review.md # create-feature.md # debug-error.md # dependency-audit.md # fix-issue.md # optimize-build.md # performance-audit.md # refactor-code.md # security-audit.md
This method makes the commands available as /user:command-name across all your projects.
-
Create Personal Commands Directory:
# Create personal commands directory mkdir -p ~/.claude/commands -
Copy Command Files:
# Copy command files to personal directory cp /path/to/claude-rules/.claude/commands/*.md ~/.claude/commands/
If you want to keep the commands updated with this repository:
- Create Symbolic Link:
# In your project directory (for project commands) ln -s /path/to/claude-rules/.claude ./.claude # Or for personal commands: ln -s /path/to/claude-rules/.claude/commands ~/.claude/commands
-
Test Command Detection:
# Start Claude Code in your project directory claude code # Type / to see available slash commands # You should see your custom commands listed as: # /project:architecture-review # /project:code-review # /project:create-feature # etc. -
Test a Simple Command:
# In Claude Code, try a basic command: /project:code-review # Claude should recognize the command and begin the code review workflow
Ensure you're using Claude Code version 1.0 or later, which supports the rules system:
Your project structure should look like this after installation:
If Claude Code doesn't recognize your rules:
-
Check Directory Structure:
# Ensure correct directory structure ls -la .claude/commands/ -
Verify File Permissions:
# Make sure files are readable chmod 644 .claude/commands/*.md -
Check Claude Code Configuration:
# Start Claude Code and verify commands are detected claude code # Then type / to see if your commands appear -
Restart Claude Code: Sometimes you need to restart Claude Code after adding new rules.
If a specific command doesn't work:
-
Check File Format:
# Ensure files have proper markdown format head -5 .claude/commands/code-review.md -
Validate Markdown: Make sure each command file follows the proper format with # Command Name as the first line.
-
Check for Syntax Errors: Review the command file for any formatting issues that might prevent parsing.
To update the rules when new versions are available:
-
Backup Your Customizations:
# If you've customized any commands, backup first cp -r .claude .claude-backup -
Update Command Files:
# Pull latest version from this repository cp /path/to/updated/claude-rules/.claude/commands/*.md ./.claude/commands/ -
Merge Your Customizations: If you had custom modifications, carefully merge them back into the updated files.
Commands can be invoked with the /project: prefix followed by the command name and optional arguments:
Provides a comprehensive architectural analysis including:
- High-level system architecture mapping
- Design pattern assessment
- Dependency management review
- Scalability and security architecture evaluation
- Future-proofing recommendations
Performs thorough code quality assessment:
- Repository structure analysis
- Code quality and style evaluation
- Security vulnerability scanning
- Performance bottleneck identification
- Testing coverage assessment
Conducts systematic security analysis:
- Dependency vulnerability scanning
- Authentication/authorization review
- Input validation assessment
- Data protection evaluation
- Infrastructure security check
Implements complete feature development workflow:
- Feature planning and requirements analysis
- Architecture design and API planning
- Implementation with best practices
- Comprehensive testing strategy
- Documentation and deployment preparation
Structured GitHub issue resolution:
- Issue analysis and reproduction
- Root cause identification
- Solution design and implementation
- Testing and quality assurance
- Pull request creation and follow-up
Each command follows a consistent structure:
To customize a command:
- Edit the corresponding .md file in the .claude/commands/ directory
- Modify the instructions to match your project's specific requirements
- Add or remove steps as needed for your workflow
To create a new command:
- Create a new .md file in the .claude/commands/ directory
- Follow the established structure and naming convention
- Include comprehensive step-by-step instructions
- Test the command with various scenarios
You can create project-specific versions of these commands by:
- Copying the base command files to your project's .claude/commands/ directory
- Modifying the instructions to include project-specific:
- Technology stack requirements
- Coding standards and conventions
- Testing frameworks and procedures
- Deployment and CI/CD processes
- Start with Analysis: Use analysis commands (/project:code-review, /project:architecture-review) before making changes
- Use Specific Arguments: Provide clear, descriptive arguments for commands that accept them
- Follow Up: Use multiple commands in sequence for complex workflows
- Review Output: Always review and validate the command output before proceeding
- Be Specific: Use descriptive names for features and components
- Context Matters: Run commands from the appropriate directory (usually project root)
- Iterative Approach: Break complex tasks into smaller, focused command executions
- Documentation: Keep track of command usage and results for future reference
-
New Feature Development:
/project:code-review # Assess current state /project:create-feature user-dashboard # Implement feature /project:security-audit # Verify security /project:performance-audit # Check performance -
Bug Fix Process:
/project:fix-issue 456 # Fix the specific issue /project:code-review # Verify fix quality /project:security-audit # Ensure no new vulnerabilities -
Maintenance and Optimization:
/project:dependency-audit # Check for outdated dependencies /project:performance-audit # Identify bottlenecks /project:refactor-code legacy-module # Improve problematic areas
- Command Not Found: Ensure the .md file exists in the .claude/commands/ directory
- Permission Errors: Check file permissions and Claude Code configuration
- Incomplete Execution: Verify all required tools and dependencies are available
- Check the individual command files for detailed instructions
- Review Claude Code documentation for rules system configuration
- Ensure your development environment has the necessary tools installed
To contribute improvements to these commands:
- Test your changes thoroughly across different project types
- Follow the established documentation format
- Include examples and use cases
- Update this README with any new commands or significant changes
These custom slash commands are designed to enhance your development workflow with Claude Code, providing consistent, thorough approaches to common software development tasks. They work across different technologies and project types, adapting to your specific codebase and requirements.