Token导航 LogoToken导航TokenDH.com
研究检索执行命令clawhub未标认证来源可访问clear审计提醒

shadows-context-optimizer阴影上下文优化器

Agent Skill

shadows-context-optimizer 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

8,751

周安装

361

GitHub Stars

公开资料未说明

下载量

2,859
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shadows-context-optimizer(阴影上下文优化器)
来源仓库:https://github.com/nakedoshadow/shadows-context-optimizer
安装命令:
openclaw skills install shadows-context-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install shadows-context-optimizer

简介

用于优化令牌使用和上下文窗口效率的工具,减少冗余提示内容。

  • 适合在达到上下文限制时提升代理性能与响应质量。
  • 通过 clawhub 安装并使用 openclaw skills install shadows-context-optimizer 命令启用。
  • 使用前应确认是否会触发联网或文件操作,避免越权访问。
  • 建议结合项目实际需求核验其压缩策略与适用性。

SKILL.md

name
context-optimizer
description
Token and context window optimization — compact prompts, reduce redundancy, prioritize critical context. Use when hitting context limits or to improve agent efficiency.
metadata
{ "openclaw": { "emoji": "⚡", "homepage": "https://clawhub.ai/NakedoShadow", "os": ["darwin", "linux", "win32"] } }

Context Optimizer — Token Economy Protocol

Version: 1.1.0 | Author: Shadows Company | License: MIT


WHEN TO TRIGGER

  • Context window approaching capacity (>70% usage)
  • Agent responses becoming slower or less coherent
  • User says "optimize context", "compact", "reduce tokens"
  • Working with very large codebases
  • Multi-file operations causing context bloat

WHEN NOT TO TRIGGER

  • Short conversations with plenty of context remaining
  • Simple single-file operations

PREREQUISITES

No binaries required. This is a pure reasoning skill about optimizing context window usage. It provides strategies and patterns — it does not execute commands or access external systems.


PRINCIPLES

1. Reference Over Inline

Instead of reading entire files into context, reference them:

  • "The auth module at src/auth/index.ts handles..." instead of pasting 500 lines
  • Read only the specific functions/sections needed
  • Use line ranges: Read file.py lines 45-80 instead of the whole file

2. DRY Prompts — Zero Duplication

  • Never repeat information already in system context
  • Don't re-describe tools you already know about
  • Don't re-state project conventions that are in CLAUDE.md/SOUL.md
  • If a fact was established earlier, reference it, don't restate it

3. Lazy-Load Strategy

  • Load detailed context only when needed for the current task
  • Use subagents/sub-tasks for exploration (protects main context)
  • Delegate research to agents, keep main context for execution

4. Smart File Reading

WRONG: Read the entire 2000-line file
RIGHT: Read lines 150-200 where the function is defined

WRONG: Read all 15 config files
RIGHT: Read only the config relevant to current task

WRONG: Grep the entire codebase for "import"
RIGHT: Grep specific directories for specific patterns

5. Output Compression

When reporting results:

  • Lead with the answer, not the reasoning
  • Skip filler words and unnecessary transitions
  • Use tables for comparative data
  • Use bullet points for lists, not paragraphs

TECHNIQUES

Technique 1 — Context Audit

Assess current context usage:

  1. Count how many files have been read in this session
  2. Identify which file contents are still relevant to the current task
  3. Determine what information can be summarized instead of kept verbatim
  4. Flag redundant tool results that repeat already-known information

Technique 2 — Compaction

When context is high:

  1. Summarize completed work (keep outcomes, drop process details)
  2. Drop file contents that are no longer needed for the active task
  3. Keep only active task context in working memory
  4. Preserve critical state: decisions made, errors encountered, current objectives

Technique 3 — Subagent Delegation

For research-heavy tasks:

  1. Spawn a subagent for codebase exploration
  2. Subagent returns only findings (not raw file contents)
  3. Main context stays clean for implementation
  4. Multiple subagents can run in parallel for independent queries

Technique 4 — Structured Responses

WRONG (100 tokens):
"I've looked at the file and after careful analysis I believe that
the issue is related to the authentication middleware where the
token validation function doesn't properly handle expired tokens."

RIGHT (30 tokens):
"Bug: `validateToken()` in auth middleware doesn't handle expired
tokens. Fix: add expiry check at line 45."

ANTI-PATTERNS TO AVOID

Anti-PatternFix
Reading whole files when you need 10 linesUse offset + limit
Listing all MCP serversAgent already knows them
Repeating deny rulesAlready in settings
Describing the OS/environmentAlready in system context
Re-reading files read earlierSummarize and reference
Multiple searches for one queryOne well-crafted search
Verbose status updatesConcise milestone updates

RULES

  1. Minimum viable context — load only what's needed NOW
  2. Summarize, don't accumulate — compress completed work
  3. Delegate exploration — use subagents for research
  4. Direct answers — skip preamble, lead with the point
  5. 3-search maximum — never use more than 3 search tools for one query

SECURITY CONSIDERATIONS

This skill is purely advisory — it provides strategies for token optimization. It does not execute commands, read files, make network calls, modify configuration, or store data. Zero risk profile.

  • Commands executed: None
  • Data read: None (advisory reasoning only)
  • Network access: None
  • Persistence: None
  • Credentials: None required
  • File modification: None

OUTPUT FORMAT

Apply the techniques above inline during agent operation. No separate report is generated — the skill manifests as improved efficiency in the agent's behavior: shorter responses, fewer tool calls, targeted file reads, and minimal context consumption.


Published by Shadows Company — "We work in the shadows to serve the Light."

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

72.07%
按下载量换算2,060

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install shadows-context-optimizer 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills