凡自治之物 · LGD 治理学 · 创造术家族 | 评测协议:skill-quality-gate
English
When to use
- When the user detects capacity-limits scenarios such as "the prompt is too long", "tokens are burning too fast" or "the context won't fit".
- When you need to cut an agent's per-turn communication cost to fit the window-size limit or cost-control policy.
- When the input contains lots of redundancy, repetition or low information density and you must preserve core intent density.
Usage
- Call the core script
compress_prompt.pyas the main logic carrier. - Configure via command-line:
python compress_prompt.py --input "text-to-compress" --threshold 0.5. - For system integration, import the compiled module from
__pycache__to ensure dependencies are ready.
Workflow
- Monitor the conversation flow / input features; spot trigger words ("compress", "save tokens") and context-overflow signals.
- Sentence-split and tag the raw prompt; per the LGD convergence theory, keep keyword-dense and front-positioned sentences.
- Run
compress_prompt.pyto auto-filter redundancy, pleasantries and repetitions. - Validate the output: core logic intact and no key instruction lost.
- Return the trimmed prompt together with a runnable compression report.
- Hand the final result to downstream agents or to the user for confirmation.
Evidence & safety statement
- Evidence: TBD (no evaluation / badge link yet; update here once produced)
- Version: 1.1.1
- Safety: no independent security scan has been performed (TBD); the conclusion is pending and no endorsement is given until it is completed.
中文
何时用
- 当用户检测到「提示词太长」「token 烧太快」或「上下文塞不下了」等容量限制场景时。
- 需要降低 Agent 每轮沟通成本,以符合窗口大小限制或成本控制策略时。
- 针对输入中包含大量冗余、复述或低信息密度内容,需保持核心意图密度的情况。
用法
- 调用核心脚本
compress_prompt.py,作为技能执行的主要逻辑载体。 - 支持命令行参数配置:
python compress_prompt.py --input "待压缩文本" --threshold 0.5。 - 若用于系统集成,读取
__pycache__中的编译模块即可确保依赖环境就绪。
流程
- 监测对话流或输入特征,识别触发词(如「压缩」「省 token」)及上下文溢出信号。
- 对原始提示词进行分句与标记,依据 LGD 收敛理论筛选关键词密集及位置靠前的句子。
- 执行
compress_prompt.py脚本,自动过滤冗余、客套及重复信息片段。 - 校验输出结果,确保核心逻辑完整性且未丢失关键指令内容。
- 返回精简后的提示词,并生成对应的可运行压缩报告。
- 将最终结果交付给后续 Agent 调用或用户确认。
证据与安全声明
- 证据:TBD(暂无评测/徽章链接;产生后在此更新实际链接)
- 版本:1.1.1
- 安全:未做独立安全扫描(TBD),结论待补;补全前不作推荐背书。
