Skip to content

TIKAZI/TIKAZ-AI-Skills / suites/context-economy

context-economy

Flagged

Automatically prepare fidelity-first, bounded context when users paste text, attach files or folders, provide webpages or PDFs for Markdown conversion, continue long conversations, or supply documents containing images and complex tables. Route each input through Text, Hybrid, or Source; reduce exact or formatting-only repetition; protect facts and source anchors; queue only useful visual evidence; preserve uncertain originals; and benchmark efficiency and fidelity separately.

FileKindSize
MANIFEST.inother353 B
README.mdmarkdown17.1 KB
README.zh-CN.mdmarkdown8.6 KB
SKILL.mdskill md5.5 KB
VERSIONother10 B
__init__.pyscript118 B
__main__.pyscript77 B
adapters/defuddle/extract.mjsscript694 B
adapters/defuddle/package-lock.jsonmanifest12.8 KB
adapters/defuddle/package.jsonmanifest172 B
agents/openai.yamlconfig420 B
assets/conversation-state.template.mdmarkdown715 B
assets/workflow.svgother5.7 KB
benchmarks/fixtures/chinese.mdmarkdown168 B
benchmarks/fixtures/code.pyscript127 B
benchmarks/fixtures/conversation.mdmarkdown176 B
benchmarks/fixtures/data.jsonconfig84 B
benchmarks/fixtures/efficiency-long.mdmarkdown3.5 KB
benchmarks/fixtures/english.mdmarkdown167 B
benchmarks/fixtures/long-form.mdmarkdown439 B
benchmarks/fixtures/multimodal-decoration.mdmarkdown150 B
benchmarks/fixtures/multimodal-hybrid.mdmarkdown220 B
benchmarks/fixtures/multimodal-plain-image.mdmarkdown112 B
benchmarks/fixtures/multimodal-simple-table.mdmarkdown75 B
benchmarks/fixtures/multimodal-table.mdmarkdown257 B
benchmarks/fixtures/multimodal-text.mdmarkdown184 B
benchmarks/fixtures/multimodal-two-charts.mdmarkdown101 B
benchmarks/fixtures/prompt-repeat-a.txtmarkdown140 B
benchmarks/fixtures/prompt-repeat-b.txtmarkdown148 B
benchmarks/fixtures/prompt-structural-a.txtmarkdown238 B
benchmarks/fixtures/prompt-structural-b.txtmarkdown220 B
benchmarks/fixtures/service.logother155 B
benchmarks/fixtures/source-scan.pdfbinary193 B
benchmarks/fixtures/web-article-images.htmlother334 B
benchmarks/fixtures/web-article.htmlother389 B
benchmarks/fixtures/web-empty.htmlother135 B
benchmarks/manifest.jsonconfig11.9 KB
benchmarks/pdf/fixtures/illustrated-report.pdfbinary1.9 KB
benchmarks/pdf/fixtures/table-report.pdfbinary1.9 KB
benchmarks/pdf/fixtures/text-report.pdfbinary2.2 KB
benchmarks/pdf/generate_fixtures.pyscript3.1 KB
benchmarks/pdf/ground-truth.jsonconfig1.0 KB
benchmarks/pdf/results/README.mdmarkdown1.4 KB
benchmarks/pdf/results/converted/illustrated-report.mdmarkdown112 B
benchmarks/pdf/results/converted/table-report.mdmarkdown246 B
benchmarks/pdf/results/converted/text-report.mdmarkdown201 B
benchmarks/pdf/results/metrics.jsonconfig1.4 KB
benchmarks/pdf/run_fidelity.pyscript5.5 KB
benchmarks/results/README.mdmarkdown2.2 KB
benchmarks/results/cases.jsonconfig30.2 KB
benchmarks/results/metrics.jsonconfig4.1 KB
benchmarks/results/summary.jsonconfig1.1 KB
benchmarks/retrieval-challenge-v1.jsonconfig9.1 KB
benchmarks/retrieval-manifest.jsonconfig14.5 KB
benchmarks/retrieval-results/challenge-v1/cases.jsonconfig14.1 KB
benchmarks/retrieval-results/challenge-v1/evidence-card.mdmarkdown536 B
benchmarks/retrieval-results/challenge-v1/metrics.jsonconfig494 B
benchmarks/retrieval-results/challenge-v1/summary.jsonconfig1.1 KB
benchmarks/retrieval-results/development-v1/cases.jsonconfig19.6 KB
benchmarks/retrieval-results/development-v1/evidence-card.mdmarkdown603 B
benchmarks/retrieval-results/development-v1/metrics.jsonconfig442 B
benchmarks/retrieval-results/development-v1/summary.jsonconfig1.1 KB
pyproject.tomlmanifest2.1 KB
references/benchmark-method.mdmarkdown2.9 KB
references/context-health.mdmarkdown480 B
references/conversion-adapters.mdmarkdown2.5 KB
references/output-contract.mdmarkdown2.2 KB
references/routing.mdmarkdown1.4 KB
references/threat-model.mdmarkdown5.1 KB
scripts/__init__.pyscript45 B
scripts/tikaz_context.pyscript94.3 KB

README.zh-CN.md

View on GitHub
<p align="center"><a href="README.md">English</a> · <strong>简体中文</strong></p>

<p align="center"><img src="assets/workflow.svg" alt="Context Economy 工作流" width="100%" /></p>

# TIKAZ Context Orchestration for Codex

**用一套证据合同统筹默认 Economy 与首词 `ON` 触发的本地多模态路线。**

由 **TIKAZ** 主导设计、整合、独立重构和持续维护。

Context Orchestrator 不是第三个压缩器。它默认使用无依赖 **Context Economy**;只有首个非空控制词为大写 `ON`,或用户显式调用时,才进入 **Context On-Premise**。两条路线都准备**仍然可以核验的最小有用上下文**,并统一返回证据、遗漏、Pending、回退与成本台账。

| 固定基准 | 命中结果 | 同时报告的成本结果 |
|---|---:|---:|
| 14 例双语开发集 | **Recall@5 100% · Precision@5 100%** | 动态选择召回 100% · 估算文本降低 28.50% |
| 12 例独立对抗集 | **Recall@3 94.44% · Precision@3 94.44%** | 动态选择召回 94.44% · 估算文本降低 38.81% |

这是固定合成标签集的可复现结果,不是普遍搜索准确率。所有失败样例都保留在原始结果中,节省数字始终与证据召回一起展示。

## 🧩 可以单独使用的 Skill

