Thank you for your interest in contributing to Commit Coach! This document provides guidelines and information for contributors.
- Contributing to Commit Coach
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/commit-coach.git - Create a new branch:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes
- Submit a pull request
- Node.js 20+
- pnpm (recommended) or npm
- Git
# Clone the repository
git clone https://github.com/rasterandstate/commit-coach.git
cd commit-coach
# Install dependencies
pnpm install
# Build the project
pnpm run build# Development
pnpm run dev # Start development mode
pnpm run build # Build the project
pnpm run build:action # Build the GitHub Action
# Testing
pnpm run test # Run tests
pnpm run test:run # Run tests without coverage
pnpm run test:coverage # Run tests with coverage
pnpm run test:watch # Run tests in watch mode
# Code Quality
pnpm run lint # Run ESLint
pnpm run lint:fix # Fix ESLint issues
pnpm run format # Format code with Prettier
pnpm run format:check # Check code formatting
# Utilities
pnpm run coach # Run commit coach CLIsrc/
├── action.ts # GitHub Action entry point
├── analyzers/ # Commit analysis modules
├── config/ # Configuration handling
├── core/ # Core functionality
├── insights/ # Insight generation
├── integrations/ # External service integrations
├── output/ # Output formatters
└── types/ # TypeScript type definitions
- Use TypeScript for all new code
- Follow the existing code style and patterns
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
We follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(analyzers): add semantic commit analyzer
fix(github): handle missing PR context
docs(readme): update installation instructions
# Run all tests
pnpm run test
# Run tests with coverage
pnpm run test:coverage
# Run specific test file
pnpm test src/analyzers/semantic.test.ts- Write tests for new functionality
- Aim for good test coverage
- Use descriptive test names
- Test both success and error cases
- Mock external dependencies
describe('Feature Name', () => {
describe('when condition is met', () => {
it('should behave correctly', () => {
// Test implementation
});
});
});Before submitting a pull request, please:
- Check if an issue already exists for your feature/bug
- If not, create an issue to discuss the change
- Use the appropriate issue template (bug report or feature request)
- Create a descriptive title that clearly explains what the PR does
- Link to related issues using "Fixes #123" or "Related to #123"
- Provide a clear description of what changes were made and why
- Include tests for new functionality
- Update documentation if needed
- Ensure all checks pass (tests, linting, formatting)
We use a pull request template to ensure consistency. Please fill out all relevant sections.
- Automated checks must pass (CI, tests, linting)
- At least one maintainer review is required
- Address any feedback from reviewers
- Maintainers will merge when ready
Releases are automated using GitHub Actions:
- Version bumps are handled automatically
- Changelog is generated from conventional commits
- GitHub releases are created automatically
- npm packages are published automatically
We follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoringtest/description- Test improvements
# Add upstream remote
git remote add upstream https://github.com/rasterandstate/commit-coach.git
# Fetch latest changes
git fetch upstream
# Merge upstream changes
git checkout main
git merge upstream/main
# Update your feature branch
git checkout feature/your-feature
git rebase main- Check existing issues and discussions
- Join our community discussions
- Contact maintainers for urgent issues
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- GitHub contributors page
Thank you for contributing to Commit Coach! 🚀