Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
Be respectful and inclusive. We welcome contributors of all backgrounds and experience levels.
- Check existing issues - Your bug may already be reported
- Create a new issue with:
- Clear title describing the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Python version, etc.)
- Open an issue with the
enhancementlabel - Describe:
- The problem you're trying to solve
- Your proposed solution
- Alternative approaches you considered
# Clone the repository
git clone https://github.com/puneet8800/cocoindex-claude-code.git
cd cocoindex-claude-code
# Create virtual environment
python3.11 -m venv .venv
source .venv/bin/activate
# Install with dev dependencies
pip install -e ".[dev]"
# Start PostgreSQL
docker compose -f docker/compose.yaml up -d
# Setup CocoIndex
cocoindex setup main.py -f-
Create a branch:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes:
- Write clear, documented code
- Follow the existing code style
- Add tests if applicable
-
Test your changes:
# Run type checking mypy flows/ # Run linter ruff check . # Format code ruff format . # Test manually cocoindex update main.py python scripts/query.py "test query"
-
Commit your changes:
git add . git commit -m "feat: add new feature" # or git commit -m "fix: resolve issue with X"
Follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation onlyrefactor:- Code change that neither fixes a bug nor adds a featuretest:- Adding testschore:- Maintenance tasks
-
Push and create PR:
git push origin feature/your-feature-name
Then open a Pull Request on GitHub.
- Title: Clear, descriptive title
- Description: Explain what and why
- Link issues: Reference related issues with
Fixes #123 - Small PRs: Keep changes focused and reviewable
- Tests: Include tests for new functionality
- Documentation: Update docs if needed
- Python 3.11+ features are welcome
- Use type hints
- Follow PEP 8 (enforced by ruff)
- Maximum line length: 100 characters
# Good
def search(query: str, limit: int = 5) -> QueryOutput:
"""Search indexed documents.
Args:
query: The search query
limit: Maximum results to return
Returns:
QueryOutput with matching documents
"""
...
# Avoid
def search(q, l=5):
...- Use Markdown for all docs
- Include code examples
- Add Mermaid diagrams where helpful
- Keep language clear and accessible
cocoindex-claude-code/
├── flows/ # CocoIndex flow definitions
│ ├── text_embedding.py
│ └── llm_extraction.py
├── scripts/ # Utility scripts
├── docker/ # Docker configuration
├── docs/ # Documentation
├── main.py # FastAPI server
├── mcp_server.py # MCP server
└── pyproject.toml # Dependencies
| File | Purpose |
|---|---|
mcp_server.py |
MCP protocol implementation |
main.py |
FastAPI REST API |
flows/text_embedding.py |
Vector search flow |
flows/llm_extraction.py |
LLM extraction flow |
# Test indexing
cocoindex update main.py
# Test search
python scripts/query.py "test query"
# Test MCP server
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | python mcp_server.py
# Test FastAPI
python main.py &
curl http://localhost:8000/search?q=testPlace tests in a tests/ directory:
# tests/test_search.py
import pytest
from flows.text_embedding import search
def test_search_returns_results():
result = search("test query")
assert len(result.results) >= 0We especially welcome contributions in:
- Documentation improvements
- New flow types (e.g., image indexing, code-specific flows)
- Additional MCP tools
- Performance optimizations
- Test coverage
- CI/CD setup
- Open a Discussion
- Check existing issues and PRs
- Review the documentation
Thank you for contributing!