Thank you for your interest in contributing! This document provides guidelines and information for contributors.
Use this when you just want the shortest path to a good PR:
- Create a branch
- Implement + add/update tests
- Run:
npm run build && npm run typecheck && npm run lint && npm run test:run - Add at least one release category label
- Open PR with summary + testing notes
- Getting Started
- Development Setup
- Making Changes
- Pull Request Guidelines
- Project Structure
- Release Labels and Notes
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/opencode-codebase-index.git cd opencode-codebase-index - Install dependencies:
npm install
- Build the project:
npm run build
- Node.js >= 18
- Rust toolchain (for native module)
- npm
# Build everything (TypeScript + Rust)
npm run build
# Build only TypeScript
npm run build:ts
# Build only Rust native module
npm run build:native# Run all tests
npm run test:run
# Run tests in watch mode
npm run test
# Run Rust tests
cd native && cargo test# Run ESLint
npm run lint
# Run Clippy (Rust)
cd native && cargo clippy-
Create a feature branch:
git checkout -b feature/my-feature
-
Make your changes and add tests if applicable
-
Run checks before committing:
npm run build && npm run typecheck && npm run lint && npm run test:run
-
Commit with a descriptive message:
git commit -m "feat: add my feature"We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesperf:- Performance improvementrefactor:- Code refactoringtest:- Adding/updating testschore:- Maintenance tasks
-
Push and open a pull request:
git push origin feature/my-feature
If you're contributing parser or call-graph support for a new language, use docs/adding-language-support.md. It explains the difference between file discovery, semantic parsing, and call-graph support, and lists every code path you may need to update.
- Keep PRs focused and atomic
- Include tests for new functionality
- Update documentation if needed
- Ensure CI passes before requesting review
- Add at least one release category label (
feature,bug,performance,documentation,dependencies,refactor,test, orchore)
src/ # TypeScript source
├── indexer/ # Core indexing logic
├── embeddings/ # Embedding providers
├── tools/ # OpenCode tool definitions
├── native/ # Rust module wrapper
└── config/ # Configuration schema
native/src/ # Rust native module
├── parser.rs # Tree-sitter parsing
├── store.rs # Vector storage
└── inverted_index.rs # BM25 search
tests/ # Unit tests
This repository enforces release labels in CI (Release Label Check).
- Every PR must include at least one release category label (
feature,bug,performance,documentation,dependencies,refactor,test,chore, orskip-changelog). - Use
semver:major,semver:minor, orsemver:patchwhen the change should explicitly drive the release bump. - Use
skip-changelogonly for intentionally excluded changes.
Open an issue for any questions or concerns. We're happy to help!