Guide for contributing to claude-rules, testing commands, and following best practices.
-
Fork and Clone:
git fork https://github.com/qdhenry/Claude-Command-Suite.git git clone <your-fork-url> cd Claude-Command-Suite
-
Set Up Development Environment:
# Install using symlink for development ./install.sh --symlink # This creates a symbolic link so changes are immediately available
-
Create a Feature Branch:
git checkout -b feature/new-command-name
-
Create or Modify Commands:
- Add new
.mdfiles to.claude/commands/ - Follow the established naming convention
- Use the standard command structure
- Add new
-
Test Your Changes:
# Test command recognition claude code # Type / to see if your command appears # Test command execution /project:your-new-command
-
Validate Command Format:
# Check markdown syntax markdownlint .claude/commands/your-command.md # Verify file structure head -n 10 .claude/commands/your-command.md
-
Test Command Recognition:
# Start Claude Code claude code # Verify command appears in slash command list # Type / and look for /project:your-command
-
Test Command Execution:
# Test with different argument types /project:your-command /project:your-command simple-argument /project:your-command "complex argument with spaces"
-
Test Different Project Types:
# Test in various project structures cd javascript-project && claude code cd python-project && claude code cd rust-project && claude code
For each command, verify:
- Command appears in slash command autocomplete
- Command executes without errors
- Command produces expected output
- Command handles arguments correctly
- Command works across different project types
- Command follows established patterns
- Command includes appropriate error handling
-
Test Command Sequences:
# Test typical workflows /project:code-review /project:create-feature test-feature /project:security-audit -
Test with Real Projects:
# Test on actual codebases cd ~/real-project /project:your-command
-
Test Error Conditions:
# Test with invalid arguments /project:your-command invalid-arg-format # Test in empty directories mkdir empty-dir && cd empty-dir /project:your-command
# Good command names
architecture-review.md
create-feature.md
security-audit.md
# Avoid
arch_review.md
CreateFeature.md
security_and_performance_audit.md# Command Name
Brief, clear description of what the command does.
## Instructions
1. **Descriptive Step Category**
- Specific, actionable items
- Use tools and best practices
- Include quality checkpoints
2. **Next Logical Step**
- Continue the workflow
- Validate previous steps
- Prepare for next phase## Instructions
1. **Environment Validation**
- Check that required tools are available
- Verify project structure is appropriate
- Validate any prerequisites
2. **Error Handling**
- Provide clear error messages
- Suggest fixes for common issues
- Gracefully handle edge cases1. **Project Analysis**
- Examine project structure and technology stack
- Review existing documentation
- Understand project goals and constraints
- Adapt approach based on project characteristics# Good: Adaptable approach
1. **Code Quality Analysis**
- Use appropriate linting tools for the project language
- Check for language-specific best practices
- Review dependency management
# Avoid: Language-specific assumptions
1. **JavaScript Analysis**
- Run ESLint on all files
- Check package.json dependencies- Clear Purpose: Command has a single, well-defined purpose
- Comprehensive Instructions: Step-by-step workflow is complete
- Proper Structure: Follows standard markdown format
- Error Handling: Includes validation and error recovery
- Documentation: Instructions are clear and actionable
- Flexibility: Works across different project types
- Consistency: Matches patterns from other commands
-
Command Descriptions:
- One clear sentence explaining the purpose
- Avoid jargon and technical complexity
- Focus on the outcome, not the process
-
Instruction Steps:
- Use action verbs (analyze, create, verify, etc.)
- Include expected outcomes
- Provide context for decision-making
-
Examples:
- Include concrete examples where helpful
- Show both simple and complex usage
- Demonstrate error handling
-
Self Review:
# Check your changes git diff main...your-branch # Test thoroughly ./test-commands.sh # If available
-
Peer Review:
- Submit pull request with clear description
- Include testing steps and examples
- Address all feedback
-
Update README.md:
- Add new commands to the list
- Update examples if needed
- Maintain consistency with existing docs
-
Update Installation Guide:
- Note any new requirements
- Update troubleshooting if needed
# Tag releases
git tag -a v1.2.0 -m "Add new debugging commands"
git push origin v1.2.0When adding many related commands:
# Group related commands
.claude/commands/
├── analysis/
│ ├── architecture-review.md
│ ├── code-review.md
│ └── security-audit.md
├── development/
│ ├── create-feature.md
│ ├── fix-issue.md
│ └── refactor-code.mdCreate templates for common patterns:
# Create template for new analysis commands
cp .claude/commands/code-review.md .claude/commands/_analysis-template.md
# Edit to create generic analysis pattern#!/bin/bash
# test-commands.sh - Basic command validation
echo "Testing command file formats..."
for cmd in .claude/commands/*.md; do
# Check file starts with proper header
if ! head -n 1 "$cmd" | grep -q "^# "; then
echo "ERROR: $cmd doesn't start with proper header"
exit 1
fi
# Check for Instructions section
if ! grep -q "^## Instructions" "$cmd"; then
echo "ERROR: $cmd missing Instructions section"
exit 1
fi
done
echo "All command files validated successfully!"-
Command Not Recognized:
# Check file permissions ls -la .claude/commands/ # Verify markdown format head -n 5 .claude/commands/problematic-command.md
-
Command Execution Errors:
# Enable Claude Code debug mode export CLAUDE_DEBUG=1 claude code
-
Argument Processing Issues:
# Debug argument handling ## Instructions 1. **Debug Arguments** - Print received arguments: "$ARGUMENTS" - Validate argument format - Handle empty or malformed arguments
## Instructions
1. **Debug Information**
- Current working directory: `pwd`
- Git status: `git status --porcelain`
- Available tools: Check for required dependencies
- Environment: List relevant environment variables
2. **Execution Logging**
- Log each major step completion
- Save intermediate results
- Record any errors or warnings encountered- Be respectful and inclusive
- Provide constructive feedback
- Help others learn and improve
- Follow established patterns and conventions
- New Commands: Add workflows for common development tasks
- Command Improvements: Enhance existing commands with better practices
- Documentation: Improve guides and examples
- Testing: Add test cases and validation tools
- Bug Fixes: Resolve issues with existing commands
- Review existing commands for patterns
- Check GitHub issues for known problems
- Ask questions in discussions
- Provide detailed context when reporting issues
This development guide ensures consistent, high-quality contributions to the claude-rules project while maintaining the usability and reliability that users expect.