← 返回 Skills 市场
0xcjl

auto-context

作者 Jialin · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
165
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install 0xcjl-auto-context
功能描述
智能上下文卫生检查器。分析当前会话的上下文污染程度 (长对话、主题漂移、噪声累积),建议:continue、/fork、/btw 或新会话。 支持手动触发(/auto-context)和自动触发(响应层实现)。 基于 ArXiv 论文和认知心理学研究的多维度评估体系。
使用说明 (SKILL.md)

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

主动监控会话状态,智能提醒用户。

AutoContext: 智能上下文卫生检查器

Context hygiene checker for AI agents — analyze session health and recommend actions

触发方式

手动触发

  • 命令:/auto-context
  • 关键词:上下文检查、context check、context hygiene

自动触发(响应层实现)

当检测到以下信号时自动激活:

信号类型 检测条件
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 轮次计数
主题漂移 语义相似度检测
对话长度 连续 20+ 轮无明显进展
主题漂移 当前话题与 5 轮前话题无关
噪声累积 连续 3 轮用户输入 \x3C 10 字
工具重复 相同工具连续调用 5+ 次无有效产出
记忆模糊 开始混淆之前会话的内容
压缩触发 session compression 已执行 2+ 次

智能判断标准(多维度评估)

评估维度

维度 指标 阈值 权重
对话长度 连续轮数 >28 轮 20%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100% | | 主题连贯性 | 主题漂移次数 | 漂移 2+ 次 | 25% | | 信息密度 | 平均每轮字数 | \x3C50 字/轮 | 15% | | 工具效率 | 工具调用产出比 | \x3C10% 有效 | 20%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100% | | 上下文压缩 | 压缩次数 | 压缩 2+ 次 | 20%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100%
  • 权重归一化为100% |

健康等级说明

分数越高,上下文越健康。

健康等级

计算公式:健康指数 = Σ(维度分数 × 权重)

等级 分数 状态 建议
🟢 HEALTHY 80-100 上下文健康 继续当前话题
🟡 NOISY 60-79 轻度污染 可继续但注意效率
🔴 POLLUTED 40-59 中度污染 建议 /fork 或 /btw
⛔ CRITICAL \x3C40 严重污染 建议新会话

手动模式:完整报告

当用户调用 /auto-context 时,输出:

输出格式: 输出格式: 输出格式: 输出格式: 输出格式: 输出格式: 输出格式:

🧠 上下文健康报告

📊 评估维度:
  • 对话长度:XX 轮
  • 主题变化:X 次漂移
  • 信息密度:低/中/高
  • 工具效率:X% 有效产出

📈 健康等级:🟢 HEALTHY / 🟡 NOISY / 🔴 POLLUTED / ⛔ CRITICAL

💡 建议:continue / /fork / /btw / 新会话

边缘情况

  • 首次会话(\x3C5轮)不触发

规则

  • 最多 5 行
  • 关注可执行建议,不堆砌指标
  • 语气专业但简洁

自动模式:轻量提醒

当自动检测到问题时,严格执行 1 句话,不超过 20 字提醒:

上下文状态 提醒文案
主题漂移 "话题有点跳脱,考虑用 /fork 开新分支?"
对话过长 "会话有点长,建议 /fork 保持效率"
工具重复 "这个操作试了多次,要不要换个思路?"
信息稀疏 "最近几轮信息量较低,要不要聚焦一下?"
压缩频繁 "上下文压缩多次了,考虑开新会话?"

边缘情况

  • 首次会话(\x3C5轮)不触发

规则

  • 严格执行 1 句话,不超过 20 字
  • 上下文正常 → 什么都不说
  • 只建议,不强制
  • 不提 "AutoContext",除非用户问

与现有系统的集成

已有系统

系统 关系 集成方式
MEMORY 互补 长期记忆 vs 临时上下文
compression 互补 自动压缩 vs 主动建议
session_reset 互补 定时重置 vs 智能提醒

判断逻辑融合

将上述智能评估标准内化到响应层,当:

  1. 用户输入符合确认式句式(anti-sycophancy 触发)
  2. 会话长度超过阈值(compression 前)
  3. 检测到主题漂移

