← ClaudeAtlas

context-overlaylisted

Use when configuring or debugging the context-overlay OpenAI-compatible proxy for deterministic prompt/context injection, prompt patching, rule matching, request routing, rejection rules, skill_dir retrieval, streaming forwarding, and local or tunneled proxy validation.
black-yt/skills · ★ 2 · AI & Automation · score 63
Install: claude install-skill black-yt/skills
# Context Overlay ## 使用边界 - `context-overlay` 是 OpenAI-compatible request proxy,位于 SDK client 和上游模型服务之间。 - 用于按规则注入 context、skill、policy、memory、profile、prompt patch,或把特定请求 route 到另一个上游。 - 它不运行 agent loop、不执行 tools、不解释模型输出。 - 它应保留 OpenAI-compatible 字段,例如 `tools`、`image_url`、`response_format`、`stream`。 - 不要把 secrets 写进 overlay 文本、skill JSON 或公开配置;优先用环境变量展开。 - 暴露到公网前必须配置 `auth.api_key`,不要公开无认证 proxy。 - 需要安装、开公网 tunnel、改服务端口或改长期配置时,先征得用户同意。 ## 安装与最小配置 - PyPI 安装:`pip install context-overlay` - GitHub 源码:https://github.com/black-yt/context-overlay 安装模板: ```bash pip install context-overlay ``` 开发版本模板: ```bash git clone https://github.com/black-yt/context-overlay.git cd context-overlay pip install -e ".[dev]" pytest -q ``` ## 源码追溯 - 如果配置字段、transform 行为或转发逻辑不确定,优先追溯已安装包源码。 - `inspect.getsource(...)` 适合查看 `apply_rules`、`load_config`、`SkillStore`、FastAPI app 创建逻辑。 - `module.__file__` 可定位包安装路径,再按需打开源码文件。 - 源码只用于阅读和定位问题,不要改源码,不要直接改 `site-packages` 或长期环境;需要改库时,先 clone 仓库并使用 editable install,且必须征得用户同意。 ```python import inspect import context_overlay from context_overlay import apply_rules, load_config, SkillStore from context_overlay.server import create_app print(context_overlay.__file__) print(inspect.getsource(load_config)) print(inspect.getsource(apply_rules)) print(inspect.getsource(SkillStore)) print(inspect.getsource(create_app)) ``` 命令行快速定位: ```bash python - <<'PY' import context_overlay print(context_overlay.__file__) PY ``` 最小 `config.yaml`: ```yaml upstream: base