# Contributing to Treehouse
Thank you for your interest in contributing to Treehouse! This document provides guidelines and instructions for contributing.
## Code of Conduct
This project follows a standard code of conduct:
- Be respectful and inclusive
- Focus on constructive feedback
- Help create a welcoming environment for all contributors
## How to Contribute
### Reporting Bugs
If you find a bug, please create an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs actual behavior
- Your environment (OS, Node version, git version)
- Any relevant logs or error messages
### Suggesting Features
Feature suggestions are welcome! Please create an issue describing:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
- How this fits with the project's goals
### Pull Requests
1. **Fork and clone the repository**
```bash
git clone https://github.com/yourusername/treehouse.git
cd treehouse
```
2. **Install dependencies**
```bash
npm install
```
3. **Create a branch**
```bash
git checkout -b feature/your-feature-name
```
4. **Make your changes**
- Write clean, readable code
- Follow existing code style
- Add tests for new functionality
- Update documentation as needed
5. **Run tests and linting**
```bash
npm test
npm run lint
npm run build
```
6. **Commit your changes**
```bash
git commit -m "feat: add amazing feature"
```
Follow conventional commit format:
- `feat:` - New features
- `fix:` - Bug fixes
- `docs:` - Documentation changes
- `test:` - Test additions or changes
- `refactor:` - Code refactoring
- `chore:` - Maintenance tasks
7. **Push and create a pull request**
```bash
git push origin feature/your-feature-name
```
## Development Setup
### Prerequisites
- Node.js 18+
- Git 2.5+
- A git repository for testing
### Project Structure
```
treehouse/
├── src/
│ ├── __tests__/ # Test files
│ ├── utils/ # Utility modules
│ ├── cli.ts # CLI entry point
│ ├── treehouse.ts # Main Treehouse class
│ ├── mcp-server.ts # MCP server implementation
│ └── types.ts # TypeScript types
├── dist/ # Compiled JavaScript
├── .github/workflows/ # CI/CD workflows
└── package.json
```
### Running Tests
```bash
# Run all tests
npm test
# Watch mode
npm run test:watch
# With coverage
npm run test:coverage
# UI mode
npm run test:ui
```
### Code Style
- Use TypeScript for all code
- Follow existing ESLint configuration
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
### Testing Guidelines
- Write tests for all new features
- Aim for high test coverage
- Test both success and error cases
- Use descriptive test names
## Release Process
Releases are automated through GitHub Actions:
1. Update version in `package.json`
2. Update `CHANGELOG.md` with changes
3. Create a git tag: `git tag v1.2.3`
4. Push tag: `git push --tags`
5. Create a GitHub release
6. CI will automatically publish to npm
## Questions?
Feel free to open an issue for any questions about contributing!
## License
By contributing, you agree that your contributions will be licensed under the MIT License.