Thank you for your interest in knowledge! We welcome contributions of all kinds — bug fixes, features, documentation, and ideas.
- Development Setup
- Branch Naming
- Commit Conventions
- Pull Request Process
- Coding Standards
- Testing
- Documentation
- Code of Conduct
# Fork and clone the repository
git clone https://github.com/your-username/knowledge.git
cd knowledge
# Install with dev dependencies
pip install -e ".[dev]"
# Verify everything works
pytest
ruff check knowledge/ tests/
mypy knowledge/Use a short, descriptive name prefixed by the type of change:
| Prefix | Example |
|---|---|
feat/ |
feat/markdown-heading-support |
fix/ |
fix/content-length-crash |
docs/ |
docs/api-reference |
refactor/ |
refactor/extractor-module |
test/ |
test/round-trip-edge-cases |
chore/ |
chore/update-ci |
We follow Conventional Commits (v1.0.0):
<type>: <short description>
[optional body]
[optional footer]
| Type | Usage |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation changes only |
refactor |
Code change that neither fixes nor adds |
test |
Adding or updating tests |
chore |
Build, CI, dependencies, tooling |
style |
Formatting (white-space, semicolons, etc.) |
The subject line must be 72 characters or less and use the imperative mood ("add" not "added" or "adds").
- Create an issue describing the bug or feature before starting work (unless it is a trivial fix).
- Fork the repo and create a branch from
master. - Write tests for your change (aim for 80%+ coverage on new code).
- Run all checks locally:
pytest ruff check knowledge/ tests/ ruff format --check knowledge/ tests/ mypy knowledge/
- Update documentation if your change affects the public API or CLI.
- Open a pull request with a clear title and description. Reference the issue number in the description.
- Address review feedback — all CI checks must pass before merging.
- Python: 3.12+
- Line length: 100 characters
- Quotes: double (
") for all strings - Type hints: required on all public function/method signatures
- Naming: all identifiers are public (no
_foosemi-private naming) - Formatting: run
ruff formatbefore committing - Imports: standard library → third-party → local (separated by blank line)
- Docstrings: Google-style module, class, and public method docstrings
"""Module-level docstring."""
from __future__ import annotations
import os
from pydantic import BaseModel
class MyModel(BaseModel):
"""Short description."""
name: str
def greet(self, greeting: str) -> str:
"""Return a greeting string."""
return f"{greeting}, {self.name}!"- Framework: pytest
- Location:
tests/ - Coverage target: 90%+
- Naming:
test_<module>.pyfor files,test_<method>_<scenario>for functions - Fixtures: prefer
conftest.pyfor shared fixtures - No network calls: mock
litellm.completionandurlopenin tests
# Run all tests
pytest
# With coverage
pytest --cov=knowledge
# Specific test file
pytest tests/test_sdk.py
# Verbose
pytest -v- API docs: docstrings in the source code (Pydocstyle-compatible).
- User-facing docs: Markdown files in
docs/. - Architecture decisions: ADR files in
docs/adr/. - When adding a new public class or function, include a docstring with:
- Short description
Args:sectionReturns:sectionRaises:section (if applicable)- Optional
Example:code block
This project adheres to the Contributor Covenant v2.1. By participating you agree to uphold this code. Report unacceptable behavior to sachncs@gmail.com.