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

prompt-slimmer迅速瘦身

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

8,397

周安装

357

GitHub Stars

公开资料未说明

下载量

2,942
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:prompt-slimmer(迅速瘦身)
来源仓库:https://github.com/xiaoyaner0201/prompt-slimmer
安装命令:
openclaw skills install prompt-slimmer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install prompt-slimmer

简介

自动精简 OpenClaw 工作区核心文件以减少令牌占用。

  • 针对 SOUL.md、AGENTS.md 等关键文档进行智能压缩。
  • 帮助优化上下文长度,提升大模型处理效率。prompt-slimmer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 适用于频繁更新配置文件但需控制 token 消耗的场景。
  • 压缩过程可能丢失部分细节,建议备份原始文件后再运行。

SKILL.md

name
prompt-slimmer
description
>

Prompt Slimmer

Audit and optimize OpenClaw workspace files to reduce system prompt token overhead without losing information.

Why This Matters

Every workspace file (SOUL.md, MEMORY.md, etc.) is injected into the system prompt on every API call. A 50K-char workspace means ~12K tokens sent with every single message — even a simple "hi". At Opus pricing ($15/1M input tokens), that's $0.18 per message just for workspace overhead.

Quick Start

Run the audit:

1. Measure all workspace files (chars + lines)
2. Analyze each section for frequency-of-use
3. Identify redundancies across files
4. Generate slim-down plan with before/after estimates
5. Execute (with user approval) and verify

The Method: Frequency-Based Layering

Layer 1: Always-On (workspace files)

Content needed in every session: core identity, active relationships, behavioral rules, critical safety constraints.

Layer 2: Searchable (memory/archive/)

Content needed sometimes: completed projects, historical records, detailed technical specs, one-time learnings. Retrieved via memory_search when relevant.

Layer 3: Skill-Embedded

Content needed only for specific tasks: workflow steps, code templates, platform-specific guides. Lives in SKILL.md files, loaded only when the skill triggers.

Audit Procedure

Step 0: Ghost File Scan (Often the Biggest Win!)

OpenClaw injects all .md files in the workspace root into the system prompt — not just the standard files. Scan for "ghost files": old reports, task materials, research notes, or temp files sitting in the workspace root.

cd <workspace_dir>
echo "=== All .md files in workspace root ==="
for f in *.md; do
  [ -f "$f" ] && echo "$f: $(wc -c < "$f") chars"
done
echo "=== Standard files ==="
echo "SOUL.md AGENTS.md TOOLS.md IDENTITY.md USER.md HEARTBEAT.md MEMORY.md BOOTSTRAP.md GARDEN.md"

Any .md file NOT in the standard list is a ghost file candidate. Move completed task files, old research, and temp notes to memory/archive/ or a subdirectory (subdirectories are not injected).

Real example: One instance had 15K in standard files but 31K in two ghost files (an old promotion review + research report) — removing them saved 63% instantly.

Step 1: Measure Standard Files

cd <workspace_dir>
for f in SOUL.md AGENTS.md TOOLS.md IDENTITY.md USER.md HEARTBEAT.md MEMORY.md; do
  [ -f "$f" ] && echo "$f: $(wc -c < "$f") chars, $(wc -l < "$f") lines"
done

Step 2: Section-Level Analysis

For each file, extract ## headings and measure each section's size. Then classify:

CategoryCriteriaAction
🟢 KeepReferenced every session, identity-criticalKeep as-is
🟡 SlimUseful but verbose, can be compressedRewrite concisely
🔴 ArchiveCompleted/paused projects, historical recordsMove to memory/archive/
⚫ DeduplicateSame info in multiple filesKeep in one place, remove others

Step 3: Cross-File Deduplication Check

Common duplication patterns:

  • IDENTITY.md ↔ MEMORY.md (appearance, voice info)
  • SOUL.md ↔ MEMORY.md (behavioral rules)
  • HEARTBEAT.md ↔ AGENTS.md (task scheduling rules)
  • MEMORY.md ↔ Skill files (project details duplicated in both)

Rule: Information lives in the most specific location. If a skill covers it, remove from MEMORY.md.

Step 4: Execute Slim-Down

  1. Create archive file: memory/archive/projects.md (or topic-specific files)
  2. Move archived sections: Cut from workspace file → paste to archive
  3. Replace with pointer: Details: see memory/archive/projects.md or just a 1-line summary
  4. Verify memory_search: Confirm archived content is findable via search
  5. Measure result: Compare before/after char counts

Step 5: Verify Integrity

After slimming, verify:

  • [ ] memory_search can find archived content
  • [ ] No critical behavioral rules were accidentally removed
  • [ ] Core identity (name, relationships, key rules) still present
  • [ ] Safety constraints still in workspace files (not just archive)
  • [ ] Pointers/references are correct paths

File-Specific Heuristics

MEMORY.md (Usually the biggest win)

Typical bloat sources:

  • Paused/completed project details → archive, keep 1-line status
  • Detailed timelines/changelogs → archive
  • Team roster tables → archive
  • Cron job indexescron list can fetch this live
  • Platform account details → slim to name + ID only
  • Milestone lists → archive (historical)
  • Cross-referenced content → remove if covered by skill or other file

Target: MEMORY.md should be < 5,000 chars for a well-maintained instance.

HEARTBEAT.md

Typical bloat sources:

  • Code templates (osascript, shell snippets) → agent already knows these
  • Verbose priority descriptions → compress to 1-2 lines per priority
  • Paused project references → 1 line max
  • Repeated emphasis ("核心!", "每次 HB 必做!") → once is enough

Target: HEARTBEAT.md should be < 3,000 chars.

SOUL.md

Be careful here. SOUL.md is identity-critical. Don't optimize away personality.

  • Hierarchy diagrams → can be compressed
  • Behavioral rules → review for overlap with AGENTS.md
  • Generally leave SOUL.md alone unless it's > 10,000 chars.

TOOLS.md

Usually already lean. Check for:

  • Deprecated tool entries → remove
  • Detailed port tables for rarely-used services → slim or archive

AGENTS.md

Usually already lean. Check for:

  • Redundancy with system prompt (OpenClaw injects its own rules)
  • Over-detailed workflow descriptions → reference skill instead

Expected Results

Workspace SizeBeforeAfterTypical Savings
Light (<20K)20K15K25%
Medium (20-50K)35K18K50%
Heavy (50K+)60K22K63%

Cost Impact

At Opus pricing ($15/1M input, $1.50/1M cached):

SavingsChars SavedTokens Saved$/message saved$/day (100 msg)
25%5K~2K$0.03$3
50%25K~10K$0.15$15
63%38K~15K$0.23$23

*With prompt caching, savings are ~90% less but still meaningful for cache-miss turns.*

What NOT to Slim

  • Safety constraints (never archive security rules)
  • Core identity (name, key relationships, personality)
  • Active behavioral rules that prevent known failure modes
  • Credentials management rules (how to handle secrets)
  • Cross-instance coordination rules (if running multiple agents)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

70.77%
按下载量换算2,082

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

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

安装前确认

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

来源信息

继续浏览同类 Skills