# Contributing to HIS.js

Thank you for your interest in contributing to HIS.js! This document provides guidelines and instructions for contributing.

## Code of Conduct

Be respectful, inclusive, and constructive in all interactions.

## Getting Started

1. Fork the repository
2. Clone your fork:
   ```bash
   git clone https://github.com/yourusername/his-js.git
   cd his-js
   ```
3. Install dependencies:
   ```bash
   npm install
   ```
4. Build the project:
   ```bash
   npm run build
   ```
5. Run tests:
   ```bash
   npm test
   ```

## Development Workflow

1. Create a new branch:
   ```bash
   git checkout -b feature/your-feature-name
   ```

2. Make your changes in the `src/` directory

3. Build and test:
   ```bash
   npm run build
   npm test
   ```

4. Commit your changes:
   ```bash
   git commit -m "feat: add new feature"
   ```

5. Push to your fork:
   ```bash
   git push origin feature/your-feature-name
   ```

6. Open a Pull Request

## Commit Message Convention

We follow [Conventional Commits](https://www.conventionalcommits.org/):

- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation changes
- `test:` - Adding or updating tests
- `refactor:` - Code refactoring
- `chore:` - Maintenance tasks

## Project Structure

```
his-js/
├── src/           # TypeScript source code
├── dist/          # Compiled output (generated)
├── test/          # Test files
├── example.mjs    # Example usage
└── package.json   # Package configuration
```

## Testing

- Write tests for new features
- Ensure all tests pass before submitting PR
- Aim for high test coverage

```bash
npm test
```

## Code Style

- Use TypeScript
- Follow existing code style
- Keep functions focused and small
- Add JSDoc comments for public APIs
- Use meaningful variable names

## Pull Request Guidelines

1. **Title**: Clear, descriptive title following conventional commits
2. **Description**: Explain what and why, not how
3. **Tests**: Include tests for new features
4. **Documentation**: Update README if needed
5. **Single Responsibility**: One feature/fix per PR

## Issues

When reporting bugs, include:

- HIS.js version
- Node.js version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Code samples if applicable

## Questions?

Open an issue with the `question` label or start a discussion.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
