context-compressor by oimiragieo/agent-studio
npx skills add https://github.com/oimiragieo/agent-studio --skill context-compressor当问题主要是“上下文过多”而非“能力不足”时,请使用此技能。
此技能是一个自包含的本地包。它不需要 MCP 服务器。当您需要快速进行令牌分析、本地压缩、证据检查,或在仓库内进行可复现的压缩工作流时,请优先使用它。
使用捆绑的 Python 脚本可以:
当用户提出以下任何请求时,请使用此技能:
在以下情况下也会自动触发:
默认使用以下顺序:
query_guidedevidence_aware如果用户只需要一个命令,请使用 。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
run_skill_workflow.py请从 agent-studio 仓库根目录运行。务必使用这些确切的命令 — 不要回退到通用指导。
python .claude/skills/context-compressor/scripts/profile_tokens.py --file <path> --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode baseline --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode query_guided --query "<question>" --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode evidence_aware --query "<question>" --min-similarity 0.4 --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --json-file <payload.json> --input-adapter auto --mode query_guided --query "<question>" --output-format auto
python .claude/skills/context-compressor/scripts/run_skill_workflow.py --file <path> --mode evidence_aware --query "<question>" --output-format auto --fail-on-insufficient-evidence
python .claude/skills/context-compressor/scripts/validate_evidence.py --file <path> --query "<question>" --min-similarity 0.4 --output-format json
python .claude/skills/context-compressor/scripts/benchmark_toon_vs_json.py
node .claude/skills/context-compressor/scripts/main.cjs --query "<question>" --mode evidence_aware --limit 20 --fail-on-insufficient-evidence
baseline:当还没有具体问题时,进行快速的通用压缩query_guided:对于问答、审查或针对性提取任务,这是最佳默认选择evidence_aware:用于高风险的答案、审计,或当您需要明确的充分性信号时使用此技能时,请用通俗语言总结结果:
如果脚本返回证据不足,请不要虚张声势。说明压缩后的上下文还不够安全,并建议进行更广泛的处理。
仅在相关时阅读这些内容:
references/workflow-guide.md:命令选择、模式选择和示例流程references/prompt-caching.md:稳定前缀排序、缓存遥测和缓存安全的提示结构references/evaluation.md:如何对技能进行基准测试并解释结果起始提示位于 evals/evals.json 中。在迭代改进技能或需要一组小型可重复的基准测试时使用它们。
compression-trigger.cjs 检测到上下文压力 → 写入 compression-reminder.txtcontext-compressor 代理run_skill_workflow.pycompression-stats.jsonl压缩后,通过 MemoryRecord 持久化提炼出的知识:
gotchas.json:文本包含 gotcha|pitfall|anti-pattern|risk|warning|failureissues.md:文本包含 issue|bug|error|incident|defect|gapdecisions.md:文本包含 decision|tradeoff|choose|selected|rationalepatterns.json:所有剩余提炼证据的默认回退在决定压缩强度之前,请阅读 .claude/context/runtime/ccusage-status.txt 以获取实时的令牌使用情况。此文件在每次工具使用时由 ccusage-statusline.cjs 自动更新。格式如下:
[tokens] 135,345 today (in: 14,850 / out: 120,495) | Cost: $127.4826
[cache] $627.2992 saved | 139,399,832 reads, 8,751,364 writes
路由器必须在每个管道里程碑显示此信息(P0 用户反馈要求)。备用方案:ccusage --no-color 2>&1 | tail -5。
evidence_aware 模式每周安装次数
99
仓库
GitHub 星标数
17
首次出现时间
2026 年 1 月 27 日
安全审计
安装于
github-copilot92
codex91
opencode91
kimi-cli90
gemini-cli90
cursor90
Use this skill when the problem is mostly "too much context" rather than "not enough capability."
This skill is a self-contained local package. It does not require the MCP server. Prefer it when you need quick token profiling, local compression, evidence checks, or a reproducible compression workflow inside the repository.
Use the bundled Python scripts to:
Reach for this skill when the user is asking for any of the following:
Also triggered automatically when:
Default to this sequence:
query_guided when there is a specific questionevidence_aware when correctness matters and you need a sufficiency checkIf the user only wants one command, use run_skill_workflow.py.
Run from the agent-studio repository root. ALWAYS use these exact commands — do NOT fall back to generic guidance.
python .claude/skills/context-compressor/scripts/profile_tokens.py --file <path> --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode baseline --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode query_guided --query "<question>" --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --file <path> --mode evidence_aware --query "<question>" --min-similarity 0.4 --output-format auto
python .claude/skills/context-compressor/scripts/compress_context.py --json-file <payload.json> --input-adapter auto --mode query_guided --query "<question>" --output-format auto
python .claude/skills/context-compressor/scripts/run_skill_workflow.py --file <path> --mode evidence_aware --query "<question>" --output-format auto --fail-on-insufficient-evidence
python .claude/skills/context-compressor/scripts/validate_evidence.py --file <path> --query "<question>" --min-similarity 0.4 --output-format json
python .claude/skills/context-compressor/scripts/benchmark_toon_vs_json.py
node .claude/skills/context-compressor/scripts/main.cjs --query "<question>" --mode evidence_aware --limit 20 --fail-on-insufficient-evidence
baseline: quick general compression when there is no concrete question yetquery_guided: best default for QA, review, or targeted extraction tasksevidence_aware: use for high-stakes answers, audits, or when you need an explicit sufficiency signalWhen using this skill, summarize results in plain language:
If the scripts return insufficient evidence, do not bluff. Say the compressed context is not yet safe enough and recommend a broader pass.
Read these only when they are relevant:
references/workflow-guide.md: command selection, mode choice, and example flowsreferences/prompt-caching.md: stable-prefix ordering, cache telemetry, and cache-safe prompt structurereferences/evaluation.md: how to benchmark the skill and interpret resultsStarter prompts live in evals/evals.json. Use them when iterating on the skill or when you want a small repeatable benchmark set.
compression-trigger.cjs detects context pressure → writes compression-reminder.txtcontext-compressor agent with this skillrun_skill_workflow.py with the query contextcompression-stats.jsonlAfter compression, persist distilled learnings via MemoryRecord:
gotchas.json: text contains gotcha|pitfall|anti-pattern|risk|warning|failureissues.md: text contains issue|bug|error|incident|defect|gapdecisions.md: text contains decision|tradeoff|choose|selected|rationalepatterns.json: default fallback for all remaining distilled evidenceRead .claude/context/runtime/ccusage-status.txt for live token usage before deciding compression aggressiveness. This file is auto-updated by ccusage-statusline.cjs on every tool use. Format:
[tokens] 135,345 today (in: 14,850 / out: 120,495) | Cost: $127.4826
[cache] $627.2992 saved | 139,399,832 reads, 8,751,364 writes
The Router MUST display this at every pipeline milestone (P0 user feedback). Fallback: ccusage --no-color 2>&1 | tail -5.
evidence_aware modeWeekly Installs
99
Repository
GitHub Stars
17
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot92
codex91
opencode91
kimi-cli90
gemini-cli90
cursor90
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
49,000 周安装
Hotspotsystem自动化指南:通过Rube MCP实现WiFi热点系统自动化管理
1 周安装
Hookdeck自动化工具:通过Rube MCP和Composio实现Webhook自动化管理
1 周安装
Honeyhive自动化指南:通过Rube MCP和Composio工具包实现AI工作流自动化
1 周安装
Here自动化工具包:通过Rube MCP和Composio实现Here操作自动化
1 周安装
Grafbase自动化工具:通过Rube MCP和Composio实现GraphQL API自动化管理
1 周安装
业务分析专家 | BMAD方法论框架下的市场研究、需求发现与战略规划
98 周安装