| Skill | 单独使用场景 | 主要输出 |
|---|---|---|
| [`context-orchestrator`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-orchestrator/index.html) | 任务可能需要默认轻量路线或显式 ON 本地路线 | 路由、证据槽、有界上下文、命中与成本台账 |
| [`context-economy`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-economy/index.html) | 默认无依赖路线需要安全处理混合输入 | Text / Hybrid / Source、上下文、遗漏项与验证边界 |
| [`context-onpremise`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-onpremise/index.html) | 合法 ON 请求需要本地 OCR、音视频、视觉、检索、重排或受保护压缩 | 规范证据、本地检索台账、保护结果、回退与成本数据 |
| [`context-pack`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-pack/index.html) | 文件、代码或日志需要形成一次任务移交 | Context Markdown、锚点、视觉队列和成本台账 |
| [`conversation-checkpoint`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/conversation-checkpoint/index.html) | 长对话需要压缩、恢复或移交 | 七部分的可恢复任务状态 |
| [`context-audit`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-audit/index.html) | 只诊断现有上下文而不改写 | 六维 Context Health 报告 |
| [`context-benchmark`](https://tikazi.github.io/TIKAZ-AI-Skills/zh/skills/context-benchmark/index.html) | 节省与保真主张需要可复现实证 | 原始用例、指标、汇总和证据卡 |

安装套件可获得完整编排;复制任一子文件夹即可单独安装专业 Skill。

重依赖 On-Premise 引擎独立发布在 [TIKAZ-Codex-Context-OnPremise](https://github.com/TIKAZI/TIKAZ-Codex-Context-OnPremise);模型和本地运行时不会打包进 Monorepo。

## 🔄 自动路由

- 纯文本、代码、日志和结构化数据走 **Text**。
- 有任务相关图片或复杂表格的文档走 **Hybrid**,Markdown 仍是主要上下文,只把必要视觉证据加入有上限的队列。
- 扫描件、重布局文件、转换器缺失或提取不确定时走 **Source**,保留原文件或原页面。
- 长对话转为 **Checkpoint**,保留决策、约束、完成证据、路径、数字、命令和开放问题。

## 网页转为可追溯 Markdown

网页流程可选使用固定版本的 Defuddle 适配器,Python 核心仍保持零强制外部依赖。它同时保留原始 HTML、清理后 HTML、Markdown、元数据、独立的字节/Token 估算,以及 Text / Hybrid / Source 分流结果。

```powershell
Set-Location .\adapters\defuddle
npm ci
Set-Location ..\..
python .\scripts\tikaz_context.py web `
  --url 'https://example.com/article' `
  --task '提取发布证据' `
  --output .\.context-economy-web
```

安装必须由用户明确执行,只影响网页适配器。流程不会执行网页脚本,也关闭了 Defuddle 的第三方异步提取回退;公开 URL、重定向、超时和响应体积均有限制。正文含信息图或复杂表格时进入 Hybrid;动态空壳、依赖缺失或提取不足时保留 `source.html` 并进入 Source。

## 🚀 一分钟开始

推荐从独立 GitHub 仓库用 `pipx` 隔离安装零强制运行依赖的核心 CLI:

```bash
pipx install git+https://github.com/TIKAZI/TIKAZ-Codex-Context-Economy.git
```

没有 `pipx` 时,可安装到当前 Python 环境:

```bash
python -m pip install git+https://github.com/TIKAZI/TIKAZ-Codex-Context-Economy.git
```

检查环境、生成有预算的上下文包,并复现内置基准:

```bash
tikaz-context doctor
tikaz-context pack --input notes.md --query "整理发布证据" --budget 800 --output .context-economy
tikaz-context benchmark --output .context-benchmark
tikaz-context benchmark-retrieval --output .context-retrieval
tikaz-context benchmark-retrieval --manifest benchmarks/retrieval-challenge-v1.json --output .context-retrieval-challenge
```

输出包含规范化 Markdown、稳定锚点、受保护事实、遗漏证据、路由结果和分项成本台账;Benchmark 同时保留原始用例、机器可读指标与汇总。

卸载隔离 CLI:

```bash
pipx uninstall tikaz-context-economy
```

### 在克隆的 Monorepo 中运行

```powershell
python .\scripts\tikaz_context.py pack `
  --input .\notes.md `
  --query 'prepare the release validation context' `
  --budget 800 `
  --visual-budget 4 `
  --output .\.context-economy
```

只安装一个 Skill:

```powershell
Copy-Item -Recurse `
  -LiteralPath '.\suites\context-economy\context-pack' `
  -Destination '.\.agents\skills\context-pack'
```

## ⚠️ 真实限制

- 文档转换依赖当前环境中可用的适配器,不会静默安装依赖。
- 估算 Token 不等于 Provider 账单遥测。
- 图片在视觉宿主实际检查前保持 `pending-vision`。
- 生成 PDF 的字面保真测试不证明 OCR、复杂布局、图表语义或扫描件泛化。
- 短小、密集或高风险输入可能增长或直接透传。
- 不确定转换回退到原始来源,不伪装成压缩成功。

## 🔐 隐私、安全与真实采用证据

核心 CLI 在本地运行、没有强制运行依赖,也不会自动上传输入、上下文包、诊断信息或使用 telemetry。网页与文档适配器都是需要明确启用的外部边界。处理不可信文件或 URL 前请阅读[威胁模型](references/threat-model.md),敏感漏洞按 [SECURITY.md](../../SECURITY.md) 的私密报告方式处理。

真实使用比匿名好评更有价值。如果 Context Economy 帮助了公开任务或可脱敏任务,可以提交[可核验用户案例](https://github.com/TIKAZI/TIKAZ-AI-Skills/issues/new?template=context_economy_showcase.yml),附上版本、输入画像、命令、前后数据、保真检查和可复现产物。未核验的提交不会被宣传为采用证据。

## 📊 可复现证据

当前公开基准包含 50 个上下文/路由合成样例、14 例双语检索开发集、12 例独立对抗检索集和独立生成 PDF 固定样例。检索开发集为 **Recall@5 / Precision@5 100%**;对抗集为 **Recall@3 / Precision@3 94.44%**。六个长上下文任务的估算 Token 降低 **69.7%**,受保护事实 **46/46**,预期锚点 **39/39**;30 个短输入样例增长 **143.9%**,作为协议开销的公开负面证据保留。

这些数字只描述声明的固定样例,不是普遍节省或命中承诺。动态选择的估算降低必须与召回率一起读取;真实 Provider Token、扫描 PDF、视觉语义准确率和下游盲测仍为 **Pending**。

来源、许可证与具体 TIKAZ 贡献见仓库根目录的 [SOURCES.yml](../../SOURCES.yml) 和 [THIRD_PARTY_NOTICES.md](../../THIRD_PARTY_NOTICES.md)。

## 🌐 探索 TIKAZ 工作流家族

[🏠 AI Skills](https://github.com/TIKAZI/TIKAZ-AI-Skills) · [⚡ Context Economy](https://github.com/TIKAZI/TIKAZ-Codex-Context-Economy) · [🧠 Context On-Premise](https://github.com/TIKAZI/TIKAZ-Codex-Context-OnPremise) · [🎨 Frontend Design](https://github.com/TIKAZI/TIKAZ-Codex-Frontend-Design) · [🎬 Video Intelligence](https://github.com/TIKAZI/TIKAZ-Codex-Video-Intelligence) · [🛠️ Engineering](https://github.com/TIKAZI/TIKAZ-Codex-Engineering) · [🔬 Research](https://github.com/TIKAZI/TIKAZ-Codex-Knowledge-Research) · [📽️ Presentation](https://github.com/TIKAZI/TIKAZ-Codex-Presentation) · [🖼️ Visual Content](https://github.com/TIKAZI/TIKAZ-Codex-Visual-Content)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall