CONTRIBUTING.md•4.39 kB
# Contributing to Cyber Sentinel MCP
Thank you for your interest in contributing to Cyber Sentinel MCP! This document provides guidelines for contributing to the project.
## 🤝 How to Contribute
### Reporting Issues
1. **Search existing issues** first to avoid duplicates
2. **Use the issue template** when creating new issues
3. **Provide detailed information** including:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Python version, OS, etc.)
- Error messages and logs
### Submitting Pull Requests
1. **Fork the repository** and create a feature branch
2. **Follow the coding standards** (see below)
3. **Add tests** for new functionality
4. **Update documentation** as needed
5. **Run the test suite** before submitting
6. **Create a clear PR description** explaining your changes
## 🛠️ Development Setup
### Prerequisites
- Python 3.8 or higher
- Git
- Virtual environment tool (venv, conda, etc.)
### Setup Instructions
```bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/cyber-sentinel-mcp.git
cd cyber-sentinel-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
```
### Running Tests
```bash
# Run all tests
python -m pytest tests/ -v
# Run with coverage
python -m pytest tests/ --cov=cyber_sentinel --cov-report=html
# Run specific test file
python -m pytest tests/test_threat_intel.py -v
```
### Code Quality Checks
```bash
# Format code
black src/ tests/
isort src/ tests/
# Type checking
mypy src/
# Security check
bandit -r src/
# Run all checks
python scripts/check_release_ready.py
```
## 📝 Coding Standards
### Python Style
- Follow **PEP 8** style guidelines
- Use **Black** for code formatting (line length: 88)
- Use **isort** for import sorting
- Use **type hints** for all functions and methods
- Write **docstrings** for all public functions and classes
### Code Organization
- Keep functions small and focused
- Use descriptive variable and function names
- Add comments for complex logic
- Follow the existing project structure
### Testing
- Write tests for all new functionality
- Aim for high test coverage (>90%)
- Use descriptive test names
- Include both positive and negative test cases
- Mock external API calls in tests
## 🔒 Security Guidelines
### API Keys and Secrets
- **Never commit API keys** or secrets to the repository
- Use environment variables for configuration
- Add sensitive files to `.gitignore`
- Use placeholder values in documentation
### Code Security
- Validate all inputs
- Use secure coding practices
- Avoid hardcoded credentials
- Follow OWASP guidelines
## 📚 Documentation
### Code Documentation
- Write clear docstrings for all public APIs
- Include parameter types and return values
- Provide usage examples where helpful
- Keep documentation up-to-date with code changes
### User Documentation
- Update README.md for new features
- Add usage examples
- Update configuration instructions
- Keep installation guide current
## 🚀 Release Process
### Version Numbering
We follow [Semantic Versioning](https://semver.org/):
- **MAJOR**: Breaking changes
- **MINOR**: New features (backward compatible)
- **PATCH**: Bug fixes (backward compatible)
### Release Checklist
1. Update version in `pyproject.toml`
2. Update `CHANGELOG.md`
3. Run `python scripts/check_release_ready.py`
4. Create release PR
5. Tag release after merge
6. Publish to PyPI
## 🏷️ Issue Labels
- `bug`: Something isn't working
- `enhancement`: New feature or request
- `documentation`: Improvements or additions to docs
- `good first issue`: Good for newcomers
- `help wanted`: Extra attention is needed
- `security`: Security-related issues
## 💬 Communication
- **GitHub Issues**: For bug reports and feature requests
- **GitHub Discussions**: For questions and general discussion
- **Email**: jx888jx888@gmail.com for security issues
## 📄 License
By contributing to Cyber Sentinel MCP, you agree that your contributions will be licensed under the MIT License.
## 🙏 Recognition
Contributors will be recognized in:
- README.md acknowledgments
- Release notes
- GitHub contributors page
Thank you for helping make Cyber Sentinel MCP better! 🛡️