context-rainbow
Color-aware OKF context routing for progressively loading repository knowledge.
context-rainbow keeps an OKF bundle as a small map of a repository. An agent
matches a task against that map, follows the relevant branch, and reads only
the source files that the selected OKF documents point to. Source code is not
duplicated inside the knowledge bundle.
Why
Task: "Fix refresh token expiry"
|
v
Read compact OKF map
|
v
Match auth / refresh-token
|
v
Follow existing OKF relationships
|
v
Read only referenced source files
The package adds one routing convention to OKF: a top-level color field.
Existing OKF paths and relationships remain the navigation structure.
Installation
pip install context-rainbow
OKF color convention
Color belongs directly in the document frontmatter:
---
type: Index
title: Authentication
description: Authentication architecture and implementation
tags: [okf, auth]
status: stable
color: amber
relationships:
- type: applies_to
target: /repositories/example.md
---
Colors identify sibling branches. Direct children of one splitter/index must have different colors. A color may be reused in a different branch.
Supported colors:
blue · green · amber · red · violet · cyan · pink · orange
Python API
from context_rainbow import ContextRainbow, OkfDocument
documents = [
OkfDocument(
id="auth.refresh-token",
type="code-context",
title="Refresh token",
color="red",
tags=("auth", "refresh", "token"),
relationships=({"type": "applies_to", "target": "/backend/auth"},),
),
]
selected = ContextRainbow(documents).route("Fix refresh token expiry")
for match in selected:
print(match.document.id, match.reasons)
Routing is deterministic and body-free: matching uses document IDs, titles, tags, and existing relationship targets. The selected document body is loaded only by the caller after routing.
Optional Clinotes integration
Clinotes is not a required dependency. If a repository has committed
.clinotes/INDEX.md and detail/*.md files, the adapter exposes those details
as project-memory documents:
from context_rainbow.sources.clinotes import load_clinotes
project_memory = load_clinotes("C:/work/my-repo")
selected = ContextRainbow(project_memory).route("refresh token decision")
This adapter is read-only and filesystem-based. Clinotes remains responsible for writing decisions and learnings through its own API/MCP server.
Design boundaries
OKF → meaning, architecture, relationships, navigation
Context Rainbow → color validation and deterministic selection
Repository source → exact implementation files
Clinotes → optional project decisions and learnings
Development
python -m pip install -e ".[dev]"
python -m pytest -q
python -m build
Project
- Repository: https://github.com/karthyick/context-rainbow
- Issues: https://github.com/karthyick/context-rainbow/issues
- Author: Karthick Raja M — Karthickrajam18@gmail.com
- License: MIT
Metadata
Release files for context-rainbow 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| context_rainbow-0.1.1.tar.gz | 8.0 kB | Without provenance | Details for context_rainbow-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| context_rainbow-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for context_rainbow-0.1.1-py3-none-any.whl |
Total release size: 14.5 kB
Release files / context_rainbow-0.1.1.tar.gz
| Download URL | context_rainbow-0.1.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
234b6bcaa631fb876124444db518199f7bac5ed7de4adbaa26356c1eae126713
|
|
BLAKE2b-256 checksum How to use checksums |
d4c71f16c0a7fe9b19f9f227612b5222a3539ab569f08fa4863a9d880ec56321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / context_rainbow-0.1.1-py3-none-any.whl
| Download URL | context_rainbow-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db82239d1d406913bd7bd25cb844f3ce94a7b8ea36c6d4ab651d094170b5012c
|
|
BLAKE2b-256 checksum How to use checksums |
bf8b13022b8e289c1c1d9477074afe15f0fa856a40e89007904d2751c5dfda94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for context-rainbow 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.