← 返回 Skills 市场
tkuehnl

context-engineer

作者 Todd Kuehnl · GitHub ↗ · v1.0.2
cross-platform ⚠ suspicious
682
总下载
0
收藏
2
当前安装
3
版本数
在 OpenClaw 中安装
/install context-engineer
功能描述
Context window optimizer — analyze, audit, and optimize your agent's context utilization. Know exactly where your tokens go before they're sent.
使用说明 (SKILL.md)

When to use this skill

Use this skill when the user wants to:

  • Understand where their context window tokens are going
  • Analyze workspace files (SKILL.md, SOUL.md, MEMORY.md, etc.) for bloat
  • Audit tool definitions for redundancy and overhead
  • Get a comprehensive context efficiency report
  • Compare before/after snapshots to measure optimization progress
  • Optimize system prompts for token efficiency

Commands

# Analyze workspace context files — token counts, efficiency scores, recommendations
python3 skills/context-engineer/context.py analyze --workspace ~/.openclaw/workspace

# Analyze with a custom budget and save a snapshot for later comparison
python3 skills/context-engineer/context.py analyze --workspace ~/.openclaw/workspace --budget 128000 --snapshot before.json

# Audit tool definitions for overhead and overlap
python3 skills/context-engineer/context.py audit-tools --config ~/.openclaw/openclaw.json

# Generate a comprehensive context engineering report
python3 skills/context-engineer/context.py report --workspace ~/.openclaw/workspace --format terminal

# Compare two snapshots to see projected token savings
python3 skills/context-engineer/context.py compare --before before.json --after after.json

What It Analyzes

  • System prompt efficiency — Length, redundancy detection, compression potential
  • Tool definition overhead — Count tools, per-tool token cost, identify unused/overlapping
  • Memory file bloat — MEMORY.md size, stale entries, optimization suggestions
  • Skill overhead — Installed skills contributing to context, per-skill token cost
  • Context budget — What % of model context window is consumed by static content vs available for conversation

Options

  • --workspace PATH — Path to workspace directory (default: ~/.openclaw/workspace)
  • --config PATH — Path to OpenClaw config file (default: ~/.openclaw/openclaw.json)
  • --budget N — Context window token budget (default: 200000)
  • --snapshot FILE — Save analysis snapshot to FILE for later comparison
  • --format terminal — Output format (currently: terminal)

Notes

  • Token estimates are approximate (~4 characters per token). For precise counts, use a model-specific tokenizer.
  • No external dependencies required — runs with Python 3 stdlib only.
  • Built by Anvil AI — context engineering experts. https://anvil-ai.io
安全使用建议
This skill appears to do what it says: it inspects your agent workspace and OpenClaw config and writes analysis snapshots. Before installing or running it: 1) Understand it will read any files you point it at (SKILL.md, MEMORY.md, configs, skills/*/SKILL.md) — do not point it at directories containing secrets you don't want analyzed. 2) Review context.py (or run it in a sandbox) to confirm there are no network/exfiltration calls; the visible code shows only local file I/O and reporting, but the provided context.py snippet in this review was partial, so double-check the full file for network/socket/HTTP usage. 3) When running, avoid using elevated privileges and keep backups of any files you modify; inspect any saved snapshot JSON before sharing, since it may contain extracted text from your workspace. If you want extra assurance, run the script on a copy of your workspace or in an isolated environment first.
功能分析
Type: OpenClaw Skill Name: context-engineer Version: 1.0.2 The skill is classified as suspicious due to a potential arbitrary file read vulnerability. The `context.py` script's `parse_tool_definitions` function attempts to `json.load()` the file specified by the `--config` argument (defaulting to `~/.openclaw/openclaw.json`). While intended for configuration, a malicious prompt could instruct an agent to use `--config` with a sensitive file path (e.g., `/etc/passwd`, `~/.ssh/id_rsa`). Although the script would likely fail to parse non-JSON files, it would still read their content, posing a risk of information disclosure. There is no evidence of intentional malicious behavior like data exfiltration or persistence, but the capability to read arbitrary files via user-controlled input is a significant vulnerability.
能力评估
Purpose & Capability
The skill is described as a context window optimizer and the code and SKILL.md show it scans workspace files (SKILL.md, MEMORY.md, skills/*/SKILL.md, and .openclaw/openclaw.json) and produces token/efficiency reports — the requested binary (python3) and the file reads are appropriate for that purpose.
Instruction Scope
Instructions explicitly tell the agent to run the included Python script against a workspace or OpenClaw config; the script reads many user files under the provided workspace and can write snapshots. This matches the stated scope, but it does mean the skill will examine any files you point it at (which may contain sensitive data).
Install Mechanism
No install spec or third-party downloads are declared; the skill is instruction-only and ships a Python script that runs with the stdlib. No network fetches or external package installs are required according to the metadata and SKILL.md.
Credentials
No environment variables, credentials, or config paths beyond the workspace/config paths are requested. The script reads local workspace and OpenClaw config files only, which is proportionate to a context-auditing tool.
Persistence & Privilege
always is false and the skill does not declare any persistent system-level installation. Its writable actions are limited to saving snapshots/files you explicitly name; it does not request to modify other skills or global agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install context-engineer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /context-engineer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Rebrand to Anvil AI. Remove CacheForge marketing copy. Normalize install commands.
v1.0.1
Fix: box-drawing row alignment off-by-one
v1.0.0
Initial release: context window optimizer with analyze, audit-tools, report, and compare commands
元数据
Slug context-engineer
版本 1.0.2
许可证
累计安装 2
当前安装数 2
历史版本数 3
常见问题

context-engineer 是什么?

Context window optimizer — analyze, audit, and optimize your agent's context utilization. Know exactly where your tokens go before they're sent. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 682 次。

如何安装 context-engineer?

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

context-engineer 是免费的吗?

是的,context-engineer 完全免费(开源免费),可自由下载、安装和使用。

context-engineer 支持哪些平台?

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

谁开发了 context-engineer?

由 Todd Kuehnl(@tkuehnl)开发并维护,当前版本 v1.0.2。

💬 留言讨论