๐ค Contributing to Claude Code Enhanced Statusline
February 6, 2026 ยท View on GitHub
Assalamu'alaikum and Welcome! ๐
Thank you for your interest in contributing to the Claude Code Enhanced Statusline project! This project is built with love for the Claude Code community, and we warmly welcome contributors from all backgrounds and skill levels.
๐ Table of Contents
- ๐ Ways to Contribute
- ๐ Quick Start for Contributors
- ๐ ๏ธ Development Environment Setup
- ๐ Development Workflow
- ๐ Code Standards & Guidelines
- ๐งช Testing Requirements
- ๐ฆ Pull Request Process
- ๐ Issue Guidelines
- ๐๏ธ Project Structure Guide
- ๐จ Theme Contribution Guide
- ๐ Documentation Contributions
- ๐ Release Process
- ๐ Community Guidelines
- โ Getting Help
๐ Ways to Contribute
We welcome contributions in many forms! Choose what resonates with your skills and interests:
๐ Bug Reports & Issues
- Found a bug? โ Report it here
- System compatibility issues โ Help us support more platforms
- Performance problems โ Share your performance observations
- Configuration troubles โ Help us improve user experience
๐ก Feature Requests & Ideas
- Have a brilliant idea? โ Suggest it here
- Check our TODOS.md โ Pick an item that interests you
- Profile system โ High priority feature explicitly planned
- Plugin system โ Help extend functionality
- Performance improvements โ Optimization opportunities
๐จ Theme Creation & Design
- Create beautiful themes โ Follow our theme system
- Custom theme development โ Create new themes beyond classic/garden/catppuccin
- Theme inheritance โ Planned future feature
- Visual improvements โ Screenshots, icons, ASCII art
๐ Documentation & Tutorials
- Improve existing docs โ Fix typos, clarify instructions
- Create video tutorials โ Installation, configuration, customization
- Write blog posts โ Share your statusline setup
- API documentation โ Help document module interfaces
๐ง Code Contributions
- Bug fixes โ Resolve reported issues
- Feature implementation โ Build new functionality
- Performance optimization โ Improve response times
- Security improvements โ Enhance safety measures
- CI/CD pipeline โ Critical infrastructure gap (no .github/workflows/)
๐งช Testing & Quality Assurance
- Expand test coverage โ Currently 77 tests, always room for more
- Cross-platform testing โ Test on different OS environments
- Load testing โ High-frequency usage scenarios
- Security testing โ Input validation, path traversal prevention
๐ Quick Start for Contributors
1๏ธโฃ Choose Your Contribution Style
๐ฐ First-time contributor?
- Start with documentation improvements or theme creation
- Look for issues labeled
good first issueorhelp wanted - Check TODOS.md for beginner-friendly items
โก Ready to code?
- Focus on items in TODOS.md marked as High Priority
- Ocean theme integration โ Low complexity, high impact
- Profile system โ Medium complexity, very high demand
๐งช Testing enthusiast?
- Expand test coverage in
tests/directory - Create performance benchmarks
- Test edge cases and error scenarios
2๏ธโฃ Read the Roadmap
- Review TODOS.md for comprehensive development roadmap
- Understand project priorities and planned features
- See implementation hints and complexity estimates
๐ ๏ธ Development Environment Setup
๐ Prerequisites
-
Core Requirements:
# Essential tools bash --version # 3.2+ minimum (auto-upgrades to modern bash), 5.0+ recommended for development jq --version # 1.5+ required, 1.6+ recommended git --version # 2.0+ required, 2.30+ recommended๐ฏ Universal Bash Compatibility: The statusline includes runtime bash detection that automatically finds and uses modern bash when available, with graceful fallback for older versions.
-
Testing Framework (required for development):
# macOS with Homebrew brew install bats-core shellcheck # Ubuntu/Debian sudo apt-get install bats shellcheck # Alternative: Install via npm npm install -g bats -
Optional but Recommended:
# For enhanced macOS compatibility brew install coreutils # (macOS only) # Cost tracking is built-in (native JSONL) - no extra dependencies
๐ง Project Setup
-
Fork and Clone:
# Fork the repository on GitHub first, then: git clone https://github.com/YOUR-USERNAME/claude-code-statusline.git cd claude-code-statusline # Add upstream remote git remote add upstream https://github.com/rz1989s/claude-code-statusline.git -
Install Dependencies:
# Install npm dependencies for testing npm install # Verify setup by running tests npm test -
Setup Pre-commit Hooks (recommended):
# Install pre-commit framework pip install pre-commit # Install hooks (runs shellcheck, validates TOML, etc.) pre-commit install # Test hooks manually pre-commit run --all-files -
Verify Installation:
# Test the statusline directly ./statusline.sh --help # Run development workflow npm run dev
โ Verification Checklist
- All tests pass:
npm test - Linting passes:
npm run lint - Statusline runs:
./statusline.sh --help - Can generate config:
cp examples/Config.toml ./Config.toml test.toml
๐ Development Workflow
๐ฟ Branching Strategy
Current Active Branches:
main- Stable production releasesnightly- Experimental features for community testingdev- Stable development integrationdev6- Current development: Enhanced settings.json management
# Start from the appropriate base branch
git checkout dev6 # For current development features
git pull upstream dev6
# Alternative: Start from stable dev for general contributions
git checkout dev # For general development
git pull upstream dev
# Create a feature branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
# or
git checkout -b docs/documentation-improvement
Branch Selection Guide:
- Contributing to settings.json features? โ Base on
dev6 - General bug fixes or features? โ Base on
dev - Experimental features? โ Consider
nightlybranch - Documentation updates? โ Any branch, prefer
dev6for current docs
๐ Development Cycle
-
Make Your Changes:
# Edit files as needed vim lib/themes.sh # Example: adding Ocean theme # Test your changes frequently ./statusline.sh # Configuration is automatically loaded -
Run Tests & Validation:
# Clean environment and run full test suite npm run dev # Run specific test categories npm run test:unit # Fast unit tests npm run test:integration # End-to-end tests # Code quality checks npm run lint # ShellCheck main script npm run lint:all # Check everything -
Verify Your Changes:
# Test with different configurations ENV_CONFIG_THEME=garden ./statusline.sh ENV_CONFIG_THEME=catppuccin ./statusline.sh # Test configuration generation cp examples/Config.toml ./Config.toml ./statusline.sh --validate-config # For dev6 contributors: Test enhanced settings.json features # Test standard installation (modifies settings.json) ./install.sh --branch=dev6 # Test preserve functionality (skips settings.json) ./install.sh --branch=dev6 --preserve-statusline # Verify backup creation ls ~/.claude/settings.json.backup.*
๐ Commit Guidelines
We follow conventional commit format for consistency:
# Format: type(scope): description
#
# Types: feat, fix, docs, style, refactor, test, chore
# Scope: theme, config, mcp, cost, git, security, etc.
# Examples:
git commit -m "feat(themes): add ocean theme integration"
git commit -m "fix(config): resolve TOML parsing edge case"
git commit -m "docs: update installation guide with new dependencies"
git commit -m "test: add security validation test cases"
git commit -m "refactor(display): optimize output formatting performance"
Commit Message Guidelines:
- First line: 50 characters or less
- Body: Wrap at 72 characters, explain the "why"
- Reference issues: "Closes #123" or "Fixes #456"
- Breaking changes: Include "BREAKING CHANGE:" in footer
๐ Code Standards & Guidelines
๐๏ธ Modular Architecture Principles
Our codebase follows a clean modular architecture:
statusline.sh # Main orchestrator (332 lines)
โโโ lib/core.sh # Base utilities, module loading
โโโ lib/security.sh # Input validation, sanitization
โโโ lib/config.sh # TOML configuration management
โโโ lib/themes.sh # Color theme system
โโโ lib/git.sh # Repository status, commits
โโโ lib/mcp.sh # MCP server monitoring
โโโ lib/cost.sh # Cost tracking integration
โโโ lib/display.sh # Output formatting
๐ Coding Standards
-
Shell Scripting Best Practices:
# Use strict mode set -euo pipefail # Quote variables echo "$variable" not $variable # Use local variables in functions local variable_name="value" # Handle errors gracefully command || handle_error "Command failed" 1 "function_name" -
Function Structure:
# Standard function template function_name() { local param1="\$1" local param2="${2:-default_value}" # Validate inputs [[ -n "$param1" ]] || { handle_error "Parameter required" 1 "function_name" return 1 } # Implementation # ... return 0 } -
Module Guidelines:
- Each module must be self-contained
- Use
[[ "${MODULE_LOADED:-}" == "true" ]] && return 0to prevent double-loading - Export
MODULE_LOADED=trueat the end - Follow existing function naming conventions
๐จ Theme Development Standards
When creating new themes:
# Theme function structure in lib/themes.sh
apply_THEME_NAME_theme() {
# Set all required color variables
export RED="\\033[31m"
export BLUE="\\033[34m"
# ... all basic colors
# Extended colors
export ORANGE="\\033[38;5;208m"
# ... extended colors
# Set theme name for display
export CURRENT_THEME="theme-name"
}
๐ Security Guidelines
- Input validation: Use
sanitize_path_secure()for all paths - Command injection prevention: Quote all variables, use arrays
- Timeout protection: All external commands must have timeouts
- Error handling: Never expose sensitive information in error messages
๐ Performance Standards
- Caching: Use intelligent caching for expensive operations
- Timeouts: All network operations must have configurable timeouts
- Parallel execution: Independent operations should run in parallel
- Memory efficiency: Avoid large temporary files
๐งช Testing Requirements
๐ Test Coverage Expectations
Our project maintains high test coverage standards:
- Unit Tests: 95%+ function coverage
- Integration Tests: All major user scenarios
- Security Tests: All input validation paths
- Performance Tests: Response time validation
๐ Running Tests
# Complete test suite (77 tests)
npm test
# Specific test categories
npm run test:unit # Individual function tests
npm run test:integration # End-to-end scenarios
bats tests/benchmarks/ # Performance tests
# Individual test files
bats tests/unit/test_git_functions.bats
bats tests/integration/test_toml_integration.bats
โ๏ธ Writing New Tests
-
Unit Test Template:
#!/usr/bin/env bats load '../setup_suite' load '../helpers/test_helpers' setup() { common_setup setup_mock_environment } teardown() { common_teardown } @test "function should handle normal input correctly" { # Arrange local input="test input" # Act run my_function "$input" # Assert assert_success assert_output_contains "expected output" } -
Integration Test Template:
@test "full statusline with ocean theme configuration" { # Setup ocean theme config create_test_config_file "ocean" # Run statusline with test input echo "$TEST_INPUT_JSON" | run ./statusline.sh # Validate output structure assert_success validate_statusline_format "$output" assert_output_contains "ocean colors" }
๐ ๏ธ Test Utilities Available
# Mock functions (in helpers/test_helpers.bash)
setup_mock_git_repo() # Create mock git repository
setup_mock_mcp() # Mock MCP server responses
create_mock_command() # Mock any command
validate_statusline_format() # Validate 4-line output
strip_ansi_codes() # Remove colors for testing
โ Test Requirements for PRs
Before submitting a pull request:
- All existing tests pass:
npm test - New functionality has corresponding tests
- Test coverage remains above 90%
- Performance tests pass (if applicable)
- Security tests pass for new input handling
๐ฆ Pull Request Process
๐ฏ Before You Submit
-
Complete the Development Checklist:
- Code follows project standards
- All tests pass:
npm test - Linting passes:
npm run lint:all - Documentation updated (if needed)
- TODOS.md updated (if implementing a TODO item)
-
Test Your Changes Thoroughly:
# Test with different configurations ./statusline.sh # Configuration is automatically loaded ENV_CONFIG_THEME=garden ./statusline.sh ENV_CONFIG_THEME=catppuccin ./statusline.sh # Test edge cases ./statusline.sh --help cp examples/Config.toml ./Config.toml
๐ PR Submission Guidelines
-
PR Title Format:
feat(themes): add ocean theme integration fix(config): resolve TOML parsing edge case docs: update contributing guidelines -
PR Description Template:
## ๐ Summary Brief description of changes and motivation. ## ๐ Changes Made - [ ] Added ocean theme integration - [ ] Updated lib/themes.sh with ocean colors - [ ] Added ocean theme tests - [ ] Updated documentation ## ๐งช Testing - [ ] All existing tests pass - [ ] Added new tests for ocean theme - [ ] Tested with multiple configurations - [ ] Manual testing completed ## ๐ Documentation - [ ] Updated relevant documentation - [ ] Added theme examples - [ ] Updated TODOS.md (if applicable) ## ๐ Related Issues Closes #123 Related to #456 ## ๐ธ Screenshots (if applicable) [Add screenshots of visual changes] -
PR Size Guidelines:
- Small PRs preferred โ Easier to review, faster to merge
- One feature per PR โ Focused changes, clear purpose
- Documentation updates โ Can be combined with related code changes
๐ Review Process
-
Automated Checks:
- All tests must pass
- Linting must pass
- No security vulnerabilities detected
-
Human Review:
- Code quality and style consistency
- Adherence to architectural principles
- Test coverage and quality
- Documentation completeness
-
Merge Requirements:
- At least one maintainer approval
- All CI checks passing
- Conflicts resolved
- Up-to-date with target branch
๐ Issue Guidelines
๐ Bug Reports
Use the bug report template and include:
-
Environment Information:
# Run this diagnostic command ./statusline.sh --help bash --version jq --version uname -a -
Reproduction Steps:
- Clear, step-by-step instructions
- Minimal test case if possible
- Expected vs. actual behavior
-
Configuration Details:
# Include your Config.toml (remove sensitive data) cat Config.toml # Or show relevant environment overrides ENV_CONFIG_THEME=garden ./statusline.sh
๐ก Feature Requests
Use the feature request template and include:
- Problem Statement: What problem does this solve?
- Proposed Solution: How should it work?
- Alternative Solutions: What other approaches did you consider?
- Use Cases: Who would benefit from this feature?
- Implementation Ideas: Any technical suggestions?
๐ท๏ธ Issue Labels
We use these labels to organize issues:
bugโ Something isn't workingenhancementโ New feature or improvementdocumentationโ Documentation relatedgood first issueโ Great for newcomershelp wantedโ Community help neededpriority: highโ Critical issuesthemeโ Theme-related changesconfigโ Configuration system changessecurityโ Security-related issuesperformanceโ Performance improvements
๐๏ธ Project Structure Guide
๐ Directory Overview
claude-code-statusline/
โโโ statusline.sh # Main orchestrator script (332 lines)
โโโ lib/ # Modular components (8 modules)
โ โโโ core.sh # Base utilities, module loading
โ โโโ security.sh # Input sanitization, validation
โ โโโ config.sh # TOML configuration parsing
โ โโโ themes.sh # Color theme management
โ โโโ git.sh # Repository status, commits
โ โโโ mcp.sh # MCP server monitoring
โ โโโ cost.sh # Cost tracking integration
โ โโโ display.sh # Output formatting
โโโ tests/ # Comprehensive test suite (77 tests)
โ โโโ unit/ # Individual function tests
โ โโโ integration/ # End-to-end scenarios
โ โโโ benchmarks/ # Performance tests
โ โโโ fixtures/ # Mock data and outputs
โ โโโ helpers/ # Test utilities
โโโ docs/ # Documentation
โโโ examples/ # Sample configurations
โ โโโ sample-configs/ # Theme examples (Ocean ready!)
โโโ Config.toml # Configuration file
โโโ version.txt # Centralized version management
โโโ TODOS.md # Development roadmap
โโโ install.sh # Automated installer
๐ Module Loading System
Understanding how modules work:
-
Core Module (
lib/core.sh):- Loaded first by
statusline.sh - Provides
load_module()function - Contains shared utilities and constants
- Loaded first by
-
Module Dependencies:
core.sh โ (required first) security.sh โ (required by most modules) config.sh โ themes.sh, git.sh, mcp.sh, cost.sh themes.sh โ display.sh git.sh, mcp.sh, cost.sh โ display.sh display.sh โ (loaded last) -
Adding New Modules:
# Create new module: lib/mymodule.sh #!/bin/bash [[ "${MYMODULE_LOADED:-}" == "true" ]] && return 0 # Your module code here export MYMODULE_LOADED=true # Load in statusline.sh: load_module "mymodule" || exit 1
๐จ Theme System Architecture
# Theme system in lib/themes.sh
apply_theme() {
case "${CONFIG_THEME:-classic}" in
"classic") apply_classic_theme ;;
"garden") apply_garden_theme ;;
"catppuccin") apply_catppuccin_theme ;;
"ocean") apply_ocean_theme ;; # Ready to implement!
"custom") apply_custom_theme ;;
*) apply_classic_theme ;;
esac
}
๐จ Theme Contribution Guide
๐ High Priority: Ocean Theme Integration
The Ocean theme is ready to implement - it exists in examples/sample-configs/ocean-theme.toml but needs integration:
-
Implementation Steps:
# Add to lib/themes.sh apply_ocean_theme() { # Copy colors from examples/sample-configs/ocean-theme.toml export BLUE="\\033[38;2;0;119;190m" # Deep ocean blue export TEAL="\\033[38;2;0;150;136m" # Teal depths # ... etc } # Update apply_theme() case statement "ocean") apply_ocean_theme ;; -
Testing Requirements:
# Test ocean theme ENV_CONFIG_THEME=ocean ./statusline.sh # Add ocean theme test bats tests/integration/test_ocean_theme.bats
๐จ Creating Custom Themes
-
Design Principles:
- Readability: Ensure good contrast in terminals
- Consistency: Use a coherent color palette
- Accessibility: Consider color-blind users
- Terminal compatibility: Test in different terminal emulators
-
Theme Structure:
apply_THEME_NAME_theme() { # Basic ANSI colors (required) export RED="\\033[31m" export GREEN="\\033[32m" export YELLOW="\\033[33m" export BLUE="\\033[34m" export MAGENTA="\\033[35m" export CYAN="\\033[36m" export WHITE="\\033[37m" # Extended colors (optional but recommended) export ORANGE="\\033[38;5;208m" export PURPLE="\\033[95m" export LIGHT_GRAY="\\033[38;5;248m" export BRIGHT_GREEN="\\033[92m" # Formatting (required) export DIM="\\033[2m" export RESET="\\033[0m" # Theme identification export CURRENT_THEME="theme-name" } -
Testing Your Theme:
# Quick test ENV_CONFIG_THEME=your_theme ./statusline.sh # Generate config with your theme cp examples/Config.toml ./Config.toml # Edit Config.toml to set theme.name = "your_theme" ./statusline.sh # Configuration is automatically loaded
๐ธ Theme Documentation Requirements
When contributing themes:
- Add theme to examples/sample-configs/
- Include screenshots in assets/screenshots/
- Update README.md theme gallery
- Add theme tests
- Document color meanings and inspiration
๐ Documentation Contributions
๐ Documentation Standards
-
Style Guide:
- Use emoji sections for visual organization ๐ฏ
- Code blocks with syntax highlighting
- Clear examples with expected outputs
- Cross-references between related sections
-
Structure Requirements:
- Table of contents for long documents
- Step-by-step instructions where applicable
- Troubleshooting sections
- Links to related documentation
๐ฏ High-Priority Documentation Needs
- Performance Tuning Guide โ TODOS.md
- API Documentation โ Module interface documentation
- Plugin Development Guide โ For future plugin system
- Video Tutorial Series โ Installation, configuration, themes
- Best Practices Guide โ Configuration recommendations
๐ Documentation Workflow
-
Update Related Files:
- README.md โ For user-facing changes
- CLAUDE.md โ For development-related changes
- docs/ โ For detailed guides
- TODOS.md โ Remove completed items
-
Validation:
# Test all code examples in documentation # Validate all links work # Check spelling and grammar # Ensure screenshots are current
๐ Release Process
๐ Version Management
We use centralized version management with version.txt:
# Current version
cat version.txt # Example: 1.5.2
# Version sync commands
./statusline.sh --version-sync # Sync package.json with version.txt
./statusline.sh --version-check # Verify consistency
๐ Release Workflow
-
Pre-release Checklist:
- All tests passing:
npm test - Documentation updated
- TODOS.md updated with completed items
- Version bumped appropriately
- Changelog draft prepared
- All tests passing:
-
Version Bump Guidelines:
- Major (X.0.0): Breaking changes, API removal
- Minor (0.X.0): New features, backward-compatible
- Patch (0.0.X): Bug fixes, small improvements
-
Release Process (For Maintainers):
# Update version.txt echo "1.6.0" > version.txt # Sync package.json ./statusline.sh --version-sync # Create release commit git commit -am "release: v1.6.0" git tag v1.6.0 git push origin dev --tags
๐ Release Notes Format
## v1.6.0 - Ocean Theme Integration ๐
### โจ New Features
- Added Ocean theme as built-in option
- Profile system implementation
- Enhanced theme inheritance
### ๐ Bug Fixes
- Fixed TOML parsing edge case
- Resolved timeout validation issue
### ๐ Documentation
- Updated theme gallery
- Added contributing guidelines
- Enhanced installation guide
### ๐๏ธ Internal Improvements
- Improved test coverage to 82%
- Enhanced CI/CD pipeline
- Code quality improvements
๐ Community Guidelines
๐คฒ Our Values
This project is built with Islamic values and community spirit:
- Respect: Treat all contributors with dignity and kindness
- Patience (Sabr): Be patient with newcomers and different skill levels
- Gratitude (Shukr): Appreciate all contributions, big and small
- Excellence (Ihsan): Strive for quality in all work
- Cooperation (Ta'awun): Work together for the benefit of the community
๐ฃ๏ธ Communication Guidelines
-
Be Welcoming:
- Use inclusive language
- Welcome newcomers warmly
- Share knowledge generously
- Celebrate contributions
-
Be Respectful:
- Disagree respectfully about code, not people
- Assume good intentions
- Give constructive feedback
- Be open to learning
-
Be Helpful:
- Answer questions when you can
- Point to relevant documentation
- Share useful resources
- Mentor newcomers
๐ซ Unacceptable Behavior
- Harassment, discrimination, or offensive language
- Personal attacks or trolling
- Spam or off-topic discussions
- Sharing others' private information
- Any behavior that creates a hostile environment
๐ Reporting Issues
If you experience or witness unacceptable behavior:
- Contact maintainers directly
- Use GitHub's reporting features
- GitHub: https://github.com/rz1989s
โ Getting Help
๐ Where to Get Help
-
Documentation First:
-
Community Support:
- GitHub Issues โ Bug reports and questions
- GitHub Discussions โ General discussion
- Pull Request comments โ Code-specific questions
-
Development Help:
- Check existing tests for examples
- Look at similar implementations in the codebase
- Review Project Structure Guide
๐ค Common Questions
Q: I'm new to shell scripting. Can I still contribute?
A: Absolutely! Start with documentation, themes, or testing. Everyone's contributions are valuable.
Q: How do I test my changes without affecting my system?
A: Use the test environment and temporary configurations: ./statusline.sh # Configuration is automatically loaded test.toml
Q: What if I break something?
A: Don't worry! That's what tests are for. Run npm test to catch issues early, and the community will help fix any problems.
Q: Can I implement multiple TODO items in one PR?
A: It's better to focus on one feature per PR for easier review. Exception: closely related items can be grouped.
๐ Thank You!
Jazakallahu khairan for your interest in contributing! Your efforts help make this project better for the entire Claude Code community.
Whether you're fixing a typo, implementing a major feature, or helping other contributors, your work matters. Every contribution, no matter how small, makes a difference.
Barakallahu feek and happy coding! ๐
Made with โค๏ธ for the Claude Code community