自动输出轻量提醒。


使用示例

手动调用

用户:/auto-context
AI:🧠 上下文健康报告
    📊 32轮对话,主题漂移1次,信息密度中
    📈 健康等级:🟡 NOISY
    💡 建议:建议继续,但考虑用 /btw 聚焦新话题

自动提醒

用户:(继续长篇大论)
AI:[在回答前] "会话有点长了,建议 /fork 保持效率。"

Credits

  • 原始版本: lovstudio/auto-context
  • Hermes适配: 0xcjl
安全使用建议
This skill appears coherent and low-risk: it only analyzes the conversation and produces short suggestions. Before enabling auto-triggering, confirm how the skill will be wired into your agent's response layer (what exact data it will read and whether any extra permissions are required). Because the source is 'unknown' and the SKILL.md has duplicated/poorly formatted sections, consider reviewing the referenced GitHub repo (or the files packaged) yourself or testing the skill in a restricted environment first. If you only want manual use, keep auto-trigger disabled so it cannot post reminders automatically.
功能分析
Type: OpenClaw Skill Name: 0xcjl-auto-context Version: 1.1.0 The auto-context skill is a context management tool designed to help AI agents monitor conversation health and suggest session resets or forks. While SKILL.md contains significant amounts of repetitive text (a technique sometimes used in prompt injection to amplify instruction weight), the instructions themselves are entirely aligned with the stated purpose of context hygiene and do not command the agent to perform any harmful actions. There is no executable code, network activity, or evidence of data exfiltration across the provided files (SKILL.md, package.json, and READMEs).
能力评估
Purpose & Capability
Name/description (context hygiene checker) align with the SKILL.md and the files: the skill only needs access to the current conversation and makes recommendations (/fork, /btw, continue, new session). No unrelated environment variables, binaries, or remote endpoints are requested.
Instruction Scope
Runtime instructions focus on analyzing session history (turn counts, semantic similarity/ topic drift, short user inputs, tool-call repetition, compression count). That requires access to the conversation history (expected). The SKILL.md also describes an automatic trigger implemented in the response layer — enabling that requires platform integration and access to responses; verify the platform integration does not grant broader permissions than intended. The SKILL.md contains many duplicated/redundant lines and formatting issues (sloppy but not malicious).
Install Mechanism
Instruction-only skill with no install spec and no code files to execute. package.json and README files are present but no install/download steps or third-party installs are required. This is low-risk from installation perspective.
Credentials
The skill declares no required environment variables, credentials, or config paths. The actions it describes (reading session context and computing metrics) are proportionate to its purpose.
Persistence & Privilege
Flags: always=false and default autonomous-invocation allowed. Autonomous invocation is the platform default; this skill does not request forced/global presence. If you enable the automatic response-layer trigger you will be giving the integration access to examine responses and inject short reminders — confirm that integration is scoped only to the conversation data and not to system credentials or other skills' configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install 0xcjl-auto-context
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /0xcjl-auto-context 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
**Summary:** Reworked documentation and metadata to clarify skill operation and streamline reminders. - Significantly expanded SKILL.md with repeated headers and sections explaining usage, triggering conditions, and evaluation criteria. - Adjusted evaluation thresholds and description wording in several tables. - Removed some detailed technical explanations and condensed output/reporting rules. - Added repeated tags and sections, possibly as a formatting or templating update. - Added a new package.json for dependency/config tracking.
v1.0.0
Initial release
元数据
Slug 0xcjl-auto-context
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

auto-context 是什么?

智能上下文卫生检查器。分析当前会话的上下文污染程度 (长对话、主题漂移、噪声累积),建议:continue、/fork、/btw 或新会话。 支持手动触发(/auto-context)和自动触发(响应层实现)。 基于 ArXiv 论文和认知心理学研究的多维度评估体系。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 165 次。

如何安装 auto-context?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install 0xcjl-auto-context」即可一键安装,无需额外配置。

auto-context 是免费的吗?

是的,auto-context 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

auto-context 支持哪些平台?

auto-context 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 auto-context?

由 Jialin(@0xcjl)开发并维护,当前版本 v1.1.0。

💬 留言讨论