Thank you for your interest in contributing to Contextception!
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/contextception.git - Create a branch:
git checkout -b my-feature - Make your changes
- Run tests:
make test - Run linter:
make lint - Commit and push
- Open a pull request
- Go 1.24+ — required for building
- GCC — required for CGO (tree-sitter TypeScript/JavaScript extraction)
- golangci-lint — for linting (optional, CI runs it automatically)
make build # Binary at ./bin/contextception
make test # Run all tests
make lint # Run golangci-lintcmd/contextception/ CLI entrypoint
cmd/gen-schema/ JSON schema generator
internal/
analyzer/ Core analysis engine (scoring, categorization, risk triage)
change/ PR/branch diff analysis
classify/ File role classification
cli/ Command handlers (cobra subcommands)
config/ Configuration parsing (per-repo + global)
db/ SQLite database layer (migrations, store, search)
extractor/ Language-specific extractors (python, typescript, golang, java, rust)
git/ Git history signal extraction
grader/ Internal quality evaluation framework
history/ Historical analysis, usage tracking, and feedback storage
indexer/ Incremental indexing pipeline
mcpserver/ MCP server (tools, stdio transport)
model/ Shared data types
resolver/ Module resolution (per-language)
session/ Claude Code session parser (discover, adoption)
update/ Version check, self-update, install method detection
validation/ Fixture-based validation framework
version/ Version injection (set via ldflags)
protocol/ JSON Schema specifications
schema/ Go types for schema generation
integrations/ MCP config examples and slash commands
testdata/ Test fixtures (synthetic repos + expected outputs)
Language support is pluggable. To add a new language:
- Create an extractor in
internal/extractor/<language>/ - Implement the
extractor.Extractorinterface - Create a resolver in
internal/resolver/<language>/if needed - Register both in
internal/indexer/indexer.go(instantiate extractor + resolver inNewIndexer) - Add the extractor to
internal/cli/extensions.gosocontextception extensionsincludes it - Add test fixtures in
testdata/
See existing extractors (e.g., internal/extractor/python/) for reference.
- Follow standard Go conventions (
gofmt,go vet) - Error handling: wrap errors with
fmt.Errorf("context: %w", err) - No
panic()— return errors instead - Use parameterized SQL queries (never string concatenation)
- Write tests for new features
- Run
make testbefore submitting - Test files go alongside source files (
foo_test.gonext tofoo.go) - Integration test fixtures go in
testdata/
- Keep PRs focused — one feature or fix per PR
- Include a clear description of what changed and why
- Ensure CI passes (tests + lint)
By contributing, you agree that your contributions will be licensed under the MIT License.