Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

docs: update CONTRIBUTING.md with improved formatting and documentation guidelines

KaifAhmad1ca04bfd1e9ee
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 064c2970..4c07c8d1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,306 +1,262 @@
# Contributing to Semantica
-Thank you for your interest in contributing to Semantica! This document provides guidelines and instructions for contributing to the project.
+Thank you for your interest in contributing! Every contribution, no matter how small, is valuable. πŸŽ‰
-## Table of Contents
+> **New to contributing?** Start with a [`good first issue`](https://github.com/Hawksight-AI/semantica/labels/good%20first%20issue) or join our [Discord](https://discord.gg/vqRt2qbx) community.
-- [Code of Conduct](#code-of-conduct)
-- [Getting Started](#getting-started)
-- [Development Setup](#development-setup)
-- [Code Style Guidelines](#code-style-guidelines)
-- [Testing Requirements](#testing-requirements)
-- [Commit Message Conventions](#commit-message-conventions)
-- [Pull Request Process](#pull-request-process)
-- [Documentation Standards](#documentation-standards)
-- [Types of Contributions](#types-of-contributions)
-- [Getting Help](#getting-help)
+---
-## Code of Conduct
+## πŸš€ Quick Start
-This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers.
+1. Find a [`good first issue`](https://github.com/Hawksight-AI/semantica/labels/good%20first%20issue)
+2. Fork & clone the repository
+3. Make your changes
+4. Submit a pull request!
-## Getting Started
+**Need help?** Join [Discord](https://discord.gg/vqRt2qbx) or [GitHub Discussions](https://github.com/Hawksight-AI/semantica/discussions)
-1. **Fork the repository** on GitHub
-2. **Clone your fork** locally:
- ```bash
- git clone https://github.com/your-username/semantica.git
- cd semantica
- ```
-3. **Add the upstream remote**:
- ```bash
- git remote add upstream https://github.com/Hawksight-AI/semantica.git
- ```
+---
-## Development Setup
+## 🎯 Ways to Contribute
-### Prerequisites
+### πŸ’» Code
-- Python 3.8 or higher (3.9+ recommended)
-- pip package manager
-- Git
+**What you can do:**
+- Fix bugs
+- Add new features
+- Improve code quality (add type hints, docstrings, improve error messages)
+- Optimize performance
-### Installation
+**Where:** `semantica/` directory
-1. **Create a virtual environment** (recommended):
- ```bash
- python -m venv venv
- source venv/bin/activate # On Windows: venv\Scripts\activate
- ```
+**Good first issues:** Add docstrings, type hints, or improve error messages
-2. **Install the project in editable mode with dev dependencies**:
- ```bash
- pip install -e ".[dev]"
- ```
+---
-3. **Install pre-commit hooks**:
- ```bash
- pre-commit install
- ```
+### πŸ“ Documentation
-### Verify Installation
+**What you can do:**
+- Fix typos and grammar errors
+- Improve clarity and readability
+- Add code examples and tutorials
+- Create new cookbook notebooks
+- Improve API documentation (docstrings)
+- Create troubleshooting guides
+- Update installation instructions
+- Add missing documentation
-```bash
-python -c "import semantica; print(semantica.__version__)"
-pytest --version
-black --version
-```
+**Where:** `README.md`, `docs/`, `cookbook/`, docstrings in code
-## Code Style Guidelines
+**Good first issues:** Fix typos, add examples, create cookbook tutorials, improve docstrings
-We use several tools to maintain code quality and consistency:
+**Documentation formatting:**
+- Use clear, concise language
+- Include code examples where helpful
+- Follow markdown best practices
+- Use proper headings hierarchy
+- Add links to related sections
+- Include screenshots for UI-related docs
-### Formatting
+---
-- **Black**: Code formatting (line length: 88)
- ```bash
- black semantica/
- ```
+### πŸ§ͺ Testing
-- **isort**: Import sorting
- ```bash
- isort semantica/
- ```
+**What you can do:**
+- Add unit tests
+- Improve test coverage
+- Add integration tests
-### Linting
+**Where:** `tests/` directory
-- **flake8**: Style guide enforcement
- ```bash
- flake8 semantica/
- ```
+**Good first issues:** Add tests for specific functions or classes
-- **mypy**: Static type checking
- ```bash
- mypy semantica/
- ```
+---
-### Running All Checks
+### πŸ› Bug Reports
-```bash
-# Format code
-black semantica/ tests/
+**What:** Report bugs you find
-# Sort imports
-isort semantica/ tests/
+**How:** Use the [bug report template](https://github.com/Hawksight-AI/semantica/issues/new?template=bug_report.md)
-# Lint
-flake8 semantica/ tests/
+**Include:** Description, steps to reproduce, expected vs actual behavior, environment details
-# Type check
-mypy semantica/
-```
+---
-Or use pre-commit hooks (automatically runs on commit):
-```bash
-pre-commit run --all-files
-```
+### πŸ’‘ Feature Requests
-## Testing Requirements
+**What:** Suggest new features or improvements
-### Running Tests
+**How:** Use the [feature request template](https://github.com/Hawksight-AI/semantica/issues/new?template=feature_request.md)
-```bash
-# Run all tests
-pytest
+**Include:** Problem statement, proposed solution, use cases
-# Run with coverage
-pytest --cov=semantica --cov-report=html
+---
-# Run specific test file
-pytest tests/test_specific.py
+### 🎨 Cookbook & Examples
-# Run with verbose output
-pytest -v
-```
+**What:** Create tutorials and examples
-### Test Coverage
+**Where:** `cookbook/` directory
-- Minimum coverage: **80%**
-- Critical modules: **90%+**
-- Coverage reports are generated in `htmlcov/`
+**Examples:** Create new notebooks, add examples, improve existing tutorials
-### Writing Tests
+---
-- Follow pytest conventions
-- Use descriptive test names
-- Include docstrings for complex tests
-- Test both success and failure cases
-- Use fixtures for common setup
+### πŸ’¬ Community Support
-Example:
-```python
-def test_entity_extraction():
- """Test basic entity extraction functionality."""
- from semantica.semantic_extract import NamedEntityRecognizer
-
- ner = NamedEntityRecognizer()
- entities = ner.extract("Apple Inc. was founded by Steve Jobs.")
-
- assert len(entities) > 0
- assert any(e.text == "Apple Inc." for e in entities)
-```
+**What:** Help others in the community
-## Commit Message Conventions
+**Where:** [Discord](https://discord.gg/vqRt2qbx), [GitHub Discussions](https://github.com/Hawksight-AI/semantica/discussions)
-We follow [Conventional Commits](https://www.conventionalcommits.org/) specification:
+**Examples:** Answer questions, review PRs, share your projects
-### Format
+---
-```
-<type>(<scope>): <subject>
+### πŸŽ“ Educational Content
+
+**What:** Create educational materials
+
+**Examples:** Blog posts, video tutorials, talks, workshops, case studies
+
+---
-<body>
+### πŸ”§ Other Contributions
-<footer>
+- **Design & Graphics:** Logos, diagrams, visualizations
+- **Tools & Integrations:** CLI tools, integrations with other frameworks
+- **Infrastructure:** CI/CD improvements, Docker optimization
+- **Security:** Report security vulnerabilities (privately)
+
+---
+
+## πŸ“‹ Getting Started
+
+### 1. Fork & Clone
+
+```bash
+git clone https://github.com/your-username/semantica.git
+cd semantica
+git remote add upstream https://github.com/Hawksight-AI/semantica.git
```
-### Types
+### 2. Set Up Environment
-- `feat`: New feature
-- `fix`: Bug fix
-- `docs`: Documentation changes
-- `style`: Code style changes (formatting, etc.)
-- `refactor`: Code refactoring
-- `test`: Adding or updating tests
-- `chore`: Maintenance tasks
-- `perf`: Performance improvements
-- `ci`: CI/CD changes
+```bash
+# Create virtual environment
+python -m venv venv
+source venv/bin/activate # Windows: venv\Scripts\activate
-### Examples
+# Install dev dependencies
+pip install -e ".[dev]"
+# Install pre-commit hooks (optional)
+pre-commit install
```
-feat(kg): add temporal graph support
-Add support for temporal knowledge graphs with version tracking
-and time-based queries.
+### 3. Create Branch
-Closes #123
+```bash
+git checkout -b feature/your-feature-name
+# or
+git checkout -b fix/bug-description
```
+### 4. Make Changes
+
+- Follow code style (see below)
+- Add tests for new features
+- Update documentation
+
+### 5. Run Checks
+
+```bash
+pytest # Run tests
+black semantica/ tests/ # Format code
+isort semantica/ tests/ # Sort imports
+flake8 semantica/ tests/ # Lint
```
-fix(parse): handle empty PDF files gracefully
-Previously, empty PDF files would cause a crash. Now they return
-an empty document with appropriate warnings.
+Or use pre-commit hooks: `pre-commit run --all-files`
+
+### 6. Commit & Push
-Fixes #456
+```bash
+git commit -m "feat(module): add new feature"
+git push origin feature/your-feature-name
```
-## Pull Request Process
+Then create a pull request on GitHub!
-### Before Submitting
+---
-1. **Update your fork**:
- ```bash
- git fetch upstream
- git checkout main
- git merge upstream/main
- ```
+## πŸ“ Code Style
-2. **Create a feature branch**:
- ```bash
- git checkout -b feature/your-feature-name
- # or
- git checkout -b fix/bug-description
- ```
+We use automated tools:
-3. **Make your changes** and commit following our conventions
+| Tool | Purpose | Command |
+|----------|----------------------------|----------------------------|
+| **Black** | Code formatting | `black semantica/ tests/` |
+| **isort** | Import sorting | `isort semantica/ tests/` |
+| **flake8** | Style enforcement | `flake8 semantica/ tests/` |
+| **mypy** | Type checking | `mypy semantica/` |
-4. **Run all checks**:
- ```bash
- pytest
- black semantica/ tests/
- isort semantica/ tests/
- flake8 semantica/ tests/
- mypy semantica/
- ```
+**Run all:** `black semantica/ tests/ && isort semantica/ tests/ && flake8 semantica/ tests/ && mypy semantica/`
-5. **Push to your fork**:
- ```bash
- git push origin feature/your-feature-name
- ```
+---
-### PR Checklist
+## πŸ§ͺ Testing
-- [ ] Code follows style guidelines
-- [ ] Tests pass locally
-- [ ] New tests added for new features
-- [ ] Documentation updated
-- [ ] Commit messages follow conventions
-- [ ] No merge conflicts
-- [ ] PR description is clear and complete
+```bash
+pytest # Run all tests
+pytest --cov=semantica # With coverage
+pytest tests/test_file.py # Specific file
+```
-### PR Description Template
+**Coverage goal:** 80% minimum, 90%+ for critical modules
-```markdown
-## Description
-Brief description of changes
+---
-## Type of Change
-- [ ] Bug fix
-- [ ] New feature
-- [ ] Breaking change
-- [ ] Documentation update
+## πŸ“ Commit Messages
-## Related Issues
-Closes #123
-Related to #456
+Use [Conventional Commits](https://www.conventionalcommits.org/):
-## Testing
-- [ ] Tests pass locally
-- [ ] Added new tests
-- [ ] Updated existing tests
+```
+feat(kg): add temporal graph support
+fix(parse): handle empty PDF files
+docs(readme): add installation guide
+test(extract): add unit tests
+```
+
+**Types:** `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `style`, `chore`
+
+---
+
+## βœ… PR Checklist
+
+Before submitting:
-## Checklist
- [ ] Code follows style guidelines
-- [ ] Self-review completed
-- [ ] Comments added for complex code
+- [ ] Tests pass locally
+- [ ] New tests added (if applicable)
- [ ] Documentation updated
-- [ ] No new warnings generated
-```
+- [ ] Commit messages follow conventions
+- [ ] No merge conflicts
-## Documentation Standards
+---
-### Code Documentation
+## πŸ“– Documentation Standards
-- Use Google-style docstrings
-- Include type hints
-- Document all public functions and classes
-- Include examples for complex functions
+### Code Documentation (Docstrings)
+
+**Format:** Use Google-style docstrings
-Example:
```python
-def extract_entities(
- text: str,
- model: str = "transformer",
- confidence_threshold: float = 0.7
-) -> List[Entity]:
+def extract_entities(text: str, model: str = "transformer") -> List[Entity]:
"""Extract named entities from text.
Args:
text: Input text to process
model: NER model to use (default: "transformer")
- confidence_threshold: Minimum confidence score (default: 0.7)
Returns:
List of extracted Entity objects
@@ -309,92 +265,96 @@ def extract_entities(
ValueError: If text is empty or model is invalid
Example:
- >>> ner = NamedEntityRecognizer()
+ >>> from semantica.semantic_extract import NERExtractor
+ >>> ner = NERExtractor(method="ml", model="en_core_web_sm")
>>> entities = ner.extract("Apple Inc. was founded in 1976.")
>>> len(entities)
2
"""
- ...
```
-### Documentation Files
-
-- Update relevant documentation in `docs/`
-- Add examples to cookbook if applicable
-- Update API reference if adding new public APIs
-- Keep README.md up to date
+### Markdown Documentation Formatting
-## Types of Contributions
+**General Guidelines:**
+- Use clear headings (H1 for title, H2 for main sections, H3 for subsections)
+- Keep paragraphs short and focused
+- Use bullet points for lists
+- Add code blocks with syntax highlighting
+- Include links to related documentation
-### πŸ’» Code Contributions
+**Code Blocks:**
+- Use triple backticks with language identifier: ` ```python `, ` ```bash `
+- Include comments in code examples
+- Show expected output when helpful
-- **Bug Fixes**: Resolving issues reported in the issue tracker.
-- **New Features**: Implementing new capabilities (please discuss via an issue first!).
-- **Refactoring**: Improving code structure and maintainability without changing behavior.
-- **Algorithm Optimization**: Improving the efficiency of graph algorithms and vector search.
+**Examples:**
-#### ⚑ Performance and Latency
-We deeply value efficiency. Contributions that make Semantica faster and lighter are highly appreciated!
-
-- **Latency Reduction**: Optimize critical paths and RAG pipeline response times.
-- **Memory Optimization**: Reduce graph/vector processing memory footprint.
-- **Throughput**: Improve operations per second (bulk ingestion, parallel queries).
-- **Benchmarks**: Add performance benchmarks to track regressions.
-- **Async/Concurrency**: Enhance asynchronous execution and concurrency.
+```markdown
+## Section Title
-### πŸ“š Documentation Contributions
+Brief introduction paragraph.
-- Fix typos and grammar
-- Improve clarity
-- Add examples
-- Create tutorials
-- Translate documentation
+### Subsection
-### Testing Contributions
+- Bullet point 1
+- Bullet point 2
-- Add test coverage
-- Improve test quality
-- Add integration tests
-- Performance benchmarks
+**Code example:**
-### Other Contributions
+```python
+from semantica import SomeClass
-- Answer questions in discussions
-- Help with issues
-- Review pull requests
-- Share use cases
-- Report bugs
-- Suggest features
+instance = SomeClass()
+result = instance.method()
+```
-## Getting Help
+**Note:** Additional context or warnings.
+```
-### Communication Channels
+**Best Practices:**
+- Start with an overview/introduction
+- Use consistent terminology
+- Include "See also" links
+- Add examples for complex concepts
+- Keep formatting consistent across docs
-- **GitHub Discussions**: General questions and discussions
-- **GitHub Issues**: Bug reports and feature requests
-- **Discord**: Real-time chat and community support
+---
-### Before Asking for Help
+## πŸ†˜ Getting Help
-1. Check existing documentation
-2. Search GitHub issues and discussions
-3. Review code examples in cookbook
-4. Check FAQ in documentation
+- πŸ’¬ [Discord](https://discord.gg/vqRt2qbx) - Real-time chat
+- πŸ’­ [GitHub Discussions](https://github.com/Hawksight-AI/semantica/discussions) - Q&A
+- πŸ› [GitHub Issues](https://github.com/Hawksight-AI/semantica/issues) - Bug reports
-### Asking Good Questions
+**Before asking:** Check existing documentation, search issues/discussions, review cookbook examples
-- Provide context and environment details
-- Include code examples
-- Show what you've tried
-- Include error messages and logs
-- Be specific about what you need
+---
-## Recognition
+## πŸ† Recognition
-Contributors are recognized in:
+All contributors are recognized in:
- [CONTRIBUTORS.md](CONTRIBUTORS.md)
- GitHub contributors page
-- Release notes for significant contributions
+- Release notes
+
+We follow the [all-contributors](https://allcontributors.org) specification!
+
+---
+
+## πŸ“œ Code of Conduct
+
+This project follows a [Code of Conduct](CODE_OF_CONDUCT.md). Be respectful and inclusive.
+
+---
+
+## πŸ“š Resources
+
+- [README.md](README.md) - Project overview
+- [Cookbook](cookbook/) - Tutorials and examples
+- [Documentation](docs/) - Comprehensive guides
+
+---
-Thank you for contributing to Semantica! πŸŽ‰
+**Thank you for contributing!** πŸš€
+Every contribution matters - whether it's a single line of code, a typo fix, a helpful answer, or a bug report. We appreciate you! πŸ™