Contributing to CLEO
Thank you for your interest in contributing to CLEO! This guide will help you get started with development, testing, and submitting changes.CLEO welcomes contributors of all experience levels. Whether you’re fixing a typo, improving documentation, or adding new features, your contributions are valued.
Quick Start for Contributors
1
Fork & Clone
2
Install for Development
3
Run Tests
4
Create a Branch
Prerequisites
Before contributing, ensure you have:Bash 4.0+
Check with
bash --versionjq 1.5+
Check with
jq --versionGit
For version control
Unix Environment
Linux, macOS, or WSL2
Project Structure
Testing Requirements
Running Tests
- All Tests
- Unit Tests
- Integration Tests
- Specific Test
Writing Tests
CLEO uses BATS (Bash Automated Testing System). Test files go intests/unit/ or tests/integration/.
Code Style Guidelines
Shell Scripts
Shebang & Strict Mode
Shebang & Strict Mode
Naming Conventions
Naming Conventions
- Functions:
snake_case(e.g.,validate_task_id) - Variables:
snake_case(e.g.,task_count) - Constants:
UPPER_SNAKE_CASE(e.g.,SCRIPT_DIR)
Quoting & Conditionals
Quoting & Conditionals
Function Definitions
Function Definitions
JSON Files
JSON files must pass JSON Schema validation. No trailing commas allowed.
Commit Guidelines
Commit Message Format
Commit Types
| Type | Description | Example |
|---|---|---|
feat | New feature | feat: Add export command for CSV format |
fix | Bug fix | fix: Handle empty task list gracefully |
docs | Documentation | docs: Update session workflow guide |
test | Test changes | test: Add validation edge case tests |
refactor | Code refactoring | refactor: Extract common validation logic |
chore | Maintenance | chore: Update dependencies |
Branch Naming
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentationtest/description- Test additionsrefactor/description- Code refactoring
Pull Request Process
1
Ensure Tests Pass
2
Update Documentation
If your change affects user-facing behavior, update relevant docs
3
Push Your Branch
4
Create Pull Request
Open a PR on GitHub with:
- Clear description of changes
- Link to related issues (if any)
- Test evidence
5
Address Review Feedback
Respond to reviewer comments and make requested changes
PR Checklist
Before submitting, verify:- All tests pass (
./tests/run-all-tests.sh) - Code follows style guidelines
- Documentation updated (if applicable)
- Commit messages are clear and follow conventions
- No merge conflicts with
main - New features have tests
Architecture Guidelines
Core Principles
Anti-Hallucination First
All data modifications must be validated. Never trust input blindly.
Atomic Operations
Use temp file → validate → backup → rename pattern for all writes.
Single Source of Truth
todo.json is authoritative. Never store derived data.Immutable History
Log entries are append-only. Never modify historical records.
Adding New Commands
- Create script in
scripts/following naming convention - Add
--helpsupport with usage information - Use library functions from
lib/ - Add to CLI wrapper routing in main
cleoscript - Write unit and integration tests
- Update command documentation
Modifying Schemas
Schema changes require careful consideration:- Update schema file in
schemas/ - Increment schema version appropriately
- Add migration function if breaking change
- Test with existing data files
- Update schema documentation
Reporting Issues
Bug Reports
Include:- Description: Clear explanation of the bug
- Steps to Reproduce: Minimal steps to trigger the issue
- Expected vs Actual: What should happen vs what does happen
- Environment: OS, Bash version, jq version, CLEO version
- Logs: Relevant error messages or output
Feature Requests
Include:- Problem: What problem does this solve?
- Solution: Your proposed approach
- Alternatives: Other approaches you considered
- Use Case: Real-world scenario where this helps
Getting Help
Recognition
Contributors are recognized in:CHANGELOG.mdfor their specific contributions- Project README for significant contributions
- Release notes when features ship
All contributions, no matter how small, are valuable. Documentation fixes, typo corrections, and test improvements are just as appreciated as new features.
Thank you for contributing to CLEO!
