Thank you for helping make ctxeng better! This guide covers everything you need to get started.
git clone https://github.com/your-username/python-context-engineer
cd python-context-engineer
pip install -e ".[dev]"pytest # run all tests
pytest tests/unit/ # unit tests only
pytest -k "test_scoring" # filter by name
pytest --cov=ctxeng # with coverageWe use ruff for linting:
ruff check ctxeng/
ruff format ctxeng/ctxeng/
├── __init__.py Public API exports
├── core.py ContextEngine main class
├── builder.py ContextBuilder fluent API
├── models.py Data classes (Context, ContextFile, TokenBudget)
├── scorer.py File relevance scoring (keyword, AST, git, path)
├── optimizer.py Token counting, budget fitting, smart truncation
├── cli.py CLI entry point
├── sources/ File collectors (filesystem, git, explicit)
└── integrations/ LLM client helpers (Claude, OpenAI, LangChain)
- Add a function
_my_signal_score(content, query, ...) -> floatinscorer.py - Call it from
score_file()and add it to the weighted average - Add a unit test in
tests/unit/test_core.py - Document it in the README scoring table
- Add an
ask_mymodel(ctx, ...) -> strfunction inctxeng/integrations/__init__.py - Follow the pattern of
ask_claude/ask_openai - Add it to
pyproject.tomloptional-dependencies - Document it in the README
- Fork the repo and create a branch:
git checkout -b feat/my-feature - Write code + tests
- Run
pytestandruff check— both must pass - Open a PR with a clear description of what it does and why
Open an issue with:
- Python version
ctxengversion- Minimal reproduction case
- Expected vs actual behavior