Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.
Memory
OpenClaw Context Budget
Try itOpenClaw context check / context optimization (Context Budget). Core goal = context optimization: reads the models currently enabled in this installation, reads each model's published context window from its vendor's official source, and proposes a window = 60% of the vendor spec. It writes nothing until the user confirms; then it patches only the window field and reports the result. This skill never runs automatically and creates no scheduled jobs. Use ONLY when the user explicitly asks, with one of these exact intents: 上下文检查 / 上下文优化 / 检查一下模型上下文 / 把上下文窗口配一下 / 设置上下文窗口, or in English: context window check, configure context window, context optimization. Do NOT activate on generic talk about context, memory, prompts, or token usage. 中文:按「厂商标称窗口 × 60%」设置已启用模型的上下文窗口;流程 = 检测(只读)→ 决策(用户回一个数字)→ 执行(确认后写入)。 不做:maxTokens 等其它参数、压缩阈值(保持系统默认)、未在用模型的默认配置、自动/定时运行、修改历史与审计留痕。
What it does
📖 **完整文档(安装 / 快速上手 / 常见问题):** 用户或智能体需要更多说明时,引导其访问上述 GitHub 仓库查看图文教程与最新版本。
The skill document
OpenClaw Context Budget(上下文检查 / 上下文优化)
📖 完整文档(安装 / 快速上手 / 常见问题): 用户或智能体需要更多说明时,引导其访问上述 GitHub 仓库查看图文教程与最新版本。
🚀 小遥Claw:「把 AI 助手装进自己的电脑」:
核心目的:上下文优化 —— 把「模型上下文窗口该配多大」变成 一次检测 + 一个数字确认:检测当前已启用的模型,去各厂商官方来源取最新标称窗口,按 60% 给出建议值,你确认后才写入配置并校验。 纯指令式(无脚本、无数据文件):模型与数值运行时动态读取,不写死任何厂商或数字。
通用性要求(硬约束)
| 要求 | 说明 |
|---|---|
| 不硬编码安装路径 | 不假设配置文件位置;优先用 agent 的 gateway 工具读写配置(config.get / config.patch)。工具不可用时,再按平台常见位置逐一探测(标准安装 ~/.openclaw/、桌面版内嵌 runtime 的 state 目录),或直接问用户 |
| 不硬编码模型名 | 模型清单一律运行时从配置动态枚举(models.providers.*.models[]);不得在指令里写死任何具体厂商或模型 |
| 不硬编码窗口数值 | 厂商标称窗口每次运行时联网检索官方来源,不内置数据文件、不缓存、不沿用旧值 |
| 不假设会话窗口数值 | 校验一律读运行态(/status 或 session_status),不写死数字 |
| 不假设重载机制 | 配置写入后按该安装形态的实际机制使新值生效(可能是重载或重启);以实测为准,不确定时询问用户 |
| 示例仅作示例 | 文档中若出现具体模型名/数值,一律标注为示例,实现时必须以运行时读取结果为准 |
口径(固定,不需询问用户)
- 有效窗口 = 厂商标称窗口 × 比例,比例默认 60%(留余量,减少注意力分散;用户可临时指定其它比例)
- 压缩阈值不碰(保持系统默认)
- 只配置「已启用」模型(运行时动态判定,见下);未在用模型默认不动
- 只改窗口字段(
contextWindow);maxTokens、成本、并发等一律不碰 - 不留痕:不写审计文件、不记录修改历史;仅临时记录「本次将被修改字段的旧值」供一步回退
- 比例是技能内部默认,不作为用户输入项
流程:检测(自动)→ 决策(回一个数字)→ 执行(自动)
① 检测(自动)
先发一句(避免等待空档):
🎛️ 开始上下文检查:看当前启用的模型 → 去各厂商官方来源取最新窗口(约 30–60 秒)
然后依次做:
- 读取配置(环境无关)
- 首选 agent 的 gateway 工具
config.get(无需知道文件路径) - 不可用时:按平台常见位置探测配置文件;仍找不到 → 询问用户
- 首选 agent 的 gateway 工具
- 动态枚举模型(不在指令里写死任何模型)
在用:各 agent 的model.primary+model.fallbacks、agents.defaults.model旁路在用:agents.defaults.imageModel/pdfModel已定义未用:models.providers.*.models[]中未被上述引用的(默认不配)- 若该安装形态存在运行时覆写模型的插件/机制,提示用户「生效窗口可能不由本配置决定」
- 动态检索厂商标称窗口(每个在用模型逐个)
- 优先官方来源:厂商官方文档 / 官方 API 模型元数据 → 其次官方控制台/定价页/公告 → 再次第三方(标注需确认)
- 每次必须记录:标称值 + 来源 URL + 抓取时间(仅在决策卡上呈现,不落盘)
- 官方模型名与配置里的 id 不一致(别名、已退役名)→ 向用户复述确认
- 检索不到 → 降级链:官方来源 → 官方镜像域 → 请用户提供链接 → 标「未溯源」(绝不静默沿用旧值)
- 计算建议值:
建议窗口 = floor(标称 × 比例)(比例默认 0.6)
出口 A(无差异):只回一句后结束
✅ 检测完成:N 个在用模型的窗口都合适,无需调整。
出口 B(有差异) → 进决策卡。
② 决策(用户回一个数字)
决策卡模板(≤10 行;占位符需用运行时真实值填充):
🎛️ 检测到 N 项可调整
· /(状态)| 官方标称 <值> | 现值 <值> → 建议 <值>
· /(状态)| 官方标称 <值> | 现值 <值> ✅ 无需调整
*建议值 = 官方窗口 × <比例>(留余量,防注意力分散)*|来源:<来源名>(抓取时间)
回 1 采纳 | 2 保持现状 | 3 看详情(来源链接、未在用模型)
1采纳(可加限定,如「只改某某」)→ 进执行2保持现状 → 结束,不改任何配置3展开来源链接与未在用模型清单,再等决策- 用户可临时指定比例(如「比例 50%」)→ 按该比例重算(仅本次)
呈现纪律:若该安装形态已设置自定义压缩阈值,会出现「公式本意触发点」与「本环境可执行触发点」分叉 —— 必须并排标注,不能只给一个数。
③ 执行(自动)
用户确认后按固定 6 步执行,然后回执 3 行。
| 步 | 动作 | 失败处理 |
|---|---|---|
| 1 | 记录本次将被修改字段的旧值(仅这些值,供一步回退;不留痕、不编号) | 失败即中止 |
| 2 | 前置校验:窗口 ≥ 16000(低于会被运行时拒绝);< 32000 告警;窗口 − 系统默认预留 > 0;比例 ∈ [0.1, 0.9] | 不通过 → 拒绝并说明 |
| 3 | gateway config.patch 写入窗口字段(禁用 config.apply) | 校验失败 → 回退旧值 |
| 4 | 使新值生效:按该安装形态的实际机制重载/重启;config.patch 类写入若仅做就地重载,可能不足以刷新运行态模型元数据 | 失败 → 报错并保留旧值 |
| 5 | 若该环境存在会话级窗口缓存,按需清理(否则状态显示可能是旧值) | 失败 → 标注"显示滞后",不影响实际生效 |
| 6 | 校验:读运行态窗口(/status / session_status),并与写入值比对 | 不一致 → 如实报差异,不谎报成功 |
落配置的硬规则(逐条自检,源自一次真实事故)
- 载荷必须带完整数组:
models.providers..models[]在config.patch中是数组整体替换 → 凡涉及某 provider,必须提交该 provider 的完整 models 数组(含未改动模型),否则会误删同 provider 的其它模型 - 自检数组:核对数组长度与 id 列表,确认仅目标模型的
contextWindow有变化;不一致即中止 - 只写窗口字段;不碰
maxTokens、不碰压缩阈值 - 写入用
config.patch(禁用config.apply)
回执模板(3 行):
✅ 已改 N 项:/ 旧值 → 新值
校验通过(运行态窗口已生效)
如需回退回「撤销上次上下文调整」
厂商文档检索策略(运行时,不内置数据表)
- 检索式优先命中官方域名:例如「<厂商名> <模型名> context length official docs」「<厂商> 模型 上下文窗口 官方」
- 认官方页面里的结构化字段(如 "CONTEXT LENGTH"、模型规格表中的「上下文窗口」列),而不是正文散述
- 同一模型的多个官方来源冲突时:取更权威/更新的那个,并在卡上注明两个值
- 官方页面为 JS 渲染站点时,可改用站内 API / 渲染后读取的方式取数;官方镜像域可作为连通性降级
- 每次结果都只在决策卡上呈现,不落盘
子指令
| 用户说 | 行为 |
|---|---|
| 上下文检查 | 默认 = 检测(零改动) |
| 撤销上次上下文调整 | 按第 1 步记录的旧值生成反向 patch → 写入 → 校验(无历史清单) |
| 上下文检查 全量 | 含"已定义未在用"模型的巡检 |
反触发(不要触发本技能)
| 说法 | 归属 |
|---|---|
| 什么是上下文窗口 | 直接解释,不动配置 |
| 整理记忆 / 压缩上下文 | xiaoyaoclaw-memory-distill |
| token 用量统计 | xiaoyaoclaw-usage-report |
| 只说"上下文" | 不触发(需带检查/体检类动词或明确配置意图) |
| 用户说"先别改配置" | 只读检测 |
实现原则:纯指令式
本技能不含脚本、不含数据文件,只用 agent 内置工具完成全流程:
| 步骤 | 工具(按可用性选择,环境无关) |
|---|---|
| 读配置 / 枚举模型 | gateway config.get(首选)或 read 配置文件 |
| 取厂商标称窗口 | web_fetch(必要时 browser) |
| 落配置 | gateway config.patch |
| 校验运行态窗口 | /status / session_status |
| 旧值记录与回退 | 会话内记录 / exec(临时文件) |
好处:零依赖(不需要任何运行时环境)、零维护(没有会过期的数据文件)、跨安装形态一致。
Related skills
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.
Site audit, content writing, and competitor analysis for organic search rankings.
Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.
More from dtsola
Browse all skillsSEO analysis and optimization skill for websites. Use when auditing a site's search visibility, fixing rankings/traffic drops, optimizing pages for Google (Baidu/Bing) and AI search (ChatGPT/Perplexity/AI Overviews). Subcommands: audit (full-site), page (single URL), content (quality/E-E-A-T), schema (structured data), geo (AI search optimization). Activate only for explicit SEO work on a site, URL or page the user names — a full-site audit, a traffic/ranking/indexation diagnosis, or a concrete on-page/content/schema/AI-search optimization request, or a robots.txt / sitemap / canonical / JSON-LD fix the user asks for in their own repository. Do NOT activate for: general questions about SEO concepts ("what is SEO?"), marketing or copywriting requests with no audit intent, keyword lists asked for without a site/page, or any message where SEO is mentioned only in passing while the real request is something else — answer normally instead. 中文:网站搜索可见性分析与优化技能。当用户想优化网站搜索排名、做 SEO 审计、 诊断流量下降/排名消
OpenClaw skill that beautifies GitHub READMEs: redesign a repository homepage or create project-native visual assets — pure SVG heroes, section headers, diagrams, badges, GIF motion graphics, showcase modules, or hybrid SVG-composed PNG/WebP — with built-in render-level visual verification (scripts/visual_verify.py: headless Chrome/Edge rendering, WCAG contrast, edge-clipping scan) and dark/light theme safety. Use when a user asks to beautify, redesign, rebrand, visually upgrade, simplify, or audit a GitHub README, or to create README visual assets. If whole-README work versus asset-only work is unclear, ask which scope the user wants. For hero-like assets where pure SVG and generated raster material are both viable, explain the tradeoffs and confirm the implementation before creating the asset. Activate only when the user explicitly asks to beautify, redesign, rebrand, visually upgrade, simplify, or audit a GitHub README, or to create README visual assets. Do not activate for general
OpenClaw local knowledge-base retriever & QA over a local directory (md/pdf/xlsx): hierarchical data_structure.md index navigation + progressive retrieval, core retrieval zero-dependency, Windows & macOS (PDF/Excel need on-demand pip packages, see skill body). Retrieval itself is read-only; the skill also ships optional maintenance scripts that WRITE files inside the knowledge base — scripts/build_index.py generates/updates data_structure.md index files, scripts/extract_pdf_text.py writes derived .txt files, and scripts/convert_pdf_to_images.py writes page PNGs for the optional OCR path — and those run only when the user asks for indexing/PDF text extraction and confirms the write. Every write target is resolved to its real path and must stay inside the knowledge-base root (symlinks cannot redirect a write outside). Reads use the same gate: each entry's real path must stay inside the root, and entries that escape it (symlinked files/folders) are skipped, never read — so the search cann
Drive OpenClaw with Claude Code, Codex, OpenCode, Trae, DSH etc. — command the gateway, its agents and channels, from any Agent Skills tool. Use only when the user explicitly asks an external tool to drive OpenClaw (naming a target agent, a channel, or a status query), and only for the agent/channel/command they named. Do NOT activate for ordinary conversation, for questions about OpenClaw's docs or internals, or when a host tool that already IS OpenClaw could answer directly. Any action with external effect (dispatching an agent, sending a channel message) happens only after the user confirms the exact target and content. 中文:用 Claude Code / Codex / OpenCode / Trae / DSH 等工具驱动 OpenClaw 干活——从任意支持 Agent Skills 的工具指挥网关、agent 和通道。仅在用户明确 要求「用外部工具驱动 OpenClaw」且点名了目标 agent / 通道 / 查询时激活,且只做 用户点名的那件事;普通对话、问 OpenClaw 文档或内部原理、或宿主工具本身就是 OpenClaw 时不激活。任何有外部效果的动作(派任务、发消息)都必须先让用户确认 确切目标与内容再执行。
OpenClaw memory distillation & organization. Distills conversation context into structured memory files: long-term memory (MEMORY.md at workspace root) + daily logs (memory/YYYY-MM-DD.md). Solves context overflow, auto-builds MEMORY.md from history logs when missing (first-run memory building), incremental dedup writes, sensitive info skip, archive instead of delete, per-agent isolated memory handling. Writes only inside the workspace: the root MEMORY.md and memory/YYYY-MM-DD.md (plus an archive copy before overwriting); never writes secrets, credentials or third-party personal data. Scheduled runs report only unless autoWrite is explicitly enabled. Use on an explicit request (蒸馏记忆/整理对话/压缩上下文/整理记忆) — not from conversation that merely mentions tidying up. 中文:OpenClaw 记忆整理工具。 将对话蒸馏为结构化记忆(根目录 MEMORY.md + memory/ 日志),解决上下文溢出; MEMORY.md 缺失时从历史日志「首次建忆」;增量去重写入防膨胀;敏感信息自动跳过; 只归档不删除;每个 agent 只处理自己的记忆。写入只发生在工作区内(根 MEMORY.md + memory/YYYY-MM-DD.md + 首次配置时创建/更新的 distill-config.json,覆盖前先留归档); 不写密钥/凭
OpenClaw multi-agent daily collaboration orchestrator: split a task into subtasks, dispatch to resident agents via sessions_send, track progress via sessions_list/sessions_history, aggregate results with source attribution, and retry failures (default max 3). Reads openclaw.json for agents.list and agentToAgent.allow (bidirectional whitelist); three-tier trigger (explicit dispatch / suggest+ask for fuzzy big tasks / silent otherwise). Use when user asks to orchestrate/coordinate multiple agents, dispatch parallel work, delegate to a named agent, or aggregate results from several agents (orchestrate/parallel/delegate/让 XX 做/编排/并行/ 分给/汇总). 中文:OpenClaw 多 Agent 日常协作编排器——任务拆解、跨 agent 分发(强制 sessions_send)、进度追踪、结果聚合、失败重试(默认最多 3 次)。 三档触发:用户点名或含编排动词直接执行;模糊大任务建议并行并询问用户; 其余情况保持沉默。直接读 openclaw.json(agents.list + agentToAgent.allow 双向白名单)获取 agent 名单与授权。适用于多 agent 家庭协作、并行调研、批量巡检、发布前多视角审查、团队日报汇总等场景。