Thank you for your interest in contributing to treehouse! This document provides guidelines and instructions for contributing.
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the behavior
- Expected behavior vs actual behavior
- Environment details (Zsh version, OS, plugin manager)
- Code samples or error messages if applicable
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description
- Use case explaining why this would be useful
- Possible implementation if you have ideas
- Examples from other tools if relevant
-
Fork the repository and create your branch from
main -
Follow the coding style used throughout the project
-
Write clear commit messages using Conventional Commits format:
- Format:
type(dir): Descriptionwherediris the component/directory/command feat(dir): Descriptionfor new featuresfix(dir): Descriptionfor bug fixesdocs(dir): Descriptionfor documentation changestest(dir): Descriptionfor test additions/changesrefactor(dir): Descriptionfor code refactoringchore(dir): Descriptionfor maintenance tasks
Examples:
feat(lock): Add archive supportfix(completion): Resolve branch name completiondocs(readme): Update installation instructionstest(core): Add worktree creation testsrefactor(functions): Modularize helper functionschore(deps): Update dependencies
- Format:
-
Update documentation if you're changing functionality
-
Add tests if applicable
-
Ensure all tests pass before submitting
-
Reference issues in your PR description
- Zsh 5.8 or higher
- Git 2.20 or higher
- Make (usually pre-installed)
- BATS for testing:
brew install bats-core(macOS) orsudo apt-get install bats(Linux)
# 1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/treehouse
cd treehouse
# 2. Create a feature branch
git checkout -b feature/your-feature-name
# 3. Quick test that plugin loads
make quick
# 4. Load plugin in current shell for development
source treehouse.plugin.zsh
# 5. Test your changes interactively
gwt help # Test help
gwt main # Test main command
# 6. Run full test suite
make test
# 7. Commit with conventional commit format
git commit -m "feat(add): Support creating from remote branches"# Quick load test
make quick
# Run full test suite (requires BATS)
make test
# Test specific commands manually
zsh -c 'source treehouse.plugin.zsh && gwt-list'
# Clean up test artifacts
make clean
# See all available commands
make helpmake help- Show all available commandsmake quick- Quick plugin load testmake test- Run all tests (67 tests: 8 core + 59 command tests)make test-core- Run core tests only (8 tests)make test-commands- Run command tests only (59 tests)make install- Install to Oh My Zshmake clean- Clean test artifacts
- Use
localfor function-scoped variables - Quote variables:
"$variable"not$variable - Use
[[ ]]for conditionals, not[ ] - Prefer
${variable}over$variablefor clarity - Use 2-space indentation (no tabs)
- Add comments for complex logic
Every function should have a documentation header:
# Function: gwt-example
# Description: Brief description of what the function does
# Usage: gwt-example [options] <arguments>
# Arguments:
# $1 - Description of first argument
# Options:
# --option - Description of option- User commands:
gwt-command-name - Internal helpers:
_gwt_helper_name - Completion functions:
_gwt_command_completion - Use kebab-case for multi-word names
treehouse/
├── treehouse.plugin.zsh # Minimal autoload loader (74 lines)
├── functions/ # User-facing commands (26 files)
│ ├── gwt-* # Individual command files
│ └── internal/ # Internal helpers (8 files)
├── completions/ # Shell completions (3 files)
├── lib/ # Core libraries
│ ├── config.zsh # Configuration
│ └── colors.zsh # Color support
├── tests/ # Test suite (34 tests)
│ ├── core.bats # Core tests (8)
│ ├── commands/ # Command tests (26)
│ ├── helpers/ # Test utilities
│ └── README.md # Test documentation
├── docs/ # Documentation
│ └── DEVELOPMENT.md # Development guide
└── .github/ # GitHub templates & workflows
- Zsh: 5.8+ (we test on 5.8 and 5.9)
- Git: 2.20+ (for worktree support)
- OS: macOS, Linux, WSL
This project uses Conventional Commits for automated versioning and changelog generation. All commits must follow this format:
type(dir): Description
Where type is the commit type, dir is the component/directory/command name, and Description is a brief summary.
- feat - New feature (triggers MINOR version bump)
- fix - Bug fix (triggers PATCH version bump)
- perf - Performance improvement (triggers PATCH version bump)
- refactor - Code refactoring (triggers PATCH version bump)
- docs - Documentation only (no version bump)
- test - Test changes (no version bump)
- chore - Maintenance tasks (no version bump)
- ci - CI configuration (no version bump)
- style - Code formatting (no version bump)
- build - Build system changes (no version bump)
For breaking changes, add ! after the type/scope or include BREAKING CHANGE: in the footer:
feat(api)!: Remove deprecated authentication method
BREAKING CHANGE: Old auth method removed. Use OAuth2 instead.
This triggers a MAJOR version bump.
feat(lock): Add bulk lock operation for multiple worktrees
fix(status): Resolve issue with uncommitted changes detection
perf(list): Optimize worktree listing performance
docs(readme): Update installation instructions
chore(ci): Add automated release workflow
Releases are fully automated using GitHub Actions:
- Merge PR to
mainwith conventional commits - GitHub Actions automatically:
- Analyzes commits since last tag
- Determines version bump (major/minor/patch)
- Updates VERSION and CHANGELOG.md
- Creates git tag
- Creates GitHub release with changelog
For hotfixes or manual releases:
# Bump version (auto-detects from commits)
./scripts/bump-version.sh
# Or specify bump type
./scripts/bump-version.sh major|minor|patch
# Update changelog
./scripts/update-changelog.sh $(cat VERSION)
# Commit and push
git add VERSION CHANGELOG.md
git commit -m "chore(release): bump version to $(cat VERSION) [skip ci]"
git tag -a "v$(cat VERSION)" -m "Release v$(cat VERSION)"
git push origin main --tagsFor detailed information about versioning and releases, see docs/VERSIONING.md.
- Open an issue with the
questionlabel - Check existing documentation in
docs/ - Review closed issues for similar questions
Contributors will be recognized in:
- GitHub contributors page
- Release notes for significant contributions
- CHANGELOG.md for feature additions
Thank you for contributing to treehouse!